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

*

*Your recorded 100 neurons. How many neurons you expect to see from each type?

*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)



*

*I think that the answer for this is 80/20, am I right? (seems to easy to be true)

*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?

 A: 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$
A: 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?
