Advanced Engineering
Mathematics
Instructor: Dr. Madiha Liaqat
Outline
Recap: Additive Rule
Multiplicative Rule
Independent Events
Dependent Events
Conditional Probability
Bayes’ Theorem
Recap: Additive Rule
Mutually Exclusive Events: Two events A and B of a single
experiment are said to be mutually exclusive or disjoint if
and only if they cannot both occur at the same time.
Example: Event of getting a Head is mutually exclusive
with the event of getting a Tail.
Counter Example: Event of getting a Jack and event of
getting a spade in a deck of card are not mutually
exclusive.
Recap: Additive Rule
When two events A and B are mutually exclusive, there
probabilities are added.
i.e., P(A or B)= P(A U B)= P(A)+P(B)
Example: We draw a card randomly from a deck. What is the
probability that it is a card of black color or belong to diamond
(suit).
Four suits of playing cards
Each suit
contains 13
cards: Ace, 2,
3, 4, 5, 6, 7,
8, 9, 10,
Jack, Queen,
King.
The deck of 52 playing cards is broadly classified into into 2 divisions. Red(26
cards) and Black(26 cards). The red cards are further divided into diamonds♦️
(13 cards) and hearts♥️ (13 cards). The black cards are further divided into
clubs ♣️(13 cards) and spades ♠️ (13 cards).
Union
The union of two events A and B, denoted A U B, is the event
containing all the elements that belong to A or B or both.
There are two special cases in Union.
i. A U B can be mutually exclusive.
ii. A U B can not be mutually exclusive.
The given figure diagrammatically depicts A U B both for the
case in which A and B are and are not mutually exclusive.
Union (Examples)
Example: when A U B is mutually exclusive
Example Hypertension:
Let events A is defined as A={X<90},
Let events B is defined as B={90<=X<=95}
Where X = diastolic blood pressure(DBP)
Then A U B= {X<95}
Union (Examples)
Example: when A U B is not mutually exclusive
Example Hypertension:
Let events C is defined as C={X>=90},
Let events D is defined as D={75<=X<=100}
Where X = diastolic blood pressure(DBP)
Then C U D= {X>=75}
Joint Probability and Intersection
(Example 2)
Example 3: Classroom
Let E be the event that a person selected at random in a
classroom is majoring in engineering and
Let F be the event that a person is female
Then E n F is the event of all female engineering students in
the classroom.
Independent Events
Independent events are events which are not affected by the
occurrence of other events. For example, if we roll a die twice,
the outcome of the first roll and second roll have no effect on
each other – they are independent.
If two events are independent then If two events
are not independent,
P(A and B) = P(A) × P(B) = P(A) × P(B). then we say that they
are dependent events.
This is called the multiplication rule.
Let’s look at an example.
If we are rolling a dice twice, we can find the probability of
getting two sixes. The probability of getting a 6 is 1/6. So the
probability of getting a 6 and a 6 is 1/6×1/6=1/36.
With replacement
Sampling may be done with replacement or without
replacement.
With replacement: If each member of a population is replaced
after it is picked, then that member has the possibility of being
chosen more than once. When sampling is done with
replacement, then events are considered to be independent,
meaning the result of the first pick will not change the
probabilities for the second pick.
With replacement
A bag contains four blue and three white
marbles. James draws one marble from
the bag at random, records the color, and
replaces the marble. The probability of
drawing blue is 4/7.
When James draws a marble from the bag
a second time, the probability of drawing
blue is still 4/7. James replaced the
marble after the first draw, so there are
still four blue and three white marbles.
Without replacement
Without replacement: When sampling is done without
replacement, each member of a population may be
chosen only once. In this case, the probabilities for the
second pick are affected by the result of the first pick.
The events are considered to be dependent or not
independent.
Without replacement
The bag still contains four blue and three
white marbles. Maria draws one marble from
the bag at random, records the color, and sets
the marble aside. The probability of drawing
blue on the first draw is 4/7.
Suppose Maria draws a blue marble and sets it
aside. When she draws a marble from the bag
a second time, there are now three blue and
three white marbles. So, the probability of
drawing blue is now 3/6=1/2.
Removing the first marble without replacing it
influences the probabilities on the second
draw.
Example 1: identifying independent
events
Look at the events below. Which set of events are not independent?
Rolling a die and getting a 6 and tossing a coin and getting a head.
Tossing two coins and getting two heads.
Choosing a blue ball from a bag containing blue and yellow balls, not
replacing it, and then choosing another blue ball from the same bag.
A student in class 5 having brown hair and size 3 feet.
Example 1: identifying independent
events
When you roll a die and toss a coin, the outcome of one does not
affect the outcome of the other therefore the events
are independent.
When you toss two coins, the outcome of one does not affect the
other therefore the events are independent.
When you choose a ball from a bag and do not replace it, you are
changing the number of balls in the bag and therefore the outcome of
choosing the first ball will have an effect on the outcome of choosing
the second ball (for example, if you choose a blue ball the first time,
the probability of choosing a blue ball the second time will decrease).
Therefore these are dependent events.
The colour of someone’s hair does not affect the size of their feet
therefore the events are independent.
Example 2: probability of two
independent events
The probability that Tom forgets his PE kit is 0.3. The
probability that Noah forgets his PE kit is 0.1. The events
are independent.
Calculate the probability that both Tom and Noah forget
their PE kits on the same day.
SOLUTION ? ?
Example 3: probability of three
independent events
Rachel tosses three fair coins. Find the probability that all
three coins land on tails.
SOLUTION ????
Example 4: using a tree diagram
Niamh plays a game of table tennis on Saturday and a game of badminton on
Sunday. The different outcomes are represented on the tree diagram below.
Calculate the probability
that Niamh wins both
games.
Practice:
Identify the pair of events that are not independent.
Rolling two dice and each landing on 6.
Rain falling on 20th December 2020 and 20th December 2021.
Flipping a coin and landing on tails and picking a king from a deck
of cards.
Picking one card from a deck of cards and then a second card and
getting an ace both times.
Practice
Q1. The probability that my train is late on any given day
is 0.3. Find the probability that my train is late three days in a row.
Q2. Zainab has two bags of mixed sweets. She picks one sweet
from each bag. The probability that Zainab picks a lollipop from
the first bag is 1/6 and the probability that she picks a lollipop
from both bags is 1/15. What is the probability that she picks a
lollipop from the second bag?
Solution
If we call the probability of picking a lollipop from the
second bag P(L) then
1/6×P(L)=1/15.
Solving this
P(L)=1/15÷1/6= 2/5
Practice
The probability that a man will be alive in 2050 is 3/5, and the
probability that his wife will be alive in 2050 is 2/3 (these are
independent events). Find the probability that:
1. both will be alive
2. only man will be alive
3. at least one of them will be alive
4. neither will be alive in 2050 ?
Dependent Events
Dependent events in probability are events in which occurrence
of one affects the probability of occurrence of the other.
Suppose a bag has 3 red and 6 green balls. Two balls are drawn
from the bag, one after the other. Let A be the event of drawing a
red ball in the first draw and B be the event of drawing a green
ball in the second draw. If the ball drawn in the first draw is not
replaced back in the bag, then A and B are dependent events
because P(B) is decreased or increased according to the first draw
results as a red or green ball.
Multiplicative Rule
If the occurrence of one event A affects the probability of
the event B, then these events are dependent.
Then
P(A and B)= P(A)*P(B|A)
Where P(B|A) is called the Conditional probability of B
when A is already occurred.
Conditional Probability
The conditional probability of A given B is written P(A|B), read
"the probability of A, given B." P(A|B) is the probability that
event A will occur given that the event B has already occurred.
A conditional probability reduces the sample space. We
calculate the probability of A from the reduced sample space B.
The formula to calculate P(A|B) is
where P(B) is greater than zero.
Conditional Probability
Example:
What is the probability of a card drawn to be diamond, given that
it is red?
Conditional Probability
Two coins are tossed. What is the conditional probability
that two heads result, given that there is at least one
head ?
Practice
Example: Four coins are tossed. Given that there are at least
two heads. What is the (conditional) probability of:
i. (exactly) 3 heads?
ii. At most 4 heads?
iii. No tails
Practice
What is the probability of a card drawn to be red as well as
face card?
Practice
The probability of a student passing in science is ⅘ and
the of the student passing in both science and maths is ½.
What is the probability of that student passing in maths
knowing that he passed in science?
Solution
Let A ≡ event of passing in science
B ≡ event of passing in maths
Given, P(A) = ⅘ and P(A ∩ B) = ½
Then, probability of passing maths after passing in science
= P(B|A) = P(A ∩ B)/P(A)
=½÷⅘=⅝
∴ the probability of passing in maths is ⅝.
Practice
A fair coin is tossed twice such that
E: event of having both head and tail, and
F: event of having atmost one tail.
Find P(E), P(F) and P(E|F)
Solution
The sample space S = { HH, HT, TH, TT}
E = {HT, TH}
F = {HH, HT, TH}
E ∩ F = {HT, TH}
P(E) = 2/4 = ½
P(F) = ¾
P(E ∩ F) = 2/4 = ½
P(E|F) = P(E ∩ F)/P(F) = ½ ÷ ¾ = ⅔.
Practice
In a class, 40% of the students like Mathematics and 25%
of students like Physics and 15% like both the subjects.
One student select at random, find the probability that he
likes Physics if it is known that he likes Mathematics.
Solution
Let there be 100 students, then,
Number of students like Mathematics = n(A) = 40
Number of students like Physics = n(B) = 25
Number of students like both Mathematics and Physics =
n(A ∩ B) = 15
Now, the probability that the student likes Physics if it is
known that he likes Mathematics is given by –
P(B|A) = n(A ∩ B)/n(A) = 15/40 = ⅜.
Practice
Two dice are rolled, if it is known that atleast one of the
dice always shows 4, find the probability that the numbers
appeared on the dice have a sum 8.
Solution
Let,
A: one of the outcomes is always 4
B: sum of the outcomes is 8
Then, A = {(1, 4), (2, 4), (3, 4), (4, 4), (5, 4), (6, 4), (4, 1), (4, 2),
(4, 3), (4, 5), (4, 6)}
B{(4, 4), (5, 3), (3, 5), (6, 2), (2, 6)}
n(A) = 11, n(B) = 5, n(A ∩ B) = 1
P(B|A) = n(A ∩ B)/n(A) = 1/11.
Practice
A bag contains 3 red and 7 black balls. Two balls are
drawn at random without replacement. If the second ball
is red, what is the probability that the first ball is also
red?
Solution
Let A: event of selecting a red ball in first draw
B: event of selecting a red ball in second draw
P(A ∩ B) = P(selecting both red balls) = 3/10 × 2/9 = 1/15
P(B) = P(selecting a red ball in second draw) = P(red ball and
red ball or black ball and red ball)
= P(red ball and red ball) + P(black ball and red ball)
= 3/10 × 2/9 + 7/10 × 3/9 = 3/10
∴ P(A|B) = P(A ∩ B)/P(B) = 1/15 ÷ 3/10 = 2/9.
Practice
If a family has two children, what is the conditional
probability that both are girls if there is atleast one girl?
Solution
Let A: both being girls
B: Atleast one girl
n(A) = 1
n(B) = 3
n(A ∩ B) = 1
P(A|B) = n(A ∩ B)/n(B) = ⅓.
Bayes Theorem
Conditional Probability
A conditional probability measures the probability of an
event given that another event has occurred.
If the event of interest is A and the event B is known or
assumed to have occurred, “the conditional probability of
A given B”, or “the probability of A under the condition
B”, is usually written as P(A|B)
When to apply Bayes’ Theorem
Part of the challenge in applying Bayes’ theorem involves
recognizing the types of problems that warrant its use. You should
consider Bayes’ theorem when the following conditions exist.
Within the sample space, there exists an event B, for which
P(B)>0.
The analytical goal is to compute a conditional probability of the
form: P(Ak|B).
You know atleast one of the two sets of probabilities described
below.
P(Ak n B) for each Ak
P(Ak) and P(B|Ak) for each Ak
Example
Four technicians regularly make repairs when breakdowns
occur on an automated production line. Janet, who
services 20% of the breakdowns, makes a bad repair 1
time in 20; Tom who services 60% of the breakdowns,
makes a bad repair 1 time in 10; Georgia, who services
16% of the breakdowns, makes a bad repair 1 time in 10;
and Victor, who services 4% of the breakdowns, makes bad
repair 1 time in 20.
For a problem diagnosed as being due to a bad initial
repair, find the probability that the initial repair was
made by Janet.
Solution
Let B be the event that the initial repair was bad, J that the
initial repair was made by Janet, T it was made by Tom, G it
was made by Georgia, and V that it was done by Victor.
Solution: Substitute value in Bayes’ theorm (extended form)
P (J )P (B | J )
P (J | B ) =
P (J )P (B | J ) + P (T )P (B | T ) + P (G )P (B | G ) + P (V )P (B | V )
For deeper understanding of the formula, lets introduce
the concept of “Contribution in the Bad Repair” (CBR)
Solution
CBR by Janet = P(J)*P(B|J)=0.01
CBR by Tom = P(T)*P(B|T)=0.06
CBR by Georgia= P(G)*P(B|G)=0.016
CBR by Victor = P(V)*P(B|V)=0.002
CBR by all= 0.088
Thus
P(J|B)=CBR by Janet/CBR by all= 0.01/0.088=0.113
Bayes Rule
The Bayes theorem was developed and named for Thomas
Bayes(1702-1761)
Show the relation between one conditional probability and
its inverse.
Provide a mathematical rule for revising an estimate or
forecast in light of experience and observation.
Bayes Rule
In the 18th Century, Thomas Bayes,
Ponder this question:
“Does God really exist?”
Being interested in the mathematics, he attempted to
develop a formula at the probability that God does exist
based on the evidence that was available on earth.
Later, Laplace refined Bayes’ work and gave it the name
“Bayes’ Theorem”
Definition
In probability theory and statistics, Bayes’ theorem
(alternatively Bayes’ law or Bayes’ rule) describes the
probability of an event, based on conditions that might be
related to the event.
Bayes’ Theorem is a method of revising a probability given
that additional information is obtained. For two event:
Bayesian inference
Bayesian inference is a method of statistical inference in
which Bayes theorem is used to update the probability for
a hypothesis as evidence. It involves:
Prior Probability:
The initial probability based on the present level of
information
Posterior Probability:
A revised probability based on additional information.
Bayes’ Theorem (simple form)
P (B ) ×P (A B ) = P (A ) ×P (B A )
P (A ) ×P (B A )
Þ P (A B ) =
P (B )
Bayes’ Theorem (Extended Form)
Events A1 , A2 ,… Ak form a partition of a sample space S,
B is any other event of S such that it can occur only if one
of Ai occurs, then for any i,
P (Ai )P (B | Ai )
P (Ai | B ) = for i = 1, 2,..., k
k
å P (Ai )P (B | Ai )
i= 1
59
Example
Solution
Solution
Example
Solution
Solution
Example
Marie is getting married tomorrow, at an outdoor
ceremony in the desert. In recent years, it has rained only
5 days each year. Unfortunately, the weatherman has
predicted rain for tomorrow. When it actually rains, the
weatherman correctly forecasts rain 90% of the time.
When it doesn’t rain, he incorrectly forecasts rain 10% of
the time. What is the probability that it will rain on the
day of Marie’s wedding?
Solution
Solution
Solution
Practice
A cab was involved in a hit and run accident at night. Two cab
companies, the Green and the Blue, operate in the city. The
following facts are known; 85% of the cabs in the city are
Green and 15% are Blue.
A Witness identified the cab as Blue. The court tested the
reliability of the witness under the same circumstances that
existed on the night of the accident and concluded that the
witness correctly identified each one of the two colours 80% of
the time and failed 20% of the time. What is the probability
that the cab involved in the accident was actually Blue?
Why is Bayes’ Theorem so cool?
Thank You!