Login  Register

Re: expectations

Posted by Amit Goyal on Jun 10, 2013; 7:54am
URL: http://discussion-forum.276.s1.nabble.com/expectations-tp7582086p7582096.html

Xhh is the no. of tosses it takes to see two consecutive heads for the first time.
E(Xhh) = Pr(1st toss is H)E(Xhh|1st toss is H) + Pr(1st toss is T)E(Xhh|1st toss is T)
It is clear that
E(Xhh|1st toss is T) = 1+E(Xhh)
E(Xhh|1st toss is H) = Pr(2nd toss is H)E(Xhh|1st toss is H, 2nd toss is H) + Pr(2nd toss is T)E(Xhh|1st toss is H, 2nd toss is T)
E(Xhh|1st toss is H, 2nd toss is H) = 2
E(Xhh|1st toss is H, 2nd toss is T) = 2+E(Xhh)
Thus,
E(Xhh|1st toss is H) = 0.5(2) + 0.5(2+E(Xhh)) = 2 + 0.5E(Xhh)
E(Xhh|1st toss is T) = 1+E(Xhh)
E(Xhh) = 0.5(2+0.5E(Xhh)) + 0.5(1+E(Xhh))
E(Xhh) = 6

Similarly,
Let Xht be the no. of tosses it takes to see a tail right after the head for the first time.
E(Xht) = Pr(1st toss is H)E(Xht|1st toss is H) + Pr(1st toss is T)E(Xht|1st toss is T)
It is clear that
E(Xht|1st toss is T) = 1+E(Xht)
E(Xht|1st toss is H) = Pr(2nd toss is H)E(Xht|1st toss is H, 2nd toss is H) + Pr(2nd toss is T)E(Xht|1st toss is H, 2nd toss is T)
E(Xht|1st toss is H, 2nd toss is H) = 1+E(Xht|1st toss is H)
E(Xht|1st toss is H, 2nd toss is T) = 2
Thus,
E(Xht|1st toss is H) = 0.5(1+E(Xht|1st toss is H)) + 0.5(2)
gives us
E(Xht|1st toss is H) = 3
E(Xht|1st toss is T) = 1+E(Xht)
E(Xht) = 0.5(3) + 0.5(1+E(Xht))
E(Xht) = 4