Math1532Chapter4 (PartOne)
Math1532Chapter4 (PartOne)
MATH1532
Lecture
Probability
Chapter 4 (Part one)
Jason Chan, PhD
1
Outlines
• Properties of Probability
• Discrete Random Variables and
Probability Distributions
2
Experiment and Sample Space
• An experiment is any activity or process whose outcome is
subject to uncertainty.
• Experiments that may be of interest include tossing a coin
once or several times, selecting a card or cards from a
deck, obtaining blood types from a group of individuals, or
measuring the compressive strengths of different steel
beams.
• Definition The sample space of an experiment, denoted
by 𝒮 , is the set of all possible outcomes of that
experiment.
3
Event
• The sample space for this experiment can be abbreviated
as 𝒮={N, D}, where N represents not defective, D represents
defective, and the braces are used to enclose the elements
of a set.
• Definition An event is any collection (subset) of outcomes
contained in the sample space .
• Consider an experiment in which a vehicle taking a
particular freeway exit turns left (L) or right (R) at the end
of the exit ramp.
• Let A = the event of turning left , n(S)= 2 , n(A)=1
4
Using a Sample Space to Find a Probability
• For equally likely events:
number of outcomes in A
P(A)
number of all possible outcomes
Example: Roll a die. Let A represent the event “get a
number less than 3.” Find P(A)
n(A)= 2 , n(S)= 6
𝑛(𝐴) 2 1
𝑃 𝐴 = = =
𝑛(𝑆) 6 3
5
Definition for Complement ,Union and Intersection
1.The complement of an event A, denoted by A, is the set of
all outcomes in 𝒮 that are not contained in A.
Note : A= 𝐴𝑐
2.The union of two events A and B, denoted by A B and
read “A or B,” is the event consisting of all outcomes that are
either in A or in B or in both events that is, all outcomes in at
least one of the events.
3. The intersection of two events A and B, denoted by A B
and read “A and B,” is the event consisting of all outcomes
that are in both A and B.
6
Definition for Complement ,Union and Intersection
• For the experiment in which the number of pumps in use
at a single six-pump gas station is observed,
• let A = {0, 1, 2, 3, 4}, B = {3, 4, 5, 6}, and C = {1, 3, 5}.
• A = {5, 6}, A B = {0, 1, 2, 3, 4, 5, 6} ,
A C = {0, 1, 2, 3, 4, 5}, A B = {3, 4}, A C = {1, 3},
(A C) = {0, 2, 4, 5, 6}
• Note:
X and Y have no outcomes in common, so the intersection
of A and B contains no outcomes.
7
Example: Combining Events Using “And”
• A person is selected at random from
this group. Find the probability that
he/she is wearing a hat And raising
his/her hand. Number in sample
space = 6, number raising a hand and
wearing a hat =2
• A= wearing a hat , B=raising his/her
hand
2 1
•𝑃 𝐴∩𝐵 = =
6 3
8
Venn Diagram for Probability
• Definition Let ∅ denote the null event (the event
consisting of no outcomes).
• When A B = ∅ , A and B are said to be mutually
exclusive or disjoint events.
9
Probability Rule
• Rule 1
For any event A, P(A) 0.
• Rule 2
• P(𝒮 ) = 1.
• Rule 3
Complement rule: For any event A, P(A) + P(𝐴𝑐 ) = 1, from
which P(𝐴𝑐 )= = 1 – P(A).
Note: P(A)= P(𝐴𝑐 )
10
Probability Rule
• Rule 4
• When events A and B are mutually exclusive,
P(A or B) = P(A B) = P(A) + P(B).
• Rule 5
• When events A and B are independent,
P(A and B) = P(A ∩ B) = P(A)∙P(B).
11
Not Mutually Exclusive Events
• For events that are not mutually exclusive, adding
P(A) and P(B) results in “double counting” outcomes in the
intersection.
• For any two events A and B,
P(A B) = P(A) + P(B) – P(A B)
12
Example
• From a bag containing 5 green, 7 red and 8 yellow balls, one ball is
drawn at random. What is the probability that the ball drawn is
a. yellow? b. yellow or red? c. not yellow?
• Solutions
• Let Y be the event of getting a yellow ball
• Let R be the event of getting a red ball
#(𝑌) 8
• a. 𝑃 𝑌 = = = 0.4
#(𝒮) 20
#(𝑌) #(𝑅) #(𝑌∩𝑅)
• b. 𝑃 𝑌 ∪ 𝑅 = 𝑃 𝑌 + 𝑃 𝑅 − 𝑃(𝑌∩R) = + - =
#(𝒮) #(𝒮) #(𝒮)
8 7
= + − 0 = 0.75
20 20
c. P(Yc ) = 1 − P(Y) = 1- 0.4 = 0.6
13
Example (CN Tower & Sky Dome)
• A study by Tourism Ontario revealed that 80% of the tourists going
to Toronto visit the CN Tower, 75% visit Sky Dome and 72% visit
both. What is the probability that a tourist will visit at least one of
these magnificent attractions?
Solution
Let P(C ) be the probability of a tourist going to visit the CN Tower
Let P(D) be the probability of a tourist going to visit Sky Dome
14
Union- Three Events
• P(A B C) = P(A) + P(B) + P(C) – P(A B)
– P(A C) – P(B C) + P(A B C)
15
Practice Question
• If A and B are mutually exclusive events, P(A)=0.45 , and
P(B)=0.30. Find
a) P(A ∪ B) b) 𝑃 𝐴 ∩ 𝐵𝑐 c) 𝑃 𝐴𝑐 ∩ 𝐵𝑐
Answer:
a. 0.75 b.0.45 c. 0.25
16
Practice Question
• Given P(A)=0.30 , P(B)=0.62 and 𝑃 𝐴 ∩ 𝐵 =0.12. Find
a) P(A ∪ B) b) 𝑃 𝐴𝑐 ∩ 𝐵 𝑐) 𝑃 𝐴 ∩ 𝐵𝑐
d) 𝑃 𝐴𝑐 ∪ 𝐵𝑐
Answer :
a. 0.80 b. 0.5 c. 0.18 d. 0.88
17
Practice Questions
• The route used by a certain motorist in commuting to work
contains two intersections with traffic signals. The
probability that he must stop at first signal is 0.4 , the
probability for the second signal is 0.5, and the probability
he must stop at least one of the two signals is 0.7. What is
the probability that he must stop
a. both signal b. at the first signal but not at the second one
c. at exactly one signal ?
Answer a. 0.2 b. 0.2 c. 0.5
18
Independence and Conditional Probability
• Events A and B are said to be independent if
• P(A ∩ B) = P(A)P(B).
• If P(B) ≠ 0 then the conditional probability of A given
B is
P(A ∩ B)
P(A | B) = .
𝑷(𝑩)
19
Independence and Conditional Probability
Interpretation:
If we repeat our experiment many times, one sees that
P(A | B) is the relative frequency with which A will occur, out
of just those repetitions in which B occurs. So it is the
likelihood that A will occur, if we’re given the information
that B will occur.
Likewise, if P(B) ≠ 0 then independence ⇒ P(A|B) = P(A).
That is, knowing that B will occur doesn’t affect the
likelihood that A will occur.
In other words, independence means that B occurring has
no influence on A occurring.
20
Example: Conditional Probability
• Example Complex components are assembled in a
plant that uses two different assembly lines, A and A.
• Line A uses older equipment than A, so it is somewhat
slower and less reliable. Suppose on a given day line A
has assembled 8 components, of which 2 have been
identified as defective (B) and 6 as non-defective (B),
whereas A has produced 1 defective and 9 non-
defective components. Compute P(A) , P(A|B)
21
Example: Conditional Probability
22
Example: Conditional Probability
• Example Suppose that of all individuals buying a certain
digital camera, 60% include an optional memory card in
their purchase, 40% include an extra battery, and 30%
include both a card and battery. Given that the selected
individual purchased an extra battery, what is the
probability that an optional card was also purchased?
A= {memory card purchased} and B = {battery purchased}.
• P(A) = 0.60, P(B) = 0.40, P(both purchased) =P(A∩B)=0.30
𝑃(𝐴∩𝐵) 0.3
• P(A|B)= = =0.75
𝑃(𝐵) 0.4
23
Multiplication Rule P (A ∩B )
• The Multiplication Rule
24
Multiplication Rule- several stages
• The multiplication rule is most useful when the
experiment consists of several stages in succession.
P(A1 ∩ A2 ∩ A3) = P(A3 | A1 ∩ A2) P(A1 ∩ A2)
= P(A3 | A1 ∩ A2) P(A2 | A1) P(A1)
25
Example : Multiplication Rule-several stages
• An individual has 3 different email accounts. Most
of her messages, in fact 70%, come into account #1,
whereas 20% come into account #2 and the
remaining 10% into account #3. Of the messages
into account #1, only 1% are spam, whereas the
corresponding percentages for accounts
#2 and #3 are 2% and 5%, respectively. What is the
probability that a randomly selected message is
spam?
26
Example : Multiplication Rule-several stages
• Solution
Ai = {message is from account i} for i = 1, 2, 3,
B = {message is spam}
27
Tree Diagram
28
Example: Tree Diagram
• Draw 2 cards without
replacement. What is
the probability the
second card is black,
i.e. P(2nd is black) =?
1
• the answer must = .
2
29
Example: Tree Diagram
•
30
Bayes Rule
• Problem: Compute P(B|A),
• Knowing P(B), P(A|B), P(A|Bc ).
• Bayes rule:
P(B)P(A|B)
P(B | A) =
P(B)P(A | B) + P(Bc)P(A | Bc)
P(A∩B) P(B)P(A|B)
• Proof: P(B|A) = =
P(A) P(A∩B) + P(A∩Bc)
31
Example: Bayes Rule
• 2 urns. Urn 1 has 3 Red & 5 Green balls. Urn 2 has 2
Red & 3 Green. Pick an urn at random and then a
ball. If it’s red, what are the chances we had picked
the 1st urn?
1 1
• A: get a red ball. B: pick 1st urn. P(B) = , P(Bc ) =
2 2
3 2
• P(A|B) = , P(A|Bc ) =
8 5
1 3
P(B)P(A|B) × 15
2 8
So P(B|A) = = 1 3 1 2 =
P(B)P(A|B) + P(Bc)P(A|Bc) × + ×
2 8 2 5
31
32
Bayes Rule : Multiple alternative
• Let B1 , . . . , Bn partition . i.e. are disjoint with ∪ = 𝒮.
• Bayes rule:
P(B1)P(A|B1)
• P(B1 | A) =
P(B1)P(A |B1) +⋯+ P(Bn)P(A |Bn)
33
Bayes Rule: Multiple alternative
• A Medical screening test
• A medical condition affects 1 person in 1,000. A test is 98%
effective on healthy people and 99% effective on infected
ones. If you test positive, what’s the likelihood you have
the condition?
• Define events A – test positive. B – are ill. Bc – are healthy.
• P(B) = 0.001, P(Ac | Bc ) = 0.98, P(A | B) = 0.99 ,
P(Bc ) = 0.999 and P(A | Bc ) = 0.02
0.001×0.99
P(B | A) = =0.0472
0.001×0.99+0.999×0.02
34
Example (Washing Machine)
• It is known that 30% of a certain company’s washing
machines require service while under warranty,
whereas only 10% of its dryers need such service.
• If someone purchases both a washer and a dryer
made by this company, what is the probability that
both machines will need warranty service?
35
Example
• Let A denote the event that the washer needs
service while under warranty, and let B be defined
analogously for the dryer.
• Then P(A) = 0.30 and P(B) = 0.10.
• Assuming that the two machines will function
independently of one another, the desired
probability is
• P(A B) = P(A) P(B) = (0.30)(0.10) =0.03
36
Random Variable
• A random variable is a variable that takes on numerical
values realized by the outcomes in the sample space
generated by a random experiment.
• It is important to distinguish between a random variable
and the possible values it can take.
• Using notation, the capital letters such as 𝑋 to denote the
random variable and the corresponding lowercase letter, 𝑥
to denote a possible value.
37
Example: Random Variable
• Example:
• A store has 5 cellphones on shelf. In the past experience, the
store manager know that at least 1 cellphone will be sold
and the probabilities of selling one through five cellphones
are equals.
• This random variable can take specific values 𝑥 = 1, 𝑥 =
2, ⋯ , 𝑥 = 5, each with probability 0.2
• The random variable 𝑋 in this example is a discrete random
variable.
38
Discrete and Continuous Random Variable
• A random variable that can take on only a finite number of
values is discrete.
• Example:
The number of errors detected in corporation’s accounts
The number of claims on medical insurance policy in a year
• A random variable that can take any value in an interval is
continuous.
• Example:
The change in the price of a share of Tesla stock in a week.
The time that elapses between the installation of a new
component and its failure.
39
Discrete Random Variable
• Random variable has a discrete distribution if there are only finitely or
countably many values it can take.
• In that case, the distribution is given by a table of values 𝑥𝑖 and
probabilities 𝑝𝑖 = P(X = 𝑥𝑖 ).
X 𝑥𝟏 𝑥𝟐 𝑥𝟑 …
P(X=x) 𝑝1 𝑝2 𝑝3 …
• Conditions
• the 𝑥𝑖 and 𝑝𝑖 must satisfy:
• i. the 𝑥𝑖 are distinct;
• ii. the 𝑝𝑖 ≥ 0 and σ 𝑝𝑖 = 1.
• [any 𝑥𝑖 and 𝑝𝑖 satisfying these conditions define a discrete distribution]
40
Example(Apartments): Discrete Random Variable
The number of apartments sold per week by a property agent
is defined by the following probability distribution:
X 0 1 2 3 4
42
Example (marbles) : Discrete Random Variable
• Two marbles are randomly selected from a box containing
five blue marbles and three green marbles. One at a time
without replacement. List the elements of the sample
space, the corresponding probabilities and the
corresponding values x of the random variable X where X
is the number of blue marbles selected.
Solution:
• Let B and G be blue and green marbles, the probabilities
5 4 5 5 3 15
for BB, BG, GB , GG are respectively, × = , × = ,
8 7 14 8 7 56
3 5 15 3 2 3
× = , × = ,
8 7 56 8 7 28
43
Example (marbles) : Expected Value
X 0 1 2
3 15 5
P(X=x) 28 28 14
• Compute the expected value of the number of blue marbles
• Solution
• 𝐸 𝑋 = 𝜇𝑋 = σ𝑥∈𝐷 𝑥 ∙ 𝑃(𝑥)
3 15 5
• =0∙ +1∙ +2∙ =1.25
28 28 14
44
The variance of X
Definition Let X have p (x) and expected value . Then the
variance of X, denoted by V(X) or 2X , or just 2, is
𝑉 𝑋 = (𝑥 − 𝜇)2 ∙ 𝑃 𝑥 = 𝐸 (𝑋 − 𝜇)2
𝐷
The standard deviation (SD) of X is
𝜎𝑋 = 𝜎𝑋2
• Compute 𝜎 2
• Solution
2 3 2 15 2 5
E(X2) =0 ∙ + 1 ∙ +2 ∙ =1.964
28 28 14
𝜎 2 = E(X2) – [E(X)]2 =1.964 - 1.25 =0.4018
2
46
Example : The variance of X
• Example : A library has an upper limit of 6 on the number
of videos that can be checked out to an individual at one
time. Consider only those who check out videos, and let X
denote the number of videos checked out to a randomly
selected individual.
47
Example : The variance of X
• Example : A library has an upper limit of 6 on the number
of videos that can be checked out to an individual at one
time. Consider only those who check out videos, and let X
denote the number of videos checked out to a randomly
selected individual.
• Determine 2
48
Example : The variance of X
• Solution
• = 1(0.3)+2(0.25)+3(0.15)+4(0.05)+5(0.10)+6(0.15)
• =2.85
• E(X2)=12(0.3)+22(0.25)+32(0.15)+42(0.05)+52(0.10)+
62(0.15) = 11.35
• 2 = E(X2) – [E(X)]2 = 11.35 - 2.852
• = 3.2275
49
Practice Question : Quiz scores
Probability Distribution for Quiz Scores
50
Practice Question :Quiz scores
• Compute the expected value and standard deviation
• Solution
• Expected value = 2.9
• Standard deviation= 1.14
51