0% found this document useful (0 votes)
16 views

Lec 4

Uploaded by

zeka.eeeww33
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Lec 4

Uploaded by

zeka.eeeww33
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Statistics and

Probability
Dr . Mohammed. Yusef Dr. Salma Shatta
Lecture 4
Conditional Probability

The conditional probability of an event A given that the event


B has occurred is defined by

𝐏(𝐀 ∩ 𝐁)
𝐏 𝐀𝐁 =
𝐏(𝐁)

provided that P(B) > 0.

𝐏(𝐀 ∩ 𝐁)
Note that; 𝐏 𝑩𝑨 =
𝐏(𝐀)
Example

If P(A) = 0.4, P(B) = 0.5, and P(A∩B) = 0.3, then

𝑃(𝐴∩𝐵) 0.3
𝑃 𝐴𝐵 = = = 0.6
𝑃(𝐵) 0.5
and
𝑃(𝐴∩𝐵) 0.3
𝑃 𝐵𝐴 = = = 0.75
𝑃(𝐴) 0.4

Clearly, P(A|B) ≠ P(B|A).


Example
Three fair coins are tossed. Find the probability that they are all heads if
(i) the first coin is head. (ii) one of the coins is head.
Solution
S = (HHH, HHT, HTH, THH, HTT, TTH, THT, TTT)
(i) Let
B = {The first coin is head} = {HHH, HHT, HTH, HTT}.

Let A = { all are heads} = {HHH}


𝑃(𝐴∩𝐵) 1/8 1
P(A|B) = = 4/8 = 4
𝑃(𝐵)
(ii) Let C = {one of the coins is head}
= {HHH, HHT, HTH, THH, HTT, TTH, THT}
𝑃(𝐴∩𝐶) 1
P(A|C) = =
𝑃(𝐶) 7
Some special cases of conditional probability:

• When A and B are disjoint: In this case A∩B=∅, so

𝑃 𝐴∩𝐵 𝑃 ∅
𝑃 𝐴𝐵 = = = 0.
𝑃 𝐵 𝑃 𝐵

• When B is a subset of A: If B⊂A, then whenever B happens, A also happens.


Thus, given that B occurred, we expect that probability of A
be one. In this case A∩B=B, so
𝑃 𝐴∩𝐵 𝑃 𝐵
𝑃 𝐴𝐵 = = = 1.
𝑃 𝐵 𝑃 𝐵

• When A is a subset of B : In this case A∩B=A, so


𝑃 𝐴∩𝐵 𝑃 𝐴
𝑃 𝐴𝐵 = =
𝑃 𝐵 𝑃 𝐵
Independent Events

For certain pairs of events, the occurrence of one of them may or may not
change the probability of the occurrence of the other. In the latter case
they are said to be independent events.

Definition
If A and B are independent events:
𝑃 𝐵 𝐴 = 𝑃(𝐵)
𝑃 𝐴 𝐵 = 𝑃(𝐴)
Independent Events

Two events A and B are said to be mutually independent, if and only if,
P(A ∩ B) = P(A)P(B).

i.e that A occurs does not affect the probability of B occurring.

Otherwise, A and B are called dependent events.

The events A, B and C are said to be independent, if and only if,

P(A ∩ B ∩ C) = P(A)P(B)P(C).
Example :
A card is chosen at random from a standard deck of 52
playing cards. Without replacing it, a second card is
chosen. What is the probability that the first card chosen
is a queen and the second card chosen is a jack?
Solution
Example
Flip a coin twice and observe the sequence of heads
and tails. Find 𝑃 𝐵 𝐴 , where A is heads on the first flip
and B is tails on the second flip. The sample space is
S = {HH, HT, T H, T T}.
Solution
It is reasonable to assign a probability of 1/4 to each of these four outcomes.
2
Let, A = {heads on the first flip} = {HH, HT} → 𝑃 𝐴 =
4

2
B = {tails on the second flip} = {HT, T T}→ 𝑃 𝐵 =
4
1
∴ 𝐴 ∩ 𝐵 = {HT} → 𝑃 𝐴 ∩ 𝐵 = 𝑃 𝐴 𝑃 𝐵 =
4

∴ 𝐴 ∩ 𝐵 are independent events


If we are given that A has occurred, then

𝑃(𝐴∩𝐵) 1/4 1
𝑃 𝐵𝐴 = = = = 𝑃(𝐵)
𝑃(𝐴) 2/4 2

So, the occurrence of A has not changed the probability of B.

Hence the probability of B does not depend upon knowledge about


event A, so we say that A and B are independent events
Example

A dice is rolled two times. Define the events A and B as:

A = {4 on the first roll}

B = {The sum of two rolled is odd}

Are A and B independent events?


S = {(1, 1), ...,(1, 6),(2, 1), ...,(2, 6),(3, 1), ...,(3, 6), (4, 1), ...,(4, 6),(5, 1), ...,(5, 6),(6, 1), ...,(6, 6)}
→ 𝑛 𝑆 = 36

𝟔
A = {(4, 1),(4, 2),(4, 3),(4, 4),(4, 5),(4, 6)} → 𝐏 𝐀 =
𝟑𝟔

B = {(1, 2),(1, 4),(1, 6),(2, 1),(2, 3),(2, 5), (3, 2),(3, 4),(3, 6),(4, 1),(4, 3),(4, 5), (5,2),
𝟏𝟖
(5, 4),(5, 6),(6, 1),(6, 3),(6, 5)} →𝐏 𝐁 =
𝟑𝟔

𝟑
A ∩ B = {(1, 4),(3, 4),(5, 4)} → 𝐏 A ∩ B =
𝟑𝟔

Thus,
𝟔 𝟏𝟖 𝟑
P(A) × P(B) = × = = P(A ∩ B).
𝟑𝟔 𝟑𝟔 𝟑𝟔
Hence A and B are independent.
In previous Example , let the events C and D be defined as
C = {5 on second dice} and D = {sum of dice is 11}

Of the 36 equally likely outcomes,


C={(1,5),(2,5),(3,5),(4,5),(5,5),(6,5)}, D={(5,6),(6,5)}
C ∩ D={(6,5)}
Thus,
6 2 1
𝑃 𝐶 = , 𝑃 𝐷 = , 𝑃 𝐶∩𝐷 =
36 36 36
6 2 1
∴𝑃 𝐶 ∗𝑃 𝐷 = ∗ = ≠ 𝑃(𝐶 ∩ 𝐷)
36 36 108

Hence C and D are dependent events.


Example
An urn contains four balls numbered 1, 2, 3, and 4. One ball is to be
drawn at random from the urn. Let the events A, B, and C be defined by
A = {1, 2}, B = {1, 3}, C = {1, 4}.
Are they independent events?
Solution
P(A) = P(B) = P(C) = 1/2.

P(A ∩ B) = 1/4 = P(A)P(B),


P(A ∩ C) = 1/4 = P(A)P(C),
P(B ∩ C) = 1/4 = P(B)P(C),
which implies that A, B, and C are independent in pairs (called
pairwise independence).
Definition
The events A, B, and C are mutually independent, if and only if, the
following two conditions hold:

(a)They are pairwise independent. That is,


(i) P(A ∩ B) = P(A) P(B),
(ii) P(A ∩ C) = P(A) P(C),
(iii) P(B ∩ C) = P(B) P(C).

(b) P(A ∩ B ∩ C) = P(A) P(B) P(C).


Example:
Au urn contains three red balls, two blue balls, and five green balls. A ball
is selected at random and its color noted. Then it is replaced. A second ball
is selected at random and its color noted. Find the probability of each of
the following.
(a) Selecting two blue balls.
(b) Selecting a blue ball and then a green ball.
(c) Selecting a red ball and then a blue ball.

Solution
2 2 1 2 5 1 3 2 3
𝑎 ∗ = 𝑏 ∗ = 𝑐 ∗ =
10 10 25 10 10 10 10 10 50
Example:
Solve the previous example when the balls are selected without replacement.

Solution
Let
Bi = {the i-th selected ball is blue, i = 1,2},
Ri = {the i-th selected ball is red, i = 1,2}
Gi = {the i-th selected ball is green, i = 1,2}.
2 1 1
𝑎 𝑃 𝐵1 𝑎𝑛𝑑 𝐵2 = 𝑃 𝐵1 𝑃 𝐵2 𝐵1 = ∗ =
10 9 45
2 5 1
𝑏 𝑃 𝐵1 𝑎𝑛𝑑 𝑊2 = 𝑃 𝐵1 𝑃 G2 𝐵1 = ∗ =
10 9 9
3 2 1
𝑐 𝑃 𝑅1 𝑎𝑛𝑑 𝐵2 = 𝑃 𝑅1 𝑃 𝐵2 𝑅1 = ∗ =
10 9 15
Theorem ( The Multiplication Law of Probability)

If 𝐴1 , 𝐴2 , · · · , 𝐴𝐾 are mutually independent events, then

P(𝐴1 ∩ 𝐴2 ∩· · ·∩ 𝐴𝐾 ) = P(𝐴1 )×P(𝐴2 )×· · ·×P(𝐴𝐾 ).


Example
Two cards are drawn at random from an ordinary deck of 52 playing
cards. What is the probability of getting two aces if
(a)The first card is replaced before the second card is drawn.
(b)The first card is not replaced before the second card is drawn?

Solution
(a)Since there are four aces among the 52 cards, we get
4 4 1
× =
52 52 169

(b) Since there are only three aces among the 51 cards which remain after
one ace has been removed from the deck, we get
4 3 1
× =
52 51 221
Theorem ( Bayes Rule )

Let 𝐴1 , 𝐴2 , · · · , 𝐴𝑛 constitute a partition of the sample space S.


That is,
S = 𝐴1 ∪ 𝐴2 ∪ · · · ∪ 𝐴𝑛 and 𝐴𝑖 ∩ 𝐴𝑗 = ∅ ∀ 𝑖 ≠ 𝑗 .

Then, for any event B in the same sample space with P(B) > 0, we have

𝑃(𝐴𝑖 ∩𝐵) 𝑃(𝐵|𝐴𝑖 )𝑃(𝐴𝑖 )


𝑃 𝐴𝑖 𝐵 = = σ𝑛
𝑃(𝐵) 𝑗=1 𝑃(𝐵|𝐴𝑗 )𝑃(𝐴𝑗 )
Example:
A disease affects 1% of the population. A test is 95% accurate for both
positive and negative results. If a person tests positive, what’s the
probability they have the disease?
Solution:

P(D) = 0.01, P(T|D) = 0.95,

P(T|not D) = 0.05

P(T) = 0.95 * 0.01 + 0.05 * 0.99 = 0.0585

P(D|T) = (0.95 * 0.01) / 0.0585 ≈ 0.1624 or 16.24%


Example:

40% of applicants have high test scores. Among those with high scores,
80% are admitted. Among those without high scores, 30% are admitted.
If a student is admitted, what’s the probability they had high test
scores?
Solution:
Let 𝐻be the event that a student has high test scores.
Let 𝐴 be the event that a student is admitted.
P(H) = 0.4, P(A|H) = 0.8, P(A|not H) = 0.3 P(not H)=0.6

P(A) = 0.8 * 0.4 + 0.3 * 0.6 = 0.5

P(H|A) = (0.8 * 0.4) / 0.5 = 0.64 or 64%


Example

In a certain factory, machines 𝐴1 , 𝐴2 and 𝐴3 are all producing mobiles


of the same type. Of the production, machines 𝐴1 , 𝐴2 and 𝐴3 produce
2%, 1%, and 3% defective mobiles, respectively. Of the total production
of mobiles of the factory, machine 𝑨𝟏 , produce 35%, machine 𝑨𝟐 ,
produce 25%, machine 𝑨𝟑 , produce 40%. If one mobile is selected at
random from the total mobiles produced in a day, what is the
probability that it is defective? If the selected mobile is defective, find
the probability that it was produced by machine 𝐴3 ?
1) Let the event D denote the selected spring is defective. Therefore we
have: 𝑃 𝐴1 = 0.35 , 𝑃 𝐴2 = 0.25, : 𝑃 𝐴3 = 0.4

𝑃 𝐷 = σ3𝑗=1 𝑃(𝐷|𝐴𝑗 )𝑃(𝐴𝑗 ) = (0.02) (0.35) + (0.01) (0.25) + (0.03) (0.4)


= 0.0215.

2) If the selected mobile is defective, the probability that it was produced


by machine 𝐴3 by Bayes’ formula:

𝑃(𝐷|𝐴3 )𝑃(𝐴3 ) 𝑃(𝐷|𝐴3 )𝑃(𝐴3 ) (0.03) (0.4) 120


𝑃 𝐴3 𝐷 = σ3𝑗=1 𝑃(𝐷|𝐴𝑗 )𝑃(𝐴𝑗 )
= = =
𝑃(𝐷) 0.0215 215
MCQ
1. Two events A and B are independent.
If P(A)=0.4 and P(B)=0.5 , what is P(A∩B)

•A. 0.2
•B. 0.9
•C. 0.1
•D. 0.4

Answer: A

Since A and B are independent, P(A∩B)=P(A)×P(B)=0.4×0.5=0.2


2-The probability that a randomly selected student passes an exam is 0.7.
The probability that a student has studied given that they passed the exam is
0.85. What is the probability that a student studied and passed the exam?
•A. 0.7
•B. 0.595
•C. 0.85
•D. 0.119
Answer: B

The probability of both studying and passing is

P(Studied∩Passed)=P(Passed)×P(Studied∣Passed)=0.7×0.85=0.595
3-In a factory, machine A1 produces 40% of the products, and machine A2 produces
60% of the products. The probability that a product is defective from machine A1 is
0.05, and from machine A2 is 0.02. What is the probability that a randomly selected
product is defective?
•A. 0.03
•B. 0.025
•C. 0.04
•D. 0.05
Answer: A
By the law of total probability:
P(Defective)=P(A 1 )×P(Defective∣A 1 )+P(A 2 )×P(Defective∣A2 )𝑃(Defective)
=(0.40)(0.05)+(0.60)(0.02)=0.02+0.012=0.032

P(Defective)=(0.40)(0.05)+(0.60)(0.02)=0.02+0.012=0.032
4-If 𝑃(𝐴∩𝐵)=0.2 and 𝑃(𝐵)=0.5, what is 𝑃(𝐴∣𝐵)?
A. 0.2
B. 0.5
C. 0.4
D. 0.1

Answer: C

Conditional probability is given by

𝑃(𝐴∣𝐵)=𝑃(𝐴∩𝐵)/𝑃(𝐵)=0.2/0.5=0.4
5-Two events 𝐴 and 𝐵 are independent. If 𝑃(𝐴)=0.6 and 𝑃(𝐴∪𝐵)=0.8, what
is 𝑃(𝐵)?

A. 0.2
B. 0.5
C. 0.4
D. 0.33

Answer: C

For independent events, 𝑃(𝐴∪𝐵)=𝑃(𝐴)+𝑃(𝐵)−𝑃(𝐴)𝑃(𝐵)

0.8=0.6+𝑃(𝐵)−0.6×𝑃(𝐵)

Solving, 𝑃(𝐵)=0.4
6-In a group of 100 people, 40 are male and 60 are female. Out of the 40
males, 10 have a driver's license. Out of the 60 females, 20 have a driver’s
license. If a randomly selected person has a driver's license, what is the
probability that the person is female?
•A. 0.33
•B. 0.67
•C. 0.75
•D. 0.5
Answer: B
Use Bayes'Theorem:
7-In a survey, 70% of respondents said they liked product A, and 50%
said they liked product B. If 40% liked both products, what is the
probability that a respondent likes product A given that they like
product B?

•A. 0.57
•B. 0.80
•C. 0.50
•D. 0.40
Answer: B

Conditional probability:
P(A∣B)=P(A∩B)/ P(B)=0.40/0.50= 0.80
8-Events A and B are independent. If P(A∣B)=0.4 and P(B)=0.5, what is P(A)?
•A. 0.2
•B. 0.5
•C. 0.4
•D. 0.8

Answer: C
For independent events,
P(A∣B)=P(A)

P(A)=0.4
9-A coin is tossed twice. Let A be the event "the first toss results in heads," and
B be the event "the second toss results in heads." What is P(A∣B)?

•A. 0.5
•B. 0.25
•C. 0.75
•D. 0.1
Answer: A

Event A { HH,HT}, P(A)=2/4=1/2


Event B {HH,TH}, P(B)=2/4=1/2
A∩B ={HH}, P(A∩B)=1/4
P(A∣B)=P(A∩B)/P(B)=0.5
10- Which of the following best defines independent events?

•A. Two events that cannot occur at the same time


•B. Two events where the occurrence of one does not affect the probability
of the other
•C. Two events that are mutually exclusive
•D. Two events that always occur together

Answer: B
.
Thanks!

You might also like