# calculate size of sample to reach wanted probability

You are recording neural activity in a cortical brain region. This brain region is known to contain excitatory and inhibitory neurons randomly distributed in space. In the cortex, the number of excitatory neurons is 4 times than the inhibitory neurons. You record blindly the neural activity, that is, you don’t know the type of the recorded neurons. Note that each time you stick your electrode you might record the same neuron

1. Your recorded 100 neurons. How many neurons you expect to see from each type?
2. How many neurons must you record so that you will have at least one neuron from each type with probability of >0.95? (use matlab to estimate the number, it is not easy to solve the equation analytically)
1. I think that the answer for this is 80/20, am I right? (seems to easy to be true)
2. I'm not sure how to start with this. am I suppose to calculate the CDF? I was thinking that if the probability of hitting inhibitory neuron is the smallest(0.2?) than I should just calculate the value of X for CDF(X) =0.95. is this the correct way to solve this?
• @NickPeterson thanks. I see the logic in your solution, but do you think that my suggestion is wrong? because I get same result by plugin CDF(14) in matlab. they asked to "use matlab to estimate the number" and to not solve it analytically, so I figured that they wanted me to try all values from CDF(1) to CDF(14) and see which value reaches ~0.95 Oct 27, 2020 at 9:47
• @KaranElangovan please see comment above. Oct 27, 2020 at 9:48
• ... the CDF of what variable? Oct 27, 2020 at 17:39

I think you're right for the first part.

For the second part, say we record n neurons.

What's the probability that we don't have at least one of each type?

That's P(no Es) + P(no Is) (we can't have none of either so these cases are disjoint)

P(no Es) = P(all Is) P(no Is) = P(all Es)

So our probability is $$(\frac15)^n + (\frac45)^n$$

So the probability there is at least one of each type, P(n): $$P(n) = 1 - (\frac15)^n - (\frac45)^n$$

We want the smallest integer n so $$P(n) > 0.95$$ I'm not sure how we could solve this with algebra so I just used a table of values, to find that the smallest is $$n = 14$$

• thanks, please see question in the main comments Oct 27, 2020 at 10:50

For (1): spot on.

A hint for (2): note that \begin{align*} P(\text{at least one of each})&=1-P(\text{all excitatory or all inhibitory})\\ &=1-(P(\text{all excitatory})+P(\text{all inhibitory})\\ &=1-P(\text{all excitatory})-P(\text{all inhibitory}). \end{align*} If you take $$n$$ measurements, can you compute the probability that they were all excitatory? The probability they were all inhibitory?

• thanks, please see question in the main comments Oct 27, 2020 at 10:49