Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to demonstrate how an algorithm I wrote would fail in a multi-spiked gene

ID: 3885374 • Letter: I

Question

I need to demonstrate how an algorithm I wrote would fail in a multi-spiked generation. I also need the runtime (In Big Theta notation) of my algorithm. I think it is 1 f(x)=O(1), or something similar, but I'm not positive.

My algorithm runs recursively through an array, and returns the maximum value in that array. The algorithm is pseudo code by the way.

It looks like:

findMax(A)

{

currMax = NULL

n = length(A)-1

return maxElement(A, n, currMax)

}

maxElement(A, n, currMax)

{

if (n==NULL)

{

return -1

}

if (currMax == NULL)

{

currMax=A[n] //the last index in the array

}

if (n=0) //the whole array has been searched

{

return currMax

}

else

{

if (A[n]>currMax)

{

currMax= A[n]

return maxElement(A, n-1, currMax)

}

else

{

return maxElement(A, n-1, currMax)

}

}

}

The full question reads:

a) Now consider the multi-spiked generalization, in which the array contains k spikes, i.e., it contains k subarrays, each of which is itself a spiked array. Let k = 2 and prove that your algorithm can fail on such an input.

(b) Suppose that k = 2 and we can guarantee that neither spike is closer than n/4 positions to the middle of the array, and that the “joining point” of the two singlyspiked subarrays lays in the middle half of the array. Now write an algorithm that returns the maximum element of A in sublinear time. Prove that your algorithm is correct, give a recurrence relation for its running time, and solve for its asymptotic behavior.

THank you for your help!!

Explanation / Answer

the stimulus amplitude and DC offset as follows: Given a fixed, fluctuating aperiodic current waveform, h(t) with a duration of 1000 ms, constructed to have an average value of zero and a given variance, we inject a current stimulus of the form I(t)=+ h(t) (Figure 1A and B). The mean DC current injected is and the root mean square (RMS) size of the fluctuation is times the RMS size of h. On any given set of trials we predetermined a set of relative amplitudes b and offsets a, which we scale with a multiplicative factor . This factor is determined on a cell-by-cell basis in order to adjust each suite of stimuli to the cell's intrinsic firing properties (as described below). The resulting stimulus is I(t)= (a+b h(t)), so the stimulus offset is given by = a, and the stimulus amplitude is given by = b. As the quantities a and b are common across experiments, the results will be presented in terms of a and b (the latter as a percentage) rather than and .

The current so constructed was injected into the soma of layer 5 pyramidal cells in a slice of rat prefrontal/infralimbic cortex. The fluctuating drive was the same on each trial, but for the first experiment we used eleven different amplitudes, expressed as percentages. The first step was to determine the scaling factor , which varied from neuron to neuron according to its intrinsic properties. We used between 18 and 51 trials per amplitude and performed experiments on 10 different cells. For 8/10 cells, b ranged from 0% to 100% in steps of 10%, whereas for 2/10 cells b was 20% to 100% in steps of 8%. Because the injected waveform was prepared off-line and stored in a file, at the time of recording we could only adapt the overall gain to the properties of each neuron. The overall gain (, taking values between 0.4 and 5) was chosen such that the neuron produced at least one spike for the lowest amplitude (b=0 or 20%), which was achieved for 8/10 cells.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote