Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Introduction to Probability & Statistics
Code 104 ريض
CREDIT HOURS: 4 UNIT
Lecture 3.0 hours/week
Tutorial 1.0 hour/on every week
a. This course introduces the students to the concept of probability
and random variables
b. Also deals with the conditional probability
c. The course also looks into probability distribution of some discrete
and continuous variables ..
Learning Objectives:
Identify the role of probability in our life by learning the
principal and rules of probability, conditional probability,
independent events and Bayes Theorem.
Demonstrate understanding discrete and continuous
probability distributions
References:
H.Hsu, 2nd Edition “Probability, Random Variables, Random
Processes”, Schaum’s Outline Series, McGraw Hill, 2011
Statistics and probability
Dr Anies Ismaaeil Kinjo 2nd Edition
King Saud University
2
Starting From Week 2
Sunday
[10:00 – 12:00]-[1-2] (9-04-1435 h) – LEC. 3[ H]
Monday
1:00 – 2:00 (10-04-1435 h) – Tutorial 1 [H]
ASSESSMENTS
MidTerm 1 (15%)
MidTerm 2 (15%)
Internal Assessment(10%)
FINAL EXAM (60 %)
Question 1
Question 2
Question 3
Question 4
Question 5
3
9/4/1435 h
Sunday
Lecture 1
Jan 2009
4
Q:Define the following
1. Probability
Probability refers to the study of randomness
and uncertainty.
2. Random Variable
numerical measurements or observations that
have uncertain variability each time they are
repeated are called random variables
5
.3. Distribution
the term “distribution” refers to how
probability is spread out.
4. Random Process
any process whose possible results are
known but actual results cannot be predicted
with certainty in advance.
5. Experiment:
process by which an observation or
measurement is obtained (yield outcomes)
Jan 2009
6
.
6. Outcome :
each possible result for a random process
7. Sample Space:
Is the set of all possible outcomes of an experiment.
denoted by S,
8. Event :
Is any collection (subset) of outcomes contained in
the sample space S.
Jan 2009
7
Types of events
Q: Mention and define types
of events?
1. simple
An event is if it consists of exactly one
outcome
2. Compound
An event that consists of more than one
outcome.
3. Null event:
An event with no outcomes (= impossible
event, empty set).
Jan 2009
8
16/4/1435 h
Sunday
Lecture 2
Sample Space and Events
Jan 2009
9
Number of Elements in a Sample Space
n
Number of elements in = number of elements in
a sample space
a sample space in one
experiment
Where: n is a number of time the experiment is
repeated
Examples:
1. Toss a coin
A. Once
1
= 2 =2 elements
B. Twice
2
= 2 =4 elements
Jan 2009
10
C. Three times
.= 23
= 8 elements
2. Roll a fair die:
A. Once:
1
= 6 = 6 elements
B. Twice:
2
= 6 = 36 elements
Jan 2009
11
Sample Space and Events For Simple Events
.1
1.Roll a die Once
A six-sided die has this sample space
Number of elements in the sample space =
1
= 6 = 6 elements
Sample space:
S = {1, 2, 3, 4, 5, 6}
Simple events (or outcomes):
E1= {1} , E2 = {2} , E3 = {3}
E5 = {5}
E4 = {4}
E6 = {6}
12
2. Toss a coin once
Q: Show the sample space
Sample space: Number of elements in the sample
space =
1
= 2 = 2
Where:
S H , T
H = Head
T = Tail
Simple events (or outcomes):
E1( Head) = {H}
E2(Tail} = {T}
Jan 2009
13
02.
Sample Space and Events For Compound
Events
1. Roll a die
Q: Observe these events
A: odd numbers
A = {1, 3, 5}
B: observe an even number
B= {2, 4, 6}
C: observe a number greater than or
equal to 4
C= {4, 5, 6}
D: observe a number less than or equal to 4
D = {4, 3, 2,1}
Jan 2009
14
.
2. The roll of a Two dice
Q: Show the sample space when two
unbiased dice were rolled or (if one die is
rolled twice)
Number of elements in the sample space =
2
= 6 = 36 elements
.
Jan 2009
16
.
Examples that shows compound events of
rolling two dice:
Q: show the event of Sum of 6
A: = { (1,5),(5,1),(2,4),(4,2),(3,3)}
Q: show the event that shows similar faces
B= {(1,1),(2,2),(3,3),(4,4),(5,5),(6,6,)}
Jan 2009
17
3. Toss a coin twice
Q:Show the sample space?
The number of elements in the sample space
=
2
2 = 4
elements
S H , H ,, H , T , T , H , T , T
Show these events:
A: Observe the number of heads
A = { 0, 1, 2, }
B : Having exactly two head
B={(H,H)}
C: Having at least one head
C = {(H,H),(H,T),(T,H)}
Jan 2009
18
D: Observe the number of tails
. D = { 0, 1, 2, }
E: Having exactly two tail
E={(T,T)}
F: Having at least one tail
F = {(T,T),(H,T),(T,H)}
4. Toss a coin three times
Q: Show the sample space
The number of elements in the sample space
= 23 = 8 elements
S={(H,H,H),(H,H,T),(H,T,H),(T,H,H),(H,T,T),(T,H,T),(T,T,H),(T,T,T)}
Q: Observe the number of heads
S = { 0, 1, 2,3 }
Jan 2009
19
.Q: Observe
these events
A: number of Tails
A = { 0, 1, 2,3 }
B: Having at least one head
B={(T,H,T), (H,T,T),(T,T,H), (H,T,H),(T,H,H), (H,H,T),(H,H,H),}
C: Show the sample space that represents the
working state of a machine
C = { working, fail }
D: Show the sample space that represents the
number of calls arriving at a telephone exchange
during a specific time interval
D = { 0, 1, …}
Jan 2009
20
Exercise 1
1. Q:Define the following
Probability
Event
Distribution
2. Mention and define types of events?
3. Toss a coin twice
Q:Show the sample space?
Show these events:
A: Observe the number of heads
B : Having exactly two head
Jan 2009
21
1/5/1435 h
Sunday
Lecture 3
Jan 2009
22
More Definitions
1. union
Union of events A and B is the event consisting
of all outcomes that are either in A or in B or
in both events.
denoted by A U B and read “A or B”
2. intersection
intersection of A and B, is the event consisting
of all outcomes that are in both A and B.
denoted by A ∩ B and read “A and B”,
23
.
3. complement
Complements of event A is the event of all
outcomes in the sample space S that are
not contained in event A.
Denoted by A’
4. mutually exclusive or disjoint events
If two events A and B have no outcomes in
common they are said to be mutually
exclusive or disjoint events.
This means if one of the event occurs the
other cannot.
Jan 2009
24
Set Symbol Representation
25
Venn Diagram
26
1. Probability of Events
Q: What is the objective of probability?
The objective of probability is to assign to
each event, say E, a number P(E), called the
probability of E which will give a exact
measure of the chance that E will occur.
27
Define a Probability
A probability P is a rule which assigns a
number between 0 and 1 to each event and
satisfies these probability axioms:
1. 0 ≤ P(E) ≤ 1 for any event E
2. P(Ø ) = 0 , P(S) = 1,
3. If A1 , A2 , … is an infinite collection of mutually
exclusive events, then
P ( A1 A2 ...) P ( A1 ) P ( A2 ) ...
28
.
4. The probability of the complement of any event A
is given as
P( A ') 1 P( A)
Example:
If P(rain tomorrow) = 0.6 then
P(no rain tomorrow) = 0.4
Other notations for complement: Ac or Ā
29
General Probability Laws
1. Let A and B be two events defined in a sample space
S.
P(A B) P(A) P(B) P(A B)
2. If two events A and B are mutually exclusive, then
P(A B) 0
Thus
P(A B) P(A) P(B)
This can be expanded to consider more than two
mutually exclusive events.
30
Q: How can we calculate the
probability of an event
The probability of any event E,
P(E) = n/N
where n : number of times we observe the
event (frequency)
N : a very large number of trials
Jan 2009
31
.
Q1: In the experiment tossing a die
repeatedly, in the long run, what would we
expect P(E1) (probability of number 1
occurs) equal to?
P ( A) 1 =(1/6)
Exercise:
Q2: In a year calendar, what would we
expect, P(Em), date 30th occurs in a year
if it a leap year?
Jan 2009
32
8/5/1435
Sunday
Leture4
Jan 2009
33
Examples
Q:In an experiments of tossing a piece of fair coin once:
1. Show the sample space
S= {H,T}
2. Probability of having a head
P(H) = ½
3. Probability of having a tail
P(T) = ½
Jan 2009
34
.
4. Probability of head and tail =
The event head and tail = H T
( H and T) = {Ѳ}
P {Ѳ} = 0 mutually exclusive, events
6. Probability of head or tail
The event head or tail = HUT = S
P(HUT) = P(H)+ P(T) = ½+1/2 = 1
Jan 2009
35
Q:In an experiment of rolling a fair
die once show the probability of the
following events
1st the sample space is:
S = {1,2,3,4,5,6}
1. Probability of a number from 1-6 on the
upper face:
P(1)=p(2)=p(3)=p(4)=p(5)=p(6)=1/6
2. The probability of having the number 3
A1={3} (simple event)
P{A1} = P{3} = 1/6
Jan 2009
36
3. Event of having even numbers
A3 = {2,4,6}
Compound event
P(A3) = 3/6 = ½
4. Event of having odd numbers
A4 = {1,3,5}
Compound event
P(A4) = 3/6 = ½
5. Event of having a numbers greater than 4
A5 = {5,6}
P(A5 )=P(5,6)
= 2/6 = 1/3
2009
37
6. Event of having numbers greater
than 6
A6 = {Ф}
P(Ф) = 0
7. Event of having numbers divisible by 3
A7 = {3,6}
P(A7) = P(3,6)
= 2/6 = 1/3
8. Event of having numbers not divisible by 3
A8 = (1,2,4,5)
P(A8) = 4/6 = 2/3
Jan 2009
38
طريقة اخرى للحلOR
= Ac7
= 1- P(A7)
= 1-1/3 = 2/3
9. The event of having odd number and
divisible by 3
A9= (A4П A7)
A4= {1,3,5}
A7 = {3,6}
{A4ПA7} = {3}
P(A9) = P(3) = 1/6
Jan 2009
39
10. The event of having an odd
number or divisible by 3
A10 ={ A4UA7}
P(A10) = P(A4UA7) =P(A4)+P(A7) – P(A4A7)
Because A4 and A7 are not mutually exclusive
=3/6 + 2/6 – 1/6
= 4/6 = 2/3
11. The event of having even number and odd
number
A11 = {A3ПA4) = {Ф}
P(Ф) = 0
Jan 2009
40
12. The event of having odd number
or even number
A12 ={A3UA4} = {1,2,3,4,5,6}
=P(A3) + P(A4)- P(A3ПA4)
=½+½-0=1
i.e P(A12) = P(S) = 1
Jan 2009
41
9/5/1435 h
Monday
Lecture 5
Jan 2009
42
Q:In rolling a fair die twice find
the following probabilities
A1: The sum of the two numbers is 10 .1
First the sample space is
2
Number of elements in the sample spa = 6
= 36 elements
Jan 2009
43
أمثلة
6
5
4
3
2
(1,
)6
)(1,5
)(1’4
)(1’3
((1,2
)(1,1
(2,
)6
)(2,5
)(2,4
)( 2,3
)(2,2
)(2,1
(3,
)6
)(3,5
)(3,4
)(3,3
)(3,2
)(3,1
3
(4,
)6
)(4,5
)(4,4
)(4,3
)(4,2
)(4,1
4
(5,
)6
)(5,5
)(5,4
)(5,3
)(5,2
)(5,1
5
(6,
)6
)(6,5
)(6,4
)(6,3
)(6,2
)(6,1
6
نقطة36.فراغ العينة يتألف من
1
الوجه
1
الثاني الوجه
األول
2
A1 = {(4,6),(6,4),(5,5)}
P(A1) = 3/36 = 1/12
2. A2: having sum of two numbers that is
greater than 10
A2 = {(5,6),(6,5),(6,6)}
P(A2) = 3/36 = 1/12
3. A3: Having two numbers of sum = 7
A3 = {(1,6),(6,1),(2,5),(5,2),(3,4),(4,3)}
P(A3) = 6/36 = 1/6
4. A4:Having 1 in the first roll
Jan 2009
45
A4 = {(1,1),(1,2),(1,3),(1,4),(1,5),(1,6)}
P(A4) = 6/36 = 1/6
5. A5: Having a sum less than 2
A5 = {Ф}
P(A5) = P{Ф} = 0
6. A6: The difference between the two numbers is
equal to the absolute value
A6 = {(1,2),(2,1),(2,3),(3,2),(3,4),(4,3),(4,5),(5,4),(5,6),(6,5)}
P(A6) = 10/36
7. A7: Having equal numbers
A7 = {(1,1),(2,2),(3,3(,(4,4),(5,5),(6,6)}
P(A7) = 6/36 = 1/6
Jan 2009
46
8.
A8 : Having multiplication that equal
at most 6
A8 ={(1,1),(1,2),(1,3),(1,4),(1,5),(1,6)
(2,1),(2,2),(2,3),(3,1),(3,2)(4,1),(5,1),(6,1)}
P(A8) = 14/36= 7/18
Jan 2009
47
Q:In an experiment of tossing a
piece of fair coin twice:
Find the following probabilities:
1st we have to define the sample space
2
No. of elements = 2 = 4 elements
S = {(H,H),(H,T),(T,H),(T,T)}
The probability of each event = ¼
1. A1: Having similar faces
AI = {(H,H),(T,T)}
P(A1) = 2/4 = ½
Jan 2009
48
2. A2: Having H once
A2 = {(H,T),(T,H)}
P(A2) = 2/4 = ½
3. A3: Having H at least once
A3 = {(H,T),(T,H),(H,H)}
P(A3) = ¾
4. A4: Having H at most once
A4 = {(H,T),(T,H),(T,T)}
P(A4) = ¾
5. A5: Having H twice
Jan 2009
49
A5= {(H,H)}
P(A5) = ¼
6. A6: Having no H
A6 = {(T,T)}
P(A6) = ¼
7. A7: Having H three times
A7: {(H,H,H)}
A7 = {Ф}
P(A7) = 0
Jan 2009
50
Exercise 2
In an experiment of tossing a coin three times
find the following probabilities:
1. A1: Having H three times
2. A2: Having no head
3. A3: Having at least one tail
4. A4: Having at most one tail
5. A5: Having two head and one tail
6. A6: Having tail in the firs two tosses
Jan 2009
51
16/5/1435 h
Monday
Lecture 6
Conditional Probability
Jan 2009
52
Q: Define the Conditional Probability
It is a probability of a cretin event
given that other event is already
occurred and is denoted as
P ( A | B) or P ( A / B )
Example:
Give a general format for the conditional probability of A,
given that B has already occurred, And is given by
1.
P( A B)
P( A | B)
P( B)
With the condition that P(B) > 0
53
.
Likewise,
P( A B)
P( B | A)
P( A)
, P(A) > 0
Jan 2009
54
Q: Draw a diagram then write a formula for the
probability of having lung cancer(L) given that the
person smokes(S)
n( L S )
p( L S )
n( S )
people who smoke and have
lung cancer.
People with lung cancer
p( L S )
People who smoke
n( L S )
n( S )
Example 3
A local library displays three types of books entitled “Science” (S),
“Arts” (A), and “Novels” (N). Reading habits of randomly selected
reader with respect to these types of books are
Read regularly S
A
N
S∩A S∩N A∩N S∩A∩N
Probability
0.14 0.23 0.37 0.08 0.09 0.13 0.05
Find the following probabilities and interpret
1.
P( S | A )
2.
P( S | A U N )
3.
P( S | reads at least one )
4.
P( S U A | N)
56
Solution
S
0.02
0.03
A
0.07
0.05
0.04
0.20
0.51
0.08
N
P (S | A) =
P (S | A U N) =
P (S| reads at least one) = P(S | S U A U N )
P(S U A | N) =
57
.
1. P( S | A ) = P(SnA) = 0.8
P(A) 0.23
------------------------------------------------------2. P (S | A U N) =P((S n( A U N))
p(A U N)
= 0.12
0.47
Jan 2009
58
.3. P (S| reads at least one) = P(S | S U A U N )
= P(Sn(SUAUN)
P(S U A U N)
=
0.12
0.49
---------------------------------------------------------4. P(S U A | N) = P((S U A) n N)
P(N)
= 0.17
0.37
Jan 2009
59
30/6/1435
Lecture 7
Jan 2009
60
1. Q: Given the following Table find the
following probabilities?
1. P(D|P)
61
2. P(P|D)
3. P(P|2.67
2.00
2.00
2.67
2.00
2.00
2.67
1.67
6.67
6.67
c
4.33D )
62
c
4. P(P |D)
63
Independent Events
Two events A and B are independent if
P( A | B) P( A)
Example:
- Roll a fair die, consider
P(A) = 1/2
- Event A = { 2,4,6}
- Event B = { 4,5, 6}
- Are events A and B independent?
64
.
P(A|B) = p(AnB)/ P(B)
(AnB) = {4,6}
P(AnB)= 2/6
P(B) = 3/6
P(A|B) = 2/6
= 2/3 they are dependent
3/6
Jan 2009
65
Examples
1. A fair die is rolled once and we have these
events:
A1: Having a number 2
A2: Having a number less than 2
A3: Having a number less than 5
B: Having an even number
Find these probabilities
Jan 2009
66
1.
P(A1|B)
A1 ={2},
P(A1|B) = P(A1B)
P(B)
P(A1) = 1/6
B={2,4,6}, P(B) = 3/6
(A1B) = {2}, P(A1B ) = 1/6
P(A1|B) = 1/6
3/6
2.
P(A2|B)
p(A2B) = P(A2|B)
P(B)
A2={1,2,3}
B= {2,4,6} , P(B)=3/6
A2B={2} , P(A2B) = 1/6
P(A2|B) = 1/6
3/6
= 1/3
3. P(A3|B)
P(A3B) = P(A3|B)
P(B)
A3={1,2,3,4}
B={2,4,6}, P(B)= 3/6
A3B={2,4}, P(A3B)=2/6
P(A3|B) = 2/6
3/6
=2/3
.
Lecture 8
Jan 2009
70
From Conditional Probability
We Have:
Q: A piece of coin rolled
three times, if we have a
head in a first toss, what is
the probability that the
other two faces are heads
.
Jan 2009
72
Examples
Examples
1. A fair die is rolled once and we have these
events:
A1: Having a number 2
A2: Having a number less than 2
A3: Having a number less than 5
B: Having an even number
Find these probabilities
Jan 2009
74
1.
P(A1|B)
A1 ={2},
P(A1|B) = P(A1B)
P(B)
P(A1) = 1/6
B={2,4,6}, P(B) = 3/6
(A1B) = {2}, P(A1B ) = 1/6
P(A1|B) = 1/6
3/6
2.
P(A2|B)
p(A2B) = P(A2|B)
P(B)
A2={1,2,3}
B= {2,4,6} , P(B)=3/6
A2B={2} , P(A2B) = 1/6
P(A2|B) = 1/6
3/6
= 1/3
3. P(A3|B)
P(A3B) = P(A3|B)
P(B)
A3={1,2,3,4}
B={2,4,6}, P(B)= 3/6
A3B={2,4}, P(A3B)=2/6
P(A3|B) = 2/6
3/6
=2/3
7/6/1435 h
Lecture 9
Jan 2009
78
Q: Write the Multiplicative Law of
Probability and Independence
For two events A and B
P( A B) P( A | B). P( B)
Definition: Events A and B are independent if and only if
P( A B) P( A). P( B)
If events A1, .., Ak are independent then,
P( A1 A2 ... Ak ) P( A1 ) P( A2 ) P( Ak )
79
The Law of Total Probability
Suppose B1, B2 ,…, Bn are mutually exclusive and
exhaustive in S, then for any event A
n
n
i 1
i 1
P( A) P( A Bi ) P( A | Bi ) P ( Bi )
S
A
A∩ B1
B1
A∩ B2 B1
B2
A∩ B3
A∩ B4
B4
B3
80
Bayes’ Theorem
Suppose B1, B2,…, Bn are mutually exclusive
and exhaustive (whose union is S). Let A be
an event such that P(A) > 0. Then for any
event Bj , j =1, 2, …, n,
P( A Bk )
P( Bk | A)
P( A)
P( A | Bk ) P ( Bk )
n
P( A | B ) P( B )
i
i 1
81
i
Example 4.
A store stocks light bulbs from three suppliers. Suppliers A, B,
and C supply 10%, 20%, and 70% of the bulbs respectively. It
has been determined that company A’s bulbs are 1% defective
while company B’s are 3% defective and company C’s are 4%
defective. If a bulb is selected at random and found to be
defective, what is the probability that it came from supplier B?
Solution
Let D = defective
P B | D
P B P D | B
P A P D | A P B P D | B P C P D | C
0.2 0.03
0.1 0.01 0.2 0.03 0.7 0.04
0.1714
82
Example 10. A particular city has three airports. Airport A
handles 50% of all airline traffic, while airports B and C handle
30% and 20%, respectively. The rates of losing a baggage in
airport A, C and C are 0.3, 0.15 and 0.4 respectively. If a
passenger arrives in the city and losses a baggage, what is the
probability that the passenger arrives at airport A?
Solution
Let L = event of losing a baggage and A = event arriving at
Airport A
P( A) P( L | A)
P ( A | L)
P( A) P( L | A) P( B) P( L | B) P(C ) P( L | C )
(0.5)(0.3)
(0.5)(0.3) (0.3)(0.15) (0.2)(0.14)
83
0.673
Example 12:
In a certain assembly plant, three machines, B1, B2, B3, make 30%,
45% and 25%, respectively, of the products. It is known from past
experience that 2%,3% and 2% of the products made by each machine,
respectively, are defective. Now, suppose that a finished product is
randomly selected. What is the probability that it is defective?
Solution:
P(D) P(B1 ) P(D | B1 ) P(B2 ) P(D | B2 ) P(B3 ) P(D | B3 )
(0.3)(0.02) (0.45)(0.03) (0.25)(0.02)
0.006 0.0135 0.005 0.0245
If a product was chosen randomly and found to be defective,
what is the probability that it was made by machine B3?
P(B3 | D) [ P( B3 ) P( D | B3 )] / P( D)
[(0.25)(0.02)] / 0.0245 0.005 / 0.0245 10 / 49
84