Chapter 5
Chapter 5
Chapter 5
Example: Flip a coin three times, let X be the number of heads in three tosses.
S Rx
X(S)
HHH 3
HHT 2
HTH 2
HTT 1
THH 2
THT 1
TTH 1
TTT 0
X = {0, 1, 2, 3}
3
Random variable
Notice that:
each possible outcome is assigned a single numeric value,
all outcomes are assigned numeric values, and
4
Types of Random Variables
• Depending upon the numerical values it can assume, a random variable can
be classified into two major divisions.
Discrete Random Variable and
I .P ( xi ) 0 foralli
n
II . P ( xi ) 1
i 1
• The function p defined above is called the probability function (or point
probability function) of the r.v X.
• Furthermore, the tabular arrangement of all possible values of X with
their corresponding probability is called probability distribution of X.
Probability Distribution of Discrete Random variable
• Example: Roll two six sided dice. Let X be a random variable defined as
sum of the numbers shown up. Construct a probability Distribution of X?
Die 2
1 2 3 4 5 6
1 (1,1) 2 (1,2) (1,3) 4 (1,4) 5 (1,5) 6 (1,6) 7
3
Die 1 2 (2 ,1) 3 (2,2) 4 (2, 3) 5 (2, 4) 6 (2,5 ) 7 (2, 6) 8
3 (3, 1) 4 (3, 2) 5 (3, 3) 6 (3, 4) 7 (3, 5) 8 (3, 6) 9
4 (4, 1) 5 (4, 2) 6 (4, 3) 7 (4, 4) 8 (4, 5) 9 (4, 6) 10
5 (5, 1) 6 (5, 2) 7 (5, 3) 8 (5, 4) 9 (5, 5) 10 (5, 6) 11
6 (6, 1) 7 (6, 2) 8 (6, 3) 9 (6, 4) 10 (6, 5) 11 (6, 6) 12
X 2 3 4 5 6 7 8 9 10 11 12
P(X=x) 361 2
36
3
36
4
36
5
36
6
36
5
36
4
36
3
36
2
36
1
36
8
5.3. Continuous Random Variable
• Definition: A random variable X is said to be a
continuous random variable if it assumes all
values in some interval (c,d), where c and d are
real numbers.
• Examples:
– Height of students at a certain college .
– Mark of a student.
– Life time of light bulbs.
– Length of time required to complete a given training.
Probability Density Function (pdf) of Continuous Random Variables
a ) f x 0 for all x
b) f x dx 1
b
pa x b f x dx
a
10
Probability Density Function (pdf) of Continuous Random Variables
Remark
Probability at a point is zero
a
px a f x dx 0
a
b
pa x b pa x b p a x b p a x b f x dx
a
11
Probability Density Function (pdf) of Continuous Random Variables
f x dx 1
RX
1
1
2x
11
1 12
Probability Density Function (pdf) of Continuous Random Variables
b. find P(0.5<x<0.75)
0.75
2 xdx x
2 0.75
p0.5 x 0.75
0.5
0.5
0.752 0.52
0.3125
13
Probability Density Function (pdf) of Continuous Random Variables
f x dx 1
RX
1
cx 2 dx 1
0
1
cx 2 1
1
2 1 0
1
c b. Find P(X≥1/2)
x3 1
3 0
c3 14
Conditional Probability in the Case of Continuous Random Variables
Recall that for the case of discrete random variables the conditional
probability is given by:
The same formulation holds true for the case of continuous random variables
except that A and B take range of values (intervals) rather than discrete values.
15
Conditional Probability in the Case of Continuous Random Variables
6 x1 x , if 0 x 1
f x
0, otherwise
Compute
1 1 2
P x | x
2 3 3
16
Conditional Probability in the Case of Continuous Random Variables
Solution
Required: P(A/B)
1
1 1 2
1
p A B p x 6 x1 x dx 3x 2 x 1
2 3 2
3 2 1 3
3
1 2 3
1 1
2
1
3
3 2 3 2
2 2 3 3
0.2407
17
Conditional Probability in the Case of Continuous Random Variables
Solution
1
1 2 2
2
pB p x 6 x1 x dx 3 x 2 x
2 3
1
3
3 3 1 3
3
2 2 2
3
1 2 1
3
3 2 3 2
3 3 3 3
Then
0.4815
pA B
pA / B
pB
0.2407
0.4999
0.4815
18
Cumulative distribution function and its properties
The cumulative probability function, denoted F(x), shows the probability that X
is less than or equal to x
F x P X x
Notation: Cumulative distribution function is usually denoted by upper case
alphabets.
Theorems
If X is a discrete random variable, then
F x PX x P x j x j x
j
If X is a continuous random variable, then
x
F x P X x f (u )du
19
Cumulative distribution function and its properties
Example 1: Let S={HH, HT, TH, TT} and X: the number of heads. Clearly, X is a
discrete random variable. Find the CDF of X.
X 0 1 2
P(X=x) 1 2 1
4 4 4
Solution
The possible values for X are 0, 1, and 2.
0, if x 0
1 / 4, if 0 x 1
F x
3 / 4, if 1 x 2
1, if x 2
20
Cumulative distribution function and its properties
Example 2: Find the cdf of the random variable X whose pdf is given by
x, if 0 x 1
f x 2 x , 1 x 2
0, otherwise
Solution
By definition CDF, F(X), is P(X≤x)
x
F x f t dt
21
Cumulative distribution function and its properties
Example 2: Find the cdf of the random variable X whose pdf is given by
Solution
For x≤0
x x
F x f t dt 0dt 0
For 0≤x<1
x x x
1 2 1 2
F x f t dt 0 tdt t x
2 0 2
22
Cumulative distribution function and its properties
Example 2: Find the cdf of the random variable X whose pdf is given by
Solution
For 1≤x<2
x 0 1 x
F x f t dt 0dt t dt 2 t dt
0 1
1 x
0 1 1
0 t 2 2t t 2
2 0 2 1
1 1 1
0 2 x x 2 2
2 2 2
1 2
2x x 1
2
23
Cumulative distribution function and its properties
Example 2: Find the CDF of the random variable X whose pdf is given by
Solution x 0 1 2 x
F x f t dt 0dt t dt 2 t dt 0dt
For x≥2
0 1 2
1 2
0 1 1
0 t 2 2t t 2 0
2 0 2 1
Hence the CDF of X is
0, if x0
1 x2 , if 0 x 1
2
F x
2 x 1 x 2 1, if 1 x 2
2
1, if 2
24
Cumulative distribution function and its properties
Theorem:
If X is a continuous random variable, then we have
d
f x F x
dx
p x j F x j F x j 1
25
Cumulative distribution function and its properties
Example: Suppose X is a continuous random variable with cdf
0, if x 0
F x
1 e x , if x 0
d
f x
dx
1 ex
e x , if x 0
f x
0, otherwise
26
Cont.
• Example: If the probability density function of the random variable X is
given by
1
f x ( 2 x 1)
144
for x = 1, 2, 3, ..., 12 then find the cumulative distribution function of X.
Cont.
• The space of the random variable X is given by
RX = {1, 2, 3, ..., 12}
• F(1) = 1/144
• F(2) =4/144
………………
………………
• F(12)=1
Cont.
• If the space of the random variable X is given by RX = {x1 < x2 < x3 < · · ·
< xn}, then
f(x1) = F(x1)
f(x2) = F(x2) - F(x1)
f(x3) = F(x3) - F(x2)
.. ........
.. ........
f(xn) = F(xn) - F(xn-1).
Cont.
• Example: Find the probability density function of the random variable X
whose cumulative distribution function is
0.00, if x 1
0.25, if 1 x 1
F x 0.5, if 1 x 3
0.75, if 3 x 5
1 if 5
Cont.
• f(-1) = 0.25
f(1) = 0.50 - 0.25 = 0.25
f(3) = 0.75 - 0.50 = 0.25
f(5) = 1.00 - 0.75 = 0.25.
Cont.
• Example: What is the probability density function of the random variable
whose cdf is
=
EXPECTATION
Most probability distributions are characterized by their mean and variance.
The mean of a random variable is referred to as expectation, provided the
expected value converges to a constant.
If we want to summarize a random variable by a single number, then this
number should undoubtedly be its expected value.
The expected value, also called the expectation or mean, gives the center in
the sense of average value of the distribution of the random variable.
If we allow a second number to describe the random variable, then we look at
its variance, which is a measure of spread of the distribution of the random
variable.
Expectation of a random variable
…, xn.
x2, …, xn.
That is, the mean value of the square of the deviations of X from
its mean is called the variance of X or the variance of the
distribution.
The positive square root of V(X) is called the standard deviation
of X and it is denoted by s.d(X).
It is worthwhile to observe that
E X xpx 0 1 1 3 2 3 3 1 1.5
8 8 8 8
E X x px 0 1 1 3 2 3 3 1 3
2 2 2 2 2 2
8 8 8 8
V X E X 2 E X
2
0.75
Example 2: Let x has a pdf
1 13 12 1 13 12
2 3 2 2 3 2
1
3
1
x 1
E X 2 x2 dx
1 2
1
1x 4
x
3
2 4 3 1
1 14 13 1 14 13
2 4 3 2 4 3
1
3
V X E X 2 E X
2
2
1 1 2
3 3 9
Properties of Variance
Let X be a random variable
The expression E[(X −k) 2] assumes its minimum value when k=E(X)
x 0 1 2
P(x) 1/4 2/4 1/4