Transcript Chapter 4

STAT 111
Chapter Four
Random Variables and Their
Probability Distributions
1
Random Variables
In the previous chapter, we introduced properties of a set function P defined on a
sample space (S,f).In this chapter, we define random variables and discuss
some of its properties.
Definition A random variable is a function whose domain is a sample space and
whose range is a set of real numbers.
Random variables will be represented by capital letters X, Y, Z, etc., whereas,
x,y,z will denote particular values a random variable may assume.
Mathematically, a random variable X is a mapping
X: S → R
where the domain S is a sample space and R is the set of real numbers. It should
be noted that the fundamental difference between a random variable and a
real-valued function of a real variable is the associated notion of a probability
distribution. Also, the name R.V(random variable) and not a function because
the R.V is developed long before the term function is introduced.
2
Example
Suppose that a coin is
tossed twice, let X
represent the number of
heads which can come
up. Find the possible
values of X.
Solution
X= number of heads
Possible values x=0,1,2
(the values in the range,
ordered, no repetition).
(H,H)
0
(H,T)
1
(T,H)
2
(T,T)
3
Note
Random variables may be given by describing the quantity of
interest, for example, in the case of X in the preceding
example, we let X represent the number of heads which can
come up. From this the functional relationship between sample
space elements and real numbers may be determined.
It should be noted that many other random variables could also be
defined on this sample space, for example the square of the
number of heads, the number of heads minus the number of
tails, etc.
4
Discrete Distributions



Recall that a set of elements is
Countably infinite if the elements of
the set can be put into one-to-one
Correspondence with
the positive integers
It is said that a random variable X has a discrete distribution if X can take only a finite
number n of different values x1,...,xn or, countably infinite number of different values
x1, x2,….
Examples of discrete random variables are; the number of bacteria per unit area in
the study of drug control on bacterial growth, the number of defective television sets
in a shipment of 100.Indeed, discrete random variables most often represent counts
associated with real phenomena.
If X can take an infinite number of possibilities equal to the number of points on a
line segment, then X has a continuous distribution.
Definition:
If a random variable X has a discrete distribution, the probability mass function
(abbreviated p.m.f.) of X is defined as the function f such that for any real number x,
f(x) = P(X = x)
and f(x)=0, for any point x which is not one of the possible values of X.
 The expression (X= x) can be read, the set of all points in S assigned the value x by
the random variable X, and P(X=x) is defined to be the sum of the probabilities of all
sample points in S that are assigned the value x.
5
Probability mass function
(p.m.f.)
Properties of p.m.f.
f(x) is a probability mass function iff
1. f(x)  0
2.
x
 f(x)  1
x
It is often instructive to present the probability mass function in graphical format
by plotting f(x) on the y-axis against X; on the x-axis. Before presenting
several examples of p.m.f, we would like to point out that the p.m.f. of X is
often called by a variety of other names. Among these are the following:
1. Distribution of the random variable X
2. Probability function
3. Discrete density function.
6
Example
Determine whether the following can be probability mass function and
explain your answers.
1. ƒ (x) =1/5
 f(x)  1
, x = 0,1,2,3,4,5
 f(x) can' t be a p.m.f.
x
x2
2. f(x) 
,
30
f(x)  0
x  0,1,2,3,4
x and
 f(x)  1
 f(x) is a p.m.f.
x
3. f(x)

x - 2

,
5
1- 2 1
f(1) 

0
5
5
x  1,2,3,4,5
 f(x) can' t be a p.m.f.
7
Example
(H,H)
-2
Suppose that a pair of fair coins is
tossed and let the random
variable X denote the number
of heads minus the number of
tails.
1. Obtain the probability
distribution for X
X=number of H - number of T,
S= {HH,HT,TH,TT}
The probability distribution for X
(H,T)
0
(T,H)
2
(T,T)
1
f - 2  PX  -2  PTT  
4
2 1
f 0  PX  0  PHT, TH   
4 2
1
f 2   PX  2   PHH 
4
x
-2
0
2
sum
f(x)
1/4
1/2
1/4
1
8
2. Construct a graph for
this probability
distribution
0.6
0.5
x
-2
0
2
sum
f(x)
1/4
1/2
1/4
1
f(x)
0.4
0.3
0.2
0.1
0
-2-2
0
x
2
9
3. Find P(X=1), f(-2), P(X ≤ 2),P(-2≤X<2),P(X<0)
x
-2
0
2
sum
f(x)
1/4
1/2
1/4
1
P(X=1)=f(1)=0
f(-2)=1/4
P(X≤ 2)=P(X= - 2)+P(X=0)+P(X=2)=1/4+1/2+1/4=1
P(-2≤X<2)=P(X= -2)+P(X=0)=1/4+1/2=3/4
P(X<0)=P(X= -2)=1/4
10
Example
Find the value of k if
x
-1
0
1
f(x)
0.2
k
0.5
Solution
 f(x)  1
x
0.2+k+0.5=1
k=0.3
11
Example
A shipment of 7 television sets contains 2 defectives. A hotel makes a random
purchase of 3 of the sets. If X is the number of defective sets purchased by
the hotel. Find the probability distribution for X.
Solution:
X ≡ number of defective
possible values of x=0,1,2
 2  5 
  
0  3  2

P X  0 

7
7
 
 
 3
 2  5 
  
1  2  4

P X  1 

7
7
 
 3
 2  5 
  
2  1  1

P X  2  

7
7
 
 
 3
x
0
1
1
f(x)
2/7
4/7
1/7
12
Cumulative Distribution Functions
The cumulative distribution function (abbreviated c.d.f.), or more simply the distribution
function F of the random variable X, is defined for all real numbers x, -∞ <x < ∞ as
F (x)= P( X ≤ x)
In words, F(x) denotes the probability that the random variable X takes on a value that is
less than or equal to x.
Some properties of the c.d.f F are
1. 0≤F(x)≤1
2. F is nondecreasing function; that is, if x < y , then
F (x) ≤ F ( y)
3. lim x → -∞ F ( x ) = 0 i.e. F(x) = 0 for every x that is less than the smallest value in S
4. limx → ∞ F ( x ) = 1 i.e. F(x)= 1 for every x that is grater than the largest x values in S.
F is right continuous. That is, for any x and any decreasing sequence xn ,n ≥ 1, that
converges to x,
limx → ∞ F (xn) = F( x )
Note: For a discrete random variable X, the graph of F(x) will have a jump at every
possible value of X and will be flat between possible values. Such a graph is called a
step function.
5.
Example
The probability mass function of the random variable X is given as
x
1
2
3
f(x)
1/2
1/3
1/6
Find the distribution function F(x) and graph this distribution function.
Solution:
0
x 1
1
 2 1  x  2
F x    5
2 x3

6
x3
 1
Graph of F(x) (step function)
Cumulative distribution function
All probability questions about X can be answered in terms
of the c.d.f. For example,
 P(X≤ a)=F (a)
 P(X=a)=P( X≤ a) -P (X< a)
=P(X≤ a )-P(X≤ a-1)
=1- F(a) - F (a-1)
 P(X>a)=1- P(X≤ a)=1 - F(a)
 P(X≥ a)=1- P(X<a)=1- P(X≤ a -1)= 1-F(a-1)
 P(X<a)=P(X≤ a - 1)=F (a -1)
 P(a <X ≤ b)=F(b)-F(a)
All probabilities in term of F(a)
In summary, all probabilities in term of F(a)
1. P(a<X≤b) = F (b) – F (a )
2. P(a≤ X≤ b) = P(a-1<X ≤ b) = F(b) –F (a-1)
3. P(a < X < b) = P(a < X≤ b-1)= F (b-1) – F (a )
4. P(a≤ X< b) = P(a-1<X ≤ b-1) =F (b-1) – F (a-1 )
5. P(X = a) = F(a) – F (a-1)
6. P(X ≤ a ) = F (a )
7. P (X < a ) = P (X ≤ a – 1 ) = F ( a – 1 )
8.
P (X > a ) = 1 –P (X ≤ a ) = 1 – F ( a )
9. P (X ≥ a ) = 1 – P (X < a ) = 1 – P ( X ≤ a – 1 ) = 1 F ( a – 1 )
Example
The distribution function of the random
variable X is given by
1. Determine the p .m .f.
The probability mass function is
x
0
1
2
f(x)
0.25
0.5
0.17
x0
 0
0.25 0  x  1

F x   0.75 1  x  2
0.92 2  x  3
 1
x3

3 Sum
0.08
1
2. Compute
Or simply f(2)=0.17
P(X< 0) =0
P (X = 2 ) =F(2)-F(1)=0.92-0.75=0.17
P( X ≤ 5) =F(5)=1
P (1/2 < X ≤ 4) =F(4)-F(1/2)=1-0.25=0.75