Discrete Mathematics and Its Application - Chapter 5
Discrete Mathematics and Its Application - Chapter 5
• Historic
• Introduction (5.1)
• Discrete Theory (5.2)
• Expected Value &
Variance (5.3)
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2011
2
Historic
• The theory of probability was first developed
more than three hundred years ago by Blaise
Pascal for gambling purposes
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
3
Historic (cont.)
• Finite probability
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
6 Introduction to Discrete Probability (5.1) (cont.)
– Definition 1:
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
7 Introduction to Discrete Probability (5.1) (cont.)
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
8 Introduction to Discrete Probability (5.1) (cont.)
– Theorem 2:
– Definition 2:
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
16
Probability Theory (5.2) (cont.)
– Example:
Suppose that a die is biased so that 3
appears twice as often as each other number
but that the other 5 outcomes are equally
likely. What is the probability that an odd
number appears when we roll this die?
Solution: We want to find the probability of
the event E = {1, 3, 5}
p(1) = p(2) = p(4) = p(5) = p(6) = 1/ 7
p(3) = 2/ 7
It follows that:
p(E) = p(1) + p(3) + p(5) = 1/ 7 + 2/ 7 + 1/ 7
= 4/ 7
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
17
Probability Theory (5.2) (cont.)
• Conditional probability
– Definition 3:
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
18
Probability Theory (5.2) (cont.)
Solution:
E = event that a bit string of length 4 contains at least 2
consecutive 0s.
F = event that the first bit of a bit string of length 4 is a 0.
The probability that a bit string of length 4 has at least 2
consecutive 0s, given that its first bit is equal 0, equals
p( E F )
p( E | F ) .
© by Kenneth H. Rosen, Discrete Mathematics & itspApplications,
( F ) Seventh Edition, Mc Graw-Hill, 2011
19
Probability Theory (5.2) (cont.)
Solution (cont.):
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
20
Probability Theory (5.2) (cont.)
• Random variables
– They are numerical values associated with
the outcome of an experiment
– Definition 5:
A random variable is a function from the
sample space of an experiment to the set of
real numbers. That is, a random variable
assigns a real number to each possible
outcome.
Remark: Note that a random variable is a function. It
is not a variable, and it is not random!
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
21
Probability Theory (5.2) (cont.)
X(HHH) = 3,
X(HHT) = X(HTH) = X(THH) =2,
X(TTH) = X(THT) = X(HTT) = 1,
X(TTT) = 0.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
22
Expected Value & Variance (5.3)
• Introduction
• Expected values
– Definition 1:
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
24
Expected Value & Variance (5.3) (cont.)
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
25
Expected Value & Variance (5.3) (cont.)
– Theorem 1:
then E ( X ) p X r r .
r X ( S )
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
26
Expected Value & Variance (5.3) (cont.)
Solution:
Let X be the random variable equal to the
sum of the numbers that appear when a pair
of dice is rolled.
We have 36 outcomes for this experiment.
The range of X is {2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12}.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
27
Expected Value & Variance (5.3) (cont.)
Solution (cont.):
p(X = 2) = p(X = 12) = 1/36,
p(X = 3) = p(X = 11) = 2/36 = 1/18,
p(X = 4) = p(X = 10) = 3/36 = 1/12,
p(X = 5) = p(X = 9) = 4/36 = 1/9,
p(X = 6) = p(X = 8) = 5/36,
p(X = 7) = 6/36 = 1/6.
1 1 1 1 5 1
E( X ) 2* 3* * 4 * 5 * 6 * 7 *
36 18 12 9 36 6
5 1 1 1 1
8* 9 * 10 * 11* 12 *
36 9 12 18 36
7.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
28
Expected Value & Variance (5.3) (cont.)
• Linearity of expectations
– Theorem 3:
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
29
Expected Value & Variance (5.3) (cont.)
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
30
Expected Value & Variance (5.3) (cont.)
– Definition 4:
V ( X ) ( X ( s ) E ( X ))2 p( s )
sS
X ( s )2 p( s ) 2 E ( X ) X ( s ) p( s ) E ( X )2 p( s )
sS sS sS
E ( X 2 ) 2 E ( X ) E ( X ) E ( X )2
E ( X 2 ) E ( X )2
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Seventh Edition, Mc Graw-Hill, 2011
Dr. Djamel CSE 504 Discrete Structures & Foundations of
33
Expected Value & Variance (5.3) (cont.)