Adobe Interview Question
Just think of it this way:
If the probability for n and r is Prob(n,r) then:
Prob(n,r) = p * Prob(n-1,r-1) + (1-p) * Prob(n-1,r)
Which means that, if you order the events, the probability that (n,r) happens is the same as when the last event yields true (p probability) AND (n-1,r-1) happens with the first n-1 events OR the last event yields false (1-p) AND (n-1,r) happens.
You can now plug in the binomial formula to this recurrence equation to show that it satisfies it.
Another way would be to prove it by induction using the above technique, which is pretty much equivalent.
Consider an experiment with two outcomes - T and F. The probability of T occurring is p. The probability of F occurring is them (1-p).
- Easy July 13, 2011Assume there were n instances of the same experiment. r resulted in T, the rest in F. The number of possible selections is = nCr. Add to that the probability of the events, you get nCr (p^r)(1-p)^(n-r).
The formula hence describes the probability of an event occurring exactly r times in a set of n experiments. In statistical terms, it describes the probability of a data point occurring exactly r times in a sample set of n terms.