Professional Documents
Culture Documents
2.random Variables and Probability Distributions
2.random Variables and Probability Distributions
1
2. The Concept of a Random Variable
Introduction
In the first chapter, we covered basic probability
concepts and computation of probability of an event.
3
Definition: Let X represent a function that associates a real
number with each and every elementary event in a sample
space, S. Then X is known as a random variable.
Alternatively, a random variable is a function from the
sample space S to the real numbers.
HH 2 0 2
HT 1 1 2
TH 1 1 2
TT 0 2 2
We say that the space of the R. V. X = {0, 1, 2}
5
2. Tossing a fair coin three times. The sample
space is HHH , HHT , HTH , HTT , THH , THT ,TTH ,TTT
The random variable can be the number of heads
in this three tosses.
7
Types of Random Variable
8
2.2. The probability distribution/function
of a discrete random variable
Once a random variable X is defined, the sample
space is no longer important.
10
A function can serve as the probability distribution of
a discrete random variable X iff its value, f(χ), satisfy
the following two conditions:
1. f ( x ) 0 for each value within its domain
2. f ( x ) 1,
x
11
3. If X is a discrete rv, then
12
Tables of Probability Distributions
Examples
Consider an experiment of tossing two coins. Let the
random variable X denote the number of heads,
13
14
2. Tossing a fair coin three times. The random
variable X can be the number of heads in this three
tosses.
The probability distribution is given by (table):
15
3. Rolling pair of a fair dice. A random variable
X is the sum of the two dice
16
4. In the experiment of flipping a coin and generating the
number of tosses required to find a head, the sample
space, S = {H, TH, TTH, TTTH ...}
Let the R.V. X = the number of tosses required to
produce the first head and let P(H) = p, P(T) = 1-p, then
2. f ( x) 1,
x
Where the summation extends over all the values within its
domain.
19
Examples:
Check whether the following function represents
probability distribution
x
f ( x) ,1,2,3,4,5,6
21
Solution: Check for the two conditions:
f ( x) 1
x 1
20
2. Probability function of the uniform distribution is
given by:
1
, x 1 , , 6
f X
x 6
0 , elsewhere
21
4. Check whether the following function represents
probability distribution
22
5. For what value of k can the following function serve
as probability distribution:
24
25
Cumulative Distribution Functions (CDF) a
Discrete Random Variable
It tries to answer the question “what the probability that a
discrete rv X will assume a value less than or equal to a
given number?”
Definition: A cdf shows the relation between the possible
value t of a rv X and the probability that the value of X is
less than or equal to t. That is, the cdf relates each
possible value t that variable X might take on the
probability f ( X t ) , the probability of the value less than
or equal to t.
This cumulative probability f ( X t ) is written as .
F ( x) f ( X x)
Formally
26
The values of F(x) satisfy the following
conditions:
F ( ) 1
F () 0
If a b, then F (a) F (b) for any real numbers a & b
27
The following five properties hold for
the CDF
a) 0 ≤ F(x) ≤ 1
b) F(x) is non-decreasing (i.e., if x1 x2 , then F ( x1 ) F ( x2 ) )
c) F(x) = 0 for x < x1, x1 being the minimum/least of the
values of the random variable X.
d) F(x) = 1 for x ≥ xn, xn being the maximum/largest value of
X
e) P(x < X ≤ x/) = P(X ≤ x/) -P (X ≤ x) = FX(x/) - FX(x)
28
Example: Suppose the pdf is given by:
f x i , x x i; i 1, , k
f x
0
, elsewhere
29
Example
1
, x x i; i 1, 2 ,6
f x 6
0 , elsewhere
30
31
Graphically,
F(x)
5/6
4/6
3/6
2/6
1/6
x
0 1 2 3 4 5 6
33
34
2.3 Probability Density Functions
(pdf) of the Continuous rv X
Continuous Random Variable: if a random variable
can assume infinite and uncountable set of values, it is
known as continuous random variable
(e.g. height, weight, and the time elapsing between two
telephone calls). More technically,
Definition: A random variable X is called continuous
if there exists a function f(.) such that
x
P(X≤ x) = F ( x) f (u )du for every real number x,
36
A function can serve as a probability density
function of a continuous random variable X if its
values, f(χ), satisfy the following conditions:
37
Properties of Probability Density
Function (pdf)
38
Examples:
1. f ( x) 6 x(1 x), for 0 x 1
Solution:
1
0
6 x (1 x )dx 1
1
6( ( x x 2 ) dx) |10 1
0
1 2 1 3 1
( x x ) |0
2 3
3x 2 2 x3 1
6( ) |0 1
6
3 2 1
11
graph it x-intercept= 0 or 1
39
For what value of k the function
Solution:
40
3. The pdf of the continuous rv X is given by:
c
,0 x 4
f ( x) x
0 , otherwise
kxe x ,for x 0
2
f ( x)
Find the 0 value
,for x 0
of k.
41
Cumulative Distribution Functions
(cdf) of a continuous rv X
Definition: if X is a continuous rv and the value of its
probability density at t is f(t), then the function given by:
x
F ( x) p ( X x)
f (t )dt , for x
42
Properties of cdf of a continuous rv X
1. F lim F x 1
x
2. F lim F x 0
x
3. Properties 1 and 2 imply that
0 F X x 1
4. If f(x) and F(x) are the values of the pdf and cdf of a continuous rv
X, then
43
7. d F X x x
f x F x F - f u du
dx
Examples
44
ii.
c
,0 x 4
f ( x) x
0 , otherwise
45
1. Find the cdf of the pdf of the form:
kxe
x2
,for x 0
f ( x)
0 ,for x 0
1
2. Suppose X is a continuous rv with cdf: F ( x)
1 e x
Find its pdf and compute p(-1<x<2) using both pdf and cdf
46
2.4. The Expected Value of a
Random Variable and Moments
Mathematical Expectation:
1. Let X be a discrete random variable taking values x1, x2,
x3,…with f(xi) as its probability density, then the expected
value of X, denoted by E(X), is defined as
48
b. For continuous:
49
Expectation of a Function of a Random
Variable
Let g(x) be a function of a rv X, then
50
Soln.
51
For c is any positive constant and g(x) be a
function of a rv X, then
1. for the discrete rv:
52
Variance and Standard Deviation of a rv X
The variance of the rv X measures the spread or
dispersion of a rv X
Let X be a rv with the following distribution.
53
Properties of Var(X)
a. If “a” is any real constant, then Var(a)=0
2
b. If Var ( X ) , then the variance of Y in Y=aX+b is given
by: Var (Y ) a 2 2
54
Examples: for discrete
1. Given
55
The above tabular expression for the probability of a
Bernoulli R. V. can be written as
56
57
58
Examples for Continuous rv X
1. Given the pdf:
59
Moments of a probability distribution
The mean of a distribution is the expected value of the
random variable X.
A generalisation of this is to raise X to any power r, for r =0,
1, 2,... and compute the E(Xr). This is known as the moment
of order r about the origin.
/
r EX r
x
r
f ( x )dx ; r 0,1, 2, (Continuous )
62
Thus, the variance of a random variable is expected value
of the square of the random variable less the square of
the expected value of the random variable.
63
is the third moment about the mean and is equal to :
64
is the fourth moment about the mean and is
equal to :
65
Interpretations
66
Skewness and Kurtosis
A fundamental task in many statistical analyses is to characterize
the location and variability of a data set.
A further characterization of the data includes skewness and
kurtosis.
Skewness is a measure the lack of symmetry. A distribution, or
data set, is symmetric if it looks the same to the left and right of
the center point.
Kurtosis is a measure of whether the data are peaked or flat
relative to a normal distribution.
That is, data sets with high kurtosis tend to have a distinct peak
near the mean, decline rather rapidly, and have heavy tails. Data
sets with low kurtosis tend to have a flat top near the mean
rather than a sharp peak.
67
Measures of Asymmetry
68
Kurtosis - It is a measure of
peakedness.
69
4. μ3 is the third moment about the mean and is used to
calculate the measure of skewness which is given
3
as 3 3
and known as the Pearson’s measure of
skewness.
70
5. μ4, the fourth moment about the mean and is used to
calculate the measure of pickedness or flatness
4 (which is
known as kurtosis) and is given as 4 4 .
72
Cont.
Exercise
Let the random variable Y be the number of failures
preceding a success in an experiment of tossing a fair
coin, where success is obtaining a head. Find E(Y) and 2
for this random variable.
73
Moment Generating Function (mgf)
Moments of most distributions can be determined directly
through integration or summation. An alternative technique
to calculate moments of a distribution is known as the
moment generating function (mgf).
Definition: Moment generating function of a random
variable X, written as M(t), is defined as
tx
m(t ) E (e )
where t is any constant in neighbourhood of 0 (zero).
74
Taylor series expansion about any point x0 of a
continuously differentiable function f(x) is given by:
75
Example: Let f ( x) e x , then
76
In general,
d r m(t )
r
|t 0 /
r , the r th
moment about the origin
dt
Examples
1. Given the pdf f ( x) 2 x, 0 x 1 x
1
2. Given the probability distribution: f ( x) 2 3 , x 1, 2,3,...
Find:
77