Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

CHAPTER FIVE

ONE DIMENSIONAL RANDOM VARIABLES


3.1 Random variable: definition and distribution function

3.2 Discrete random variables

3.3 Continuous random variables

3.4 Cumulative distribution function and its properties

3.1 Random variable

Introduction

The theory of probability distributions is widely used in both natural and social science. For that
matter, the concept of random variables and distributions is the backbone of statistics.
Particularly, the area of inferential statistics is entirely dependent on these concepts. In
estimation and hypotheses testing we extensively use some commonly known distributions.

Definition: Let E be an experiment and S be a sample space associated with the experiment. A
function X that assigning to every element ∈ , a real number, ( ), is called a random
variable. The set of all possible values of the random variable X is called the range space.
Moreover, the domain of the random variable X is S.

 Random variables are nothing but real valued functions that transform events to real
numbers. Hence, one can say that random variables serve as links between events and real
numbers. Their significance can be seen from the fact that it is theoretically easier to deal
with numbers than events.
 A random variable, X, is a function that assigns a single, but variable, value to each element
of a sample space.
 A random variable, X, provides a means of assigning numerical values to experimental
outcomes.
 A random variable, X, is a numerical description of the outcomes of the experiment or a
numerical valued function defined on sample space, usually denoted by capital letters.

Page 1 of 12
Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

Example 1: Consider the different possible orderings of boy (B) and girl (G) in four sequential
births. There are 2*2*2*2=24 = 16 possibilities, so the sample space is:

BBBB GGBB BGBB GBBB


BBBG BGBG GBBG GGBG
BBGB BGGB GBGB GGGB
BBGG BGGG GBGG GGGG
If girl and boy are each equally likely [P(G) = P(B) = 1/2], and the gender of each child is
independent of that of the previous child, then the probability of each of these 16 possibilities is:

(1/2)(1/2)(1/2)(1/2) = 1/16.

Now count the number of girls in each set of four sequential births:

BBBB (0) GGBB (2) BGBB (1) GBBB (1)


BBBG (1) BGBG (2) GBBG (2) GGBG (3)
BBGB (1) BGGB (2) GBGB (2) GGGB (3)
BBGG (2) BGGG (3) GBGG (3) GGGG (4)
Notice that:

 each possible outcome is assigned a single numeric value,


 all outcomes are assigned a numeric value, and
 the value assigned varies over the outcomes.

The count of the number of girls is a random variable:

Page 2 of 12
Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

Where RX is the range space of X and S is the sample space.

Example 2: Consider the experiment of tossing of fair coin once.

The sample space is S= {H, T} where H denotes the outcome ‘Head’ and T denotes the outcome
‘Tail’. So, there are two possible outcomes H or T.

Now, let the random variable X represents the outcome `Head’, then X can take the value 0 or
1.

Example 3: Suppose a single fair die is rolled once.

The sample space of this experiment constitutes six possible outcomes, S = {1, 2, 3, 4, 5, 6}

Let the random variable X denotes the out come ‘A number greater than 2 occurs’. Then the
random variable can assume the values 3, 4, 5 or 6.

Probability Distribution

The probability distribution for a random variable describes how the probabilities are distributed
over the values of the random variable

Types of Random Variables

Page 3 of 12
Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

Depending upon the numerical values it can assume, a random variable can be classified into two
major divisions.

 Discrete Random Variable and


 Continuous Random Variable

3.2. Discrete Random Variable

Definition: Let X be a random variable. If the number of possible values of X (i.e. Rx) is finite
or countably infinite, then we call X is a discrete random variable. That is, the possible values of
X may be listed as , ,…, , … In the finite case the list terminates and in the countably
infinite case the list continues indefinitely.

 has a countable number of possible values


 has discrete jumps (or gaps) between successive values
 has measurable probability associated with individual values
 counts

Examples:

• Toss a coin times and count the number of heads.


• Number of children in a family.
• Number of car accidents per week.
• Number of defective items in a given company.
• Number of bacteria per two cubic centimeter of water.

Probability distribution of discrete random variable

Definition:: Let X be a discrete random variable. Hence, RX consists of at most a countably


infinite number of values, , , … with each possible outcome we associate a number
( ) = ( = ) called the probability of .The probabilities ( ) for = 1,2,3, . . . , , . ..
must satisfy the following two conditions:

I. ( ) ≥ 0 for all ,
II. ∑ ( )=1

Page 4 of 12
Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

The function p defined above is called the probability function (or point probability
function) of the random variable X. Furthermore, the tabular arrangement of all possible
values of X with their corresponding probability is called probability distribution of X.

Example 1: Construct a probability distribution for the number of heads in tossing of a fair coin
two times.

Solution: The sample space of the experiment contains the following:

S = {HH, HT, TH, TT}

Let the random variable X denotes the ‘number of heads’. We then use the probability function
P(X) to assign probability to each outcome consequently; the probability distribution is given
below:

0 1 2
( ) 1/4 1/2 1/4
Example 2: The number of mistakes a typist made in ten days of assessment is shown in the
following table.

Number of mistakes 2 3 4 5
Number of days 1 4 3 2

Construct a probability distribution for the number of mistakes she committed.

Solution: Let the variable X denotes the number of mistakes the typist committed. Then, we
assign a probability for each of the number of days with respect to the total number of days.

The probability distribution is shown below:

Number of mistakes (xi) 2 3 4 5


( ) 1/10 4/10 3/10 2/10

Notes:

Page 5 of 12
Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

a) Suppose that the discrete random variable X may assume only a finite number of values,
say , ,…, . If each outcome is equally probable, then we obviously have ( ) =
( )=⋯= ( )= .

b) If X assumes a countably infinite number of values, then it is impossible to have all


outcomes equally probable. For we cannot possibly satisfy the condition ∑ P(x ) = 1
if we must have ( ) = c for all .
c) In every finite interval there will be at most a finite number of possible values of X. if
some such interval contains name of these possible values we assign probability zero to
it. That is, if ={ , ,…, } and if no ∈ [a, b], then ( ≤ ≤ ) = 0.

3.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.

 has an uncountably infinite number of possible values


 moves continuously from value to value
 has no measurable probability associated with each value
Examples:
• Height of students at certain college.
• Mark of a student.
• Life time of light bulbs.
• Length of time required to complete a given training.

Probability density function ( ) of continuous random variable

A random variable X is said to be a continuous random variable if there exists a function ,


called the probability density function (pdf) of X, satisfying the following conditions:

a) ( ) ≥ 0 for all
b) ∫ ( ) =1

c) For any ℎ−∞< < < ∞, ℎ ( ≤ ≤ )=∫ ( )

Page 6 of 12
Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

Remark:

a. P(a≤x≤b) represents the area under the graph ( or curve) of the P.d.f of f between a and b.

b. It is a consequence of the above description of X that for any specified value of X, say X0,

x0

we have p(X=X0)=0, since P(X=X0)=  f ( x) dx  0


x0

We must realize, however, that if we allow X to assume all t he values in so me interval, then the
zero value of the probabilit y does not imply that the event is impossible. That is, zero probabilit y
does not necessarily imply impossibilit y. Hence, in the cont inuous case P(A)=0 does not imply
A=. In view o f this fact, the fo llowing probabilit ies are all the same if X is a cont inuous rando m
variable.

P(c≤X≤d)= P(c≤Xd)= P(c<X≤d)= P(c<X<d)

c. If X assumes values only in some interval [a, b], we may simply set f(x) = 0 for all x ∉
[a, b].

Example 1: Let X be a continuous random variable with probabilit y densit y function (P.d.f)

2 x if 0  x  1
f ( x)  
0 otherwise

a) Verify that f is a P.d.f b) find P(0.5<x<0.75)

Solution:

a) A funct ion f is a P.d.f iff the fo llowing two condit ions are satisfied

i) f(x)0 and ii)  f ( x) dx  1


Page 7 of 12
Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

In our case, it is easily observable that f (x)  0 because 2x is a positive number for all x

between 0 and 1.Moreover, for other values of x the given funct ion assumes the value 0.

Hence the first condit ion is satisfied. We can also show the second condit ion as under.

 0 1  0 1 

 f ( x) dx   f ( x)dx   f ( x)dx   f(x)dx   0dx   2 xdx   0dx  0  1  0  1


  0 1  0 1

Therefore, we can conclude that the given funct ion is a P.d.f.


0.75
2
0.75 9 1 5
b) P (0.5<x<0.75)=  2 xdx  x
0.5
0.5
  
16 4 16
Example 2: Suppose that X is a continuous random variable wit h P.d.f
1
 x  k if 0  x  3
f (x )   6
0 otherwise

a) Evaluate k b) (1 ≤ ≤ 2)

3x 2 if 0  x  1
Example 2: Suppose that X is a continuous random variable wit h P.d.f f ( x )  
0 otherwise

a) Verify that f is a P.d.f b) P(X>1/3) c) P(1/4  x  2/3)

Conditional Probability in the Case of Continuous Random Variables


Recall that for the case of discrete random variables the conditional probabilit y is given by

P( A  B)
P( A / B) 
P( B)

The same formulat ion ho lds true for the case of cont inuous random variables except that A and B
take range of values (intervals) rather than discrete values.

Example: The diameter of an electric cable is assumed to be a cont inuous rando m variable, sa y
6 x(1  x) if 0  x  1
X, with P.d.f f ( x)  
0 otherwise

 1 1 2
Compute P x  x 
 2 3 3 

Solution:

Page 8 of 12
Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

1/ 2
 1 1 2  1 1
 11 2
P  ( x  )  (  x  )  P  x  
2 3 3  3 2
 6 x(1  x)dx
P x   x        1/ 3
2/3
 1/ 2
 23 3 1 2 1 2
P  x   P  x    6 x(1  x)dx
3 3 3 3 1/ 3

3.4 Cumulative distribution function and its properties

Definition (Cumulative Distribution Function) Let X be a rando m variable (discrete or


continuous). The funct ion F that is defined as

( ) = (  )
is called the cumulat ive distribution function (Cdf) of the rando m variable X.

Notation: Cumulative distribut ion funct ion is usually denoted by upper case alphabets.

Theorems
1. If X is a discrete rando m variable, then

F ( x )   p( x j ) for all x j  x
j

2. If X is a continuous rando m variable, then



F ( x)   f ( s)ds


Example 1: Let S={H,T} and X: the number of heads.

Clearly, X is a discrete random variable. Since P(x=0)=1/2=P(x=1), we have

0 if X  0

F (x )  1 / 2 if 0  x  1
1 if x  1

Graphically,

Page 9 of 12
Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

Example 2: Suppose that a rando m variable X assumes the six values 1, 2, 3, 4, 5, 6 with
probabilit y 1/6. Then,

0 if X  1
1 / 6 if 1  x  2

2/6 if 2  x  3

F ( x )  3/6 if 3 x 4
4/6 if 4x5

5/6 if 5x6
1 if x6

Example 3: Find the cdf of the rando m variable X whose P.d.f is given by

x if 0  x  1

f ( x )  2  x if 1  x  2
0 Otherwise

Solution:
x 0 1 2 
F(x)  P( X  x )   f (t )dt   f (t )dt   f (t )dt   f (t )dt   f (t )dt
  0 1 2

Case 1: For x0


x x
F(x)   f (t )dt   0dt 0
 

Case 2: For 0 x  1

x 0 x x x
t2 x2
F(x)  P ( X  x)   f (t )dt   f (t )dt   f (t )dt 0   tdt  
  0 0
2 0
2

Case 3: For 1 x  2

x 0 1 x 1 x
t2
F(x)  P ( X  x)   f (t )dt   f (t )dt   f (t )dt   f (t )dt  0   2  x
  0 1
2 0 1
x
1  x2  x2
 
   2x    2x  1
2  2 1 2

Case 4: For x>2

Page 10 of 12
Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

x 0 1 2 x
F(x)  P( X  x)   f (t )dt   f (t )dt   f (t )dt   f (t )dt   f (t )dt
  0 1 2
2
2 1 x
t  x2  1  3
0   2 x     0dt    2    0  1
2 0  2 1 2 2  2

Therefore, the cdf o f X beco mes,

0 if x  0
 2
x if 0  x  1

F ( x)   2 2
2x - x - 1 if 1  x  2
 2

1 if x  2

Exercises:

e -x if x  0
1. Find the cdf of a rando m variable X whose P.d.f is given by f ( x)  
0 Otherwise

2. Determine the cdf of the rando m variable X with P.d.f

1
2 x if 0  x  1

 1 if 1  x  2
f ( x)   2
 1 3
- x  if 2  x  3
 2 2
 0 Otherwise

Properties of Cumulative Distribution Function (cdf) F

a) The funct ion F is a non-decreasing funct ion,


b) lim F ( x)  0 and lim F ( x )  1
x   x  

Theorem
d
If X is a continuous rando m variable, then we have f ( x)  F ( x) , for all x at which F is
dx
different iable.

On the other hand, if X is a discrete random variable with possible values , , … and suppose
that it is possible to label these values so that < < ⋯ then we have
P ( x j )  F ( x j )  F ( x j 1 ) .

Page 11 of 12
Introduction to probability and Statistics (Stat 276) Department of Statistics (AAU)

Proof
Case 1: X is a continuous rando m variable
x
F ( x)   f (t )dt

x
d d
 F ( x)  f (t )dt  f ( x) .......by the fundamenta l theorem of calculus
dx dx 

Case 2: X is a discrete random variable

F ( x j )  P ( x  x j )  P ( x1 )  P ( x 2 )  ...  P ( x j 1 )  P ( x j )
F ( x j 1 )  P ( x  x j 1 )  P ( x1 )  P ( x 2 )  ...  P( x j  2 )  P ( x j 1 )
 F ( x j )  F ( x j 1 )  P ( x j )  f ( x)

Remark: P(a X  b)=F(b)-F(a)

Example: Suppose X is a continuous rando m variable with cdf

0 if x  0
F ( x)   -x
1 - e if x  0

Find the P.d.f of X.

Solution:

d
Since X is a continuous random variable f ( x)  F ( x) . But then,
dx

d d
dx
0  0 and
dx

1  e x  ex 

d 0 if x  0
Hence, f ( x)  F ( x)   - x
dx e if x  0

Page 12 of 12

You might also like