SlideShare a Scribd company logo
1 of 116
Download to read offline
Probability and Statistics
Chapter 2
Probability
Dr. Yehya Mesalam
Basic Concepts
• Random Experiment is an experiment or a
process for which the outcome cannot be
predicted with certainty.
• Sample space (S) The set of all possible
outcomes of a random experiment
• Sample space: The collection of all possible
outcomes for an experiment.
• Event: is any subset of the sample space.
• Subset : a set A is called a subset of a set B if
each element of set A belongs to the set B.

A B
2
Dr. Yehya Mesalam
Examples of Experiments,
3
Dr. Yehya Mesalam
Solution
Draw the Venn and tree diagrams for the experiment
of tossing a coin once.
Example
a) Venn Diagram and
b) Tree diagram
4
Dr. Yehya Mesalam
Draw the Venn and tree diagrams for the experiment of
tossing a coin twice.
Example
Solution
a) Venn Diagram and b) Tree diagram
5
Dr. Yehya Mesalam
Example
Suppose we randomly select two workers from a company and
observe whether the worker selected each time is a man or a woman.
Write all the outcomes for this experiment. Draw the Venn and tree
diagrams for this experiment.
Solution
a) Venn Diagram and
b) Tree diagram
6
Dr. Yehya Mesalam
Example
• State the sample space for the experiment of
selecting two items from the batch consists of
three items {a, b, c}
1. without replacement
2. with replacement
1- S={{a, b}, {a, c}, {b, c}}.
2- S ={{a, a}, {a, b}, {a, c}, {b, b}, {b, c}, {c, c}}.
Solution
7
Dr. Yehya Mesalam
Axioms of sets
law
ation
Complement
)
(
Laws
Idempotent
laws
domination
laws
identity
A
A
A
A
A
A
A
A
S
S
A
A
S
A
A
A
A


















8
Dr. Yehya Mesalam
Axioms of sets
B
A
B
A
B
A
B
A
C
A
B
A
C
B
A
C
A
B
A
C
B
A
C
B
A
C
B
A
C
B
A
C
B
A
A
B
B
A
A
B
B
A








































)
(
laws
s
Morgan'
De
)
(
)
(
)
(
)
(
laws
ve
distributi
)
(
)
(
)
(
)
(
)
(
laws
e
associativ
)
(
)
(
laws
e
commutativ
9
Dr. Yehya Mesalam
• Union of Events – If A and B are two events in
a sample space S, then the union, A U B, is the
set of all outcomes in S that belong to either
A or B
A B
The entire shaded area
represents
A U B
S
Axioms of sets
10
Dr. Yehya Mesalam
S
Event Relations - Union
The union of two events, A and B, is the event that
either A or B or both occur when the experiment
is performed. We write
A B
A B
A B

11
Dr. Yehya Mesalam
S
A B
Event Relations-Intersection
The intersection of two events, A and B, is
the event that both A and B occur.
We write A B.
A B

• If A and B are mutually exclusive, then P(A B) = 0.
12
Dr. Yehya Mesalam
S
Event Relations - Complement
The complement of an event A consists of
all outcomes of the experiment that do not
result in event A. We write AC ( The event
that event A doesn’t occur).
A
AC
13
Dr. Yehya Mesalam
Example
List the elements of each of the following sample
spaces:
1. The set of integers between 1 and 50 divisible by 8;
2. The set S=
3. The set outcomes when a coin is tossed until a tail
or three heads appear;
Solution
1- S={8, 16, 24, 32, 40, 48, }
2- S={-5, 1}
3- S={T, HT, HHT, HHH}
}
0
5
4
{ 2


 X
X
X
14
Dr. Yehya Mesalam
Example
Let the Sample Space be the collection of all
possible outcomes of rolling one die:
S = [1, 2, 3, 4, 5, 6]
Let A be the event “Number rolled is even”
Let B be the event “Number rolled is at least 4”
Then
A = [2, 4, 6] and B = [4, 5, 6]
15
Dr. Yehya Mesalam
Example
S = [1, 2, 3, 4, 5, 6] A = [2, 4, 6] B = [4, 5, 6]
5]
3,
[1,
A 
6]
[4,
B
A 

6]
5,
4,
[2,
B
A 

S
6]
5,
4,
3,
2,
[1,
A
A 


Complements:
Intersections:
Unions:
[5]
B
A 

3]
2,
[1,
B 
16
Dr. Yehya Mesalam
Example
• The die toss:
• Simple events: Sample space:
1
2
3
4
5
6
E1
E2
E3
E4
E5
E6
S ={E1, E2, E3, E4, E5, E6}
S
•E1
•E6
•E2
•E3
•E4
•E5
(or S ={1, 2, 3, 4, 5, 6})
Venn Diagram
Tree diagram
17
Dr. Yehya Mesalam
Example
18
• Represent the sample space of three items are
selected at random from a manufacturing
process. Each item is inspected and classified
defective, D, or nondefective, N.
S = {DDD, DDN, DND, DNN, NDD, NDN, NND, NNN}.
Solution
Dr. Yehya Mesalam
19
Solution Using Tree diagram
Dr. Yehya Mesalam
Basic Concepts
• An event is a collection of one or more simple
events.
•The die toss:
–A: an even number
–B: a number less than 5
S
A ={2, 4, 6}
B ={1, 2, 3, 4}
B
A
•6
•3
•5
•4
•1
•2
A ∩ B ={2, 4} 20
Dr. Yehya Mesalam
If M = {x | 3 < x < 9} and N = {y | 5 < y < 12},
Find M ∪ N
21
Example
Solution
M ∪ N = {z | 3 < z < 12}.
Dr. Yehya Mesalam
An experiment involves tossing a pair of dice, one
blue and one black, and recording the numbers that
come up. If x equals the outcome on the blue die
and y the outcome on the black die, describe the sample
space S
(a) by listing the elements (x, y);
(b) by using the rule method.
22
Example
Solution
(a) S = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, 1), (2, 2),
(2, 3), (2, 4), (2, 5), (2, 6), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6),
(4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6), (5, 1), (5, 2), (5, 3), (5, 4),
(5, 5), (5, 6), (6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (6, 6)}.
Dr. Yehya Mesalam
Possible outcomes for rolling a pair of dice
23
Solution
(b) S = {(x, y) | 1 ≤ x, y ≤ 6}.
Dr. Yehya Mesalam
• For a two-stage experiment,
m ways to accomplish the first stage
n ways to accomplish the second stage
then there are mn ways to accomplish the whole
experiment.
• For a k-stage experiment, number of ways equal to
n1 n2 n3 … nk
Example: Toss two coins. The total number of
simple events is:
2  2 = 4
Counting Rules
24
Dr. Yehya Mesalam
Examples
Example: Toss three coins. The total number of
simple events is:
2  2  2 = 8
Example: Two balls are drawn in order from a dish
containing four candies. The total number of simple
events is:
6  6 = 36
Example: Toss two dice. The total number of
simple events is:
4  3 = 12
25
Dr. Yehya Mesalam
A prospective car buyer can choose between a fixed and
a variable interest rate and can also choose a payment
period of 36 months, 48 months, or 60 months. How
many total outcomes are possible?
Example
There are two outcomes (a fixed or a variable interest
rate) for the first step and
three outcomes (a payment period of 36 months, 48
months, or 60 months) for the second step.
Hence,
Total outcomes = 2 x 3 = 6
Solution
26
Dr. Yehya Mesalam
A National Football League team will play 16 games
during a regular season. Each game can result in one of
three outcomes: a win, a loss, or a tie. The total possible
outcomes for 16 games are calculated as follows:
Example
Total outcomes = 3·3·3·3·3·3·3·3·3·3·3·3 ·3·3·3·3
= 316 = 43,046,721
One of the 43,046,721 possible outcomes is all 16 plays.
Solution
27
Dr. Yehya Mesalam
60
)
1
(
2
)
1
)(
2
)(
3
)(
4
(
5
)!
3
5
(
!
5
5
3 



P
Permutations
• n distinct objects, take r objects at a time and
arrange them in order. The number of different
ways you can take and arrange is
60
)
3
)(
4
(
5 
.
1
!
0
and
)
1
)(
2
)...(
2
)(
1
(
!
where
)!
(
!






n
n
n
n
r
n
n
Pn
r
Example: How many 3-digit lock passwords can
we make by using 3 different numbers among 1,
2, 3, 4 and 5?
28
Dr. Yehya Mesalam
Example
• How many ways to select a student
committee of 3 members: chair, vice chair,
and secretary out of 8 students?
336
)
6
)(
7
(
8
)
1
)(
2
)(
3
)(
4
(
5
)
1
)(
2
)(
3
)(
4
)(
5
)(
6
)(
7
)(
8
(
)!
3
8
(
!
8
8
3





P
The order of the choice is
important! ---- Permutation
29
Dr. Yehya Mesalam
Permutations ofnobjects ofsamekinds
• Permutations of n objects of which n1 are alike, n2 are
alike, . . . , nr are alike is
60
)
!
2
!*
3
/(
!
6 
The order of the choice is
.
1
!
0
and
)
1
)(
2
)...(
2
)(
1
(
!
where
!
!.....
!
!
..
or
!
!.....
!
!
2
1
2
1
2
1















n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
r
r
r
Example: How many different letter arrangements can
be formed from the letters PEPPER?
30
Dr. Yehya Mesalam
Permutations ofnobjects ofsamekinds
60
)
!
2
!*
3
/(
!
6 
The order of the choice is
Example: How many different letter arrangements can
be formed from the letters PEPPER?
31
Dr. Yehya Mesalam
32
How many different letter arrangements can be made
from the letters in the word
STATISTICS?
Example
Solution:
Dr. Yehya Mesalam
Combinations
• n distinct objects, select r objects at a time without
regard to the order. The number of different ways
you can select is
Example: Three members of a 5-person committee must
be chosen to form a subcommittee. How many different
subcommittees could be formed?
)!
(
!
!
r
n
r
n
Cn
r


10
1
)
2
(
)
4
(
5
1
)
2
)(
1
)(
2
(
3
1
)
2
)(
3
)(
4
(
5
)!
3
5
(
!
3
!
5
5
3 




C
The order of
the choice is
not important!
33
Dr. Yehya Mesalam
Example
• How many ways to select a student
committee of 3 members out of 8 students?
• (Don’t assign chair, vice chair and secretary).
56
)
1
)(
2
(
3
)
6
)(
7
(
8
)]
1
)(
2
)(
3
)(
4
(
5
)][
1
)(
2
(
3
[
)
1
)(
2
)(
3
)(
4
)(
5
)(
6
)(
7
(
8
)!
3
8
(
!
3
!
8
8
3





C
The order of the choice is
NOT important!
Combination
34
Dr. Yehya Mesalam
Solution:
An ice cream parlor has six flavors of ice cream. Ahmed
wants to buy two flavors of ice cream. If he randomly
selects two flavors , how many ways of his selection?
Example
n = total number of ice cream flavors = 6
r = # of ice cream flavors to be selected = 2
Thus, there are 15 ways to select two ice cream flavors
out of six.
15
1
2
3
4
1
2
1
2
3
4
5
6
!
4
!
2
!
6
)!
2
6
(
!
2
!
6
2
6















C
Solution:
35
Example
Permutations of the First 4 letters 4p4=24
abcd
abdc
acbd
acdb
adbc
adcb
bacd
badc
bcad
bcda
bdac
bdca
cabd
cadd
cbad
cbda
cdab
cdba
dabc
dacb
dbac
dbca
dcab
dcba
How many ways can arrangement the first 4 letters of
the alphabet taken many ways all at a time. (a, b, c, d)
The # of ways = n! = 4! = 24
36
Dr. Yehya Mesalam
The Probability of an Event
• The probability of an event A measures “how
often” we think A will occur. We write P(A).
• Suppose that an experiment is performed n
times. The relative frequency for an event A is
Number of times A occurs f
n n

events
simple
of
number
total
A
in
events
simple
of
number
)
( 

N
n
A
P A
n
N
N
37
Dr. Yehya Mesalam
General Laws of Probability
For any two events, A and B, the probability of
their union, P(A B), is
)
(
)
(
)
(
)
( B
A
P
B
P
A
P
B
A
P 




A B
38
Dr. Yehya Mesalam
Intersection of Events
• Intersection of Events – If A and B are two
events in a sample space S, then the
intersection, A ∩ B, is the set of all outcomes
in S that belong to both A and B
A B
AB
S
39
Dr. Yehya Mesalam
• A and B are Mutually Exclusive Events if they
have no basic outcomes in common
– i.e., the set A ∩ B is empty (A ∩ B =Ø )
A B
S
Mutually Exclusive Events
40
‫الحادثين‬ ‫عن‬ ‫يقال‬
A
‫و‬
B
‫معا‬ ‫حدوثهما‬ ‫استحال‬ ‫إذا‬ ‫متنافيان‬ ‫أنهما‬
.
Dr. Yehya Mesalam
Laws of Probability
For any two events, A and B, the probability of
their union, P(A B), is
)
(
)
(
)
( B
P
A
P
B
A
P 


A B
The event A and B are mutually exclusive
A and B are mutually exclusive
0
)
( 
 B
A
P


 )
( B
A
41
Dr. Yehya Mesalam
• A and B are Independent Events if their joint
probability equals the product of their probabilities
• If the occurrence (or non occurrence ) of one does
not affect the probability of the occurrence
A B
S
Independent Events
42
‫الحادثين‬ ‫يعتبر‬
A
‫أو‬
B
‫عدم‬ ‫أو‬ ‫إحداهما‬ ‫ع‬
‫وقو‬ ‫كان‬ ‫إذا‬ ‫مستقمين‬ ‫حادثين‬
‫اآلخر‬ ‫ع‬
‫وقو‬ ‫في‬ ‫يؤثر‬ ‫ال‬ ‫وقوعه‬
.
A
∩
B
P(A ∩ B) =P(A) .P(B)
Dr. Yehya Mesalam
Laws of Probability
For any two events, A and B, the probability of
their union, P(A B), is
)
(
).
(
)
(
)
(
)
( B
P
A
P
B
P
A
P
B
A
P 



A B
The event A and B are
independent
A and B independent events
)
(
).
(
)
( B
P
A
P
B
A
P 

)
( B
A
43
Dr. Yehya Mesalam
Probabilities for Complements
• We know that for any event A:
P(A AC) = 0
• Since either A or AC must occur,
P(A AC) =1
• so that P(A AC) = P(A)+ P(AC) = 1
P(AC) = 1 – P(A)
A
AC
44
Dr. Yehya Mesalam
Relation Between Events
A B
A ∩ B = Ø
Mutually Exclusive Events
P(A U B) =P(A) +P(B)
P(A ∩ B) = 0
Dr. Yehya Mesalam 45
Relation Between Events
A B
Independent Events
P(A ∩ B) =P(A) .P(B)
A ∩ B
P(A U B) =P(A) +P(B)- P(A).P(B)
Dr. Yehya Mesalam 46
Relation Between Events
A B
General Events
A ∩ B
P(A U B) =P(A) +P(B)- P(A ∩ B)
Dr. Yehya Mesalam 47
Relation Between Events
A B
General Events
A ∩ B
A = 1+ 3
1
2
3
B = 2+ 3
Dr. Yehya Mesalam 48
Relation Between Events
A
A ∩ B
A = 1+ 3
1 3
Event of A
P(A) = P(1+ 3)
Dr. Yehya Mesalam 49
Relation Between Events
A
A ∩ B
A = 1+ 3
1 3
Event of A only A only = 1
Event of A
P(A only )= P(1)= P(A) – P(A ∩ B)
Dr. Yehya Mesalam 50
Relation Between Events
B
A ∩ B
B = 2+ 3 2
3
Event of B only
B only = 2
Event of B
P(B only )= P(2)= P(B) – P(A ∩ B)
Dr. Yehya Mesalam 51
Relation Between Events
A B
A ∩ B
1
2
3
Event of at least one event happened
Means A or B or A and B together
P(A U B) =P(A) +P(B)- P(A ∩ B)
(A U B) = 1 +2 + 3
Dr. Yehya Mesalam 52
Relation Between Events
A B
A ∩ B
1
2
3
Event of at Most one event happened
Means A only B only or A and B Not occur together
P(A ∩ B) / = 1- P(A ∩ B)
(A ∩ B)/ = 1 +2 + 4
S
4
4
4
White
Area
White
Area
Dr. Yehya Mesalam 53
Relation Between Events
A ∩ B
3
Event of at Most one event happened
Means A only B only or A and B Not occur together
P(A ∩ B) / = 1- P(A ∩ B)
(A ∩ B)/ = S - 3
S
Dr. Yehya Mesalam 54
Relation Between Events
A ∩ B
3
Event of at Most one event happened
Means A only B only or A and B Not occur together
P(A ∩ B) / = 1- P(A ∩ B)
(A ∩ B)/ = S - 3
S
Dr. Yehya Mesalam 55
A B
1 2
4
3
Relation Between Events
A B
A ∩ B
A only = 1
1
2
3
B only = 2
Dr. Yehya Mesalam 56
Only Event A or Event B
Means A only or B only is occur together
P(A only U B only )= 1 + 2
Relation Between Events
A ∩ B
3
Event of only event A and B event happened
Means A and B occur together
= P(A ∩ B)
(A ∩ B) = 3
S
Dr. Yehya Mesalam 57
A B
A Probability Table
B
A
A
B
)
B
P(A 
)
B
A
P( 
B)
A
P( 
P(A)
B)
P(A 
)
A
P(
)
B
P(
P(B) 1.0
P(S) 
Probabilities and joint probabilities for two events A and
B are summarized in this table:
58
Dr. Yehya Mesalam
Conditional Probabilities
The probability that A occurs, given that event
B has occurred is called the conditional
probability of A given B and is defined as
0
)
(
,
)
(
)
(
)
|
( 

 B
P
B
P
B
A
P
B
A
P
“given”
0
)
(
,
)
(
)
(
)
|
( 

 A
P
A
P
B
A
P
A
B
P
59
Dr. Yehya Mesalam
Defining Independence
• We can redefine independence in terms of
conditional probabilities:
Two events A and B are independent if and
only if
P(A|B) = P(A) or P(B|A) = P(B)
Otherwise, they are dependent.
• Once you’ve decided whether or not two
events are independent, you can use the
following rule to calculate their intersection.
60
Dr. Yehya Mesalam
Multiplicative Rule for Intersections
• For any two events, A and B, the probability that
both A and B occur is
P(A B) = P(A) P(B given that A occurred)
= P(A)P(B|A)
• If the events A and B are independent,
then the probability that both A and B
occur is
P(A B) = P(A) P(B)
61
Dr. Yehya Mesalam
Example
• Toss a fair coin twice. What is the probability of
observing at least one head (event A)? Exactly
one Head (event B)?
H
1st Coin 2nd Coin Ei P(Ei)
H
T
T
H
T
HH
HT
TH
TT
1/4
1/4
1/4
1/4
P(at least 1 head)= P(A)
= P(E1) + P(E2) + P(E3)
= 1/4 + 1/4 + 1/4 = 3/4
Tree Diagram
P(exactly 1 head)=P(B)
= P(E2) + P(E3)
= 1/4 + 1/4 = 1/2
62
Dr. Yehya Mesalam
Example
• A bowl contains three balls, two reds, one blue. A
child selects two balls at random. What is the
Probability of observing exactly two reds?
1st M&M 2nd M&M Ei P(Ei)
r1b
r1r2
r2b
r2r1
1/6
1/6
1/6
1/6
1/6
1/6
P(exactly two reds)
= P(r1r2) + P(r2r1)
= 1/6 +1/6
= 1/3
r1
b
b
r1
r1
b
br1
br2
r2
r2
r2
r2
r1 b
63
Example
Suppose that there were 1000 students in a
college, and that they could be classified as
follows:
Male (B) Female
Colorblind (A) 40 2
Not Colorblind 470 488
A: Colorblind
P(A) = 42/1000=.042
B: Male
P(B) = 510/1000=.51
P(AB) = P(A) + P(B) – P(AB)
= 42/1000 + 510/1000 - 40/1000
= 512/1000 = .512
Check: P(AB)
= (40 + 2 + 470)/1000 =.512
Dr. Yehya Mesalam
A Special Case
Male Female
Colorblind 40 2
Not Colorblind 470 488
When two events A and B are
mutually exclusive, P(AB) = 0
and P(AB) = P(A) + P(B).
A: male and colorblind
P(A) = 40/1000
B: female and colorblind
P(B) = 2/1000
P(AB) = P(A) + P(B)
= 40/1000 + 2/1000
= 42/1000=.042
A and B are mutually
exclusive, so that
Example
Male Female
Colorblind 40 2
Not Colorblind 470 488
A: male
P(A) = 510/1000=.51
B: female
P(B) = 1- P(A)
= 1- .51
=.49
A and B are
complementary, so that
Select a student at random from
the college. Define:
66
Dr. Yehya Mesalam
Example
Male (A) Female
Colorblind (B) 40 2
Not Colorblind 470 488
A: Male
B: Colorblind
Find P(A), P(A|B)
Are A and B independent?
P(A) = 510/1000=.51
Select a student at random from
the college. Define:
P(A|B) = P(AB)/P(B)=.040/.042=.95
P(B) = 42/1000=.042 P(AB) = 40/1000=.040
P(A|B) and P(A) are not equal. A, B are dependent
67
Example
• If P (A/B) =0.4 and P (B) =0.8 and P (A) =0.5
are the events A and B independent?
Solution
If A and B are independent, then
But P (A/B) =0.4 and P (A) =0.5
then A and B not independent
P(A)
)
(
)
(
)
|
( 


B
P
B
A
P
B
A
P
68
Dr. Yehya Mesalam
Example:
A: Red die show 1
B: Green die show 1
P(AB) = P(A) + P(B) – P(AB) = 6/36 + 6/36 – 1/36
= 11/36
P(A|B) = P(A and B)/P(B)
=1/36/1/6=1/6=P(A)
P(A) does not
change, whether B
happens or not…
A and B are
independent!
A:
B
69
The Law of Total Probability
P(A) = P(A  S1) + P(A  S2) + … + P(A  Sk)
= P(S1)P(A|S1) + P(S2)P(A|S2) + … + P(Sk)P(A|Sk)
Let S1 , S2 , S3 ,..., Sk be mutually exclusive and
exhaustive events (that is, one and only one
must happen). Then the probability of any event
A can be written as
70
Dr. Yehya Mesalam
The Law of Total Probability
A
A Sk
A  S1
S2….
S1
Sk
P(A) = P(A  S1) + P(A  S2) + … + P(A  Sk)
= P(S1)P(A|S1) + P(S2)P(A|S2) + … + P(Sk)P(A|Sk)
71
Dr. Yehya Mesalam
Bayes’ Rule
Let S1 , S2 , S3 ,..., Sk be mutually exclusive and
exhaustive events with prior probabilities P(S1),
P(S2),…,P(Sk). If an event A occurs, the posterior
probability of Si, given that A occurred is
,...k
,
i
S
A
P
S
P
S
A
P
S
P
A
S
P
i
i
i
i
i 2
1
for
)
|
(
)
(
)
|
(
)
(
)
|
( 


)
|
(
)
(
)
|
(
)
(
)
(
)
(
)
|
(
)
|
(
)
(
)
(
)
(
)
(
)
|
(
Proof
i
i
i
i
i
i
i
i
i
i
i
i
S
A
P
S
P
S
A
P
S
P
A
P
AS
P
A
S
P
S
A
P
S
P
AS
P
S
P
AS
P
S
A
P







72
Dr. Yehya Mesalam
Example
• Urn A1 contains 7 black and 3 white balls. A2
contains 3 black and 7 white balls, and urn A3
contains 5 white and 5 black balls. A fair die is to be
cast. If the die turns up 1, or 3, then a ball will be
selected from A1. If the die turns up 2, 4 or 6, a ball
will be selected from A2. Finally, a ball will be
selected from A3 otherwise.
a- Given that the ball selected is black, what is
probability that it was chosen from A2?
b- Given that the ball selected is white, what is
probability that it not chosen from A1?
73
Dr. Yehya Mesalam
Solution
• First calculate the P(B)
A1
A2
A3
P(W/A1)=0.3
P(W/A2)=0.7
P(W/A3)=0.5
P(B/A1)=0.7
P(B/A2)=0.3
P(B/A3)=0.5
P(A2)=3/6
P(B) = (2/6)*0.7 + 0.5*0.3 + (1/6)*0.5 = 0.466
Given that the ball selected is black, what is probability that it was chosen from
A2?
P(A2/B) = (0.5*0.3)/ 0.466 = 0.321
74
Dr. Yehya Mesalam
• b- Given that the ball selected is white, what is
probability that it not chosen from A1?
P(W) = (2/6)*0.3 + 0.5*0.7 + (1/6)*0.5 = 0.534
Or
P(W) = 1-P(B) =1 -0.466 = 0.534
• P(A1/w) = ((2/6)*0.3))/ 0.534 = 0.187
75
Solution
Dr. Yehya Mesalam
812
.
0
187
.
0
1
)
(
1
)
( 1
/
1 



 W
A
P
W
A
P
Example
One bag contains 4 white balls and 3 black balls, and a
second bag contains 3 white balls and 5 black balls.
One ball is drawn from the first bag and placed
unseen in the second bag. What is the probability
that a ball now drawn from the second bag is black?
76
Solution
Let B1 represent a black ball from bag 1
W1 represent, a white ball from bag 1
B2 represent a black ball from bag 2.
Dr. Yehya Mesalam
Solution
77
Dr. Yehya Mesalam
5/9
Example
0.90
0.90
a
b
0.95
0.80
0.90
0.95
The following circuit operates only if there is a path of
functional devices from left to right. The probability
that each device functions is shown on the graph.
Assume that devices fail independently. What is the
probability that the circuit operates
Solution
The probability that the circuit operates =
= (1- 0.13) (1- 0.052)(0.8) = 0.797202 78
Example
2 green and 4 red balls are in a box; Two of
them are selected at random.
A: First is green;
B: Second is red.
• Find P(AB).
79
Dr. Yehya Mesalam
Method 1
• Choose 2 balls out of 6. Order is recorded. (Total
number of ways, i.e. size of sample space S)
The order of
the choice is
important!
Permutation 30
)
5
(
6
!
4
!
6
)!
2
6
(
!
6
6
2





P
4
4
1 
C
2
2
1 
C
2  4 = 8 ways to
choose first green and
second red
( mn Rule)
• Event AB: First green, second red
First green
Second Red
30
8
#
#
)
(




S
B
A
B
A
P
80
Dr. Yehya Mesalam
Method 2
A: First is green;
B: Second is red;
AB: First green, second red
P(A)
P(B|A)
P(A B) = P(A)P(B|A)
P(A B) = (2/6)(4/5)=8/30
2/6
P(Second red | First green)=4/5
81
Dr. Yehya Mesalam
Probability Rules & Relations of Events
Complement Event
Additive Rule
Multiplicative Rule
Conditional probability
Mutually Exclusive Events
Independent Events
)
(
1
)
( A
P
A
P c


0
)
( 
B
A
P
)
(
)
(
)
|
(
B
P
B
A
P
B
A
P


)
(
)
(
)
(
)
( B
A
P
B
P
A
P
B
A
P 




)
|
(
)
(
)
( A
B
P
A
P
B
A
P 

)
(
)
(
)
( B
P
A
P
B
A
P 


)
(
)
(
)
( B
P
A
P
B
A
P 

)
(
)
|
( A
P
B
A
P 
)
(
)
(
)
(
)
( C
P
B
P
A
P
C
B
A
P 

 82
Key Concepts
III. Counting Rules
1. mn Rule, extended mn Rule
2. Permutations:
3. Combinations:
IV. Event Relations
1. Unions and intersections
2. Events
a. Disjoint or mutually exclusive:
b. Complementary:
)
(
1
)
( A
P
A
P c


0
)
( 
B
A
P
)!
(
!
!
)!
(
!
r
n
r
n
C
r
n
n
P
n
r
n
r




)
(
)
(
)
( B
P
A
P
B
A
P 


83
Dr. Yehya Mesalam
Key Concepts
3. Conditional probability:
4. Independent events
5. Additive Rule of Probability:
6. Multiplicative Rule of Probability:
)
(
)
(
)
( B
P
A
P
B
A
P 

)
(
)
|
( A
P
B
A
P 
)
(
)
(
)
|
(
B
P
B
A
P
B
A
P


)
(
)
(
)
(
)
( B
A
P
B
P
A
P
B
A
P 




)
|
(
)
(
)
( A
B
P
A
P
B
A
P 

)
(
)
(
)
(
)
( C
P
B
P
A
P
C
B
A
P 


84
Dr. Yehya Mesalam
Solved Problems
85
Example
One card is selected from an ordinary deck of playing cards. What is the
probability of getting?
1- The event (A) the king of hearts is selected
2- The event (B) a king is selected
3- The event (C) a heart is selected
4- The event (D) a face card is selected
5- The event (E) not a face card is selected.
86
1- The event (A) the king of hearts is selected
1/52
2- The event (B) a king is selected
1/13 = 4/52
Solution
87
Dr. Yehya Mesalam
3- The event (C ) a heart is selected
1/4 = 13/52
Solution
4- The event (D)a face card is selected
3/13=12/52
88
Dr. Yehya Mesalam
5- The event (E) not a face card is selected (D )
40/52=10/13
Solution
-
89
Dr. Yehya Mesalam
Event (B & C) King and heart
1/13 X 1/4 = 1/52
King
heart
King and heart (B∩C)
90
Dr. Yehya Mesalam
Event (B or C) King or heart
King
heart
King or heart (BUC)
16/52 = 4/52 + 13/52 - 1/52
91
Dr. Yehya Mesalam
heart
Solution
Face
92
Event (C & D) heart and face card is selected
heart and face (C∩D
3/52 = 3/13 X 1/4
Dr. Yehya Mesalam
Spade or Face Card
P (spade) + P (face card) – P (spade & face card) = 1/4 + 3/13 – 3/52
= 22/52
Spade
Face
Spade U Face
Example
One card is selected from an ordinary deck of playing cards.
What is the probability of getting?
(a) A queen? (b) A Jack? (c) Either a queen or a jack?
(d) A queen or a red card? (e) A face card?
94
Solution
(a) P(Q)=4/52
(b) P(J)=4/52
(c)P(QUJ)=P(Q)+P(J)=(4/52)+(4/52)=8/52
(d) P(QUR)=P(Q)+ P(R) -P(Q )=
4/52+26/52 - 2/52 = 28/52
(e) P(face) = 12/52
95
Dr. Yehya Mesalam
Example
• A bowl contains three balls, one red, one blue and
one green. A child takes two balls randomly one at a
time. What is the probability that at least one is red?
1st 2nd Ei P(Ei)
1/6
1/6
1/6
1/6
1/6
1/6
P(at least 1 red) =
P(E1) +P(E2) +
P(E3) + P(E6) =4/6
= 2/3
RB
RG
BR
BG
m
m
m
m
m
m
m
m
m
GB
GR
96
Example
Simple Events Probabilities
HHH
HHT
HTH
HTT
1/8
1/8
1/8
1/8
1/8
1/8
1/8
1/8
P(Exactly 2 heads)= P(B)
= P(HHT) + P(HTH) + P(THH)
= 1/8 + 1/8 + 1/8 = 3/8
P(at least 2 heads)=P(A)
= P(HHH)+P(HHT)+P(HTH)+P(THH)
= 1/8 + 1/8 +1/8 + 1/8 = 1/2
THH
THT
TTH
TTT
A={HHH, HHT, HTH, THH}
B={HHT,HTH,THH}
• Toss a fair coin 3 times. What is the probability of
observing at least two heads (event A)? Exactly two
Heads (event B)?
97
Example
Simple Events
HHH
HHT
HTH
HTT C={HTT,THT,TTH,TTT}
THH
THT
TTH
TTT
A={HHH,HHT,HTH,THH}
B={HHT,HTH,THH}
A: at least two heads; B: exactly two heads;
C: at least two tails; D: exactly one tail.
Questions: A and C mutually exclusive? B and D?
D={HHT,HTH,THH}
Mutually
Exclusive
Not Mutually
Exclusive
98
Dr. Yehya Mesalam
Example
• Toss a fair coin twice. What is the
probability of observing at least one
head (Event A)?
S
A
A
P
#
#
)
( 
H
1st Coin 2nd Coin Ei P(Ei)
H
T
T
H
T
HH
HT
TH
TT
1/4
1/4
1/4
1/4
P(at least 1 head)
= P(A)
= P(HH) + P(HT) + P(TH)
= 1/4 + 1/4 + 1/4 = 3/4
A={HH, HT, TH}
S={HH, HT, TH, TT}
99
Dr. Yehya Mesalam
Example
• A bowl contains three M&Ms®, two reds, one blue.
A child selects two M&Ms at random. What is the
probability that exactly two reds (Event A)?
S
A
A
P
#
#
)
( 
1st M&M 2nd M&M Ei P(Ei)
r1b
r1r2
r2b
r2r1
1/6
1/6
1/6
1/6
1/6
1/6
P(A)
= P(r1r2) + P(r2r1)
= 1/6 +1/6 = 2/6=1/3
r1
b
b
r1
r1
b
br1
br2
r2
r2
r2
r2
r1 b
A={r1r2, r2r1}
10
Tree Diagram
Experiment: Select 2 balls from 20 balls :
14 Blue & 6 Red. Don’t Replace.
Dependent!
B
R
B
R
B
R
P(R) = 6/20
P(R|R) = 5/19
P(B|R) = 14/19
P(B) = 14/20
P(R|B) = 6/19
P(B|B) = 13/19
10
Dr. Yehya Mesalam
Tree Diagram
Experiment: Select 2 balls from 20 balls :
14 Blue & 6 Red. With Replacement.
Independent!
B
R
B
R
B
R
P(R) = 6/20
P(R|R) = 6/20
P(B|R) = 14/20
P(B) = 14/20
P(R|B) = 6/20
P(B|B) = 14/19
10
Dr. Yehya Mesalam
Example
A survey of job satisfaction of teachers was
taken, giving the following results
Satisfied Unsatisfied Total
College 74 43 117
High School 224 171 395
Elementary 126 140 266
Total 424 354 778
Job Satisfaction
L
E
V
E
L
10
Dr. Yehya Mesalam
Example
If all the cells are divided by the total number
surveyed, 778, the resulting table is a table of
empirically derived probabilities.
Satisfied Unsatisfied Total
College 0.095 0.055 0.150
High School 0.288 0.220 0.508
Elementary 0.162 0.180 0.342
Total 0.545 0.455 1.000
L
E
V
E
L
Job Satisfaction
10
Dr. Yehya Mesalam
Example
For convenience, let C stand for the event that the
teacher teaches college, S stand for the teacher
being satisfied and so on. Let’s look at some
probabilities and what they mean.
is the proportion of teachers who are
college teachers.
P(C) 0.150

is the proportion of teachers who are
satisfied with their job.
P(S) 0.545

is the proportion of teachers who are
college teachers and who are satisfied
with their job.
P(C S) 0.095

Satisfied Unsatisfied Total
College 0.095 0.055 0.150
High School 0.288 0.220 0.508
Elementary 0.162 0.180 0.342
Total 0.545 0.455 1.000
L
E
V
E
L
Job Satisfaction
10
Example
is the proportion of teachers who
are college teachers given they are
satisfied. Restated: This is the
proportion of satisfied that are
college teachers.
P(C S)
P(C | S)
P(S)
0.095
0.175
0.545

 
is the proportion of teachers who
are satisfied given they are
college teachers. Restated: This is
the proportion of college teachers
that are satisfied.
P(S C)
P(S | C)
P(C)
P(C S) 0.095
P(C) 0.150
0.632

 

Satisfied Unsatisfied Total
College 0.095 0.055 0.150
High School 0.288 0.220 0.508
Elementary 0.162 0.180 0.342
Total 0.545 0.455 1.000
L
E
V
E
L
Job Satisfaction
106
Example
P(C S) 0.095
P(C) 0.150 and P(C| S) 0.175
P(S) 0.545
   
Satisfied Unsatisfied Total
College 0.095 0.055 0.150
High School 0.288 0.220 0.508
Elementary 0.162 0.180 0.342
Total 0.545 0.455 1.000
L
E
V
E
L
Job Satisfaction
P(C|S)  P(C) so C and S are dependent events.
Are C and S independent events?
107
Dr. Yehya Mesalam
Example
Satisfied Unsatisfied Total
College 0.095 0.055 0.150
High School 0.288 0.220 0.508
Elementary 0.162 0.180 0.658
Total 0.545 0.455 1.000
L
E
V
E
L
Job Satisfaction
P(C) = 0.150, P(S) = 0.545 and
P(CS) = 0.095, so
P(CS) = P(C)+P(S) - P(CS)
= 0.150 + 0.545 - 0.095
= 0.600
P(CS)?
108
Dr. Yehya Mesalam
We know:
P(F) =
P(M) =
P(H|F) =
P(H|M) =
Example
From a previous example, we know that 49% of the
population are female. Of the female patients, 8% are high
risk for heart attack, while 12% of the male patients are
high risk. A single person is selected at random and found
to be high risk. What is the probability that it is a male?
Define H: high risk F: female M: male
61
.
)
08
(.
49
.
)
12
(.
51
.
)
12
(.
51
.
)
|
(
)
(
)
|
(
)
(
)
|
(
)
(
)
|
(





F
H
P
F
P
M
H
P
M
P
M
H
P
M
P
H
M
P
.12
.08
.51
.49
109
Example
Suppose a rare disease infects one out of
every 1000 people in a population. And
suppose that there is a good, but not perfect,
test for this disease: if a person has the
disease, the test comes back positive 99% of
the time. On the other hand, the test also
produces some false positives: 2% of
uninfected people are also test positive. And
someone just tested positive. What are his
chances of having this disease?
110
Dr. Yehya Mesalam
We know:
P(A) = .001 P(Ac) =.999
P(B|A) = .99 P(B|Ac) =.02
Example
Define A: has the disease B: test positive
0472
.
02
.
999
.
99
.
001
.
99
.
001
.
)
|
(
)
(
)
|
(
)
(
)
|
(
)
(
)
|
(







 c
A
B
P
c
A
P
A
B
P
A
P
A
B
P
A
P
B
A
P
We want to know P(A|B)=?
111
Tom and Dick are going to take
a driver's test at the nearest DMV office. Tom
estimates that his chances to pass the test are
70% and Dick estimates his as 80%. Tom and
Dick take their tests independently.
Define D = {Dick passes the driving test}
T = {Tom passes the driving test}
T and D are independent.
P (T) = 0.7, P (D) = 0.8
Example
112
Dr. Yehya Mesalam
What is the probability that at most one of the
two friends will pass the test?
Example
P(At most one person pass)
= P(Dc  Tc) + P(Dc  T) + P(D  Tc)
= (1 - 0.8) (1 – 0.7) + (0.7) (1 – 0.8) + (0.8) (1 – 0.7)
= .44
P(At most one person pass)
= 1-P(both pass) = 1- 0.8 x 0.7 = .44
113
Dr. Yehya Mesalam
What is the probability that at least one of the
two friends will pass the test?
Example
P(At least one person pass)
= P(D  T)
= 0.8 + 0.7 - 0.8 x 0.7
= .94
P(At least one person pass)
= 1-P(neither passes) = 1- (1-0.8) x (1-0.7) = .94
114
Suppose we know that only one of the two
friends passed the test. What is the probability
that it was Dick?
Example
P(D | exactly one person passed)
= P(D  exactly one person passed) / P(exactly one
person passed)
= P(D  Tc) / (P(D  Tc) + P(Dc  T) )
= 0.8 x (1-0.7)/(0.8 x (1-0.7)+(1-.8) x 0.7)
= .63
115
116

More Related Content

What's hot

Artificial reefs
Artificial reefsArtificial reefs
Artificial reefs
Yasser Ahmed
 
Thecaribbeansecondaryeducationcertificatesocialstud
ThecaribbeansecondaryeducationcertificatesocialstudThecaribbeansecondaryeducationcertificatesocialstud
Thecaribbeansecondaryeducationcertificatesocialstud
capesociology
 

What's hot (7)

rocky and sandy shore pragati ppt.pptx
rocky and sandy shore pragati ppt.pptxrocky and sandy shore pragati ppt.pptx
rocky and sandy shore pragati ppt.pptx
 
Arithmetic Series
Arithmetic SeriesArithmetic Series
Arithmetic Series
 
Artificial reefs
Artificial reefsArtificial reefs
Artificial reefs
 
Dimethylsulphide :- The Global Coolant
Dimethylsulphide :- The Global CoolantDimethylsulphide :- The Global Coolant
Dimethylsulphide :- The Global Coolant
 
Thecaribbeansecondaryeducationcertificatesocialstud
ThecaribbeansecondaryeducationcertificatesocialstudThecaribbeansecondaryeducationcertificatesocialstud
Thecaribbeansecondaryeducationcertificatesocialstud
 
Sea and Seawater
Sea and SeawaterSea and Seawater
Sea and Seawater
 
Geometric Sequence
Geometric SequenceGeometric Sequence
Geometric Sequence
 

Similar to Chapter 2 2022.pdf

Lecture Notes MTH302 Before MTT Myers.docx
Lecture Notes MTH302 Before MTT Myers.docxLecture Notes MTH302 Before MTT Myers.docx
Lecture Notes MTH302 Before MTT Myers.docx
RaghavaReddy449756
 
0113 examia
0113 examia0113 examia
0113 examia
pschlein
 
cie-as-maths-9709-statistics1-v2-znotes.pdf
cie-as-maths-9709-statistics1-v2-znotes.pdfcie-as-maths-9709-statistics1-v2-znotes.pdf
cie-as-maths-9709-statistics1-v2-znotes.pdf
YiranMa4
 
cie-as-maths-9709-statistics1-v2-znotes 2.pdf
cie-as-maths-9709-statistics1-v2-znotes 2.pdfcie-as-maths-9709-statistics1-v2-znotes 2.pdf
cie-as-maths-9709-statistics1-v2-znotes 2.pdf
YiranMa4
 
Note 2 probability
Note 2 probabilityNote 2 probability
Note 2 probability
Nur Suaidah
 

Similar to Chapter 2 2022.pdf (20)

Sampling
SamplingSampling
Sampling
 
probability.pptx
probability.pptxprobability.pptx
probability.pptx
 
Lecture Notes MTH302 Before MTT Myers.docx
Lecture Notes MTH302 Before MTT Myers.docxLecture Notes MTH302 Before MTT Myers.docx
Lecture Notes MTH302 Before MTT Myers.docx
 
PRP - Unit 1.pptx
PRP - Unit 1.pptxPRP - Unit 1.pptx
PRP - Unit 1.pptx
 
powerpoints probability.pptx
powerpoints probability.pptxpowerpoints probability.pptx
powerpoints probability.pptx
 
Lecture-1-Probability-Theory-Part-1.pdf
Lecture-1-Probability-Theory-Part-1.pdfLecture-1-Probability-Theory-Part-1.pdf
Lecture-1-Probability-Theory-Part-1.pdf
 
Probability theory.pptx
Probability theory.pptxProbability theory.pptx
Probability theory.pptx
 
Probability
ProbabilityProbability
Probability
 
Probability unit2.pptx
Probability unit2.pptxProbability unit2.pptx
Probability unit2.pptx
 
0113 examia
0113 examia0113 examia
0113 examia
 
cie-as-maths-9709-statistics1-v2-znotes.pdf
cie-as-maths-9709-statistics1-v2-znotes.pdfcie-as-maths-9709-statistics1-v2-znotes.pdf
cie-as-maths-9709-statistics1-v2-znotes.pdf
 
cie-as-maths-9709-statistics1-v2-znotes 2.pdf
cie-as-maths-9709-statistics1-v2-znotes 2.pdfcie-as-maths-9709-statistics1-v2-znotes 2.pdf
cie-as-maths-9709-statistics1-v2-znotes 2.pdf
 
MS 1_Definition of Statistics.pptx
MS 1_Definition of Statistics.pptxMS 1_Definition of Statistics.pptx
MS 1_Definition of Statistics.pptx
 
CENTRAL LIMIT THEOREM- STATISTICS AND PROBABILITY
CENTRAL LIMIT THEOREM- STATISTICS AND PROBABILITYCENTRAL LIMIT THEOREM- STATISTICS AND PROBABILITY
CENTRAL LIMIT THEOREM- STATISTICS AND PROBABILITY
 
Note 2 probability
Note 2 probabilityNote 2 probability
Note 2 probability
 
Probability Theory for Data Scientists
Probability Theory for Data ScientistsProbability Theory for Data Scientists
Probability Theory for Data Scientists
 
Mech ma6452 snm_notes
Mech ma6452 snm_notesMech ma6452 snm_notes
Mech ma6452 snm_notes
 
R4 m.s. radhakrishnan, probability &amp; statistics, dlpd notes.
R4 m.s. radhakrishnan, probability &amp; statistics, dlpd notes.R4 m.s. radhakrishnan, probability &amp; statistics, dlpd notes.
R4 m.s. radhakrishnan, probability &amp; statistics, dlpd notes.
 
Probability and Statistics - Week 2
Probability and Statistics - Week 2Probability and Statistics - Week 2
Probability and Statistics - Week 2
 
Week8 livelecture2010
Week8 livelecture2010Week8 livelecture2010
Week8 livelecture2010
 

More from Mohamed Ali (16)

Sheet 1.pdf
Sheet 1.pdfSheet 1.pdf
Sheet 1.pdf
 
Chapter 7 2022.pdf
Chapter 7 2022.pdfChapter 7 2022.pdf
Chapter 7 2022.pdf
 
Chapter 1 2022.pdf
Chapter 1 2022.pdfChapter 1 2022.pdf
Chapter 1 2022.pdf
 
Chapter 1 2021.pdf
Chapter 1 2021.pdfChapter 1 2021.pdf
Chapter 1 2021.pdf
 
Chapter 6 2022.pdf
Chapter 6 2022.pdfChapter 6 2022.pdf
Chapter 6 2022.pdf
 
Chapter 5 2022.pdf
Chapter 5 2022.pdfChapter 5 2022.pdf
Chapter 5 2022.pdf
 
Chapter 3 2022.pdf
Chapter 3 2022.pdfChapter 3 2022.pdf
Chapter 3 2022.pdf
 
Chapter 4 2022.pdf
Chapter 4 2022.pdfChapter 4 2022.pdf
Chapter 4 2022.pdf
 
Ch 6.pdf
Ch 6.pdfCh 6.pdf
Ch 6.pdf
 
Ch 5.pdf
Ch 5.pdfCh 5.pdf
Ch 5.pdf
 
Ch 4.pdf
Ch 4.pdfCh 4.pdf
Ch 4.pdf
 
Ch 3.pdf
Ch 3.pdfCh 3.pdf
Ch 3.pdf
 
Ch 2.pdf
Ch 2.pdfCh 2.pdf
Ch 2.pdf
 
Ch 1.pdf
Ch 1.pdfCh 1.pdf
Ch 1.pdf
 
information system Ch 2
information system Ch 2information system Ch 2
information system Ch 2
 
Information system
Information systemInformation system
Information system
 

Recently uploaded

Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Recently uploaded (20)

University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 

Chapter 2 2022.pdf

  • 1. Probability and Statistics Chapter 2 Probability Dr. Yehya Mesalam
  • 2. Basic Concepts • Random Experiment is an experiment or a process for which the outcome cannot be predicted with certainty. • Sample space (S) The set of all possible outcomes of a random experiment • Sample space: The collection of all possible outcomes for an experiment. • Event: is any subset of the sample space. • Subset : a set A is called a subset of a set B if each element of set A belongs to the set B.  A B 2 Dr. Yehya Mesalam
  • 4. Solution Draw the Venn and tree diagrams for the experiment of tossing a coin once. Example a) Venn Diagram and b) Tree diagram 4 Dr. Yehya Mesalam
  • 5. Draw the Venn and tree diagrams for the experiment of tossing a coin twice. Example Solution a) Venn Diagram and b) Tree diagram 5 Dr. Yehya Mesalam
  • 6. Example Suppose we randomly select two workers from a company and observe whether the worker selected each time is a man or a woman. Write all the outcomes for this experiment. Draw the Venn and tree diagrams for this experiment. Solution a) Venn Diagram and b) Tree diagram 6 Dr. Yehya Mesalam
  • 7. Example • State the sample space for the experiment of selecting two items from the batch consists of three items {a, b, c} 1. without replacement 2. with replacement 1- S={{a, b}, {a, c}, {b, c}}. 2- S ={{a, a}, {a, b}, {a, c}, {b, b}, {b, c}, {c, c}}. Solution 7 Dr. Yehya Mesalam
  • 10. • Union of Events – If A and B are two events in a sample space S, then the union, A U B, is the set of all outcomes in S that belong to either A or B A B The entire shaded area represents A U B S Axioms of sets 10 Dr. Yehya Mesalam
  • 11. S Event Relations - Union The union of two events, A and B, is the event that either A or B or both occur when the experiment is performed. We write A B A B A B  11 Dr. Yehya Mesalam
  • 12. S A B Event Relations-Intersection The intersection of two events, A and B, is the event that both A and B occur. We write A B. A B  • If A and B are mutually exclusive, then P(A B) = 0. 12 Dr. Yehya Mesalam
  • 13. S Event Relations - Complement The complement of an event A consists of all outcomes of the experiment that do not result in event A. We write AC ( The event that event A doesn’t occur). A AC 13 Dr. Yehya Mesalam
  • 14. Example List the elements of each of the following sample spaces: 1. The set of integers between 1 and 50 divisible by 8; 2. The set S= 3. The set outcomes when a coin is tossed until a tail or three heads appear; Solution 1- S={8, 16, 24, 32, 40, 48, } 2- S={-5, 1} 3- S={T, HT, HHT, HHH} } 0 5 4 { 2    X X X 14 Dr. Yehya Mesalam
  • 15. Example Let the Sample Space be the collection of all possible outcomes of rolling one die: S = [1, 2, 3, 4, 5, 6] Let A be the event “Number rolled is even” Let B be the event “Number rolled is at least 4” Then A = [2, 4, 6] and B = [4, 5, 6] 15 Dr. Yehya Mesalam
  • 16. Example S = [1, 2, 3, 4, 5, 6] A = [2, 4, 6] B = [4, 5, 6] 5] 3, [1, A  6] [4, B A   6] 5, 4, [2, B A   S 6] 5, 4, 3, 2, [1, A A    Complements: Intersections: Unions: [5] B A   3] 2, [1, B  16 Dr. Yehya Mesalam
  • 17. Example • The die toss: • Simple events: Sample space: 1 2 3 4 5 6 E1 E2 E3 E4 E5 E6 S ={E1, E2, E3, E4, E5, E6} S •E1 •E6 •E2 •E3 •E4 •E5 (or S ={1, 2, 3, 4, 5, 6}) Venn Diagram Tree diagram 17 Dr. Yehya Mesalam
  • 18. Example 18 • Represent the sample space of three items are selected at random from a manufacturing process. Each item is inspected and classified defective, D, or nondefective, N. S = {DDD, DDN, DND, DNN, NDD, NDN, NND, NNN}. Solution Dr. Yehya Mesalam
  • 19. 19 Solution Using Tree diagram Dr. Yehya Mesalam
  • 20. Basic Concepts • An event is a collection of one or more simple events. •The die toss: –A: an even number –B: a number less than 5 S A ={2, 4, 6} B ={1, 2, 3, 4} B A •6 •3 •5 •4 •1 •2 A ∩ B ={2, 4} 20 Dr. Yehya Mesalam
  • 21. If M = {x | 3 < x < 9} and N = {y | 5 < y < 12}, Find M ∪ N 21 Example Solution M ∪ N = {z | 3 < z < 12}. Dr. Yehya Mesalam
  • 22. An experiment involves tossing a pair of dice, one blue and one black, and recording the numbers that come up. If x equals the outcome on the blue die and y the outcome on the black die, describe the sample space S (a) by listing the elements (x, y); (b) by using the rule method. 22 Example Solution (a) S = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6), (5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (5, 6), (6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (6, 6)}. Dr. Yehya Mesalam
  • 23. Possible outcomes for rolling a pair of dice 23 Solution (b) S = {(x, y) | 1 ≤ x, y ≤ 6}. Dr. Yehya Mesalam
  • 24. • For a two-stage experiment, m ways to accomplish the first stage n ways to accomplish the second stage then there are mn ways to accomplish the whole experiment. • For a k-stage experiment, number of ways equal to n1 n2 n3 … nk Example: Toss two coins. The total number of simple events is: 2  2 = 4 Counting Rules 24 Dr. Yehya Mesalam
  • 25. Examples Example: Toss three coins. The total number of simple events is: 2  2  2 = 8 Example: Two balls are drawn in order from a dish containing four candies. The total number of simple events is: 6  6 = 36 Example: Toss two dice. The total number of simple events is: 4  3 = 12 25 Dr. Yehya Mesalam
  • 26. A prospective car buyer can choose between a fixed and a variable interest rate and can also choose a payment period of 36 months, 48 months, or 60 months. How many total outcomes are possible? Example There are two outcomes (a fixed or a variable interest rate) for the first step and three outcomes (a payment period of 36 months, 48 months, or 60 months) for the second step. Hence, Total outcomes = 2 x 3 = 6 Solution 26 Dr. Yehya Mesalam
  • 27. A National Football League team will play 16 games during a regular season. Each game can result in one of three outcomes: a win, a loss, or a tie. The total possible outcomes for 16 games are calculated as follows: Example Total outcomes = 3·3·3·3·3·3·3·3·3·3·3·3 ·3·3·3·3 = 316 = 43,046,721 One of the 43,046,721 possible outcomes is all 16 plays. Solution 27 Dr. Yehya Mesalam
  • 28. 60 ) 1 ( 2 ) 1 )( 2 )( 3 )( 4 ( 5 )! 3 5 ( ! 5 5 3     P Permutations • n distinct objects, take r objects at a time and arrange them in order. The number of different ways you can take and arrange is 60 ) 3 )( 4 ( 5  . 1 ! 0 and ) 1 )( 2 )...( 2 )( 1 ( ! where )! ( !       n n n n r n n Pn r Example: How many 3-digit lock passwords can we make by using 3 different numbers among 1, 2, 3, 4 and 5? 28 Dr. Yehya Mesalam
  • 29. Example • How many ways to select a student committee of 3 members: chair, vice chair, and secretary out of 8 students? 336 ) 6 )( 7 ( 8 ) 1 )( 2 )( 3 )( 4 ( 5 ) 1 )( 2 )( 3 )( 4 )( 5 )( 6 )( 7 )( 8 ( )! 3 8 ( ! 8 8 3      P The order of the choice is important! ---- Permutation 29 Dr. Yehya Mesalam
  • 30. Permutations ofnobjects ofsamekinds • Permutations of n objects of which n1 are alike, n2 are alike, . . . , nr are alike is 60 ) ! 2 !* 3 /( ! 6  The order of the choice is . 1 ! 0 and ) 1 )( 2 )...( 2 )( 1 ( ! where ! !..... ! ! .. or ! !..... ! ! 2 1 2 1 2 1                n n n n n n n n n n n n n n n n r r r Example: How many different letter arrangements can be formed from the letters PEPPER? 30 Dr. Yehya Mesalam
  • 31. Permutations ofnobjects ofsamekinds 60 ) ! 2 !* 3 /( ! 6  The order of the choice is Example: How many different letter arrangements can be formed from the letters PEPPER? 31 Dr. Yehya Mesalam
  • 32. 32 How many different letter arrangements can be made from the letters in the word STATISTICS? Example Solution: Dr. Yehya Mesalam
  • 33. Combinations • n distinct objects, select r objects at a time without regard to the order. The number of different ways you can select is Example: Three members of a 5-person committee must be chosen to form a subcommittee. How many different subcommittees could be formed? )! ( ! ! r n r n Cn r   10 1 ) 2 ( ) 4 ( 5 1 ) 2 )( 1 )( 2 ( 3 1 ) 2 )( 3 )( 4 ( 5 )! 3 5 ( ! 3 ! 5 5 3      C The order of the choice is not important! 33 Dr. Yehya Mesalam
  • 34. Example • How many ways to select a student committee of 3 members out of 8 students? • (Don’t assign chair, vice chair and secretary). 56 ) 1 )( 2 ( 3 ) 6 )( 7 ( 8 )] 1 )( 2 )( 3 )( 4 ( 5 )][ 1 )( 2 ( 3 [ ) 1 )( 2 )( 3 )( 4 )( 5 )( 6 )( 7 ( 8 )! 3 8 ( ! 3 ! 8 8 3      C The order of the choice is NOT important! Combination 34 Dr. Yehya Mesalam Solution:
  • 35. An ice cream parlor has six flavors of ice cream. Ahmed wants to buy two flavors of ice cream. If he randomly selects two flavors , how many ways of his selection? Example n = total number of ice cream flavors = 6 r = # of ice cream flavors to be selected = 2 Thus, there are 15 ways to select two ice cream flavors out of six. 15 1 2 3 4 1 2 1 2 3 4 5 6 ! 4 ! 2 ! 6 )! 2 6 ( ! 2 ! 6 2 6                C Solution: 35
  • 36. Example Permutations of the First 4 letters 4p4=24 abcd abdc acbd acdb adbc adcb bacd badc bcad bcda bdac bdca cabd cadd cbad cbda cdab cdba dabc dacb dbac dbca dcab dcba How many ways can arrangement the first 4 letters of the alphabet taken many ways all at a time. (a, b, c, d) The # of ways = n! = 4! = 24 36 Dr. Yehya Mesalam
  • 37. The Probability of an Event • The probability of an event A measures “how often” we think A will occur. We write P(A). • Suppose that an experiment is performed n times. The relative frequency for an event A is Number of times A occurs f n n  events simple of number total A in events simple of number ) (   N n A P A n N N 37 Dr. Yehya Mesalam
  • 38. General Laws of Probability For any two events, A and B, the probability of their union, P(A B), is ) ( ) ( ) ( ) ( B A P B P A P B A P      A B 38 Dr. Yehya Mesalam
  • 39. Intersection of Events • Intersection of Events – If A and B are two events in a sample space S, then the intersection, A ∩ B, is the set of all outcomes in S that belong to both A and B A B AB S 39 Dr. Yehya Mesalam
  • 40. • A and B are Mutually Exclusive Events if they have no basic outcomes in common – i.e., the set A ∩ B is empty (A ∩ B =Ø ) A B S Mutually Exclusive Events 40 ‫الحادثين‬ ‫عن‬ ‫يقال‬ A ‫و‬ B ‫معا‬ ‫حدوثهما‬ ‫استحال‬ ‫إذا‬ ‫متنافيان‬ ‫أنهما‬ . Dr. Yehya Mesalam
  • 41. Laws of Probability For any two events, A and B, the probability of their union, P(A B), is ) ( ) ( ) ( B P A P B A P    A B The event A and B are mutually exclusive A and B are mutually exclusive 0 ) (   B A P    ) ( B A 41 Dr. Yehya Mesalam
  • 42. • A and B are Independent Events if their joint probability equals the product of their probabilities • If the occurrence (or non occurrence ) of one does not affect the probability of the occurrence A B S Independent Events 42 ‫الحادثين‬ ‫يعتبر‬ A ‫أو‬ B ‫عدم‬ ‫أو‬ ‫إحداهما‬ ‫ع‬ ‫وقو‬ ‫كان‬ ‫إذا‬ ‫مستقمين‬ ‫حادثين‬ ‫اآلخر‬ ‫ع‬ ‫وقو‬ ‫في‬ ‫يؤثر‬ ‫ال‬ ‫وقوعه‬ . A ∩ B P(A ∩ B) =P(A) .P(B) Dr. Yehya Mesalam
  • 43. Laws of Probability For any two events, A and B, the probability of their union, P(A B), is ) ( ). ( ) ( ) ( ) ( B P A P B P A P B A P     A B The event A and B are independent A and B independent events ) ( ). ( ) ( B P A P B A P   ) ( B A 43 Dr. Yehya Mesalam
  • 44. Probabilities for Complements • We know that for any event A: P(A AC) = 0 • Since either A or AC must occur, P(A AC) =1 • so that P(A AC) = P(A)+ P(AC) = 1 P(AC) = 1 – P(A) A AC 44 Dr. Yehya Mesalam
  • 45. Relation Between Events A B A ∩ B = Ø Mutually Exclusive Events P(A U B) =P(A) +P(B) P(A ∩ B) = 0 Dr. Yehya Mesalam 45
  • 46. Relation Between Events A B Independent Events P(A ∩ B) =P(A) .P(B) A ∩ B P(A U B) =P(A) +P(B)- P(A).P(B) Dr. Yehya Mesalam 46
  • 47. Relation Between Events A B General Events A ∩ B P(A U B) =P(A) +P(B)- P(A ∩ B) Dr. Yehya Mesalam 47
  • 48. Relation Between Events A B General Events A ∩ B A = 1+ 3 1 2 3 B = 2+ 3 Dr. Yehya Mesalam 48
  • 49. Relation Between Events A A ∩ B A = 1+ 3 1 3 Event of A P(A) = P(1+ 3) Dr. Yehya Mesalam 49
  • 50. Relation Between Events A A ∩ B A = 1+ 3 1 3 Event of A only A only = 1 Event of A P(A only )= P(1)= P(A) – P(A ∩ B) Dr. Yehya Mesalam 50
  • 51. Relation Between Events B A ∩ B B = 2+ 3 2 3 Event of B only B only = 2 Event of B P(B only )= P(2)= P(B) – P(A ∩ B) Dr. Yehya Mesalam 51
  • 52. Relation Between Events A B A ∩ B 1 2 3 Event of at least one event happened Means A or B or A and B together P(A U B) =P(A) +P(B)- P(A ∩ B) (A U B) = 1 +2 + 3 Dr. Yehya Mesalam 52
  • 53. Relation Between Events A B A ∩ B 1 2 3 Event of at Most one event happened Means A only B only or A and B Not occur together P(A ∩ B) / = 1- P(A ∩ B) (A ∩ B)/ = 1 +2 + 4 S 4 4 4 White Area White Area Dr. Yehya Mesalam 53
  • 54. Relation Between Events A ∩ B 3 Event of at Most one event happened Means A only B only or A and B Not occur together P(A ∩ B) / = 1- P(A ∩ B) (A ∩ B)/ = S - 3 S Dr. Yehya Mesalam 54
  • 55. Relation Between Events A ∩ B 3 Event of at Most one event happened Means A only B only or A and B Not occur together P(A ∩ B) / = 1- P(A ∩ B) (A ∩ B)/ = S - 3 S Dr. Yehya Mesalam 55 A B 1 2 4 3
  • 56. Relation Between Events A B A ∩ B A only = 1 1 2 3 B only = 2 Dr. Yehya Mesalam 56 Only Event A or Event B Means A only or B only is occur together P(A only U B only )= 1 + 2
  • 57. Relation Between Events A ∩ B 3 Event of only event A and B event happened Means A and B occur together = P(A ∩ B) (A ∩ B) = 3 S Dr. Yehya Mesalam 57 A B
  • 58. A Probability Table B A A B ) B P(A  ) B A P(  B) A P(  P(A) B) P(A  ) A P( ) B P( P(B) 1.0 P(S)  Probabilities and joint probabilities for two events A and B are summarized in this table: 58 Dr. Yehya Mesalam
  • 59. Conditional Probabilities The probability that A occurs, given that event B has occurred is called the conditional probability of A given B and is defined as 0 ) ( , ) ( ) ( ) | (    B P B P B A P B A P “given” 0 ) ( , ) ( ) ( ) | (    A P A P B A P A B P 59 Dr. Yehya Mesalam
  • 60. Defining Independence • We can redefine independence in terms of conditional probabilities: Two events A and B are independent if and only if P(A|B) = P(A) or P(B|A) = P(B) Otherwise, they are dependent. • Once you’ve decided whether or not two events are independent, you can use the following rule to calculate their intersection. 60 Dr. Yehya Mesalam
  • 61. Multiplicative Rule for Intersections • For any two events, A and B, the probability that both A and B occur is P(A B) = P(A) P(B given that A occurred) = P(A)P(B|A) • If the events A and B are independent, then the probability that both A and B occur is P(A B) = P(A) P(B) 61 Dr. Yehya Mesalam
  • 62. Example • Toss a fair coin twice. What is the probability of observing at least one head (event A)? Exactly one Head (event B)? H 1st Coin 2nd Coin Ei P(Ei) H T T H T HH HT TH TT 1/4 1/4 1/4 1/4 P(at least 1 head)= P(A) = P(E1) + P(E2) + P(E3) = 1/4 + 1/4 + 1/4 = 3/4 Tree Diagram P(exactly 1 head)=P(B) = P(E2) + P(E3) = 1/4 + 1/4 = 1/2 62 Dr. Yehya Mesalam
  • 63. Example • A bowl contains three balls, two reds, one blue. A child selects two balls at random. What is the Probability of observing exactly two reds? 1st M&M 2nd M&M Ei P(Ei) r1b r1r2 r2b r2r1 1/6 1/6 1/6 1/6 1/6 1/6 P(exactly two reds) = P(r1r2) + P(r2r1) = 1/6 +1/6 = 1/3 r1 b b r1 r1 b br1 br2 r2 r2 r2 r2 r1 b 63
  • 64. Example Suppose that there were 1000 students in a college, and that they could be classified as follows: Male (B) Female Colorblind (A) 40 2 Not Colorblind 470 488 A: Colorblind P(A) = 42/1000=.042 B: Male P(B) = 510/1000=.51 P(AB) = P(A) + P(B) – P(AB) = 42/1000 + 510/1000 - 40/1000 = 512/1000 = .512 Check: P(AB) = (40 + 2 + 470)/1000 =.512 Dr. Yehya Mesalam
  • 65. A Special Case Male Female Colorblind 40 2 Not Colorblind 470 488 When two events A and B are mutually exclusive, P(AB) = 0 and P(AB) = P(A) + P(B). A: male and colorblind P(A) = 40/1000 B: female and colorblind P(B) = 2/1000 P(AB) = P(A) + P(B) = 40/1000 + 2/1000 = 42/1000=.042 A and B are mutually exclusive, so that
  • 66. Example Male Female Colorblind 40 2 Not Colorblind 470 488 A: male P(A) = 510/1000=.51 B: female P(B) = 1- P(A) = 1- .51 =.49 A and B are complementary, so that Select a student at random from the college. Define: 66 Dr. Yehya Mesalam
  • 67. Example Male (A) Female Colorblind (B) 40 2 Not Colorblind 470 488 A: Male B: Colorblind Find P(A), P(A|B) Are A and B independent? P(A) = 510/1000=.51 Select a student at random from the college. Define: P(A|B) = P(AB)/P(B)=.040/.042=.95 P(B) = 42/1000=.042 P(AB) = 40/1000=.040 P(A|B) and P(A) are not equal. A, B are dependent 67
  • 68. Example • If P (A/B) =0.4 and P (B) =0.8 and P (A) =0.5 are the events A and B independent? Solution If A and B are independent, then But P (A/B) =0.4 and P (A) =0.5 then A and B not independent P(A) ) ( ) ( ) | (    B P B A P B A P 68 Dr. Yehya Mesalam
  • 69. Example: A: Red die show 1 B: Green die show 1 P(AB) = P(A) + P(B) – P(AB) = 6/36 + 6/36 – 1/36 = 11/36 P(A|B) = P(A and B)/P(B) =1/36/1/6=1/6=P(A) P(A) does not change, whether B happens or not… A and B are independent! A: B 69
  • 70. The Law of Total Probability P(A) = P(A  S1) + P(A  S2) + … + P(A  Sk) = P(S1)P(A|S1) + P(S2)P(A|S2) + … + P(Sk)P(A|Sk) Let S1 , S2 , S3 ,..., Sk be mutually exclusive and exhaustive events (that is, one and only one must happen). Then the probability of any event A can be written as 70 Dr. Yehya Mesalam
  • 71. The Law of Total Probability A A Sk A  S1 S2…. S1 Sk P(A) = P(A  S1) + P(A  S2) + … + P(A  Sk) = P(S1)P(A|S1) + P(S2)P(A|S2) + … + P(Sk)P(A|Sk) 71 Dr. Yehya Mesalam
  • 72. Bayes’ Rule Let S1 , S2 , S3 ,..., Sk be mutually exclusive and exhaustive events with prior probabilities P(S1), P(S2),…,P(Sk). If an event A occurs, the posterior probability of Si, given that A occurred is ,...k , i S A P S P S A P S P A S P i i i i i 2 1 for ) | ( ) ( ) | ( ) ( ) | (    ) | ( ) ( ) | ( ) ( ) ( ) ( ) | ( ) | ( ) ( ) ( ) ( ) ( ) | ( Proof i i i i i i i i i i i i S A P S P S A P S P A P AS P A S P S A P S P AS P S P AS P S A P        72 Dr. Yehya Mesalam
  • 73. Example • Urn A1 contains 7 black and 3 white balls. A2 contains 3 black and 7 white balls, and urn A3 contains 5 white and 5 black balls. A fair die is to be cast. If the die turns up 1, or 3, then a ball will be selected from A1. If the die turns up 2, 4 or 6, a ball will be selected from A2. Finally, a ball will be selected from A3 otherwise. a- Given that the ball selected is black, what is probability that it was chosen from A2? b- Given that the ball selected is white, what is probability that it not chosen from A1? 73 Dr. Yehya Mesalam
  • 74. Solution • First calculate the P(B) A1 A2 A3 P(W/A1)=0.3 P(W/A2)=0.7 P(W/A3)=0.5 P(B/A1)=0.7 P(B/A2)=0.3 P(B/A3)=0.5 P(A2)=3/6 P(B) = (2/6)*0.7 + 0.5*0.3 + (1/6)*0.5 = 0.466 Given that the ball selected is black, what is probability that it was chosen from A2? P(A2/B) = (0.5*0.3)/ 0.466 = 0.321 74 Dr. Yehya Mesalam
  • 75. • b- Given that the ball selected is white, what is probability that it not chosen from A1? P(W) = (2/6)*0.3 + 0.5*0.7 + (1/6)*0.5 = 0.534 Or P(W) = 1-P(B) =1 -0.466 = 0.534 • P(A1/w) = ((2/6)*0.3))/ 0.534 = 0.187 75 Solution Dr. Yehya Mesalam 812 . 0 187 . 0 1 ) ( 1 ) ( 1 / 1      W A P W A P
  • 76. Example One bag contains 4 white balls and 3 black balls, and a second bag contains 3 white balls and 5 black balls. One ball is drawn from the first bag and placed unseen in the second bag. What is the probability that a ball now drawn from the second bag is black? 76 Solution Let B1 represent a black ball from bag 1 W1 represent, a white ball from bag 1 B2 represent a black ball from bag 2. Dr. Yehya Mesalam
  • 78. Example 0.90 0.90 a b 0.95 0.80 0.90 0.95 The following circuit operates only if there is a path of functional devices from left to right. The probability that each device functions is shown on the graph. Assume that devices fail independently. What is the probability that the circuit operates Solution The probability that the circuit operates = = (1- 0.13) (1- 0.052)(0.8) = 0.797202 78
  • 79. Example 2 green and 4 red balls are in a box; Two of them are selected at random. A: First is green; B: Second is red. • Find P(AB). 79 Dr. Yehya Mesalam
  • 80. Method 1 • Choose 2 balls out of 6. Order is recorded. (Total number of ways, i.e. size of sample space S) The order of the choice is important! Permutation 30 ) 5 ( 6 ! 4 ! 6 )! 2 6 ( ! 6 6 2      P 4 4 1  C 2 2 1  C 2  4 = 8 ways to choose first green and second red ( mn Rule) • Event AB: First green, second red First green Second Red 30 8 # # ) (     S B A B A P 80 Dr. Yehya Mesalam
  • 81. Method 2 A: First is green; B: Second is red; AB: First green, second red P(A) P(B|A) P(A B) = P(A)P(B|A) P(A B) = (2/6)(4/5)=8/30 2/6 P(Second red | First green)=4/5 81 Dr. Yehya Mesalam
  • 82. Probability Rules & Relations of Events Complement Event Additive Rule Multiplicative Rule Conditional probability Mutually Exclusive Events Independent Events ) ( 1 ) ( A P A P c   0 ) (  B A P ) ( ) ( ) | ( B P B A P B A P   ) ( ) ( ) ( ) ( B A P B P A P B A P      ) | ( ) ( ) ( A B P A P B A P   ) ( ) ( ) ( B P A P B A P    ) ( ) ( ) ( B P A P B A P   ) ( ) | ( A P B A P  ) ( ) ( ) ( ) ( C P B P A P C B A P    82
  • 83. Key Concepts III. Counting Rules 1. mn Rule, extended mn Rule 2. Permutations: 3. Combinations: IV. Event Relations 1. Unions and intersections 2. Events a. Disjoint or mutually exclusive: b. Complementary: ) ( 1 ) ( A P A P c   0 ) (  B A P )! ( ! ! )! ( ! r n r n C r n n P n r n r     ) ( ) ( ) ( B P A P B A P    83 Dr. Yehya Mesalam
  • 84. Key Concepts 3. Conditional probability: 4. Independent events 5. Additive Rule of Probability: 6. Multiplicative Rule of Probability: ) ( ) ( ) ( B P A P B A P   ) ( ) | ( A P B A P  ) ( ) ( ) | ( B P B A P B A P   ) ( ) ( ) ( ) ( B A P B P A P B A P      ) | ( ) ( ) ( A B P A P B A P   ) ( ) ( ) ( ) ( C P B P A P C B A P    84 Dr. Yehya Mesalam
  • 86. Example One card is selected from an ordinary deck of playing cards. What is the probability of getting? 1- The event (A) the king of hearts is selected 2- The event (B) a king is selected 3- The event (C) a heart is selected 4- The event (D) a face card is selected 5- The event (E) not a face card is selected. 86
  • 87. 1- The event (A) the king of hearts is selected 1/52 2- The event (B) a king is selected 1/13 = 4/52 Solution 87 Dr. Yehya Mesalam
  • 88. 3- The event (C ) a heart is selected 1/4 = 13/52 Solution 4- The event (D)a face card is selected 3/13=12/52 88 Dr. Yehya Mesalam
  • 89. 5- The event (E) not a face card is selected (D ) 40/52=10/13 Solution - 89 Dr. Yehya Mesalam
  • 90. Event (B & C) King and heart 1/13 X 1/4 = 1/52 King heart King and heart (B∩C) 90 Dr. Yehya Mesalam
  • 91. Event (B or C) King or heart King heart King or heart (BUC) 16/52 = 4/52 + 13/52 - 1/52 91 Dr. Yehya Mesalam
  • 92. heart Solution Face 92 Event (C & D) heart and face card is selected heart and face (C∩D 3/52 = 3/13 X 1/4 Dr. Yehya Mesalam
  • 93. Spade or Face Card P (spade) + P (face card) – P (spade & face card) = 1/4 + 3/13 – 3/52 = 22/52 Spade Face Spade U Face
  • 94. Example One card is selected from an ordinary deck of playing cards. What is the probability of getting? (a) A queen? (b) A Jack? (c) Either a queen or a jack? (d) A queen or a red card? (e) A face card? 94
  • 95. Solution (a) P(Q)=4/52 (b) P(J)=4/52 (c)P(QUJ)=P(Q)+P(J)=(4/52)+(4/52)=8/52 (d) P(QUR)=P(Q)+ P(R) -P(Q )= 4/52+26/52 - 2/52 = 28/52 (e) P(face) = 12/52 95 Dr. Yehya Mesalam
  • 96. Example • A bowl contains three balls, one red, one blue and one green. A child takes two balls randomly one at a time. What is the probability that at least one is red? 1st 2nd Ei P(Ei) 1/6 1/6 1/6 1/6 1/6 1/6 P(at least 1 red) = P(E1) +P(E2) + P(E3) + P(E6) =4/6 = 2/3 RB RG BR BG m m m m m m m m m GB GR 96
  • 97. Example Simple Events Probabilities HHH HHT HTH HTT 1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8 P(Exactly 2 heads)= P(B) = P(HHT) + P(HTH) + P(THH) = 1/8 + 1/8 + 1/8 = 3/8 P(at least 2 heads)=P(A) = P(HHH)+P(HHT)+P(HTH)+P(THH) = 1/8 + 1/8 +1/8 + 1/8 = 1/2 THH THT TTH TTT A={HHH, HHT, HTH, THH} B={HHT,HTH,THH} • Toss a fair coin 3 times. What is the probability of observing at least two heads (event A)? Exactly two Heads (event B)? 97
  • 98. Example Simple Events HHH HHT HTH HTT C={HTT,THT,TTH,TTT} THH THT TTH TTT A={HHH,HHT,HTH,THH} B={HHT,HTH,THH} A: at least two heads; B: exactly two heads; C: at least two tails; D: exactly one tail. Questions: A and C mutually exclusive? B and D? D={HHT,HTH,THH} Mutually Exclusive Not Mutually Exclusive 98 Dr. Yehya Mesalam
  • 99. Example • Toss a fair coin twice. What is the probability of observing at least one head (Event A)? S A A P # # ) (  H 1st Coin 2nd Coin Ei P(Ei) H T T H T HH HT TH TT 1/4 1/4 1/4 1/4 P(at least 1 head) = P(A) = P(HH) + P(HT) + P(TH) = 1/4 + 1/4 + 1/4 = 3/4 A={HH, HT, TH} S={HH, HT, TH, TT} 99 Dr. Yehya Mesalam
  • 100. Example • A bowl contains three M&Ms®, two reds, one blue. A child selects two M&Ms at random. What is the probability that exactly two reds (Event A)? S A A P # # ) (  1st M&M 2nd M&M Ei P(Ei) r1b r1r2 r2b r2r1 1/6 1/6 1/6 1/6 1/6 1/6 P(A) = P(r1r2) + P(r2r1) = 1/6 +1/6 = 2/6=1/3 r1 b b r1 r1 b br1 br2 r2 r2 r2 r2 r1 b A={r1r2, r2r1} 10
  • 101. Tree Diagram Experiment: Select 2 balls from 20 balls : 14 Blue & 6 Red. Don’t Replace. Dependent! B R B R B R P(R) = 6/20 P(R|R) = 5/19 P(B|R) = 14/19 P(B) = 14/20 P(R|B) = 6/19 P(B|B) = 13/19 10 Dr. Yehya Mesalam
  • 102. Tree Diagram Experiment: Select 2 balls from 20 balls : 14 Blue & 6 Red. With Replacement. Independent! B R B R B R P(R) = 6/20 P(R|R) = 6/20 P(B|R) = 14/20 P(B) = 14/20 P(R|B) = 6/20 P(B|B) = 14/19 10 Dr. Yehya Mesalam
  • 103. Example A survey of job satisfaction of teachers was taken, giving the following results Satisfied Unsatisfied Total College 74 43 117 High School 224 171 395 Elementary 126 140 266 Total 424 354 778 Job Satisfaction L E V E L 10 Dr. Yehya Mesalam
  • 104. Example If all the cells are divided by the total number surveyed, 778, the resulting table is a table of empirically derived probabilities. Satisfied Unsatisfied Total College 0.095 0.055 0.150 High School 0.288 0.220 0.508 Elementary 0.162 0.180 0.342 Total 0.545 0.455 1.000 L E V E L Job Satisfaction 10 Dr. Yehya Mesalam
  • 105. Example For convenience, let C stand for the event that the teacher teaches college, S stand for the teacher being satisfied and so on. Let’s look at some probabilities and what they mean. is the proportion of teachers who are college teachers. P(C) 0.150  is the proportion of teachers who are satisfied with their job. P(S) 0.545  is the proportion of teachers who are college teachers and who are satisfied with their job. P(C S) 0.095  Satisfied Unsatisfied Total College 0.095 0.055 0.150 High School 0.288 0.220 0.508 Elementary 0.162 0.180 0.342 Total 0.545 0.455 1.000 L E V E L Job Satisfaction 10
  • 106. Example is the proportion of teachers who are college teachers given they are satisfied. Restated: This is the proportion of satisfied that are college teachers. P(C S) P(C | S) P(S) 0.095 0.175 0.545    is the proportion of teachers who are satisfied given they are college teachers. Restated: This is the proportion of college teachers that are satisfied. P(S C) P(S | C) P(C) P(C S) 0.095 P(C) 0.150 0.632     Satisfied Unsatisfied Total College 0.095 0.055 0.150 High School 0.288 0.220 0.508 Elementary 0.162 0.180 0.342 Total 0.545 0.455 1.000 L E V E L Job Satisfaction 106
  • 107. Example P(C S) 0.095 P(C) 0.150 and P(C| S) 0.175 P(S) 0.545     Satisfied Unsatisfied Total College 0.095 0.055 0.150 High School 0.288 0.220 0.508 Elementary 0.162 0.180 0.342 Total 0.545 0.455 1.000 L E V E L Job Satisfaction P(C|S)  P(C) so C and S are dependent events. Are C and S independent events? 107 Dr. Yehya Mesalam
  • 108. Example Satisfied Unsatisfied Total College 0.095 0.055 0.150 High School 0.288 0.220 0.508 Elementary 0.162 0.180 0.658 Total 0.545 0.455 1.000 L E V E L Job Satisfaction P(C) = 0.150, P(S) = 0.545 and P(CS) = 0.095, so P(CS) = P(C)+P(S) - P(CS) = 0.150 + 0.545 - 0.095 = 0.600 P(CS)? 108 Dr. Yehya Mesalam
  • 109. We know: P(F) = P(M) = P(H|F) = P(H|M) = Example From a previous example, we know that 49% of the population are female. Of the female patients, 8% are high risk for heart attack, while 12% of the male patients are high risk. A single person is selected at random and found to be high risk. What is the probability that it is a male? Define H: high risk F: female M: male 61 . ) 08 (. 49 . ) 12 (. 51 . ) 12 (. 51 . ) | ( ) ( ) | ( ) ( ) | ( ) ( ) | (      F H P F P M H P M P M H P M P H M P .12 .08 .51 .49 109
  • 110. Example Suppose a rare disease infects one out of every 1000 people in a population. And suppose that there is a good, but not perfect, test for this disease: if a person has the disease, the test comes back positive 99% of the time. On the other hand, the test also produces some false positives: 2% of uninfected people are also test positive. And someone just tested positive. What are his chances of having this disease? 110 Dr. Yehya Mesalam
  • 111. We know: P(A) = .001 P(Ac) =.999 P(B|A) = .99 P(B|Ac) =.02 Example Define A: has the disease B: test positive 0472 . 02 . 999 . 99 . 001 . 99 . 001 . ) | ( ) ( ) | ( ) ( ) | ( ) ( ) | (         c A B P c A P A B P A P A B P A P B A P We want to know P(A|B)=? 111
  • 112. Tom and Dick are going to take a driver's test at the nearest DMV office. Tom estimates that his chances to pass the test are 70% and Dick estimates his as 80%. Tom and Dick take their tests independently. Define D = {Dick passes the driving test} T = {Tom passes the driving test} T and D are independent. P (T) = 0.7, P (D) = 0.8 Example 112 Dr. Yehya Mesalam
  • 113. What is the probability that at most one of the two friends will pass the test? Example P(At most one person pass) = P(Dc  Tc) + P(Dc  T) + P(D  Tc) = (1 - 0.8) (1 – 0.7) + (0.7) (1 – 0.8) + (0.8) (1 – 0.7) = .44 P(At most one person pass) = 1-P(both pass) = 1- 0.8 x 0.7 = .44 113 Dr. Yehya Mesalam
  • 114. What is the probability that at least one of the two friends will pass the test? Example P(At least one person pass) = P(D  T) = 0.8 + 0.7 - 0.8 x 0.7 = .94 P(At least one person pass) = 1-P(neither passes) = 1- (1-0.8) x (1-0.7) = .94 114
  • 115. Suppose we know that only one of the two friends passed the test. What is the probability that it was Dick? Example P(D | exactly one person passed) = P(D  exactly one person passed) / P(exactly one person passed) = P(D  Tc) / (P(D  Tc) + P(Dc  T) ) = 0.8 x (1-0.7)/(0.8 x (1-0.7)+(1-.8) x 0.7) = .63 115
  • 116. 116