0% found this document useful (0 votes)
6 views

Lecture 3 - Statistics

The document discusses random variables, probability distributions, and mathematical expectation. It provides an outline of lecture topics including random variables, discrete and continuous probability distributions, and sampling distributions. Examples are given of defining discrete and continuous random variables and their associated probability distributions.

Uploaded by

01278326701m
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Lecture 3 - Statistics

The document discusses random variables, probability distributions, and mathematical expectation. It provides an outline of lecture topics including random variables, discrete and continuous probability distributions, and sampling distributions. Examples are given of defining discrete and continuous random variables and their associated probability distributions.

Uploaded by

01278326701m
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Applied 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

 Discrete random variable


 Obtained by counting (1, 2, 3, etc.)
 Usually a finite number of different values
 e.g.: Toss a coin five times; count the number of
tails (0, 1, 2, 3, 4, or 5 times)
 Examples of discrete RV
 the number of children in a family
 the number of patients in a doctor's clinic
 the number of defective light bulbs in a box of ten

Lecture 3 – Page 5

Continuous Random Variable

 Continuous random variable


 A continuous random variable is one which takes
an infinite number of possible values
 Continuous random variables are usually
measurements
 Examples of continuous RV
 The wind speed
 The yield stress of steel bars
 The water level in a lake
 The concentration of a chemical in river water
Lecture 3 – Page 6
Discrete Probability
Distribution Example
Event: Toss two coins Count the number of tails

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

Discrete Probability Distribution


 List of all possible [Xj , P(Xj) ] pairs
 Xj = value of random variable
 P(Xj) = probability associated with value

 The expression P(X = Xj) considered as a function


of X is called the probability mass function of the
random variable X

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

Previous coins Example:


X f(X)
0  f ( X )  1.0 0 0.25
1 0.5
2 0.25
Lecture 3 – Page 9

Discrete Probability Distribution


 F(X):The Cumulative Probability Function
 The expression P(X  Xj) considered as a function of
X is called the distribution function (Cumulative
probability function) of the random variable X which
is denoted as F(X)
F(X )   f (X )
t X
Previous coins Example:
X f(X) F(X)
F ( X )   f ( X )  1.0 0 0.25 0.25
t X 1 0.5 0.75
2 0.25 1.0

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

Probability Distribution of a Discrete


Random Variable
Distribution function Probability mass function
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

Khaled H. Hamed
Example 1

Check if f (x) is a probability function

x 1 2 3

f (x ) 0.1 0.5 0.4

F (x ) 0.1 0.6 1.0

1. ƒ(x) ≥ 0 for all x


2. Σ ƒ(x) = 1
It is a probability function

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/40 2/40 9/40 28/40

F(x) 1/40 3/40 12/40 40/40

1.ƒ(x) ≥ 0 for all x


2.Σ ƒ(x) = 1
It is a probability function
Lecture 3 – Page 14
Example 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/2 1/3 1/4

F (x) 1 1.5 …. …

Σ f (x) > 1  it is not a probability function


Lecture 3 – Page 15

Example 4

f (x) = 0.5( x-1)2 x = 0,1, 2


Check if f (x) is a probability function
Solution x 0 1 2

f (x) 0.5 0 0.5

F(x) 0.5 0.5 1.0


1.ƒ(x) ≥ 0 for all x
2.Σ f (x) = 1
it is a probability function
Lecture 3 – Page 16
Example 5

f (x) = 0.25x -1 x = 0,4, 8


Check if f (x) is a probability function

Solution
x 0 4 8

f (x) -1

F(x)

f (0) = - 1 it is not a probability function

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

 The cumulative probability function or the


Distribution function F(X) is given by

Therefore d
X
f (X ) 
F(X )   f ( X ) dX

dX
F(X )

Lecture 3 – Page 19

Probability Distribution of a
Continuous Random Variable

Probability density function


(pdf)

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

 0.5  (4  2)  (2  0.5)   1


f (x) is a probability density function
Lecture 3 – Page 21

Example 7

If f ( x)  kx3 0  x 1
0 elsewhere

is a probability density function . Find k

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

 The expected value (or expectation value,


or mathematical expectation, or mean, or
first moment) of a random variable is the
integral of the random variable with respect to
its probability distribution

 For discrete random variables, the integral is


replaced by a summation

Lecture 3 – Page 24
(Discrete Variables)

 Expected value (the mean)

  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

 (0) (0.25)  (1) (0.5)  (2) (0.25) 1


Lecture 3 – Page 25

(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

  0  1 .25  1  1 .5   2  1 .25  .5


2 2 2

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
XY, 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

P(Xi) Hydrologic condition Annual flow


0.2 Flooding 100 Bm3

0.5 Normal 80 Bm3

0.3 Drought 40 Bm3

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

 6  t / 4  t  t   6 (4  8  4)  (1/ 4  1  1)   6 1/ 4  1.5


4 3 2 2

2 2
E (X 2 )   6 t 2 (t  1) (2  t ) dt  6  (t 4  3t 3  2t 2 )dt
1 1

 6  t / 5  3t / 4  2t / 3  6 ( 32 / 5  12  16 / 3)  ( 1/ 5  3 / 4  2 / 3)


5 4 3 2

 6  (23 / 60)  2.3

 2 (X )  E (X 2 )  [E (X )]2  2.3 1.52  0.05

Lecture 3 – Page 30
Lecture 3 – Page 31

You might also like