What is the probability in n flips of a fair coin that there will be two heads in a row?
Answers
Answered by
0
To do this we need to find the probability that there are NO two consecutive heads. Let’s build a recursion relation:
In order to get such a string of length n, then either the last throw was T and there were no consecutive heads in the first n-1 throws, or the two last throws were TH and the first n-2 throws had no two consecutive throws. The probability than obeys the recursion relation
P(n)=P(n−1)2+P(n−2)4P(n)=P(n−1)2+P(n−2)4
With the initial condition
P(2)=34,P(1)=1.P(2)=34,P(1)=1.
To solve the recursion equation we assume P(n)=xnP(n)=xn and get
x2=x2+14x2=x2+14.
The solutions to the equation are
x±=1±5√4x±=1±54 .
Therefore the solution is
P(n)=a+xn++a−xn−.P(n)=a+x+n+a−x−n.
Setting this in the initial conditions yields
1=a+x++a−x−1=a+x++a−x−
34=a+x2++a−x2−34=a+x+2+a−x−2
and we get
a±=5±35√10.a±=5±3510.
Therefore the probability to have two consecutive heads in a string of n throws is
1−P(n)=1−5+35√10(1+5√4)n−5−35√10(1−5√4)n
In order to get such a string of length n, then either the last throw was T and there were no consecutive heads in the first n-1 throws, or the two last throws were TH and the first n-2 throws had no two consecutive throws. The probability than obeys the recursion relation
P(n)=P(n−1)2+P(n−2)4P(n)=P(n−1)2+P(n−2)4
With the initial condition
P(2)=34,P(1)=1.P(2)=34,P(1)=1.
To solve the recursion equation we assume P(n)=xnP(n)=xn and get
x2=x2+14x2=x2+14.
The solutions to the equation are
x±=1±5√4x±=1±54 .
Therefore the solution is
P(n)=a+xn++a−xn−.P(n)=a+x+n+a−x−n.
Setting this in the initial conditions yields
1=a+x++a−x−1=a+x++a−x−
34=a+x2++a−x2−34=a+x+2+a−x−2
and we get
a±=5±35√10.a±=5±3510.
Therefore the probability to have two consecutive heads in a string of n throws is
1−P(n)=1−5+35√10(1+5√4)n−5−35√10(1−5√4)n
Similar questions
Math,
7 months ago
Math,
7 months ago
Math,
7 months ago
Math,
1 year ago
Computer Science,
1 year ago