Lecture 3 - Statistics
Lecture 3 - Statistics
Lecture (3)
Random Variables, Probability Distributions and
Mathematical Expectation
Presented by:
Dr. Hany Gomaa Ahmed Radwan
Associate Professor- Irrigation and Hydraulics Dept.
Faculty of Engineering- Cairo University
Lecture 3– Page 1
Course Outline
Chapter 1: Introduction
Chapter 2: Organizing and Graphing Data
Chapter 3: Basic Probability Concepts
Chapter 4: Random Variables, Probability Distributions
Chapter 5: Common Discrete Probability Distributions
Chapter 6: Common Continuous Probability Distributions
Chapter 7: Sampling Distributions
Chapter 8: Confidence Intervals
Chapter 9: Fundamentals of Hypothesis: Part I
Chapter 10: Fundamentals of Hypothesis: Part II
Chapter 11: Linear Regression Analysis
Chapter 12: Linear Regression and Correlation Analysis Lecture 3 – Page 2
Course Outline
Chapter 1: Introduction
Chapter 2: Organizing and Graphing Data
Chapter 3: Basic Probability Concepts
Chapter 4: Random Variables, Probability Distributions
Chapter 5: Common Discrete Probability Distributions
Chapter 6: Common Continuous Probability Distributions
Chapter 7: Sampling Distributions
Chapter 8: Confidence Intervals
Chapter 9: Fundamentals of Hypothesis: Part I
Chapter 10: Fundamentals of Hypothesis: Part II
Chapter 11: Linear Regression Analysis
Chapter 12: Linear Regression and Correlation Analysis Lecture 3 – Page 3
Random Variable
Random Variable
Outcomes of an experiment expressed numerically
e.g.: Toss a die twice; count the number of times
the number 4 appears (0, 1 or 2 times)
Lecture 3 – Page 4
Discrete Random Variable
Lecture 3 – Page 5
Probability Distribution
Values Probability
T 0 1/4 = 0.25
1 2/4 = 0.50
T 2 1/4 = 0.25
T T
Lecture 3 – Page 7
0 P X j 1 P X 1
j
Lecture 3 – Page 8
Discrete Probability Distribution
f (X) is an appropriate probability density
function if the following two conditions are
satisfied:-
0 f ( X ) 1.0 F ( x) f ( X ) 1.0
all X
Lecture 3 – Page 10
Discrete Probability Distribution
Example:
Cumulative probabilities
Probability mass function of X (Distribution function of X)
Xj f (X ) = P (X=X j ) Xj F (X ) = P (X X j )
0 0.05 0 0.05
1 0.15 1 0.2
2 0.329 2 0.529
3 0.133 3 0.662
4 0.127 4 0.789
5 0.111 5 0.9
6 0.1 6 1
0 f ( X ) 1.0 F ( X ) f ( X ) 1.0
t X
Lecture 3 – Page 11
Khaled H. Hamed
Example 1
x 1 2 3
Lecture 3 – Page 13
Example 2
If f(x)= (x3 +1)/ 40 for x = 0, 1, 2, 3
Check if f(x) is a probability function
Solution
Check the two conditions
x 0 1 2 3
f (x) =1/x x = 1, 2, 3, 4
Check if f(x) is a probability function
Solution
x 1 2 3 4
F (x) 1 1.5 …. …
Example 4
Solution
x 0 4 8
f (x) -1
F(x)
Lecture 3 – Page 17
Probability Distribution of a
Continuous Random Variable
A continuous random variable is one which takes an
infinite number of possible values. Continuous
random variables are usually measurements.
If the random variable X is of the continuous type, f
(X) is a continuous function and is called probability
density function (pdf)
b
P ( a X b) f ( X ) dX
a
A function can be a pdf under two conditions
f (X ) 0 for all values of X and f (X ) dX
1.0
Lecture 3 – Page 18
Probability Distribution of a
Continuous Random Variable
Therefore d
X
f (X )
F(X ) f ( X ) dX
dX
F(X )
Lecture 3 – Page 19
Probability Distribution of a
Continuous Random Variable
Distribution function
a b x
Lecture 3 – Page 20
Example 6
f (x) = x 0< x<1
2–x 1≤x< 2
0 elsewhere
Check if f (x) is a probability density function or not
Solution
x 0 1 2 >2
f (x) 0 1 0 0
1 2
1 2
x2 x2
f ( x ) dx 0 x dx 1 (2 x ) dx
2
2x
2 1
0
Example 7
If f ( x) kx3 0 x 1
0 elsewhere
Solution
k x 1
3
1
1
k x4 k
0
4 1
3
k x 4
0
k 4
Lecture 3 – Page 22
Example 8
The water level of a certain reservoir ( in meters ) can be described as a
random variable X with probability density function ( continuous ):
f ( X ) = c ( X – 1 ) ( 2 – X ) if 1 X ≤ 2
= 0 elsewhere.
Find the value of the constant c and determine the distribution function of the
random variable X.
Solution 2
c (X 1) (2 X ) dX 1.0
1
1
c 1.0
6
c = 6.
The distribution function F(X) is found by computing P ( X ≤ x )
F (X) = 0 for X 1
X
F ( X ) 6 ( X 1) (2 X ) dX 2 X 3 9 X 2 12 X 5 for 1 X 2
1
1.0 for X 2.
Lecture 3 – Page 23
Mathematical Expectation
Lecture 3 – Page 24
(Discrete Variables)
E X X jP X j
j
e.g.: Toss 2 coins, count the number of tails,
compute expected value X f(X)
0 0.25
X j P( X j )
1 0.5
2 0.25
j
(Discrete Variables)
(continued)
Variance
2 E X X j P X j
2 2
e.g. Toss two coins, count number of tails, compute
variance
X f(X)
0 0.25
2 X j P X j
2 1 0.5
2 0.25
Lecture 3 – Page 26
(Continuous Variables)
Mean
E ( X ) X f ( X ) dX
Variance
2 E [ ( X ) 2 ] ( X ) 2 f ( X ) dX
Lecture 3 – Page 27
Properties of Mathematical
Expectation
The expected value of a constant is equal to
the constant itself E(C) = C
If X and Y are random variables such that
XY, then E(X) E(Y)
The expected value operator (or expectation
operator) E is linear
E(X+C) = E(X) + C
E(X + Y) = E(X) + E(Y)
E(aX) = a E(X)
2 2
Prove that the variance of X = E(X ) - [E(X)]
Lecture 3 – Page 28
Example 9
Compute the expected flow rate and the variance
Solution
E ( X ) X (100)(0.2) (80)(0.5) (40)(0.3) 72 Bm3
X2 (100 72)2 (0.2) (80 72)2 (0.5) (40 72)2 (0.3) 496
Or
E [X 2 ] X j
2
P (X j ) 1002 (0.2) 802 (0.5) 402 (0.3) 5, 680
X2 E [X 2 ] E [X ] 5, 680 722 496
2
Lecture 3 – Page 29
Example 10
The water level of a certain reservoir ( in meters ) has
f ( X ) = 6 ( X – 1 ) ( 2 – X ), 1 X ≤ 2
Find the expected value of the random variable X and its variance.
Solution
2 2
E (X ) 6 t (t 1) (2 t ) dt 6 (t 3 3t 2 2t )dt
1 1
2 2
E (X 2 ) 6 t 2 (t 1) (2 t ) dt 6 (t 4 3t 3 2t 2 )dt
1 1
Lecture 3 – Page 30
Lecture 3 – Page 31