Professional Documents
Culture Documents
WorkedExamples1 Bayes Theorom
WorkedExamples1 Bayes Theorom
1p
.
2p
S
that the first head occurs on the 2kth toss. Then E =
Ek , and
k=1
P (E) = P
Ek =
P (Ek ).
k=1
k=1
(1 p)2k1 p
k=1
p P
p
(1 p)2
(1 p)2k =
1 p k=1
1 p 1 (1 p)2
1p
.
2p
SOLUTION: Define:
sample space to consist of all possible infinite sequences of answers;
event A - A answers the first question;
event F - game ends after the first question;
event W - A wins.
We want
P (W |A)
and
P (W |A0 ).
Using the Theorem of Total Probability, and the partition given by {F, F 0 }
P (W |A) = P (W |A F )P (F |A) + P (W |A F 0 )P (F 0 |A).
Now, clearly
P (F |A) = P [A answers first question correctly] = ,
P (F 0 |A) = 1 ,
(1)
Similarly,
P (W |A0 ) = P (W |A0 F )P (F |A0 ) + P (W |A0 F 0 )P (F 0 |A0 ).
We have
P (F |A0 ) = P [B answers first question correctly] = ,
3
P (F 0 |A) = 1 ,
,
1 (1 ) (1 )
P (W |A0 ) =
(1 )
.
1 (1 ) (1 )
(2)
EXAMPLE 3.
Patients are recruited onto the two arms (0 - Control,
1-Treatment) of a clinical trial. The probability that an adverse outcome
occurs on the control arm is p0 , and is p1 for the treatment arm. Patients are
allocated alternately onto the two arms, and their outcomes are independent.
What is the probability that the first adverse event occurs on the control arm?
SOLUTION: Define:
sample space to consist of all possible infinite sequences of patient
outcomes;
event E1 - first patient (allocated onto the control arm) suffers an adverse outcome;
event E2 - first patient (allocated onto the control arm) does not suffer
an adverse outcome, but the second patient (allocated onto the treatment arm) does suffer an adverse outcome;
event E0 - neither of the first two patients suffer adverse outcomes;
event F - first adverse event occurs on the control arm.
We want P (F ). Now the events E1 , E2 and E0 partition , so, by the
Theorem of Total Probability,
P (F ) = P (F |E1 )P (E1 ) + P (F |E2 )P (E2 ) + P (F |E0 )P (E0 ).
Now, P (E1 ) = p0 , P (E2 ) = (1 p0 ) p1 , P (E0 ) = (1 p0 ) (1 p1 ) and
P (F |E1 ) = 1, P (F |E2 ) = 0. Finally, as after two non-adverse outcomes
the allocation process effectively re-starts, we have P (F |E0 ) = P (F ). Hence
P (F ) = (1 p0 ) + (0 (1 p0 ) p1 ) + (P (F ) (1 p0 ) (1 p1 ))
= p0 + (1 p0 ) (1 p1 ) P (F ),
which can be re-arranged to give
P (F ) =
p0
.
p0 + p1 p0 p1
(3)
P (V |W10 W2 ) = P (V ),
P (V |W10 W20 ) = 0,
as,
given
given
given
given
W1 W2
W1 W20
W10 W2
W10 W20
:
:
:
:
the
the
the
the
game
game
game
game
is
is
is
is
P (Vi ).
i=1
Now, P (Vi ) = 0 if i is odd, as the game can never be completed after an odd
number of points. For i = 2, P (V2 ) = 2 , and for i = 2k + 2 (k = 1, 2, 3, ...)
we have
P (Vi ) = P (V2k+2 ) = 2k k (1 )k 2
- the score must stand at deuce after 2k points and the game must not
have been completed prior to this, indicating that there must have been k
successive drawn pairs of points, each of which could be arranged win/lose
or lose/win for the nominated player. Then that player must win the final
two points. Hence
2
,
P (V ) =
P (V2k+2 ) =
{2(1 )} =
1 2(1 )
k=0
k=0
2
(5)
Now for n = 2
P (F2 ) = P (E3 ) = (1 p)2
and for n > 2,
P (Fn |E1 ) = P (Fn1 ),
P (Fn |E3 ) = 0,
as, given E1 , we need n 1 further tosses that finish T T for Fn to occur, and
given E2 , we need n 2 further tosses that finish T T for Fn to occur, with
all tosses independent. Hence, if pn = P (Fn ) then p2 = (1 p)2 , otherwise,
from (5), pn satisfies
pn = (pn1 p) + (pn2 (1 p) p) = ppn1 + p(1 p)pn2 .
To find pn explicitly, try a solution of the form pn = An1 + Bn2 which
gives
p2 + 4p(1 p)
2
2 =
p+
p2 + 4p(1 p)
2
Furthermore,
n = 1 : p1 = 0
= A1 + B2 = 0
2
n = 2 : p2 = (1 p) = A21 + B22 = (1 p)2
(1 p)2
= A =
,
1 (1 2 )
1
(1 p)2
B= A=
2
2 (1 2 )
(1 p)2 n2
(1 p)2 n1
(1 p)2 n1
+
=q
2 1n1 ,
= pn =
1 (2 1 ) 2 (2 1 )
p(4 3p)
n 2.
7
X
(6)
i=0
Consider P (R5 |S0 ); if 000 is transmitted, the probability that 101 is received
is (1 ) (1 ) = (1 )2 (corruption, no corruption, corruption)
By complete evaluation we have
P (R5 |S0 ) = (1 )2 ,
P (R5 |S2 ) = (1 )3 ,
P (R5 |S4 ) = 2 (1 ) ,
P (R5 |S6 ) = (1 )2 ,
P (R5 |S1 ) = 2 (1 ) ,
P (R5 |S3 ) = (1 )2 ,
P (R5 |S5 ) = 3 ,
P (R5 |S7 ) = 2 (1 ) .
10
Now, the prior information about digits transmitted is that the probability
of transmitting a 1 is 4/7, so
3
3
P (S0 ) =
,
7 2
4
3
P (S2 ) =
,
7 7 2
4
3
P (S4 ) =
,
7 2 7
4
3
P (S6 ) =
,
7
7
2
4
3
,
7 2 7
4
3
P (S3 ) =
,
7 2 7
4
3
P (S5 ) =
,
7 3 7
4
P (S7 ) =
,
7
P (S1 ) =
11
12
P (U |B)P (B)
P (U |B)P (B)
=
P (U )
P (U |B)P (B) + P (U |B 0 )P (B 0 )
7 1
10 20
7 1
10 20
1 19
10 20
7
0.269.
26
13