0% found this document useful (0 votes)
124 views16 pages

Random Variables

The document discusses random variables and their probability distributions. A random variable is defined as a function that maps outcomes of a random phenomenon to numerical values. Probability distributions of discrete and continuous random variables are introduced. Examples are provided to illustrate concepts like probability mass functions, probability distribution functions, and their properties.

Uploaded by

Kuroko Tetsuya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views16 pages

Random Variables

The document discusses random variables and their probability distributions. A random variable is defined as a function that maps outcomes of a random phenomenon to numerical values. Probability distributions of discrete and continuous random variables are introduced. Examples are provided to illustrate concepts like probability mass functions, probability distribution functions, and their properties.

Uploaded by

Kuroko Tetsuya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Class No.

8, Date: September 6, 7,8


MA 2302: Introduction to Probability and Statistics

RANDOM VARIABLES

Instructor
Prof. Gopal Krishna Panda
Department of Mathematics
NIT Rourkela
Random Variables

Consider the following problem done in the last class:

Example 1: Three capacitors are chosen at random and with replacement from a lot consisting
of 8 capacitors of capacity 500 𝜇𝐹 and 16 capacitors of capacity 1000 𝜇𝐹. Find the probability
that, out of the three chosen capacitors, (a) there is at least one capacitors of capacity 500 𝜇𝐹
and (b) not more that two capacitors of capacity 1000 𝜇𝐹?

As usual A is the event of choosing a 500 𝜇𝐹 capacitor and B, the event of choosing a 1000 𝜇𝐹
capacitor from the lot Observe that 𝐵 = 𝐴𝑐 . The sample space for this problem is
𝑆 = 𝐴𝐴𝐴, 𝐴𝐴𝐵, 𝐴𝐵𝐴, 𝐵𝐴𝐴, 𝐴𝐵𝐵, 𝐵𝐴𝐵, 𝐵𝐵𝐴, 𝐵𝐵𝐵 .

Let 𝑋 be the number of 500 𝜇𝐹 capacitor in the sample. Observe that 𝑋 depends on the
outcome of the experiment, that the capacity of the three capacitors drawn. In particular,

𝑋 𝐴𝐴𝐴 = 3, 𝑋 𝐴𝐴𝐵 = 2, 𝐵𝐴𝐵 = 1, 𝑋 𝐵𝐵𝐵 = 0 and so on. Thus, the possible values of 𝑋
8 12 6
are 0, 1, 2, 3 and we have seen that 𝑃𝑟 𝑋 = 0 = , 𝑃𝑟 𝑋 = 1 = , 𝑃𝑟 𝑋 = 2 = and
27 27 27
1
𝑃𝑟 𝑋 = 3 = . Let us write 𝑓 𝑥 = 𝑃𝑟 𝑋 = 𝑥 .
27
Random Variables

Then we can describe these probabilities as:

𝒙: 0 1 2 3
𝑓 𝑥 : 8/27 12/27 6/27 1/27

In this example, we notice that 𝑋 is a mapping (function) from the sample space to the real
line and the range of 𝑋 is the set 𝑅 = {0, 1, 2, 3}. Observe that 𝑓 𝑎 = 𝑃𝑟 𝑋 = 𝑎 = 0 if
𝑎 ∉ 𝑅.

Definition: A random variable 𝑋 is a function from a sample space to the real line. 𝑋 is
called a discrete random variable if its range 𝑅 is either a finite or a countable set. If 𝑅 is a
finite or infinite interval, then 𝑋 is called a continuous random variable.

Definition: Given a discrete random 𝑋, A function 𝑓: 𝑅 → [0,1] defined as 𝑓 𝑥 = Pr{𝑋 =


𝑥} is known as a probability mass function or simply a probability function.
Random variables
For a probability mass function 𝑓,

𝑓 𝑥 ≥ 0 and ෍ 𝑓 𝑥 = 1.
𝑥

The distribution of the total probability 1 to the different values of the random variable 𝑋 is
known as a probability distribution of 𝑋.

Example 1: Two players A and B go on tossing a fair coin with the agreement that if head
appears B has to pay $1 to A and if tail appears A has to pay $1 to B. Let 𝑋 be the gain of A
after 3 tosses. Then the sample space is
𝑆 = 𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝑇𝐻, 𝑇𝐻𝐻, 𝑇𝑇𝐻, 𝑇𝐻𝑇, 𝐻𝑇𝑇, 𝑇𝑇𝑇 .

Observe that the probability of each element of the sample space is 1/8 and 𝑋 𝐻𝐻𝐻 = 3,
𝑋 𝐻𝐻𝑇 = 1, … , 𝑋 𝑇𝑇𝐻 = −1 and 𝑋 𝑇𝑇𝑇 = −3.
Random variables

Thus, the range of 𝑋 is 𝑅 = −3, −1, 1, 3 and the probability distribution of 𝑋 is

𝒙 𝒇(𝒙)
-3 1/8
-1 3/8
1 3/8
3 1/8

Observe that 𝑓 −1 = Pr 𝑋 = −1 = 𝑃 𝐻𝑇𝑇, 𝑇𝐻𝑇, 𝑇𝑇𝐻 , 𝑓 −1 =


Pr 𝑋 = 3 = 𝑃 𝐻𝐻𝐻 = 1/8 and so on.
Random variables

Example 2: There are 25 girls and 35 boys in a class room. 10 questions are to be asked to the students
of this class. For each question, a student of the class is randomly chosen without bothering for
repetition of the students. Let 𝑋 be the number of questions asked to the girl students. Then the
25 5
possible values of 𝑋 are 0,1,2, … , 10. Furthermore, the probability of choosing a girl student is 60 = 12
7
and that for a boy student is 12. Observe that 𝑋 = 3 if exactly 3 questions are asked to girl students
10
and 7 to boy students. However, choosing 3 question out of 10 can be done in 3
ways and
5 3 7 7
probability of choosing 3 girls and 7 boys is equal to . Hence
12 12

3 7
10 5 7
𝑃𝑟 𝑋 = 3 = .
3 12 12

If there are 𝑛 questions, proportion of girls is 𝑝 and that of boys is 𝑞, then observe that
𝑛 𝑘 𝑛−𝑘
𝑓 𝑘 = 𝑃𝑟 𝑋 = 𝑘 = 𝑝 𝑞 , 𝑘 = 0,1,2, … , 𝑛.
𝑘
𝑆= 𝑒1 , 𝑒2 , … , 𝑒10 : 𝑒𝑖 = 𝐺 𝑜𝑟 𝐵 𝑆 = 210
Random variables
Given a random variable 𝑋, a function 𝐹: ℝ → [0,1] defined as 𝐹 𝑥 = Pr{𝑋 ≤ 𝑥} is
called a probability distribution function (or cumulative distribution function or
simply distribution function). Look at the following table:
3/8 3/8
𝒙 𝒇(𝒙)
1/8 -3 1/8
1/8
-1 3/8
1 3/8
-3 -1 1 3
Sketch of 𝑓(𝑥) 3 1/8

𝐹 −∞ = 𝐹 −7 = 𝐹 −12 = 𝐹 −3.1 = 0.

𝐹 −3 = 𝐹 −2 = 𝐹 −1.1 = 1/8. 𝐹 −1 = 𝐹 0 = 𝐹 0.9999 = 4/8.

𝐹 1 = 𝐹 2 = 𝐹 2.5 = 7/8. 𝐹 3 = 𝐹 79.67 = 𝐹 1010 = 𝐹 ∞ = 1.


Random variables

The value of the probability distribution function 𝐹(𝑥) evaluated at the range of 𝑋 is given in the
following table:
1
Thus, 𝒙 𝑭(𝒙)
7/8
-3 1/8
𝟎 𝒊𝒇 𝒙 < −𝟑, -1 4/8
𝟏
𝒊𝒇 − 𝟑 ≤ 𝒙 < −𝟏,
𝟖 4/81 7/8
𝟒
𝑭 𝒙 =
𝟖
𝒊𝒇 − 𝟏 ≤ 𝒙 < 𝟏, 3 1
𝟕
𝒊𝒇 𝟏 ≤ 𝒙 < 𝟑, Sketch of 𝑭(𝒙)
𝟖
𝟏 𝒊𝒇 𝒙 ≥ 𝟑.
1/8

-3 -1 1 3

Observe that the function 𝐹(𝑥) is right continuous, i.e. lim+ 𝐹 𝑥 = 𝐹(𝑎) for each 𝑎 ∈ ℝ.
𝑥→𝑎
Random variables
Example3 : Two fair dice are thrown. Let 𝑋 be the sum of points arising out of one throw. Then, the possible values of 𝑋
are 𝑥 = 2,3,4,5,6,7,8,9,10,11,12. Observe that, in this case the sample space is
11 12 13 14 15 16 1 2
Pr 𝑋 = 2 = 𝑃 11 = 36 , 𝑃𝑟 𝑋 = 3 = 𝑃 12,21 = 36 , Pr 𝑋 = 4 =
21 22 23 24 25 26
3
31 32 33 34 35 36 𝑃 13,22,31 = 36 , …, Pr 𝑋 = 11 = 𝑃 56,65 = 2/36, Pr 𝑋 = 12 =
41 42 43 44 45 46
51 52 53 54 55 56 𝑃 66 = 1/36. The following table gives the values of 𝑓(𝑥) for different
61 62 63 64 65 66 values of 𝑥.

𝒙 2 3 4 5 6 7 8 9 10 11 12
Hence, 𝑓(𝑥) 1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 2/36 1/36

𝟏𝟓
𝒊𝒇 𝟔 ≤ 𝒙 < 𝟕,
𝟎 𝒊𝒇 𝒙 < 𝟐, 𝟑𝟔
𝟐𝟏
𝟏 𝒊𝒇 𝟕 ≤ 𝒙 < 𝟖,
𝟑𝟔
𝒊𝒇 𝟐 ≤ 𝒙 < 𝟑, 𝟑𝟔
𝟐𝟔
𝟑
𝒊𝒇 𝟖 ≤ 𝒙 < 𝟗,
𝟑𝟔
F 𝒙 = 𝒊𝒇 𝟑 ≤ 𝒙 < 𝟒, and F 𝒙 =
𝒊𝒇 𝟗 ≤ 𝒙 < 𝟏𝟎, and one can sketch 𝑓 𝑥 and 𝐹(𝑥) as usual.
𝟑𝟎
𝟑𝟔
𝟔 𝟑𝟔
𝒊𝒇 𝟒 ≤ 𝒙 < 𝟓, 𝟑𝟑
𝒊𝒇 𝟏𝟎 ≤ 𝒙 < 𝟏𝟏,
𝟑𝟔 𝟑𝟔
𝟏𝟎 𝟑𝟓
𝒊𝒇 𝟓 ≤ 𝒙 < 𝟔, . 𝒊𝒇 𝟏𝟏 ≤ 𝒙 < 𝟏𝟐,
𝟑𝟔 𝟑𝟔
𝟏 𝒊𝒇 𝒙 ≥ 𝟏𝟐,
Random Variables
Observe that 𝐹 𝑥 = Pr{𝑋 ≤ 𝑥}. Hence, if 𝑎 < 𝑏, then
Pr{X ≤ 𝑎} + Pr 𝑎 < X ≤ 𝑏 = Pr X ≤ 𝑏 .
Hence,
Pr 𝑎 < X ≤ 𝑏 = Pr X ≤ 𝑏 − Pr X ≤ 𝑎 = 𝐹 𝑏 − 𝐹(𝑎)
and continuous
which holds for both discrete random variables. The probability (or cumulative) distribution
function of a continuous random variable 𝑋 is given by
𝑥
𝐹 𝑥 = න 𝑓 𝑢 𝑑𝑢
−∞
and 𝑓 is called the probability density function, or density function or simply a density or, in
short, pdf. Thus, at each point 𝑥 where 𝐹 is differentiable, 𝐹 ′ 𝑥 = 𝑓(𝑥). The pdf of a
continuous random variable satisfies

𝑓 𝑥 ≥ 0 for all 𝑥 ∈ ℝ and න 𝑓 𝑥 𝑑𝑥 = 1 .
−∞
In case of a continuous random variable, the total probability 1 is distributed in some
interval and hence Pr 𝑋 = 𝑎 = 0 for each 𝑎 ∈ ℝ.
In case of a discrete random variable, 𝑓 𝑥 = 𝐹 𝑥 + − 𝐹 𝑥 −
Random Variables

Pr 𝑎 < X ≤ 𝑏 = Pr X ≤ 𝑏 − Pr X ≤ 𝑎 = 𝐹 𝑏 − 𝐹 𝑎

𝑓(𝑥) 𝑓(𝑥)
𝑭 𝒙
Pr{𝑎 < 𝑋 ≤ 𝑏}

𝑎 𝑏
𝑥
Example 4: Let 𝑋 be a discrete random variable with pmf 𝑓 𝑥 = 𝐾𝑥 2 , 𝑥 = 1,2,3,4. Find 𝐾,
and the probability (cumulative) distribution function 𝐹 𝑥 . Sketch both 𝑓 𝑥 and 𝐹(𝑥).
Ans. Since sum of all probabilities is equal to 1, we have
𝐾 12 + 22 + 32 + 42 = 1.
1 𝑥2
Hence 𝐾 = and 𝑓 𝑥 = ,𝑥 = 1,2,3,4. Rest is to be done by you.
30 30
Random Variables
0 if 𝑥 ≤ 0
Example 5: Find the density function whose cdf is 𝐹 𝑥 = ቊ −3𝑥 Sketch both
1−𝑒 if 𝑥 > 0.
𝑓(𝑥) and 𝐹(𝑥).
Ans. The function 𝐹 𝑥 is differentiable except at 𝑥 = 0. Hence,
′ 0 𝑖𝑓 𝑥 < 0,
𝑓 𝑥 = 𝐹 𝑥 = ቊ −3𝑥
3𝑒 𝑖𝑓 𝑥 > 0.
Now sketch 𝑓(𝑥) and 𝐹(𝑥) as usual.
Example 4: Let 𝑋 [millimeters] be the thickness of washers. Assume that 𝑋 has the density
𝑓 𝑥 = 𝑘𝑥 if 0.9 < 𝑥 < 1.1 and 𝑓 𝑥 = 0 elsewhere. Find 𝑘. What is the probability that a
washer will have thickness between 0.95 mm and 1.05 mm?
∞ 1.1
Ans. 𝑘: ‫׬‬−∞ 𝑓(𝑥) 𝑑𝑥 = 1 . Hence 𝑘 ‫׬‬0.9 𝑥 𝑑𝑥 = 1. Thus, 𝑘 = 5. The probability that a
washer will have thickness between 0.95 mm and 1.05 mm is equal to
1.05
Pr 0.95 ≤ 𝑋 ≤ 1.05 = න 5𝑥 𝑑𝑥 = 0.5 .
0.95
Random Variables
Example 6: Find the probability that none of three bulbs in a traffic signal will have to be
replaced during the first 1500 hours of operation if the lifetime 𝑋 of a bulb is a random
variable with density 𝑓 𝑥 = 6 0.25 − 𝑥 − 1.5 2 if 1 ≤ 𝑥 ≤ 2 and 𝑓 𝑥 = 0 otherwise,
where 𝑥 is measured in multiples of 1000 hours.

Ans. Probability of no failure of any given bulb in first 1500 hr of operation


∞ 2
2
𝑝 = Pr 𝑋 > 1.5 = න 𝑓 𝑥 𝑑𝑥 = න 6 0.25 − 𝑥 − 1.5 𝑑𝑥
1.5 1.5

To make the calculation simple use the transformation 𝑦 = 𝑥 − 1.5. Then


0.5
0.53 2.25 − 0.125 17
𝑝 = න 6 0.25 − 𝑦 2 𝑑𝑦 = 1.5 × 0.5 − 0.125 = =
0 3 3 24

The probability that none of three bulbs in a traffic signal will have to be replaced during
17 3
the first 1500 hours = = 0.3554.
24
Random Variables
Example 7: Suppose that in an automatic process of filling oil cans, the content of a can (in gallons) is 𝑌 =
100 + 𝑋, where 𝑋 is a random variable with density 𝑓 𝑥 = 1 − |𝑥| if 𝑥 ≤ 1 and 𝑓 𝑥 = 0 when 𝑥 >
1. Sketch 𝑓(𝑥) and 𝐹(𝑥). In a lot of 1000 cans, about how many will contain 100 gallons or more? What is
the probability that a can will contain less than 99.5 gallons? Less than 99 gallons?.

Ans. Given that


𝑓 𝑥 =1+𝑥 𝑓 𝑥 =1−𝑥
1 + 𝑥 if − 1 ≤ 𝑥 ≤ 0
𝑓 𝑥 = ቐ 1 − 𝑥 if 0 ≤ 𝑥 ≤ 1
0 otherwise. x
−1 0 1
Thus, for 𝑥 < −1, 𝐹 𝑥 = 0. If −1 ≤ 𝑥 ≤ 0, then Sketch of 𝑓(𝑥)
𝑥 𝑥 2
1+𝑥 1 𝑥2
𝐹 𝑥 = න 𝑓(𝑢) 𝑑𝑢 = න (1 + 𝑢) 𝑑𝑢 = = +𝑥+ .
−∞ −1 2 2 2
0 1
Thus, 𝐹 0 = ‫׬‬−∞ 𝑓 𝑢 𝑑𝑢 = 2 . If 0 ≤ 𝑥 ≤ 1, then
𝑥 0 𝑥 2
1−𝑥 1 𝑥2
𝐹 𝑥 = න 𝑓(𝑢) 𝑑𝑢 = න 𝑓(𝑢) 𝑑𝑢 + න (1 − 𝑢) 𝑑𝑢 = 1 − = +𝑥− .
−∞ −∞ 0 2 2 2

If 𝑥 ≥ 1, then 𝐹 𝑥 = 1.
Random Variables
Thus,
0 𝑖𝑓 𝑥 < −1
2
1 𝑥
+𝑥+ 𝑖𝑓 − 1 < 𝑥 < 0
𝐹 𝑥 = 2 2
1 𝑥2
+𝑥− 𝑖𝑓 0 < 𝑥 < 1
2 2
1 𝑖𝑓 𝑥 ≥ 1.

Now, the probability that a can will contain 100 gallons or more is equal to
∞ 1 1
Pr 𝑌 ≥ 100 = Pr 𝑋 ≥ 0 = න 𝑓(𝑥) 𝑑𝑥 = න 1 − 𝑥 𝑑𝑥 = .
0 0 2

Thus, out of 1000 cans about 500 cans will contain 100 gallons or more.

The probability that a can will contain less than 99.5 gallons is equal to
−0.5 −0.5 1
Pr 𝑌 < 99.5 = Pr 𝑋 < −0.5 = න 𝑓(𝑥) 𝑑𝑥 = න 1 + 𝑥 𝑑𝑥 = .
−∞ −1 8

The probability that a can will contain less than 99 gallons is equal to
−1
Pr 𝑌 < 99 = Pr 𝑋 < −1 = න 𝑓(𝑥) 𝑑𝑥 = 0 .
−∞
Random Variables
Example 8: A packet contains 3 hard drives of capacity 1 TB and 7 hard drives of capacity 2 TB.
Hard drives are drawn one by one and with replacement till a hard drive of capacity 2 TB is drawn.
Let 𝑋 be the number of hard drives chosen till the first 2 TB drive is chosen. Find the pmf and cdf of
𝑋. Find the probability of choosing a 2 TB hard drive not before the third draw?

Ans. Let 𝐴 be the event of choosing a 2 TB hard drive and 𝐵 the event of choosing a 1 TB hard drive
7 3
in one draw. Then 𝑃 𝐴 = , 𝑃 𝐵 = . The first 2 TB hard drive can be chosen as follows
10 10

𝐴, 𝐵𝐴, 𝐵𝐵𝐴, 𝐵𝐵𝐵𝐴,…

Hence the possible values of 𝑋 are 1, 2, 3, … and


𝑥−1
3 7
𝑓(𝑥) = Pr 𝑋 = 𝑥 = 𝑃 𝐵𝐵𝐵 … … 𝐵𝐴 = × .
10 10
Pr choosing a 2 TB hard drive not before the third draw
7 3 7 9
= Pr 𝑋 ≥ 3 = 1 − Pr 𝑋 ≤ 2 = 1 − 𝑓 1 − 𝑓 2 = 1 − − × = = 0.09
10 10 10 100
Now you prepare tables for 𝑓 𝑥 and 𝐹(𝑥) and do the rest work.

You might also like