3-Random Variables-04-01-2023

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

MAT2001-Module-2: Randaom Variables

Dr. Nalliah M

Assistant Professor
Department of Mathematics
School of Advanced Sciences
Vellore Institute of Technology
Vellore,Tamil Nadu,India.

nalliah.moviri@vit.ac.in

July 28, 2020


Dr. Nalliah M Module-2 July 28, 2020 1 / 54
Intoduction

Statistics is concerned with making inferences about populations and


population characteristics. Experiments are conducted with results that
are subject to chance. The testing of a number of electronic components
is an example of a statistical experiment, a term that is used to describe
any process by which several chance observations are generated. It is often
important to allocate a numerical description to the outcome.

For example, the sample space giving a detailed description of each


possible outcome when three electronic components are tested may be
written S = {NNN, NND, NDN, DNN, NDD, DND, DDN, DDD}, where
N denotes nondefective and D denotes defective.

Dr. Nalliah M Module-2 July 28, 2020 2 / 54


One is naturally concerned with the number of defectives that occur.
Thus, each point in the sample space will be assigned a numerical value of
0, 1, 2, or 3. These values are, of course, random quantities determined by
the outcome of the experiment. They may be viewed as values assumed by
the random variable X , the number of defective items when three
electronic components are tested.

A random variable is a variable that associates a real number with each


element in the sample space.

Dr. Nalliah M Module-2 July 28, 2020 3 / 54


Example

Two balls are drawn in succession without replacement from an urn


containing 4 red balls(R) and 3 black balls(B). The possible outcomes
S = {RR, RB, BR, BB}. Then we define a function X from S to real
number R, where X represent the number of red balls for every sample of
S

Dr. Nalliah M Module-2 July 28, 2020 4 / 54


The variable X , representing the number of red balls in a sample of S.
Define X : S −→ R by

X (s1 ) = 2

X (s2 ) = 1

X (s3 ) = 1

X (s4 ) = 0

where si ∈ S, i = 1, 2, 3, 4.
Thus the variable X is called a random variable with the values x is 0, 1, 2.

Dr. Nalliah M Module-2 July 28, 2020 5 / 54


If a sample space contains a finite number of possibilities or an unending
sequence with as many elements as there are whole numbers, it is called a
discrete sample space.

If a sample space contains an infinite number of possibilities equal to the


number of points on a line segment, it is called a continuous sample space.

A random variable is called a discrete random variable if its set of possible


outcomes is countable.

When a random variable can take on values on a continuous scale, it is


called a continuous random variable.

Dr. Nalliah M Module-2 July 28, 2020 6 / 54


Discrete Probability Distributions

A discrete random variable assumes each of its values with a certain


probability.
In case of tossing a coin two times, the possible outcomes are
S = {HH, HT , TH, TT }. The variable X , representing the number of
heads in s ∈ S. Now, we define by X : S −→ R as

X (s1 ) = 2

X (s2 ) = 1

X (s3 ) = 1

X (s4 ) = 0.

Dr. Nalliah M Module-2 July 28, 2020 7 / 54


Thus the random variable X and the values of x with the probability
values of x is given below table.

X 0 1 2
1 1 1
P(x)=P(X=x) 4 2 4

The set of ordered pairs (x, P(x)) is called the probability mass function,
probability function, or probability distribution of the discrete random
variable X .

Dr. Nalliah M Module-2 July 28, 2020 8 / 54


Probability mass function

The set of ordered pairs (x, P(x)) is a probability mass function,


probability function, or probability distribution of the discrete random
variable X if, for each possible outcome x,

P(x) ≥ 0
P
P(x) = 1.
x

Dr. Nalliah M Module-2 July 28, 2020 9 / 54


Example

A shipment of 20 similar laptop computers to a retail outlet contains 3


that are defective. If a school makes a random purchase of 2 of these
computers, find the probability distribution for the number of defectives.
Solution
Let X be a random variable whose values x are the possible numbers of
defective computers purchased by the school. Now,
(3)(17)
P(X = 0) = 0 20 2 = 68
95
(2)
(3)(17) 51
P(X = 1) = 1 20 1 = 190
(2)
(3)(17) 3
P(X = 2) = 2 20 0 = 190
(2)

Dr. Nalliah M Module-2 July 28, 2020 10 / 54


Thus, the probability distribution of X is given below table.

X 0 1 2
68 51 3
P(x)=P(X=x) 95 190 190

Dr. Nalliah M Module-2 July 28, 2020 11 / 54


Continuous Probability Distributions

A continuous random variable has a probability of 0 of assuming exactly


any of its values. Consequently, its probability distribution cannot be given
in tabular form.

Let us discuss a random variable whose values are the heights of all people
over 21 years of age.
Between any two values, say 163.5 and 164.5 centimeters, or even 163.99
and 164.01 centimeters, there are an infinite number of heights, one of
which is 164 centimeters.

Dr. Nalliah M Module-2 July 28, 2020 12 / 54


The probability of selecting a person at random who is exactly 164
centimeters tall and not one of the infinitely large set of heights so close to
164 centimeters that you cannot humanly measure the difference is
remote, and thus we assign a probability of 0 to the event.
This is not the case, however, if we talk about the probability of selecting
a person who is at least 163 centimeters but not more than 165
centimeters tall.
Now we are dealing with an interval rather than a point value of our
random variable.

Dr. Nalliah M Module-2 July 28, 2020 13 / 54


We shall concern ourselves with computing probabilities for various
intervals of continuous random variables such as
P(a < X < b), P(W ≥ c), and so forth. Note that when X is continuous,
P(a < X ≤ b) = P(a < X < b) + P(X = b) = P(a < X < b). That is, it
does not matter whether we include an endpoint of the interval or not.
This is not true, though, when X is discrete.

A probability density function is constructed so that the area under its


curve bounded by the x-axis is equal to 1 when computed over the range
of X for which f (x) is defined.

Dr. Nalliah M Module-2 July 28, 2020 14 / 54


Should this range of X be a finite interval, it is always possible to extend
the interval to include the entire set of real numbers by defining f (x) to be
zero at all points in the extended portions of the interval.

In the following Figure, the probability that X assumes a value between a


and b is equal to the shaded area under the density function between the
ordinates at x = a and x = b, and from integral calculus is given by
Z b
P(a < X < b) = f (x)dx.
a

Dr. Nalliah M Module-2 July 28, 2020 15 / 54


Dr. Nalliah M Module-2 July 28, 2020 16 / 54
Probability density function

The function f (x) is a probability density function (pdf) for the continuous
random variable X , defined over the set of real numbers, if
fZ(x) ≥ 0, for all x ∈ R,

f (x)dx = 1.
−∞

Example
Suppose that the error in the reaction temperature, in C, for a controlled
laboratory experiment is a continuous random variable X having the
probability density function

 x 2 , −1 < x < 2

3
f (x) =
0.

elsewhere.
Dr. Nalliah M Module-2 July 28, 2020 17 / 54
Example Cont...

1 Verify that f (x) is a density function.


2 Find P(0 < X ≤ 1).

Solution
For(1),
Obviously, f (x) ≥ 0. To verify condition
Z ∞
f (x)dx = 1.
−∞

Dr. Nalliah M Module-2 July 28, 2020 18 / 54


Example Cont...

Now,
Z ∞ Z −∞ Z 2 Z ∞
f (x)dx = f (x)dx + f (x)dx + f (x)dx
−∞ −1 −1 2
2
x2
Z
=0+ dx + 0
−1 3
2
x3

=
3×3 −1
8 (−1)
= −
9 9
8 (1)
= +
9 9
= 1.

Dr. Nalliah M Module-2 July 28, 2020 19 / 54


Example Cont...

For(2),
Z 1
P(0 < X ≤ 1) = f (x)dx
0
1
x2
Z
= dx
0 3
 3 1
x
=
3×3 0
1
= −0
9
1
= .
9

Dr. Nalliah M Module-2 July 28, 2020 20 / 54


Cumulative distribution function

The cumulative distribution function F (x) of a random variable X with


probability distribution P(x) and probability desity function f (x) is

P


 P(X = t), If X is discrete
t≤x
F (x) = P(X ≤ x) = Z x
f (x)dx, If X is continuous



−∞

Let F (x) be a cumulative distribution function of a continuous random


d(F (x))
variable X . Then P(a < X < b) = F (b) − F (a) and f (x) = dx , if the
derivative exists.

Dr. Nalliah M Module-2 July 28, 2020 21 / 54


Problem

A random variable X has the following probability mass function is given

X -2 -1 0 1 2 3
P(X) 0.1 k 0.2 2k 0.3 k

1 Find k.
2 Evaluate P(X ≤ 2) and P(−1 ≤ X ≤ 2).
3 Find the cumulative distribution function.

Dr. Nalliah M Module-2 July 28, 2020 22 / 54


Solution

P
For(1), since P(x) is p.m.f, and P(x) = 1. , it follows that we get
x

X
P(x) = 1
x

0.1 + k + 0.2 + 2k + 0.3 + k = 1

0.6 + 4k = 1

4k = 0.4
0.4
k=
4
k = 0.1

Dr. Nalliah M Module-2 July 28, 2020 23 / 54


Solution Cont...

X -2 -1 0 1 2 3
P(X) 0.1 0.1 0.2 0.2 0.3 0.1

For(2),

P(X ≤ 2) = P(X = −2) + P(X = −1) + P(X = 0) + P(X = 1) + P(X = 2)

= 0.1 + 0.1 + 0.2 + 0.2 + 0.3

= 0.9

OR
Dr. Nalliah M Module-2 July 28, 2020 24 / 54
Solution Cont...

P(X ≤ 2) = 1 − P(X > 2)

= 1 − P(X = 3)

= 1 − 0.1

= 0.9

Now,

P(−1 ≤ X ≤ 2) = P(X = −1) + P(x = 0) + P(x = 1) + P(x = 2)

= 0.1 + 0.2 + 0.2 + 0.3

= 0.8
Dr. Nalliah M Module-2 July 28, 2020 25 / 54
Solution Cont...

P
F (x) = P(X ≤ x) = P(X = t).
t≤x


P(X ≤ −2) = 0.1, If x = −2







P(X ≤ −1) = 0.2, If x = −1







P(X ≤ 0) = 0.4,

If x = 0
F (x) =
P(X ≤ 1) = 0.6, If x = 1







P(X ≤ 2) = 0.9, If x = 2







P(X ≤ 3) = 1,

If x = 3.

Dr. Nalliah M Module-2 July 28, 2020 26 / 54


Problem

A random variable X has the following probability mass function is given

X 0 1 2 3 4 5 6 7
P(X) 0 k 2k 2k 3k k2 2k 2 7k 2 +k

1 Find k.
2 Evaluate P(X ≤ 6), P(X ≥ 6) and P((1.5 < X < 4.5)/(X > 2))
3 Find the cumulative distribution function.

Dr. Nalliah M Module-2 July 28, 2020 27 / 54


Problem

Let X be a continuous random variable with probability density function


(pdf) is 
2x, 0 < x < 1

f (x) =
0.

elsewhere.

1 Find P(X ≤ 0.4), P(X ≥ 34 ) and P(X ≥ 12 .)


2 Evaluate P( 12 < X ≤ 34 ) and P(X > 43 /X > 12 ).
3 Find the cumulative distribution function.

Dr. Nalliah M Module-2 July 28, 2020 28 / 54


Solution

P((X > 34 ) ∩ (X > 21 ))


 
3 1
For(2), P X > /X > =
4 2 P(X > 12 )
P(X > 34 )
=
P(X > 12 )
Z 1
2xdx
3
= Z 41
2xdx
1
2
 2 1
x 3 7
7
4 16
= = = .
[x 2 ]11 3
4
12
2

Dr. Nalliah M Module-2 July 28, 2020 29 / 54


Problem

The Department of Energy (DOE) puts projects out on bid and generally
estimates what a reasonable bid should be. Call the estimate b. The DOE
has determined that the density function of the winning (low) bid is

5 2
8b , 5b ≤ y ≤ 2b


f (y ) =
0.

elsewhere.

Find F (y ) and use it to determine the probability that the winning bid is
less than the DOE’s preliminary estimate b.

Dr. Nalliah M Module-2 July 28, 2020 30 / 54


Solution

Z y
To find F (y ),F (y ) = P(Y ≤ y ) = f (y )dy .
−∞
Z 2b h i2b
5y 5y
For 25 b ≤ y ≤ 2b, then P(Y ≤ y ) = 5
8b dy = 8b 2
= 8b − 14 .
2
b 5
b
5
Thus, 



0, y ≤ 25 b

F (y ) = 5y 1 2
 8b − 4 , 5b ≤ y ≤ 2b


y ≥ 2b.

1.

Dr. Nalliah M Module-2 July 28, 2020 31 / 54


Two dimensional random Variables

Our study of random variables and their probability distributions in the


preceding sections was restricted to one-dimensional sample spaces, in that
we recorded outcomes of an experiment as values assumed by a single
random variable.

There will be situations, however, where we may find it desirable to record


the simultaneous outcomes of several random variables.

For example, we might measure the amount of precipitate P and volume


V of gas released from a controlled chemical experiment, giving rise to a
two-dimensional sample space consisting of the outcomes (p, v ), or we
might be interested in the hardness H and tensile strength T of
cold-drawn copper, resulting in the outcomes (h, t).
Dr. Nalliah M Module-2 July 28, 2020 32 / 54
Two dimensional random Variables

In a study to determine the likelihood of success in college based on high


school data, we might use a threedimensional sample space and record for
each individual his or her aptitude test score, high school class rank, and
grade-point average at the end of freshman year in college.

For example, if an 18-wheeler is to have its tires serviced and X represents


the number of miles these tires have been driven and Y represents the
number of tires that need to be replaced, then p(30000, 5) is the
probability that the tires are used over 30,000 miles and the truck needs 5
new tires.

Dr. Nalliah M Module-2 July 28, 2020 33 / 54


Joint probability distribution

Definition
The function p(x, y ) is a joint probability distribution or probability mass
function of the discrete random variables X and Y if
1 p(x, y ) ≥ 0, for all (x, y ),
PP
2 p(x, y ) = 1,
x y
where p(x, y ) = P(X = x, Y = y ).

Dr. Nalliah M Module-2 July 28, 2020 34 / 54


Problem

Two ballpoint pens are selected at random from a box that contains 3 blue
pens, 2 red pens, and 3 green pens. If X is the number of blue pens
selected and Y is the number of red pens selected, find
1 the joint probability function p(x, y ).
2 P (X + Y ≤ 1).

Dr. Nalliah M Module-2 July 28, 2020 35 / 54


Solution

For(1),
The possible pairs of values (x, y ) are (0, 0), (0, 1), (1, 0), (1, 1), (0, 2), and
(2, 0).
Now, p(0, 1), for example, represents the probability that a red and a
green pen are selected. The total number of equally likely ways of
selecting any 2 pens from the 8 is 82 = 28


The number of ways of selecting 1 red from 2 red pens and 1 green from 3
green pens is 21 31 = 6.
 

6 3
Hence, p(0, 1) = 28 = 14 .
Similar calculations yield the probabilities for the other cases, which are
presented in following table.
Dr. Nalliah M Module-2 July 28, 2020 36 / 54
Solution Cont...

x
p(x, y ) Row Totals
0 1 2
3 9 3 15
0 28 28 28 28
3 3 3
y 1 14 14 0 7
1 1
2 28 0 0 28
5 15 3
Column Totals 14 28 28 1

For (2), P(X + Y ≤ 1) = p(0, 0) + p(0, 1) + p(1, 0)


3 3 9
= + +
28 14 28
9
= .
14
Dr. Nalliah M Module-2 July 28, 2020 37 / 54
Joint probability density function

Definition
The function f (x, y ) is a joint probability density function of the
continuous random variables X and Y if
1 f (x, y ) ≥ 0, for all (x, y ),
Z ∞Z ∞
2 f (x, y )dxdy = 1.
−∞ −∞

Dr. Nalliah M Module-2 July 28, 2020 38 / 54


Problem

A privately owned business operates both a drive-in facility and a walk-in


facility. On a randomly selected day, let X and Y , respectively, be the
proportions of the time that the drive-in and the walk-in facilities are in
use, and suppose that the joint density function of these random variables
is 
 2 (2x + 3y ), 0 ≤ x ≤ 1, 0 ≤ y ≤ 1

5
f (x, y ) =
0,

elesewhere.

1 Verify f (x, y ) is a probability density function

Find P 0 < X < 12 , 14 < Y < 12



2

Dr. Nalliah M Module-2 July 28, 2020 39 / 54


Solution
Z ∞ Z ∞
For(1), f (x, y )dxdy = 1.
−∞ −∞

Z ∞ Z ∞ Z 1Z 1
2
f (x, y )dxdy = (2x + 3y )dxdy
−∞ −∞ 0 0 5
Z 1 2 x=1
2x 6xy
= + dy
0 5 5 x=0
Z 1 
2 6y
= + dy
0 5 5
y =1
3y 2

2y
= +
5 5 y =0
2 3
= +
5 5
= 1.
Dr. Nalliah M Module-2 July 28, 2020 40 / 54
Solution Cont...

For(2), P 0 < X < 12 , 14 < Y < 1



2

  Z 1 Z 1
1 1 1 2 2 2
P 0<X < , <Y < = (2x + 3y )dxdy
2 4 2 1
0 5
4
Z 1 2 x= 12
2 2x 6xy
= + dy
1 5 5 x=0
4
Z 1 
2 1 3y
= + dy
1 10 5
4
y = 21
3y 2

y
= +
10 10 y = 1
 4  
1 1 3 1 3 13
= + − + = .
10 2 4 4 16 160
Dr. Nalliah M Module-2 July 28, 2020 41 / 54
The marginal distributions

The marginal distributions of X alone and of Y alone are


P P
PX (x) = p(x, y ) and PY (y ) = p(x, y ), if (X , Y ) discrete case, and
y x

Z ∞ Z ∞
fX (x) = f (x, y )dy and fY (y ) = f (x, y )dx,if (X , Y ) continuous
−∞ −∞
case.

Dr. Nalliah M Module-2 July 28, 2020 42 / 54


The conditional distributions for discrete case

Let X and Y be two discrete random variables. The conditional


distribution of the random variable Y given that X = x is
p(x, y )
P(Y /X ) = , provided PX (x) > 0
PX (x)

Similarly, the conditional distribution of X given that Y = y is


p(x, y )
P(X /Y ) = , provided PY (y ) > 0.
PY (y )

Dr. Nalliah M Module-2 July 28, 2020 43 / 54


The conditional distributions for continuous case

Let X and Y be two continuous random variables. The conditional


distribution of the random variable Y given that X = x is
f (x, y )
f (y /x) = , provided fX (x) > 0
fX (x)

Similarly, the conditional distribution of X given that Y = y is


f (x, y )
f (x/y ) = , provided fY (y ) > 0.
fY (y )

Dr. Nalliah M Module-2 July 28, 2020 44 / 54


Problem

The joint probability mass function of two dimensional random variables


(X , Y ) is

x
p(x, y )
0 1 2
3 9 3
0 28 28 28
3 3
y 1 14 14 0
1
2 28 0 0

1 Find the marginal distributions functions of X and Y


2 Find the conditional distribution function of X given Y = 1.

Dr. Nalliah M Module-2 July 28, 2020 45 / 54


Solution

x
p(x, y ) PY (y )
0 1 2
3 9 3 15
0 28 28 28 28
3 3 3
y 1 14 14 0 7
1 1
2 28 0 0 28
5 15 3
PX (x) 14 28 28 1

5

 , x =0
 14


The marginal distributions functions of X is PX (x) = 15 , x =1
 28


3,

x = 2.
28

Dr. Nalliah M Module-2 July 28, 2020 46 / 54


Solution Cont...


15

 28

 , y =0

The marginal distributions functions of Y is PY (y ) = 3 , y =1
 7


1,

y = 2.
28

For(2),To find the conditional distribution of X , given that Y = 1. We


p(x, y )
need to find P(X /Y ) = , provided PY (y ) > 0., where y = 1
PY (y )
p(x, 1)
That is, to find P(X /1) =
PY (1)
x=2
3 3
+ 0 = 37 .
P
First we have find PY (1) = p(x, 1) = 14 + 14
x=0
Dr. Nalliah M Module-2 July 28, 2020 47 / 54
Solution Cont...

p(x, 1)
Now,P(X /1) = = 37 p(x, 1), x = 0, 1, 2
PY (1)
p(0, 1)
= 73 p(0, 1) = 37 14
 3 1
Therefore,P(0/1) = = 2
PY (1)
p(1, 1)
= 73 p(1, 1) = 73 14
 3
P(1/1) = = 12
PY (1)
p(2, 1)
P(2/1) = = 73 p(2, 1) = 73 (0) = 0
PY (1)

Dr. Nalliah M Module-2 July 28, 2020 48 / 54


Solution Cont...

The conditional distribution of X , given that Y = 1, is



1

 , x =0
2


P(X /1) = 1 , x =1
 2



0, x = 2.

Dr. Nalliah M Module-2 July 28, 2020 49 / 54


Problem

The joint probability mass function of two dimensional random variables


(X , Y ) is
y
p(x, y )
1 2 3 4
4 2 5 1
1 36 36 36 36
1 3 1 2
2 36 36 36 36
x 3 3 1 1
3 36 36 36 36
2 1 1 5
4 36 36 36 36

1 Find the marginal distributions functions of X and Y


2 Find the conditional distribution function of X given Y = y
3 Find the conditional distribution function of Y given X = x.
Dr. Nalliah M Module-2 July 28, 2020 50 / 54
Solution

For(1),

y
p(x, y ) PX (x)
1 2 3 4
4 2 5 1 12
1 36 36 36 36 36
1 3 2 1 7
2 36 36 36 36 36
x 3 3 1 1 8
3 36 36 36 36 36
2 1 1 5 9
4 36 36 36 36 36
10 9 9 8
PY (y ) 36 36 36 36 1

Dr. Nalliah M Module-2 July 28, 2020 51 / 54


Solution Cont...

The marginal distributions functions of X is



 12 ,

x =1


 36


7,

x =2
36
PX (x) =
8
36 , x =3






9,

x = 4.

36

Dr. Nalliah M Module-2 July 28, 2020 52 / 54


Solution Cont...

The marginal distributions functions of Y is



 10 , y = 1



 36


9, y =2

36
PY (y ) =
9
36 , y = 3






 8 , y = 4.


36

Dr. Nalliah M Module-2 July 28, 2020 53 / 54


Thank you

Dr. Nalliah M Module-2 July 28, 2020 54 / 54

You might also like