Kailash Gupta
BAN USER
Comments (2)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
required prob, p = pr(10)pr(11) + pr(11)pr(10 before 7) + p(10)pr(11 before 7) + pr(anything other than 10, 11 and 7)*p
pr(rolling a 10 before 7) = pr(10) + pr(anything other than 10 and 7) * pr(10) + pr(anything other than 10 and 7)^2 * pr(10) + pr(anything other than 10 and 7)^3 * pr(10) + pr(anything other than 10 and 7)^4 * pr(10) + ...
=1/12 + (1 - 3/36 - 6/36)*1/12 + ....
= 1/12 + (3/4 * 1/12) + ((3/4)2 * 1/12) + ((3/4)3 * 1/12) + ...
= 1/12 * sum for i = 0 to infinity of (3/4)i
= 1/12 * (1/(1-3/4))
= 1/12 * 4 = 1/3
Similarly pr(rolling a 11 before 7) = 1/4
So p = 3/36*2/36 + 2/36*1/3 + 3/36 * 1/4 + (1 - 3/36 - 2/36 - 6/36)p
p = 2/(36*12) + 8/(36*12) + 9/(36*12) + 25/36 * p
11/36*p = 19/(36*12)
=>p = 19/(12*11)
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
At the 6th toss, probability of the coin to be unfair is not just 1/5 (and its more than that) as we already know that last 5 tosses resulted head.
- Kailash Gupta August 31, 2013Let P(A) = coin is unfair, P(B) = coin is fair, P(C) = coin is heads 5 times.
Then P = P(A|C)*P(Head with unfair coin) + P(B|C)* P(Head with fair coin)
As:
P(A |C) = P(C|A) * P(A) / P(C) = 1 * 1/5 / P(C) (Using Bayes Formula)
P(C)= (1*1/5) + ((1/2)^5 (4/5)) =(1/5 + (1/32 * 4/5)) = (1/5 + (4/160)) = 9/40
So P(A |C) = (1/5) / (9/40) = 8/9
Similarly P(B|C) = P(C|B)*P(B)/P(C) = (1/2)^5 * 4/5 / (9/40) = 1/9
So P = 8/9 * 1 + 1/9 * 1/2 = 17/18