When you flip a biased coin the probability of getting a tail is 0.25.
How many times would you expect to get tails if you flip the coin 180 times?
Answers
Answer :-
Here's a way to solve it without using recursion.
Let Pk denote the probability of satisfying the above condition with k heads in n tosses.
P0=(n0)(.75)n This can be seen as placing 0 heads in a row of n tails.
P1=(n1)(0.75)(n−1)∗(0.25) This can be seen as placing 1 heads in a row of n-1 tails (so n positions for a head to be placed in).
P2=(n−12)(0.75)(n−2)∗(0.25)2 This can be seen as placing 2 heads in a row of n-2 tails such that no two heads are together (so n-1 positions available for heads to be placed in).
.
.
Pk=(n−k+1k)(0.75)(n−k)∗(0.25)k
.
It can be seen that for k>n/2,Pk=0 as it would not be feasible to place heads which are greater in number than tails + 1 in total.
The summation of all probabilities till Pk should be the answer.
I would only be glad if you pointed out some flaws in the above argument.