# Computational Neuroscience Coursera Quiz Answers – Networking Funda

## All Weeks Computational Neuroscience Coursera Quiz Answers

This course provides an introduction to basic computational methods for understanding what nervous systems do and for determining how they function. We will explore the computational principles governing various aspects of vision, sensory-motor control, learning, and memory.

Specific topics that will be covered include representation of information by spiking neurons, processing of information in neural networks, and algorithms for adaptation and learning. We will make use of Matlab/Octave/Python demonstrations and exercises to gain a deeper understanding of concepts and methods introduced in the course.

The course is primarily aimed at third- or fourth-year undergraduates and beginning graduate students, as well as professionals and distance learners interested in learning how the brain processes information.

**Enroll now on Coursera for Free**

## Computational Neuroscience Coursera Quiz Answers

### Week 01: Introduction & Basic Neurobiology Quiz Answers

#### Matlab/Octave Programming

Q1. Which of the following expressions generates the column vector ⎡⎣123⎤⎦⎣⎢⎡123⎦⎥⎤? Select all the correct answers.

- [1; 2; 3]
**[1 2 3]’**- [1, 2, 3]
- [1 2 3]

Q2. Given a matrix A =⎡⎣⎢⎢123423453456⎤⎦⎥⎥*A*=⎣⎢⎢⎢⎡123423453456⎦⎥⎥⎥⎤

which of the expressions would give the matrix ⎡⎣⎢⎢23453456⎤⎦⎥⎥⎣⎢⎢⎢⎡23453456⎦⎥⎥⎥⎤? Select all the correct answers.

- A(:,:)This should not be selected
- A(2:3,:)
**A(:,2:3)**- A(:,2)

Q3. Suppose A = [1324]*A*=[1324], B = ⎡⎣234234⎤⎦*B*=⎣⎢⎡234234⎦⎥⎤, C = eye(3), d = [123]*d*=[123], E = zeros(3,3). Which of the following commands will NOT give an error? Select all the correct answers.

- C .* E
**d * B**- A * B
- A – B
**A * B’**- C * E

Q4. Suppose B = ⎡⎣234234⎤⎦*B*=⎣⎢⎡234234⎦⎥⎤, d = [123]*d*=[123], f = [89]*f*=[89]. Which of the following commands will NOT give an error? Select all the correct answers.

- B – repmat(f,1,3)
- B – [d’ d’*2]
- B + [f; f; f]
**B + repmat(f’,3,1)**

Q5. Suppose we wish to generate a 4×1 vector that contains the number 5 in every position. Which of the following expressions will accomplish this task? Select all the correct answers.

- ones(4,1)
**ones(4,1) * 5**- eye(4) * 5
- fives(4,1)
- ones(4) * 5

Q6. Given a matrix A = ⎡⎣⎢⎢⎢⎢1234523456345674567856789⎤⎦⎥⎥⎥⎥*A*=⎣⎢⎢⎢⎢⎢⎡1234523456345674567856789⎦⎥⎥⎥⎥⎥⎤, which of these expressions will generate the matrix ⎡⎣⎢⎢⎢⎢123453456756789⎤⎦⎥⎥⎥⎥⎣⎢⎢⎢⎢⎢⎡123453456756789⎦⎥⎥⎥⎥⎥⎤? Select all the correct answers.

- A(:,1:3)
- A(:,1:2:5)
**[A(:,1) A(:,3) A(:,5)**- A(1:2:5,:)
- [A(1,:) A(1,:) A(1,:)]

Q7. Suppose you enter the following commands:

x = 0:0.05:5;

y = sin(x.^2);

plot(x,y);

Which of the following matches the resulting plot?

Q8. What is the vector b equal to after this block of code is executed?

A = [1 0 -4 8 3; 4 -2 3 3 1];

b = zeros(1,5);

for index = 1:size(A,2)

if A(1,index) > A(2,index)

b(index) = A(1,index);

else

b(index) = A(2,index);

end

end

- [1−2−431]
- [40383]
- None of these
- [4−2331]
- [10−483]

Q9. What is the value (rounded to three significant figures) of x after this block of code is executed?

x = 1;

while x > 1e-5

x = x / 2;

end

- 1.53e-05
- 7.63e-05
- 1
- 3.81e-06
- 7.63e-06

Q10. Suppose we wish to generate a 2×3 matrix that contains only zeros. Which of the following expressions would achieve this goal? Select all the correct answers.

- zeros(2)
- zeros(3)
- zeros(3,2)
- eye(2,3)
**zeros(2,3)**- [0 0 0; 0 0 0]
- [0 0; 0 0; 0 0]

Q11. Suppose A =⎡⎣523−2−3434−8⎤⎦*A*=⎣⎢⎡523−2−3434−8⎦⎥⎤

Which of the following expressions could be used to set all of the negative entries in A to zero?

- A ‹ 0 = 0
- (A ‹ 0) = 0
**A(A ‹ 0) = 0**- A(:) = 0

Q12. Suppose A = ⎡⎣123⎤⎦*A*=⎣⎢⎡123⎦⎥⎤ and B = ⎡⎣−1−2−3⎤⎦*B*=⎣⎢⎡−1−2−3⎦⎥⎤. Which expression would you use to compute the element-wise product vector C = ⎡⎣−1−4−9⎤⎦*C*=⎣⎢⎡−1−4−9⎦⎥⎤?

**C = A .* B**- C = A * B
- C = A’ * B

Q13. Suppose x =[1122132231]*x*=[1122132231].

Which expression returns the index of the first element of x equal to 3?

- x == 3
- find(x == 3)
**find(x == 3, 1)**- x = 3

Q14. What does the keyboard command do when placed inside a MATLAB script

(for example:

x = 5;

y = [3 5 7];

z = x * y;

keyboard;

w = z .^ 2;

)?

- Halts the program until the user presses a key on the keyboard.
**Stops execution of program and gives control to the keyboard.**- Collects character input from the user and stores it in the most recently referenced variable.

#### Python Programming Quiz Answers

Q1. Which matrix corresponds to the following code?`1A = np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6]])`

- Please comment down correct answers to help others

Q2. Given the 2D array (i.e., matrix) A =⎡⎣123234345456⎤⎦*A*=⎣⎢⎡123234345456⎦⎥⎤, which of the following expressions generates B =[243546]*B*=[243546]

Q3. Suppose you have a script that contains the line`1A = np.array([1, 2, 3])`

Q4. Given that numpy is imported as np, and that you have defined the one-dimensional array a =[1234]*a*=[1234], which of the following commands will not raise an error? Check all that apply.

Q5. Which piece of code generates an array x*x* of 100 random numbers between 0 and 1?

Q6. Suppose x is an array of 100 random numbers between 0 and 1. Which piece of code sets to 11 all elements of x that are greater than 0.50.5?

Q7. Which piece of code returns the numerical indices of the first three elements of the one-dimensional array x*x* that are greater than 11?

Q8. What piece of code loads the file ‘data.pickle’, which contains a dict object, into the variable “data”? You can assume that the directory containing ‘data.pickle’ is in your path (i.e., is accessible).

*The end result should be that the variable data is a dict object.

Q9. Suppose the dict called “data” has been set to {‘a’: 3, ‘c’: 9, ‘b’: 5}. How do you set the value corresponding to the key ‘b’ to 100?

Q10. What is the mathematical representation of x after this sequence of commands?

Q11. Which of the following pieces of code sets the value of y to True if the value of x is either 2, 5, or 9, and to False otherwise? Check all that apply.

### Spike Triggered Averages: A Glimpse Into Neural Encoding

Q1. Which of the following is *not* an example of a linear filtering system?

Let x(t)*x*(*t*) denote the input signal and y(t)*y*(*t*) denote the output signal.

Q2. What is the definition of a spike triggered average for a neuron?

Q3. The data set we have given you (see Quiz Instructions page in the Graded Quiz section) is comprised of a stimulus vector (named stim) and a binary vector (named rho). These two vectors are the same length because they represent measurements of two different quantities over the same time period. The binary vector has a 1 if a spike occurred in the time bin corresponding to the that index and a 0 otherwise. The sampling rate for the data set was 500 Hz.

How many milliseconds are there between adjacent samples (what is the sampling period)? Only enter the number, not the units. If your answer is not an integer, round to the nearest integer value.

Set the variable named sampling_period in quiz2.m equal to this value.

Q4. We wish to compute the spike-triggered average for this neuron over a window of width 300 ms. Suppose we do not care about the value exactly 300 ms before the spike. How many elements (time steps) will be in our resulting spike-triggered average vector? Set the variable named num_timesteps in quiz2.m equal to this value and enter it below.

Hint: Your answer should be an even number.

Q5. In order to calculate the average, it is necessary for us to know how many time windows (stimulus vectors) we are averaging over. This is equal to the number of observed spikes. Write code to calculate the total number of spikes in the data set c1p8.mat. How many spikes were observed in this recording? You should not count any spikes that occur before 300 ms from the beginning of the recording.

Set the variable named num_spikes in compute_sta equal to this value, or (better yet) use the expression/variable/code you used to calculate this value and set it equal to num_spikes so that your code will work for any set of parameters (different sampling rate, different time window in which average is calculated etc.) passed to compute_sta.m.

Q6. Now we may compute the spike-triggered average. To do this, add code to compute_sta.m. Remember that the spike-triggered average is the element-wise mean of the time windows starting 300 ms before (exclusive) and ending 0 ms before a spike. Note that we have given you code to find all of the indices in the stimulus vector that correspond to the spike times (labeled as the variable spike_times in compute_sta.m).

Which of these plots most closely matches the spike-triggered average for this data set?

Q7. What is the nature of this neuron? That is, what mathematical operation of the stimulus does it compute?

Q8. Which of the following stimuli would you expect this neuron to respond most strongly to? You may assume that all non-zero values of the stimulus have the same magnitude. That is, assume that all positive stimuli have a value of c*c* and all negative stimuli have a value of -c−*c* where c > 0*c*>0.

Q9. Suppose we had reason to suspect that this neuron responded to two modes (features) of the stimulus. Which of the following methods is most likely to help us determine those two modes?

### Neural Decoding

Q1. Likelihood ratio test with asymmetric costs

Suppose we have a stimulus defined by a single variable called s*s*. s*s* can take one of two values, which we will call s_1*s*1 and s_2*s*2. You could think of these as lights flashing in the eyes at one of two possible frequencies. Or perhaps listening to punk rock vs. listening to Dvorak.

Let’s call the firing rate response of a neuron to this stimulus r*r*.

Suppose that under stimulus s_1*s*1 the response rate of the neuron can be roughly approximated with a Gaussian distribution with the following parameters:

\mu*μ* (mean): 5

\sigma*σ* (standard deviation): 0.5

And likewise for s2:

\mu*μ*: 7

\sigma*σ*: 1

Lets say that both stimuli are equally likely and we are given no other prior information.

Now let’s throw in another twist. Let’s say that we receive a measurement of the neuron’s response and want to guess which stimulus was presented, but that to us, it is twice as bad to mistakenly think it is s_2*s*2 than to mistakenly think it is s_1*s*1.

Which of these firing rates would make the best decision threshold for us in determining the value of s given a neuron’s firing rate?

Q2. Suppose we are diagnosing a very rare illness, which happens only once in 100 million people on average. Luckily, we have a test for this illness but it is not perfectly accurate. If somebody has the disease, it will report positive 99% of the time. If somebody *does not* have the disease, it will report positive 2% of the time.

Suppose a patient walks in and tests positive for the disease. Using the maximum likelihood (ML) criterion, would we diagnose them positive?

Q3. Continued from Question 2:

What if we used the maximum a posteriori (MAP) criterion?

Q4. Continued from Question 2:

Why do we see a difference between the two criteria, if there is one?

### Information Theory & Neural Coding

Q1. Suppose that we have a neuron which, in a given time period, will fire with probability 0.1, yielding a *Bernoulli distribution* for the neuron’s firing (denoted by the random variable F = 0 or 1) with P(F = 1) = 0.1.

Which of these is closest to the entropy H(F) of this distribution (calculated in bits, i.e., using the base 2 logarithm)?

Q2. Continued from Question 1:

Now lets add a stimulus to the picture. Suppose that we think this neuron’s activity is related to a light flashing in the eye. Let us say that the light is flashing in a given time period with probability 0.10. Call this stimulus random variable S*S*.

If there is a flash, the neuron will fire with probability 1/2. If there is not a flash, the neuron will fire with probability 1/18. Call this random variable F*F* (whether the neuron fires or not).

Which of these is closest, in bits (log base 2 units), to the mutual information MI(S,F)?

### Computing in Carbon

Q1. When we talk about “spikes”, we are referring to the change in some property of the neuron over time. When we typically plot a spike, the x-axis represents time. What does the y-axis represent?

Q2. Let’s imagine there is another ion that is relevant to determining a neuron’s membrane potential in addition to those discussed in the lecture. We’ll call the ion \text{Im}^{+}Im+ (for Imaginary). The equilibrium potential of \text{Im}^{+}Im+ (E_{Im}*EIm*) is -100 mV. Assume the resting potential of the neuron is -65 mV. When specialized \text{Im}^{+}Im+ channels open, the \text{Im}^{+}Im+ conductance will increase. This will ___ the cell, thus ___ its membrane potential.

Q3. Suppose \text{Im}^{+}Im+ channels are composed of 5 subunits that open and close independently, as well as an additional “ball-in-socket” gating mechanism. Each of the 5 subunits has a voltage-dependent open probability u*u* and closed probability (1-u)(1−*u*), while the ball-in-socket gating mechanism has a voltage-dependent open probability z*z* and closed probability (1-z)(1−*z*). Which expression could most likely be used to express the \text{Im}^{+}Im+ current across the membrane?

Q4. Refer again to the figure shown above the previous question. Remember that \text{Na}^{+}Na+ current depolarizes the cell and is the principal driver for the upward portion of a spike. Both m*m* and h*h* must be high for there to be a lot of \text{Na}^{+}Na+ current. h_{\infty}*h*∞ becomes 0 when voltage is close to or greater than -30 mV. How, then, is it possible for the membrane to depolarize beyond V*V* = -30 mV during a spike (spikes peak closer to V*V* = 40 mV)?

Q5. True or false: All neural coding can essentially be reduced to variations in firing rate. This allows the information in complex spiking patterns to be summarized in a “rate code.”

Q6. The FitzHugh-Nagumo model is a 2-dimensional dynamical neuron model. It is defined by the following two differential equations:

\dfrac{dV}{dt} = V(a – V)(V – 1) – w + I*d**t**d**V*=*V*(*a*−*V*)(*V*−1)−*w*+*I*

\dfrac{dw}{dt} = bV – cw*d**t**d**w*=*b**V*−*c**w*

where V*V* is voltage, w*w* represents an outward hyperpolarizing current, I*I* is injected current, and a*a*, b*b*, and c*c* are constants.

Which of the following is an expression for the w*w*-nullcline?

Q7. Change the values for the membrane’s resistance and capacitance (R*R* and C*C*), and find out how this influences the response of the membrane. Does it reach a stable value more quickly or more slowly after multiplying R*R* by 5?

Q8. Does it reach a stable value more quickly or more slowly after dividing C*C* by 10?

Q9. Does it reach a stable value more quickly or more slowly after multiplying R*R* by 10 AND dividing C*C* by 10?

Q10. An experimental method for calculating a membrane’s time constant \tau*τ* (when R*R* and/or C*C* are not known) is to start at zero and record the time at which the membrane potential V*V* reaches a value approximately equal to 0.6321V_{peak} = 0.6321IR0.6321*Vpeak*=0.6321*IR*, where I*I* is the constant injected current. Check if this method works by injecting different amounts of current I*I* and changing the values for R*R* and C*C*. Once you’ve convinced yourself that the experimental \tau*τ* appears to be identical to the theoretical \tau (= RC)*τ*(=*RC*) in all these cases, provide a theoretical justification for why this method works.

To do this, find the solution to the differential equation for the passive membrane:

### Computing with Networks

Q1. Let’s design some feedforward networks that can do some basic operations on their inputs. This could mean lowering their intensity, looking for strong changes, or one of many other possibilities. One nice way to build intuition for this sort of processing is to think of these networks as operating on images. Even though our networks will operate over only 5 pixels of image data, we can still build the same basic operations that we would for a regular image.

For the next four questions, we will start with the following image as input:

##### Computational Neuroscience Coursera Course Review:

In our experience, we suggest you enroll in the Computational Neuroscience Coursera Course and gain some new skills from Professionals completely free and we assure you will be worth it.

Computational Neuroscience Coursera course is available on Coursera for free, if you are stuck anywhere between quiz or graded assessment quiz, just visit Networking Funda to get computational Neuroscience Coursera Quiz Answers

This Course is a part of the Google Data Analytics Professional Certificate

##### Conclusion:

I hope this Computational Neuroscience Coursera Quiz Answers would be useful for you to learn something new from this Course. If it helped you then don’t forget to bookmark our site for more Coursera Quiz Answers.

This course is intended for audiences of all experiences who are interested in learning about Data Analytics in a business context; there are no prerequisite courses.

Keep Learning!