Log In
13 votes

Ram has a fair coin, i.e., a toss of the coin results in either head or tail and each event happens with probability exactly half $(1/2)$. He repeatedly tosses the coin until he gets heads in two consecutive tosses. The expected number of coin tosses that Ram does is.

  1. $2$
  2. $4$
  3. $6$
  4. $8$
  5. None of the above.
in Probability 1.8k views

watch this video its intresting 

5 Answers

17 votes
Best answer

Answer is (C)

By drawing the tree diagram we can find the following series :

$$\begin{align} E &= \sum{k.P(k) } \\ &=2.(1.x^2) + 3.(1.x^3) + 4.(2.x^4) + 5.(3.x^5)+6.(5.x^6)+7.(8.x^7)+\ldots \infty\\ \end{align}$$

Above series is a nice combination of AP , generating function and Fibonacci numbers !!!!

  • AP terms can be handled by integration or differentiation
  • Fibonacci generating function is $= \begin{align} \frac{1}{1-x-x^2} \end{align}$
  • probability on each branch is $x = \frac{1}{2}$

 $\begin{align} &\Rightarrow \frac{E}{x} =2.(1.x^1) + 3.(1.x^2) + 4.(2.x^3) + 5.(3.x^4)+6.(5.x^5)+7.(8.x^6)+\ldots \infty\\ &\Rightarrow \int \frac{E}{x} .dx = 1.x^2+1.x^3+2.x^4+3.x^5+5.x^6+.....\infty \\ &\Rightarrow \int \frac{E}{x} .dx = x^2.\left ( 1.x^0+1.x^1+2.x^2+3.x^3+5.x^4+\ldots \infty \right ) \\ &\Rightarrow \int \frac{E}{x} .dx = \frac{x^2}{1-x-x^2} \\ &\Rightarrow \frac{E}{x} = \frac{\mathrm{d}}{\mathrm{d} x}\left [ \frac{x^2}{1-x-x^2} \right ]\end{align}$
$\begin{align}  &\Rightarrow \frac{E}{x} = \frac{2x(1-x-x^2)+(1+2x)x^2}{(1-x-x^2)^2} \\ &\Rightarrow E = x.\left \{ \frac{2x(1-x-x^2)+(1+2x)x^2}{(1-x-x^2)^2} \right \} \\ &\Rightarrow E = \frac{1}{2}.\left \{ \frac{2.\frac{1}{2}(1-\frac{1}{2}-\frac{1}{4})+(1+2.\frac{1}{2}).\frac{1}{4}}{(1-\frac{1}{2}-\frac{1}{4})^2} \right \} \\ &\Rightarrow E = 6 \\ \end{align}$

Similar Kind of Question as a Reference

edited by
i did not get the calculation part :-('nt there any other easy way to calculate
  • To avoid calculation, I think you should approach other methods (like: recurrence relation), Once you carefully constructed the recurrence relations then solving them is easy.
  • But in the above method, we never know what series going to appear (depending on the problem). So I think it helpful for us to be well prepared to handle any such series summation, using generating function + integration + differentiation + etc. (these are basically done to get a closed form of a series by manipulating the coefficients). 
very beautiful Solution!!

Although it's not practical to observe the pattern and solve in the exam
23 votes

Let x be the Expected Number of tosses.

If we get a tail immediately (Probability $\frac{1}{2}$ ) then the Expected number = (x+1)

If we get a head then a tail (Probability $\frac{1}{4}$ ) then the Expected number = (x+2)

If first 2 tosses are head then the Expected number  =2


x = $\frac{1}{2}$ (x+1) + $\frac{1}{4}$ (x+2) + $\frac{1}{4}$ 2 

$\frac{1}{4}$ x = $\frac{3}{2}$ x


Hence (c) 6 is the Answer.


 first 2 tosses are head then the Expected number  =2

how? it will be HH right?then expectation will be 1 right?

We are expecting - "no. of tosses". So "HH" requires 2.

the expected number of times you would need to toss a fair coin in order to obtain n consecutive heads is 2n+1 − 2


If we use the above method for Consecutive HT then we have following solution -

If we get a tail immediately (Probability 1/2 ) then the Expected number = (x+1)

If we get a head then a Head(Probability 1/4 ) then the Expected number = (x+1)

If first 2 tosses are HT then the Expected number  =2


x = (1/2)(x+1) + (1/4)2 + (1/4)(x+1)

=> x = 5

In this case correct answer is x=4 in this case.

Where I am wrong?
@Satyam Chaudhary,Suppose we use counting.In this case expecting say a single head or tail is 2^1,both heads 2^2.By summing both we get 6.Correct if wrong.
Nice approach and very well explained!
1 vote

The expected number of coin flips required to obtain $n$ consecutive heads  $= E_n = 2(2^n-1)$

here $n=2$ $\implies E_2 = 2(2^2-1) = 2*3=6$

So option $C.$ is correct.

For details :-

Good idea.


Q:An unbiased coin is tossed repeatedly until the outcome of two successive tosses is the same. Assuming that the trials are independent, the expected number of tosses is ?

Is this approach applicable for this question also ?  

& is this question somewhat similar to this TIFR question & if not, the main reason for that is we have to consider the TT case also in this question but not in TIFR one?


You can apply this formula also but a slight modification.

The expectation would become half. i.e. $E_n = 2^n-1$

In simple words it is happening because since we are taking more outputs in our favour(like earlier we wanted only HH but now we increased our output domain and HH and TT both are valid) so coin flips required on average is reducing. Try to understand it using below explanation and stackexchange explanation provided in answer above.

Thankyou for the explanation :)
0 votes
If you simply want the number of tosses for consecutive heads or tails, there is a shortcut formula ie En = 2(2^n-1) and here in our case n is 2(as we need two consecutive tosses).
–1 vote

We need 2 consecutive head in 1 coin

out can be 

n=2             {HH}=1/22

n=3             {THH}=1/23

n=4             {HTHH,TTHH}=2/24

n=5              {TTTHH,THTHH,HTTHH}=3/25


 So, Expected no. of tosses (1/22+1/23+2/24+3/25+................)

                                             =1/22+ 1/22(1/2+2/22+3/23+.......................)

                                             =1/4 +1/4*2



Ans is (e)

I had also tried the same way but the Ans given is 6.
this is adding the probability of getting two consecutive "H". But expectation is summation over $x.P(x)$, where $x$ here is the no. of tosses. So, you have to multiple each term by the no. of tosses needed for that.
Yes I went through the ques again and realised my mistake ☺


Question asks for sigma(xp(x)) as Arjun Sir mentions


Related questions

4 votes
2 answers
Consider two independent and identically distributed random variables $X$ and $Y$ uniformly distributed in $[0, 1]$. For $\alpha \in \left[0, 1\right]$, the probability that $\alpha$ max $(X, Y) < XY$ is $1/ (2\alpha)$ exp $(1 - \alpha)$ $1 - \alpha$ $(1 - \alpha)^{2}$ $1 - \alpha^{2}$
asked Dec 5, 2015 in Probability makhdoom ghaya 430 views
10 votes
5 answers
Consider a $6$-sided die with all sides not necessarily equally likely such that probability of an even number is $P (\left \{2, 4, 6 \right \}) =\dfrac{1}{2}$, probability of a multiple of $3$ is $P (\left \{3, 6 \right \}) = 1/3$ and probability of $1$ ... $P(\left \{5 \right \}) \leq \dfrac{1}{6}$ $P(\left \{ 5 \right \}) \leq \dfrac{1}{3}$ $\text{None of the above.}$
asked Dec 2, 2015 in Probability makhdoom ghaya 866 views
12 votes
3 answers
Let $B$ consist of all binary strings beginning with a $1$ whose value when converted to decimal is divisible by $7$. $B$ can be recognized by a deterministic finite state automaton. $B$ can be recognized by a non-deterministic finite state automaton ... but not by a deterministic push-down automaton. $B$ cannot be recognized by any push down automaton, deterministic or non-deterministic.
asked Dec 7, 2015 in Theory of Computation makhdoom ghaya 829 views
5 votes
2 answers
Let $A$ and $B$ be non-empty disjoint sets of real numbers. Suppose that the average of the numbers in the first set is $\mu_{A}$ and the average of the numbers in the second set is $\mu_{B}$; let the corresponding variances be $v_{A}$ and $v_{B}$ respectively. If the average of the elements in $A \cup B$ ... $p.v_{A}+ (1 - p). v_{B} + (\mu_{A}- \mu_{B})^{2}$
asked Dec 5, 2015 in Numerical Ability makhdoom ghaya 365 views