Experimental Probability in Train Arrivals
Experimental Probability in Train Arrivals
Where the
magic
happens
Your
Comfort
Zone
Solved example:
𝐸: A medical test was performed on random people. The result was either positive (+),
negative (-), or ambiguous (a). If the result was ambiguous, the test was carried out on the
same person again and again until the test resulted as either positive or negative.
Solution:
The sample space is 𝑆 = {+, 𝑎+, 𝑎𝑎+, 𝑎𝑎𝑎+, 𝑎𝑎𝑎𝑎+, … , −, 𝑎−, 𝑎𝑎−, 𝑎𝑎𝑎−, 𝑎𝑎𝑎𝑎−, … }
Partition 1: Let us make this partition on the interest "the number of times the experiment was
performed". Then the various events 𝐴𝑘 in this partition would be:
𝐴1 = {+, −} corresponding to the experiment being performed once.
𝐴2 = {𝑎+, 𝑎 −} exp performed twice.
𝐴3 = {𝑎𝑎+, 𝑎𝑎 −} exp performed 3 times.
𝐴4 = {𝑎𝑎𝑎+, 𝑎𝑎𝑎 −} exp performed 4 times.
And so on.
In this partition there would be infinite events; 𝐴1 𝑡𝑜 𝐴∞
Partition 2: Let us make this partition on the interest "the outcome of the experiment". Then
the various events 𝐵𝑘 in this partition would be:
𝐵+ = {+, 𝑎+, 𝑎𝑎+, 𝑎𝑎𝑎+, … } corresponding to the outcomes being +.
𝐵− = {−, 𝑎−, 𝑎𝑎−, 𝑎𝑎𝑎−, … } corresponding to the outcomes being -.
In this partition there would only be two events; 𝐵+ and 𝐵−.
Partition 1: Let us make this partition on the interest "the number of heads we got ". Then the
various events 𝐴𝑘 in this partition would be:
𝐴0 = {𝑇𝑇𝑇} corresponding to the event that we got no heads.
𝐴1 = {𝑇𝑇𝐻, 𝑇𝐻𝑇, 𝐻𝑇𝑇} got one heads.
𝐴2 = {𝑇𝐻𝐻, 𝐻𝑇𝐻, 𝐻𝐻𝑇} got two heads.
𝐴3 = {𝐻𝐻𝐻} got three heads.
Partition 2: Let us make this partition on the interest "the second toss is heads". Then the
various events 𝐵𝑘 in this partition would be:
𝐵0 = {𝑇𝑇𝑇, 𝑇𝑇𝐻, 𝐻𝑇𝑇, 𝐻𝑇𝐻} corresponding to the second toss NOT being heads.
𝐵1 = {𝑇𝐻𝑇, 𝑇𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝐻𝐻} corresponding to the second toss being heads.
Partition 1: Let us make this partition on the interest "whether moon was visible or not". Then
the various events 𝐴𝑘 in this partition would be:
𝐴𝑆 = {𝑡 ∶ 𝑡 ∈ [0, 𝑡𝑚𝑎𝑥 )} corresponding to the event that the moon was visible.
𝐴𝐹 = {𝑡: 𝑡 = 𝑡𝑚𝑎𝑥 } corresponding to the event that the moon is not visible.
Partition 2: Let us make this partition on the interest "the moon was visible by the hour 𝑘".
Then the various events 𝐵𝑘 in this partition would be:
𝐵0 = {𝑡 = 0} corresponding to the moon being visible immediately.
𝐵1 = {𝑡: 0 < 𝑡 ≤ 1} corresponding to the moon being visible by first hour.
In general
𝐵𝑘 = {𝑡: 0 < 𝑡 ≤ 𝑘} corresponding to the moon being visible by 𝑘 𝑡ℎ hour.
𝐸3 : Draw two cards from a deck of 52 distinct cards with replacement after the first draw. With
replacement means the first card is drawn, noted, and put back in the deck of cards and the
second is drawn again at random.
Solution:
If the cards are numbered from 1 - 52, they would be easier to refer to.
𝑆 = {(1,1), (1,2), (1,3), … , (1,52),
(2,1), (2,2), (2,3), … , (2,52),
…
(52,1), (52,2), (52,3), … , (52,52)}
Partition 1: Let us make this partition on the interest "Card 1 drawn". Then the various events
𝐴𝑘 in this partition would be:
𝐴1 = {(1,1), (1,2), … , (1,13)} corresponding to the event that Card 1 drawn is 1.
𝐴2 = {(2,1), (2,2), … , (2,13)} corresponding to the event that Card 1 drawn is 2.
𝐴𝑘 = {(𝑘, 1), (𝑘, 2), … , (𝑘, 13)} corresponding to the event that Card 1 drawn is k, where 1 ≤
𝑘 ≤ 52.
Partition 2: Let us make this partition on the interest "Card 1 and 2 are same". Then the
various events 𝐵𝑘 in this partition would be:
𝐵1 = {(1,1), (2,2), … , (52,52)} corresponding to the event that Card 1 drawn 1 is equal to card
2.
𝐵2 = 𝐵1𝑐 corresponding to the event that Card 1 drawn is 2.
𝐸4 : A C++ function prime() returns a random prime integer. A program needs two different
prime numbers.
Solution:
𝑆 = {(2,3), (2,2,3), (2,2,2,3), … , (2,2, … ,3), (2,5), (2,2,5), … , (2,2, … ,5), (2,7), (2,2,7), …,
(2,2, … ,7), … , (3,5), (3,3,5), … , (3,3, … ,5), (3,7), (3,3,7), … , (3,3, … ,7), … , … }
Partition 2: Let us make this partition on the interest "product of the two prime numbers".
Then the various events 𝐵𝑘 in this partition would be:
𝐵6 = {(2,3), (2,2,3), … , (3,2), (3,3,2), … } for a product of 6.
𝐵10 = {(2,5), (2,2,5), … , (5,2), (5,5,2), … } for a product of 10.
𝐵14 = {(2,7), (2,2,7), … , (7,2), (7,7,2), … } for a product of 14.
And so on.
𝐸5 : An experiment consists of selecting a number 𝑥 from the interval [0, 1) and a number 𝑦
from the interval [0,2) to form a point ( 𝑥, 𝑦 ).
Solution:
𝑆 = {(𝑥, 𝑦): 0 ≤ 𝑥 < 1, 0 ≤ 𝑦 < 2}
Partition 1: Let us make this partition on the interest "unit areas along y-axis". Then the
various events 𝐴𝑘 in this partition would be:
𝐴1 = {(𝑥, 𝑦): 0 ≤ 𝑥 < 1, 0 ≤ 𝑦 < 1}
𝐴2 = {(𝑥, 𝑦): 0 ≤ 𝑥 < 1, 1 ≤ 𝑦 < 2}
Partition 2: Let us make this partition on the interest "circular strips w width thick around the
center". Then the various events 𝐵𝑘 in this partition would be:
𝐵1 = {(𝑥, 𝑦): (x – 0.5)2 + (y– 1)2 ≤ w2 }
2
𝐵2 = {(𝑥, 𝑦): 𝑤 2 < (x – 0.5)2 + (y– 1)2 ≤ 2w }
2
𝐵3 = {(𝑥, 𝑦): 2𝑤 2 < (x – 0.5)2 + (y– 1)2 ≤ 3w }
In general
2
𝐵𝑘 = {(𝑥, 𝑦): (𝑘 − 1)𝑤 2 < (x – 0.5)2 + (y– 1)2 ≤ kw }
You roll two seven-sided dice. The sides of each die are numbered from 1 to 7. The dice are
“fair” (all sides are equally likely), and the two die rolls are independent.
Part A: Event A is “the total is 14” (i.e., the sum of the results of the two die rolls is 14).
1. Is event A independent of the event “at least one of the dice resulted in a 5”?
2. Is event A independent of the event “at least one of the dice resulted in a 1”?
1. Is event B independent of getting “doubles” (i.e., both dice resulting in the same
number)?
2. Given that the total was 12, what is the probability that at least one of the dice resulted
in a 5?
|S| = 7x7 = 49, All outcomes equally likely as dice are fair.
Part A:
A = { (7,7) }
Pr(A) = 1/49
1:
𝐹 = { (5,1), (5,2), (5,3), (5,4), (5,5), (5,6), (5,7), (1, 5), (2, 5), (3, 5), (4, 5), (6, 5), (7, 5)}
𝑃𝑟(𝐹) = 13/49, (Note: also |F|c = 6x6 = 36, |F| =|S|-36=13)
𝐴 ∩ 𝐹 = 𝛷, (Note: this alone is enough to rule out independence if none of A and F are Φ)
𝑃𝑟(𝐴 ∩ 𝐹) = 𝑃𝑟(𝛷) = 0 ≠ 𝑃𝑟(𝐴). 𝑃𝑟(𝐹)
Hence A and F are not independent.
2:
Through a similar argument as above, they are not independent.
Part B:
𝐵 = { (5,7), (6,6), (7,5) }
𝑃𝑟(𝐵) = 3/49
1:
𝐷 = { (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7) }
𝑃𝑟(𝐷) = 7/49
𝐵 ∩ 𝐷 = { (6,6) }
𝑃𝑟(𝐵 ∩ 𝐷) = 1/49 = 0.020408 ≠ 𝑃𝑟(𝐵). 𝑃𝑟(𝐷) = 3/49 𝑥 7/49 = 0.00875
Hence B and D are not independent.
2:
𝑃𝑟(𝐹 | 𝐵) = 𝑃𝑟(𝐹 ∩ 𝐵}/𝑃𝑟(𝐵) = 𝑃𝑟{ (5,7), (7,5) }/(3/49) = (2/49) / (3/49) = 2/3
Consider the communication network shown in the figure below and suppose that each link
can fail with probability p. Assume that failures of different links are independent.
1. Assume that p = 3/8. Find the probability that there exists a path from A to B along
which no link has failed. (Give a numerical answer.)
2. Given that exactly one link in the network has failed, find the probability that there
exists a path from A to B along which no link has failed. (Give a numerical answer.)
1:
Define events Fi = "Link i has failed", Wi = Link i is working", W = “a path from A to B
exists)”, then
𝑃𝑟(𝐹𝑖 ) = 𝑝 = 3/8, 𝑃𝑟 (𝑊𝑖 ) = 1 − 𝑝 = 5/8
Alternate: First consider probability that link 1 and 2 are up, and Link 3 and 4 are up,
then consider the probability for the parallel path to be up and then consider the final
series path to be up. However, the expression in p may come out to be different but the
value would be the same. Try it. The expression you would get would be
Pr(𝑊) = {1 − [1 − (1 − 𝑝)2 ]2 }. (1 − 𝑝)
2:
Define event Oi = "only link i has failed", E = "exactly one link in the network has failed”
then
Pr(Oi) =p(1-p)4
Alternate 2: Since all events Oi are equally likely to occur conditional on E and since
exactly one of them has occurred, each has the same conditional probability
𝑃𝑟(𝑂𝑖 |𝐸) = 1/5. There will be no path from A to B only in the case where the link that
failed is Link 5, which happens with probability 𝑃𝑟(𝑂5 |𝐸) = 1/5. Therefore, 𝑃𝑟(𝑊|𝐸) =
1 − 1/5 = 4/5.
Alternate 4: Define event Oi = "only link i has failed", E = "exactly one link in the
network has failed, then
𝑃𝑟(𝑂𝑖 ) = 𝑝(1 − 𝑝)4
𝑃𝑟(𝐸) = 𝑃𝑟(𝑂1 𝑈 𝑂2 𝑈 𝑂3 𝑈 𝑂4 𝑈 𝑂5 ) = 5. 𝑃𝑟(𝑂𝑖 ) = 5𝑝(1 − 𝑝)4
because{𝑂1 , 𝑂2 , 𝑂3 , 𝑂4 , 𝑂5 } forms a partition of 𝐸.
So Pr(link from A to B exists given that only one link has failed) = 𝑃𝑟(𝑊 | 𝐸)
In a reduced universe where event E has occurred, W should be checked to see how it
occurs under 5 scenarios.
Pr(𝑊|𝐸) = Pr(𝑂1 |𝐸) . Pr(𝑊|𝑂1 , 𝐸) + Pr(𝑂2 |𝐸) . Pr(𝑊|𝑂2 , 𝐸) + Pr(𝑂3 |𝐸) . Pr(𝑊|𝑂3 , 𝐸)
+ Pr(𝑂4 |𝐸) . Pr(𝑊|𝑂4 , 𝐸) + Pr(𝑂5 |𝐸) . Pr(𝑊|𝑂5 , 𝐸)
where
Pr(𝑂1 , 𝐸) Pr(𝑂1 ) p(1 − p)4 1
Pr(𝑂1 |𝐸) = = = 4
=
Pr(𝐸) Pr(𝐸) 5p(1 − p) 5
and
Pr(𝑊, 𝑂1 , 𝐸) Pr(𝑂1 )
Pr(𝑊|𝑂1 , 𝐸) = = =1
Pr(𝑂1 , 𝐸) Pr(𝑂1 )
which is true for all Oi except O5, where
Pr(𝑊, 𝑂5 , 𝐸) Pr((W1 , W2 , W5 U W3 , W4 , W5 ), 𝑂5 , 𝐸)
Pr(𝑊|𝑂5 , 𝐸) = =
Pr(𝑂5 , 𝐸) Pr(𝑂5 )
Pr(W1 , W2 , W5 , O5 , E U W3 , W4 , W5 , 𝑂5 , 𝐸) Pr(∅, ∅) Pr(∅)
= = = =0
Pr(𝑂5 ) Pr(𝑂5 ) Pr(𝑂5 )
as W = W 1W 2W 5 U W 3W4W 5
Akbar has a big family. He traveled with all his family to many cities over an excursion trip. At
some point, he discovered he has lost his son. He was able to narrow down his search to two
cities; he lost his son in either city A (with probability 0.4) or in city B (with probability 0.6). If his
son is in city A and Akbar spends a day searching for it in city A, the conditional probability that
he will find his son that day is 0.25. Similarly, if his son is in city B and Akbar spends a day
looking for it there, he will find his son that day with probability 0.15.
His son cannot go from one city to the other. Akbar can search only in the daytime, and he can
travel from one city to the other only overnight.
His son is alive during day 0, when Akbar loses him, and during day 1, when Akbar starts
searching. He is alive during day 2 with probability 2/3. In general, for n ≥ 1, if his son is alive
during day n − 1, then the probability he is alive during day n is 2/(n + 1). His son can only die
overnight. Akbar stops searching as soon as he finds his son, either alive or dead.
a) In which city should Akbar look on the first day of the search to maximize the
probability he finds his son that day?
b) Akbar looked in city A on the first day but didn’t find his son. What is the probability that
his son is in city A?
c) Akbar flips a fair coin to determine where to look on the first day and finds his son on
the first day. What is the probability that he looked in city A?
d) Akbar decides to look in city A for the first two days. What is the probability that he
finds his son alive for the first time on the second day?
e) Akbar decides to look in city A for the first two days. Given that he did not find his son
on the first day, find the probability that he does not find his son dead on the second
day.
f) Akbar finally finds his son on the fourth day of the search. He looked in city A for the
first 3 days and in city B on the fourth day. Given this information, what is the
probability that he found his son alive?
Please note that I have tried to explain things a bit too. In solving a problem in exam, many
details are not needed.
Note that in any question the important part is how you formulate the question into relevant
events that you would work with onwards. Once this is properly done, the rest is not a big deal.
So read the question carefully, ignore the extra 'details' but note the 'actions' that take place
and/or the 'facts' that are being reported. Give more time to thinking and formulation than you
are used to.
So when you read this question carefully you note that:
NUCES-FAST Islamabad: Spring’19: PRP (EE) Assign # 02 - Sol Page 8/17
Roll No: _____________
The big issue is Akbar's son has been lost, he will attempt to search for him, in two cities, one
day per city and the result of a day's search would be whether found or not. Besides this the
worry is whether he is alive or dead and the chances of death increase with every passing
day.
The following events cover the various details presented in the problem:
Event A = Son is in city A, Event B = Son is in city B
Event Fi = Son Found on ith day, Event Fi' = Son not found on ith day
th
Event SA = City A is searched on i day, Event SB = City B is searched on ith day
The choices Akbar has and various probabilities are as presented in the tree-diagram below.
F1
0.25
0.4 0.75
F 1’
SA
Pr(SA)
0.6
1.0
B F 1’
A F 1’
1.0
Pr(SB) 0.4
SB
F1
0.6 0.15
0.85
F 1’
CAUTION:
Please note that although I have written single events at nodes and leaves of the tree to avoid
clutter, each of them is an intersection of all the events starting from root of the tree (left) to
that node/leaf. For example the node A (on top of the tree) is actually A ∩ SA, and the leaf on
top is actually 𝐹1 ∩ 𝐴 ∩ 𝑆𝐴 . This will be true for all subsequent trees in this question (and
elsewhere).
Note that this is different from the Radar detection example. If a Radar detects an airplane
there may or may not be an airplane actually in the air. But if Akbar finds his son, it is for sure
he is not in the other city.
Furthermore, please note (a very important point) that whether the son is alive or dead does
not depend on whether he has been found or not. It is only dependent on time, i.e., probability
of him being alive reduces with time.
Now let us continue to the question parts. Note that if you are able to comprehend a question
and write it correctly in terms of the events you have defined, solving it is a piece of cake. This
is a learning. In case you cannot convert a question being asked into the events you have
specified convincingly, you may need to revisit and redo your defining of the events.
a) In which city should Akbar look on the first day of the search to maximize the
probability he finds his son that day?
Here Akbar wants to make a choice between cities A and B so he should see searching which
one will produce a higher probability to find his son on the first day.
as F1 can only occur in city A and remember each leaf is an intersection. [If you pay close
attention, this is application of Law of Total Probability for an event under a condition.]
Similarly, Pr(Finding son on first day given that B was chosen to search) =
[Note that this is Bayesian inference. Although his initial belief was greater for his son to be in
city B, based on what chances does he have in finding his son in each city, he should not opt
for a case purely based on his initial beliefs alone.]
b) Akbar looked in city A on the first day but didn’t find his son. What is the
probability that his son is in city A?
Pr(𝐴 ∩ 𝐹1′ ∩ 𝑆𝐴 )
Pr(𝐴|𝐹1′ ∩ 𝑆𝐴 ) =
Pr(𝐹1′ ∩ 𝑆𝐴 )
Note that since everything happens under the condition that SA has occurred (i.e., being
searched in city A) we can consider the sub-tree for SA as follows:
F1
0.25
0.4 0.75
SA F1’
0.6
1.0
B F1’
Thus
Pr(𝐴 ∩ 𝐹1′ ) Pr(𝐴 ∩ 𝐹1′ ) 0.4 ∗ 0.75 1
Pr(𝐴|𝐹1′ ) = ′ = ′) ′ = =
Pr(𝐹1 ) Pr(𝐴 ∩ 𝐹1 + Pr(𝐵 ∩ 𝐹1 ) 0.4 ∗ 0.75 + 0.6 ∗ 1.0 3
c) Akbar flips a fair coin to determine where to look on the first day and finds his
son on the first day. What is the probability that he looked in city A?
For this part refer to the original tree. The flipping fair coin part gives probabilities
Pr(SA) = 0.5 and Pr(SB) = 0.5.
Pr(𝑆𝐴 ∩ 𝐹1 ) Pr(𝑆𝐴 ∩ 𝐴 ∩ 𝐹1 )
Pr(𝑆𝐴 | 𝐹1 ) = =
Pr(𝐹1 ) Pr(𝑆𝐴 ) . Pr(𝐴 ∩ 𝐹1 |𝑆𝐴 ) + Pr(𝑆𝐵 ) . Pr(𝐵 ∩ 𝐹1 |𝑆𝐵 )
since he flipped the coin, he could have searched in city A as well as city B. So the event F1
could have occurred in both cities and hence according to LTP we get the denominator term.
d) Akbar decides to look in city A for the first two days. What is the probability that
he finds his son alive for the first time on the second day?
Pr(finds son in city A and on second day and is alive given that he searched in city on first
day and he searched in city A on second day)=
Pr(finds son in city A and on second day and is alive and did not find his son on first day
given that he searched in city on first day and he searched in city A on second day)=
This is because his being alive on 2nd day is independent of other factors, i.e., where was he
searched for and whether he was in city A or B. Also once again we can look at the sub-tree
for SA.
F1
0.25
F2
A
0.25
0.4 0.75
SA F1’
0.75
0.6
1.0
F 2’
B F1’
2
Pr(𝐿2 |𝑆𝐴 ) . Pr(𝐴 ∩ 𝐹2 ∩ 𝐹1′ |𝑆𝐴 ) = ∗ 0.4 ∗ 0.25 ∗ 0.75 = 0.05
2+1
e) Akbar decides to look in city A for the first two days. Given that he did not find
his son on the first day, find the probability that he does not find his son dead on
the second day.
Although Akbar is searching for his son in city A, not finding his son dead on the second day
could mean two things, (i) he found his son on second day but alive, and (ii) he did not find his
son, alive or dead, on second day. So the event of interest here is not simple.
Let us check the complement event, that the probability that Akbar finds his son dead on the
second day, which is a definitive case, so let us use this:
Pr(dead and on second day and not found on first and in city A given that he chose to
search in A)=
1
Pr(𝐿′2 ∩ 𝐹2 ∩ 𝐹1′ ∩ 𝐴|𝑆𝐴 ) = Pr(𝐿′2 |𝑆𝐴 ). Pr(𝐹2 ∩ 𝐹1′ ∩ 𝐴|𝑆𝐴 ) = (0.25 ∗ 0.75 ∗ 0.4) = 0.025
3
Thus the probability for the event of interest, i.e. that Akbar does not find his son dead on the
second day is 1-0.025 = 0.975
f) Akbar finally finds his son on the fourth day of the search. He looked in city A for
the first 3 days and in city B on the fourth day. Given this information, what is the
probability that he found his son alive?
We would need to define new events if we need to capture every detail of this problem.
Because in saying SA we have had no consideration of days. However, luckily, a little thought
over this problem would resolve it.
For son to be alive on day 4, he must be alive on all previous days, thus this is like saying:
because for son to be alive, does not depend on which city was chosen to be searched, where
he actually was and only depends on which day he was found.
2 2 2 2
Pr(𝐿4 ∩ 𝐿3 ∩ 𝐿2 ∩ 𝐿1 ) = Pr(𝐿4 ) . Pr(𝐿3 ) . Pr(𝐿2 ) . Pr(𝐿1 ) = .1 = = 0.13333
4 +13 +12 +1 15
Every morning, before leaving for university, Aamer checks whether his wife has prepared his
lunch box or not. On any given day, with probability 0.8 the lunch box is "prepared" and with
probability 0.2 it is "not prepared". If the lunch box is "not prepared", the probability of him
taking food from the Cafe is 0.8. On the other hand, if the lunch box is “prepared”, the
probability of him taking food from Cafe is 0.1 (being a professor, says it all).
1. One day, Aamer missed checking whether the lunch box was prepared or not and he
took food from Cafe. What is the probability that the lunch box was “prepared”?
2. Aamer misses checking the lunch box in the morning with probability 0.15 on any day
in the year. If he misses checking it, Aamer will flip a fair coin to decide whether to take
food from Cafe or not. (We assume that the result of the coin flip is independent from
the checking of lunch box and his wife's routine.) On any day he checks the lunch box,
if it is "prepared” he will always take food from the lunch box, and if it is “not prepared”
he will take food from Cafe. Let C be the event that “Aamer is taking food from Cafe”,
and let P be the event that the lunch box is “prepared”. Are events C and P
independent?
3. Aamer is not having food from Cafe and he has not brought the lunch box. What is the
probability that he checked the lunch box in the morning?\
The overall tree diagram based on what information is given can be thought of as follows
under two scenarios, (i) whether Aamer checked for his lunch box, or (ii) not. We can make
two separate trees but I have merged into one.
P
0.8
0.9
C’
A C
0.8
0.2
Pr(A) P’
0.2
C’
C
0.8
Pr(A’)
0.8 P
A’
0.2
C’
C
0.8
0.2
P’
0.2
C’
OR
C
0.1
P
0.8
0.9
C’
A C
0.8
0.2
Pr(A) P’
0.2
C’
C
Pr(A’) 0.8
A’
0.2
C’
Since it does not matter whether the lunchbox was prepared or not if Aamer has not checked
it, whence he would not take it to university, and when he has not taken lunchbox to university,
he would eat from cafe with probability 0.8 and won't eat with probability 0.2.
1. One day, Aamer missed checking whether the lunch box was prepared or not
and he took food from Cafe. What is the probability that the lunch box was
“prepared”?
For this part we look into the lower universe of the above tree diagram, i.e., where Aamer
missed checking the lunch box. Assume a tree that starts from A'.
2. Aamer misses checking the lunch box in the morning with probability 0.15 on
any day in the year. If he misses checking it, Aamer will flip a fair coin to decide
whether to take food from Cafe or not. (We assume that the result of the coin flip
is independent from the checking of lunch box and his wife's routine.) On any
day he checks the lunch box, if it is "prepared” he will always take food from the
lunch box, and if it is “not prepared” he will take food from Cafe. Let C be the
event that “Aamer is taking food from Cafe”, and let P be the event that the lunch
box is “prepared”. Are events C and P independent?
For the above tree diagram, Pr(A') = 0.15, Pr(A) = 0.85, and in lieu of new information, we
need to modify the tree diagram:
1.0
P C’
0.8
A
0.2 1.0
0.85 P’ C
C
0.5
0.15 0.8 P
A’ 0.5
C’
C
0.5
0.2
P’
0.5
C’
To prove whether P and C are independent we need to prove the following:
Pr(𝑃 ∩ 𝐶) = Pr(𝑃) . Pr(𝐶)
Pr(𝑃) = 0.8
and is not dependent on whether Aamer checked the lunch box or not. For Pr(C) we need to
employ LTP as C can occur under different scenarios (two of them here, as is clear from tree
diagram above).
Pr(𝐶) = Pr(𝐴) . Pr(𝐶|𝐴) + Pr(𝐴′ ) . Pr(𝐶|𝐴′ )
Pr(𝐶) = Pr(𝐴) . Pr(𝑃′ ∩ 𝐶|𝐴) + Pr(𝐴′ ) . [Pr(𝑃 ∩ 𝐶|𝐴′ ) + Pr(𝑃′ ∩ 𝐶|𝐴′ )]
Pr(𝐶) = 0.85 ∗ 0.2 ∗ 1.0 + 0.15 ∗ [0.8 ∗ 0.5 + 0.2 ∗ 0.5]
Pr(𝐶) = 0.245
whereas Pr(𝑃 ∩ 𝐶) = Pr(𝐴) . 𝑃𝑟(𝑃 ∩ 𝐶|𝐴) + Pr(𝐴′) . 𝑃𝑟(𝑃 ∩ 𝐶|𝐴′)
Pr(𝑃 ∩ 𝐶) = 0.85 ∗ 0 + 0.15 ∗ 0.8 ∗ 0.5
Pr(𝑃 ∩ 𝐶) = 0.06
and we see that Pr(𝑃 ∩ 𝐶) ≠ Pr(𝑃) . Pr(𝐶)
NUCES-FAST Islamabad: Spring’19: PRP (EE) Assign # 02 - Sol Page 16/17
Roll No: _____________
Thus P and C are not independent.
3. Aamer is not having food from Cafe and he has not brought the lunch box. What
is the probability that he checked the lunch box in the morning?
Let event L = Carry lunchbox and L' = does not carry lunch box, then we can modify the tree
now as:
C
0.1
1.0 L
P
0.8
0.9
C’
A C
0.2 0.8
p P’ 1.0
L’
0.2
C’
C
1-p 0.8
A’ L’
1.0
0.2
C’
Although for this part, the probabilities Pr(A) and Pr(A') are not given and we should have used
p and (1-p) respectively, but let us use the values from part 2 to get a definitive answer.