0% found this document useful (0 votes)
37 views

Chapter 2 Concept of Random Variables

The document discusses concepts related to random variables including discrete and continuous probability distributions, expectation, and cumulative distribution functions. It provides examples of defining random variables for experiments involving coin tosses and dice rolls. The key concepts of discrete random variables and their probability mass functions are defined.

Uploaded by

wyperiousgaming
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Chapter 2 Concept of Random Variables

The document discusses concepts related to random variables including discrete and continuous probability distributions, expectation, and cumulative distribution functions. It provides examples of defining random variables for experiments involving coin tosses and dice rolls. The key concepts of discrete random variables and their probability mass functions are defined.

Uploaded by

wyperiousgaming
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 144

Chapter 2

Concepts of Random Variables

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-1


Overview
• Random variables
• Discrete probability distributions
– Probability function
• Continuous probability distributions
– Probability density function
• Cumulative distribution function

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-2


Overview (Continued)

• Expectation
– Mean and variance
– Expectation of functions of random variables
– Properties of expectation
• Chebychev’s Inequality

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-3


2.1 Introduction
• It is frequently the case that, when an experiment is
performed, we are mainly interested in some function of
the outcome as opposed to the actual outcome itself.
• For instance, in testing 100 electronic components, we are
often concerned with the number of defectives that occur.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-4


Introduction (Continued)
• Also, in coin-flipping, we may be interested in the total
number of heads that occur and do not care at all about the
actual head-tail sequence that result.
• These values are, of course, random quantities determined
by the outcomes of the experiment.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-5


Example 1
• Let 𝑆𝑆 = {𝐻𝐻𝐻𝐻, 𝐻𝐻𝐻𝐻, 𝑇𝑇𝑇𝑇, 𝑇𝑇𝑇𝑇} be a sample space associated with
the experiment of tossing two coins.
• Define the random variable (a function)
X = number of heads obtained.
𝑋𝑋 ∶ 𝑆𝑆 → ℝ, where ℝ is the set of all real numbers
such that 𝑋𝑋(𝐻𝐻𝐻𝐻) = 2, 𝑋𝑋(𝐻𝐻𝐻𝐻) = 1, 𝑋𝑋(𝑇𝑇𝑇𝑇) = 1 and 𝑋𝑋(𝑇𝑇𝑇𝑇) = 0.
• In fact the range space, 𝑹𝑹𝑿𝑿 , for the random variable X is
{0, 1, 2}.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-6
Example 2
Consider tossing a pair of fair dice.
• Let X be the sum of the upturned faces.
𝑆𝑆 = {(𝑥𝑥, 𝑦𝑦)|𝑥𝑥 = 1, 2, ⋯ , 6; 𝑦𝑦 = 1, 2, ⋯ , 6}.
𝑋𝑋: 𝑆𝑆 → ℝ
such that 𝑋𝑋((𝑥𝑥, 𝑦𝑦)) = 𝑥𝑥 + 𝑦𝑦
for 𝑥𝑥 = 1, 2, ⋯ , 6; 𝑦𝑦 = 1, 2, ⋯ , 6.
• e.g. 𝑋𝑋 1, 1 = 2; 𝑋𝑋 1, 2 = 3; 𝑋𝑋 3,6 =9
• 𝑹𝑹𝑿𝑿 = {2, 3, 4, 5, ⋯ , 11, 12}.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-7
Example 3
• A coin is thrown until a “Head” occurs.

• Let X be the number of trials required.


𝑆𝑆 = {𝐻𝐻, 𝑇𝑇𝑇𝑇, 𝑇𝑇𝑇𝑇𝑇𝑇, 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇, 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇, ⋯ }.
𝑋𝑋: 𝑆𝑆 → ℝ
such that 𝑋𝑋 𝐻𝐻 = 1, 𝑋𝑋 𝑇𝑇𝑇𝑇 = 2, 𝑋𝑋 𝑇𝑇𝑇𝑇𝑇𝑇 = 3 and so on.

• 𝑹𝑹𝑿𝑿 = {1, 2, 3, 4, 5, ⋯ }, the set of positive integers.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-8


2.1.1 Random Variable
Definition 2.1
• Let S be a sample space associated with the experiment, E.

• A function X, which assigns a number to every element 𝑠𝑠 ∈ 𝑆𝑆,


is called a random variable.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-9


Random Variable (Continued)
Notes:
1. X is a real-valued function.
2. The range space of X is the set of real numbers
𝑹𝑹𝑿𝑿 = 𝑥𝑥 𝑥𝑥 = 𝑋𝑋(𝑠𝑠), 𝑠𝑠 ∈ 𝑆𝑆}.
Each possible value 𝑥𝑥 of 𝑋𝑋 represents an event that is a
subset of the sample space 𝑆𝑆.
3. If S has elements that are themselves real numbers, we take
𝑋𝑋(𝑠𝑠) = 𝑠𝑠. In this case 𝑹𝑹𝑿𝑿 = 𝑆𝑆.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-10
2.1.2 Equivalent Events
Definition 2.2
• Let E be an experiment and S its sample space.
• Let X be a random variable defined on S and 𝑹𝑹𝑿𝑿 be its range
space.
That is, 𝑋𝑋 ∶ 𝑆𝑆 → ℝ
• Let B be an event with respect to 𝑹𝑹𝑿𝑿 ;
That is 𝐵𝐵 ⊂ 𝑹𝑹𝑿𝑿 .

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-11


Equivalent Events (Continued)

Definition 2.2 (Continued)


• Suppose that A is defined as
𝐴𝐴 = 𝑠𝑠 ∈ 𝑆𝑆 𝑋𝑋 𝑠𝑠 ∈ 𝐵𝐵}.
In words: A consists of all sample points, s, in S for which
𝑋𝑋 𝑠𝑠 ∈ 𝐵𝐵.

• In this case we say that A and B are equivalent events and


Pr 𝐵𝐵 = Pr 𝐴𝐴 .
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-12
Example 1 (Continued)

• Consider tossing a coin twice.


• Then 𝑆𝑆 = {𝐻𝐻𝐻𝐻, 𝐻𝐻𝐻𝐻, 𝑇𝑇𝑇𝑇, 𝑇𝑇𝑇𝑇}.
• Let 𝑋𝑋 be the number of heads obtained.
• Then the possible values for 𝑋𝑋(𝑠𝑠), (usually we just write 𝑋𝑋)
are 0, 1, 2 hence and 𝑹𝑹𝑿𝑿 = {0, 1, 2}.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-13


Example 1 (Continued)

• Therefore
𝐴𝐴1 = {𝐻𝐻𝐻𝐻} is equivalent to 𝐵𝐵1 = {2}
𝐴𝐴2 = {𝐻𝐻𝐻𝐻, 𝑇𝑇𝑇𝑇} is equivalent to 𝐵𝐵2 = {1}
𝐴𝐴3 = {𝑇𝑇𝑇𝑇} is equivalent to 𝐵𝐵3 = {0}
𝐴𝐴4 = {𝐻𝐻𝐻𝐻, 𝐻𝐻𝐻𝐻, 𝑇𝑇𝑇𝑇} is equivalent to 𝐵𝐵4 = {2, 1}

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-14


Example 1 (Continued)

Pr(𝐴𝐴1 ) = Pr(𝐵𝐵1 ) = 1/4


Pr 𝐴𝐴2 = Pr 𝐵𝐵2 = 2/4 = 1/2
Pr 𝐴𝐴3 = Pr 𝐵𝐵3 = 1/4
Pr 𝐴𝐴4 = Pr 𝐵𝐵4 = 3/4.

Note: Event {𝐻𝐻𝐻𝐻, 𝐻𝐻𝐻𝐻} does not have an equivalent event


based on random variable 𝑋𝑋 defined above.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-15


Example 1 (Continued)

We can summarize the probabilities of the random variable X


as follows.

Number of heads, 𝑥𝑥 0 1 2
Pr(𝑋𝑋 = 𝑥𝑥) 1/4 1/2 1/4

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-16


Example 2
• When a pair of fair dice is tossed, what is the probability
that a sum of 3 is obtained?
𝑆𝑆 = {(𝑥𝑥1 , 𝑥𝑥2 )|𝑥𝑥1 = 1, 2, 3, 4, 5, 6; 𝑥𝑥2 = 1, 2, 3, 4, 5, 6}.

• Let 𝑋𝑋 𝑥𝑥1 , 𝑥𝑥2 = 𝑥𝑥1 + 𝑥𝑥2 , then


𝑹𝑹𝑿𝑿 = {2, 3, 4, ⋯ , 12}.

• Hence the event 𝐵𝐵 = {3} in RX is equivalent to the event


𝐴𝐴 = {(1, 2), (2, 1)} in S.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-17
Example 2 (Continued)
• Therefore
Pr 𝑋𝑋 = 3 = Pr 1, 2 , 2, 1
= Pr 1, 2 + Pr 2, 1
= 1/36 + 1/36 = 1/18.

• The probabilities of all other possible sums can be found in


a similar manner. They are given in the table in the next
slide.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-18


Example 2 (Continued)
• The probabilities of the random variable 𝑋𝑋 are given in the
following table.
𝑥𝑥 2 3 4 5 6 7
Pr(𝑋𝑋 = 𝑥𝑥) 1/36 2/36 3/36 4/36 5/36 6/36

𝑥𝑥 8 9 10 11 12
Pr(𝑋𝑋 = 𝑥𝑥) 5/36 4/36 3/36 2/36 1/36

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-19


2.2 Discrete Probability Distributions
2.2.1 Discrete Random Variable
Definition 2.3
• Let 𝑋𝑋 be a random variable.

• If the number of possible values of 𝑋𝑋 (i.e., 𝑹𝑹𝑿𝑿 , the range


space) is finite or countable infinite, we call 𝑋𝑋 a discrete
random variable.

• That is, the possible values of 𝑋𝑋 may be listed as 𝑥𝑥1 , 𝑥𝑥2, 𝑥𝑥3, ⋯.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-20
2.2.2 Probability Function
• For a discrete random variable, each value of 𝑋𝑋 has a certain
probability 𝑓𝑓(𝑥𝑥).

• Such a function 𝑓𝑓(𝑥𝑥) is called the probability function, p.f.


(or probability mass function, p.m.f.).

• The collection of pairs (𝑥𝑥𝑖𝑖 , 𝑓𝑓(𝑥𝑥𝑖𝑖 )) is called the probability


distribution of 𝑋𝑋.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-21
Probability Function (Continued)

The probability of 𝑋𝑋 = 𝑥𝑥𝑖𝑖 denoted by 𝑓𝑓(𝑥𝑥𝑖𝑖 ) (i.e. 𝑓𝑓 𝑥𝑥𝑖𝑖 =


Pr(𝑋𝑋 = 𝑥𝑥𝑖𝑖 ), must satisfy the following two conditions.

(1) 𝑓𝑓(𝑥𝑥𝑖𝑖 ) ≥ 0 for all 𝑥𝑥𝑖𝑖 .

(2) ∑∞
𝑖𝑖=1 𝑓𝑓(𝑥𝑥𝑖𝑖 ) = 1.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-22


Example 1
• Consider tossing a coin twice.
• Let X be the number of heads obtained.
• Then we have

𝑥𝑥 0 1 2
𝑓𝑓 𝑥𝑥 = Pr(𝑋𝑋 = 𝑥𝑥) 1/4 1/2 1/4

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-23


Example 1 (Continued)
• Hence, we can see the condition (1) is satisfied since
𝑓𝑓(0) = 1/4 > 0, 𝑓𝑓(1) = 1/2 > 0 and 𝑓𝑓(2) = 1/4 > 0.

• Condition (2) is also satisfied since


𝑓𝑓 0 + 𝑓𝑓 1 + 𝑓𝑓 2 = 1/4 + 1/2 + 1/4 = 1.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-24


Example 1 (Continued)

• One might plot the points (𝑥𝑥𝑖𝑖 , 𝑓𝑓(𝑥𝑥𝑖𝑖 )) of the Example 1 so


that the probability distribution is displayed in a
probability line graph as follows.

f (x )
½
¼
x
0 1 2

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-25


Example 1 (Continued)

• Instead of using lines, we can use rectangles for the plot


and the resulting plot is called a probability histogram.

• The rectangles are constructed so that their bases of equal


width are centered at each value of X, and their heights are
equal to the corresponding probabilities.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-26


Example 1 (Continued)

• If the base of the rectangle has unit width, then the


probability Pr(𝑋𝑋 = 𝑥𝑥𝑖𝑖 ) is equal to the area of the rectangle
centered at 𝑥𝑥𝑖𝑖 .
• The total area of all the rectangles is 1.
f (x )

½
¼
x
0 1 2
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-27
Example 2
• Consider throwing a pair of fair dice.
• Let X be the sum of the two dice. Then we have
𝑥𝑥 2 3 4 5 6 7
Pr(𝑋𝑋 = 𝑥𝑥) 1/36 2/36 3/36 4/36 5/36 6/36

𝑥𝑥 8 9 10 11 12
Pr(𝑋𝑋 = 𝑥𝑥) 5/36 4/36 3/36 2/36 1/36

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-28


Example 2 (Continued)
• Notice that all 𝑓𝑓(𝑥𝑥) > 0 for 𝑥𝑥 = 2, 3, 4, 5, ⋯ , 11, 12 and

• 𝑓𝑓(2) + 𝑓𝑓(3) + 𝑓𝑓(4) + ⋯ + 𝑓𝑓(11) + 𝑓𝑓(12) = 1.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-29


Example 3
Six lots of components are ready to be shipped by a certain
supplier. The number of defective components in each lot is
as follows:
Lot 1 2 3 4 5 6
Number of defectives 0 2 0 1 2 0
• One of these lots is to be randomly selected for the
shipment to a particular customer.
• Let X be the number of defectives in the selected lot.
• The three possible X values are 0, 1, and 2.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-30
Example 3 (Continued)

• Of the six equally likely choices of one lot, three result in


𝑋𝑋 = 0, one in 𝑋𝑋 = 1, and the other two in 𝑋𝑋 = 2.
• Let 𝑓𝑓(𝑥𝑥) denote the probability that 𝑋𝑋 = 𝑥𝑥 for 𝑥𝑥 = 0, 1, 2.
• Then
𝑓𝑓 0 = Pr 𝑋𝑋 = 0 = Pr lot 1 or 3 or 6 is selected = 3/6.
𝑓𝑓 1 = Pr 𝑋𝑋 = 1 = Pr lot 4 is selected = 1/6.
𝑓𝑓 2 = Pr 𝑋𝑋 = 2 = Pr lot 2 or 5 is selected = 2/6.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-31


Example 3 (Continued)

• Therefore, the probability function of 𝑋𝑋 is given by


𝑥𝑥 0 1 2
𝑓𝑓 𝑥𝑥 = Pr(𝑋𝑋 = 𝑥𝑥) 1/2 1/6 1/3

• Hence, 𝑓𝑓(𝑥𝑥𝑖𝑖 ) > 0 for 𝑥𝑥1 = 0, 𝑥𝑥2 = 1 and 𝑥𝑥3 = 2.

• Also 𝑓𝑓(0) + 𝑓𝑓(1) + 𝑓𝑓(2) = 1.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-32


Example 4
• Find the constant c so that
𝑓𝑓(𝑥𝑥) = 𝑐𝑐𝑐𝑐, for 𝑥𝑥 = 1, 2, 3, 4,
and 0 otherwise, is a probability function of a random
variable 𝑋𝑋.
• Hence compute Pr(𝑋𝑋 ≥ 3).

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-33


Example 4 (Continued)
Solution
• By the property that ∑∞ 𝑖𝑖=1 𝑓𝑓(𝑥𝑥𝑖𝑖 ) = 1, we have
𝑓𝑓(𝑥𝑥1 ) + 𝑓𝑓(𝑥𝑥2 ) + 𝑓𝑓(𝑥𝑥3 ) + 𝑓𝑓(𝑥𝑥4 ) = 1
𝑐𝑐 + 2𝑐𝑐 + 3𝑐𝑐 + 4𝑐𝑐 = 1.
• Therefore 𝑐𝑐 = 1/10.
• Hence
Pr(𝑋𝑋 ≥ 3) = 𝑓𝑓(3) + 𝑓𝑓(4) = 3/10 + 4/10 = 7/10.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-34


Example 5
• Consider a group of five potential blood donors — A, B, C,
D and E — of whom only A and B have type O+ blood.

• Five blood samples, one from each individual, will be typed


in random order until an O+ individual is identified.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-35


Example 5 (Continued)
• Let the random variable Y = the number of typing
necessary to identify an O+ individual.
• Let 𝑂𝑂𝑖𝑖 and 𝑂𝑂𝑖𝑖′ be the event that an O+ and a non-O+
individual is typed in the i-th typing
𝑓𝑓 1 = Pr 𝑌𝑌 = 1 = Pr O1 = 2/5 = 0.4.
𝑓𝑓 2 = Pr 𝑌𝑌 = 2
= Pr 𝑂𝑂1′ Pr 𝑂𝑂2 𝑂𝑂1′ )
3 2 3
= = = 0.3.
5 4 10
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-36
Example 5 (Continued)
𝑓𝑓 3 = Pr 𝑌𝑌 = 3 = Pr 𝑂𝑂1′ Pr 𝑂𝑂2′ 𝑂𝑂1′ Pr 𝑂𝑂3 𝑂𝑂1′ ∩ 𝑂𝑂2′
3 2 2 1
= = = 0.2.
5 4 3 5
𝑓𝑓 4 = Pr 𝑌𝑌 = 4
= Pr 𝑂𝑂1′ Pr 𝑂𝑂2′ 𝑂𝑂1′ Pr 𝑂𝑂3′ 𝑂𝑂1′ ∩ 𝑂𝑂2′ Pr 𝑂𝑂4 𝑂𝑂1′ ∩ 𝑂𝑂2′ ∩ 𝑂𝑂3′
3 2 1 2 1
= = = 0.1.
5 4 3 2 10
𝑓𝑓 𝑦𝑦 = 0 if 𝑦𝑦 ≠ 1, 2, 3, 4.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-37
Example 5 (Continued)
• Then the probability function of Y is

𝑦𝑦 1 2 3 4
𝑓𝑓(𝑦𝑦) 0.4 0.3 0.2 0.1

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-38


2.2.3 Another View of Probability Function
It is often to think of a probability function as specifying a
mathematical model for a finite population.

Example
• Consider selecting at random a student who is among the
35,000 registered for the current semester in NUS.
• Let X = the number of modules for which the selected
student is registered and suppose that X has the
probability function.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-39
Another View of Probability Function (Continued)

𝑥𝑥 1 2 3 4 5 6 7
𝑓𝑓(𝑥𝑥) 0.01 0.03 0.13 0.25 0.39 0.17 0.02

• One way to view this situation is to think of the population


as consisting 35,000 individuals, each having his or her
own X value; the proportion with each X value is given by
𝑓𝑓(𝑥𝑥) above.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-40


Another View of Probability Function (Continued)

• An alternative viewpoint is to forget about the students and


think of the population itself as consisting of the 𝑋𝑋 values.
• There are some 1’s in the population, some 2’s, ⋯ and finally
some 7’s.
• The population then consists of the numbers 1, 2, ⋯, 7 (so
are discrete values), and 𝑓𝑓(𝑥𝑥) gives a model for the
distribution of population values.
• Once we have such a mathematical model for a population,
we will use it to compute values of population characteristics
(such as the mean).
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-41
2.3 Continuous Probability Distributions
2.3.1 Continuous Random Variable
Definition 2.4
• Suppose that 𝑹𝑹𝑿𝑿 , the range space of a random variable, X,
is an interval or a collection of intervals.
• Then we say that X is a continuous random variable.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-42


2.3.2 Probability Density Function
Definition 2.5
• Let X be a continuous random variable.
• The probability density function (p.d.f.) 𝒇𝒇(𝒙𝒙), is a
function, 𝑓𝑓(𝑥𝑥), satisfying the following conditions:
1. 𝑓𝑓(𝑥𝑥) ≥ 0 for all 𝑥𝑥 ∈ 𝑹𝑹𝑿𝑿 ,

2. ∫𝑹𝑹 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑 = 1 or ∫−∞ 𝑓𝑓(𝑥𝑥) 𝑑𝑑𝑑𝑑 = 1
𝑋𝑋
since 𝑓𝑓(𝑥𝑥) = 0 for 𝑥𝑥 not in 𝑹𝑹𝑿𝑿 .

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-43


Probability Density Function (Continued)

Definition 2.5 (Continued)


3. For any c and d such that 𝑐𝑐 < 𝑑𝑑 , (i.e. 𝑐𝑐, 𝑑𝑑 ⊂ 𝑹𝑹𝑿𝑿 ),

𝑑𝑑
Pr 𝑐𝑐 ≤ 𝑋𝑋 ≤ 𝑑𝑑 = � 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑
𝑐𝑐

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-44


Remarks
𝑑𝑑
1. Pr 𝑐𝑐 ≤ 𝑋𝑋 ≤ 𝑑𝑑 = ∫𝑐𝑐 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑
represents the area under the graph of the p.d.f. 𝑓𝑓(𝑥𝑥)
between 𝑥𝑥 = 𝑐𝑐 and 𝑥𝑥 = 𝑑𝑑.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-45


Remarks (Continued)

2. For any specified value of X, say 𝑥𝑥0 , we have


𝑥𝑥0
Pr 𝑋𝑋 = 𝑥𝑥0 = � 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑 = 0
𝑥𝑥0
Hence in the continuous case, the probability of X equals
to a fixed value is 0 and
Pr 𝑐𝑐 ≤ 𝑋𝑋 ≤ 𝑑𝑑 = Pr 𝑐𝑐 ≤ 𝑋𝑋 < 𝑑𝑑 = Pr 𝑐𝑐 < 𝑋𝑋 ≤ 𝑑𝑑 =
Pr(𝑐𝑐 < 𝑋𝑋 < 𝑑𝑑).
Therefore in the continuous case, ≤ and < can be used
interchangeably in a probability statement.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-46
Remarks (Continued)

3. Pr 𝐴𝐴 = 0 does not necessary imply 𝐴𝐴 = ∅.

4. If X assumes values only in some interval [𝑎𝑎, 𝑏𝑏], we may


simply set 𝑓𝑓(𝑥𝑥) = 0 for all X outside [𝑎𝑎, 𝑏𝑏].

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-47


Example 1
• Suppose that the random variable X is continuous.
• Let the p.d.f. 𝑓𝑓(𝑥𝑥) be given by

𝑐𝑐𝑐𝑐, for 0 < 𝑥𝑥 < 1;


𝑓𝑓 𝑥𝑥 = �
0, otherwise.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-48


Example 1 (Continued)

(a) Find the value c.


(b) Find Pr(𝑋𝑋 ≤ 1/2).
(c) Find Pr(1/3 ≤ 𝑋𝑋 ≤ 2/3).
(d) Find Pr(𝑋𝑋 ≥ 3/4).

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-49


Solution to Example 1
(a)
1 1
𝑥𝑥 2 𝑐𝑐
� 𝑐𝑐𝑐𝑐 𝑑𝑑𝑑𝑑 = 𝑐𝑐 =
0 2 0
2
1
• Hence ∫0 𝑐𝑐𝑐𝑐 𝑑𝑑𝑑𝑑 = 1 implies that 𝑐𝑐/2 = 1.
• Therefore 𝑐𝑐 = 2.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-50


Solution to Example 1 (Continued)

(b)
1/2
1
Pr 𝑋𝑋 ≤ = � 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑
2 0
1/2
2 1/2
=� 2𝑥𝑥 𝑑𝑑𝑑𝑑 = 𝑥𝑥 0
0
1
=
4

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-51


Solution to Example 1 (Continued)
(c)
2/3
1 2
Pr ≤ 𝑋𝑋 ≤ = � 2𝑥𝑥 𝑑𝑑𝑑𝑑
3 3 1/3
2 2/3
= 𝑥𝑥 1/3
4 1 1
= − =
9 9 3

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-52


Solution to Example 1 (Continued)
(d)
1
3
Pr 𝑋𝑋 ≥ = � 2𝑥𝑥 𝑑𝑑𝑑𝑑
4 3/4
= 𝑥𝑥 2 13/4
9 7
=1− =
16 16

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-53


Example 2
• “Time headway” in traffic flow is the elapsed time between
the time that one car finishes passing a fixed point and the
instant that the next car begins to pass that point.
• Let X = the time headway for two randomly chosen
consecutive cars on a highway during a period of heavy
flow.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-54


Example 2 (Continued)

• The following p.d.f. of X was suggested:

0.15𝑒𝑒 −0.15 𝑥𝑥−0.5 , for 𝑥𝑥 ≥ 0.5;


𝑓𝑓 𝑥𝑥 = �
0, otherwise.

Note: 𝑓𝑓 𝑥𝑥 ≥ 0 for all 𝑥𝑥.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-55


Example 2 (Continued)
• Clearly, 𝑓𝑓 𝑥𝑥 ≥ 0 and
∞ 0.5 ∞
� 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑 = � 0 𝑑𝑑𝑑𝑑 = � 0.15 𝑒𝑒 −0.15 𝑥𝑥−0.5 𝑑𝑑𝑑𝑑
−∞ −∞ 0.5

= 0.15𝑒𝑒 0.075 � 𝑒𝑒 −0.15𝑥𝑥 𝑑𝑑𝑑𝑑
0.5
1 −0.15𝑥𝑥 ∞
= 0.15𝑒𝑒 0.075 − 𝑒𝑒
0.15 0.5
1 −0.15(0.5)
= 0.15𝑒𝑒 0.075 0− − e =1
0.15
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-56
Example 2 (Continued)

• Hence the given function 𝑓𝑓(𝑥𝑥) is a legitimate probability


density function.

• What is the probability that headway time is at most 5


sec?
i.e. What is Pr(𝑋𝑋 ≤ 5)?

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-57


Solution to Example 2
5
Pr 𝑋𝑋 ≤ 5 = � 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑
−∞
0.5 5
= � 0 𝑑𝑑𝑑𝑑 + � 0.15 𝑒𝑒 −0.15 𝑥𝑥−0.5 𝑑𝑑𝑑𝑑
−∞ 0.5
5
= 0.15 𝑒𝑒 0.075 � 𝑒𝑒 −0.15𝑥𝑥 𝑑𝑑𝑑𝑑
0.5
5
1
= 0.15 𝑒𝑒 0.075 − 𝑒𝑒 −0.15𝑥𝑥
0.15 0.5
= 𝑒𝑒 0.075 −𝑒𝑒 −0.75 + 𝑒𝑒 −0.075 = 0.4908.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-58
2.4 Cumulative Distribution Function
Definition 2.6
• Let X be a random variable, discrete or continuous.

• We define 𝐹𝐹(𝑥𝑥) to be the cumulative distribution


function of the random variable 𝑋𝑋 (abbreviated as c.d.f.)
where
𝐹𝐹 𝑥𝑥 = Pr(𝑋𝑋 ≤ 𝑥𝑥).

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-59


2.4.1 CDF for Discrete Random Variables
• If X is a discrete random
variable, then
𝐹𝐹 𝑥𝑥 = � 𝑓𝑓(𝑡𝑡)
𝑡𝑡≤𝑥𝑥

= � Pr(𝑋𝑋 = 𝑡𝑡)
𝑡𝑡≤𝑥𝑥
• The c.d.f. of a discrete random
variable is a step function.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-60
CDF for Discrete Random Variables (Continued)

• For any two numbers a and b with 𝑎𝑎 ≤ 𝑏𝑏.


Pr 𝑎𝑎 ≤ 𝑋𝑋 ≤ 𝑏𝑏 = Pr 𝑋𝑋 ≤ 𝑏𝑏 − Pr 𝑋𝑋 < 𝑎𝑎
= 𝐹𝐹 𝑏𝑏 − 𝐹𝐹 𝑎𝑎−
where “𝑎𝑎− ” represents the largest possible value of X value
that is strictly less than 𝑎𝑎.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-61


CDF for Discrete Random Variables (Continued)

• In particular, if the only possible values are integers and if


a and b are integers, then

Pr 𝑎𝑎 ≤ 𝑋𝑋 ≤ 𝑏𝑏 = Pr(𝑋𝑋 = 𝑎𝑎 or 𝑎𝑎 + 1 or ⋯ or 𝑏𝑏)

Also Pr 𝑎𝑎 ≤ 𝑋𝑋 ≤ 𝑏𝑏 = 𝐹𝐹 𝑏𝑏 − 𝐹𝐹(𝑎𝑎 − 1)
• Taking 𝑎𝑎 = 𝑏𝑏 yields
Pr 𝑋𝑋 = 𝑎𝑎 = 𝐹𝐹 𝑎𝑎 − 𝐹𝐹 𝑎𝑎 − 1 .
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-62
2.4.2 CDF for Continuous Random Variables
• If X is a continuous random
variable, then

𝑥𝑥
𝐹𝐹 𝑥𝑥 = � 𝑓𝑓 𝑡𝑡 𝑑𝑑𝑑𝑑
−∞

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-63


CDF for Continuous Random Variables (Continued)
• For a continuous random variable X,
𝑑𝑑 𝐹𝐹 𝑥𝑥
𝑓𝑓 𝑥𝑥 =
𝑑𝑑𝑑𝑑
if the derivative exists.

• Also,
Pr 𝑎𝑎 ≤ 𝑋𝑋 ≤ 𝑏𝑏 = Pr 𝑎𝑎 < 𝑋𝑋 ≤ 𝑏𝑏
= 𝐹𝐹(𝑏𝑏) – 𝐹𝐹(𝑎𝑎).

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-64


CDF for Continuous Random Variables (Continued)
Remarks:
• 𝐹𝐹(𝑥𝑥) is a non-decreasing function.
That is, if 𝑥𝑥1 < 𝑥𝑥2 , then 𝐹𝐹 𝑥𝑥1 ≤ 𝐹𝐹(𝑥𝑥2 ).

• 0 ≤ 𝐹𝐹(𝑥𝑥) ≤ 1.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-65


Example 1
The p.f. of X is given as follows

𝑥𝑥−1
1 − 𝑝𝑝 𝑝𝑝, if 𝑥𝑥 = 1, 2, 3, ⋯ ;
𝑓𝑓 𝑥𝑥 = �
0, otherwise.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-66


Example 1 (Continued)
For any positive integers 𝑥𝑥,
𝑥𝑥

𝐹𝐹 𝑥𝑥 = � 𝑓𝑓(𝑡𝑡) = � 1 − 𝑝𝑝 𝑡𝑡−1 𝑝𝑝

𝑡𝑡≤𝑥𝑥 𝑡𝑡=1
𝑥𝑥−1
𝑠𝑠
= 𝑝𝑝 � 1 − 𝑝𝑝 , where 𝑠𝑠 = 𝑡𝑡 − 1
𝑠𝑠=0
𝑝𝑝 1 − 1 − 𝑝𝑝 𝑥𝑥
=
1 − 1 − 𝑝𝑝
= 1 − 1 − 𝑝𝑝 𝑥𝑥 , for 𝑥𝑥 = 1, 2, 3, ⋯
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-67
Example 1 (Continued)

Remark
• Since 𝑓𝑓 𝑥𝑥 = 0 between positive integers, hence 𝐹𝐹(𝑥𝑥) is
constant between positive integers and
0, if 𝑥𝑥 < 1,
𝐹𝐹 𝑥𝑥 = �
1 − 1 − 𝑝𝑝 𝑥𝑥 , if 𝑥𝑥 ≥ 1
where [𝑥𝑥] is the largest integer ≤ 𝑥𝑥.
(e.g., 2.7 = 2, 3 = 3).

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-68


Example 2
• Let 𝑋𝑋 = the number of days of sick leave taken by a
randomly selected employee of a large company during a
particular year.
• If the maximum number of allowable sick leave days per
year is 14, possible values of 𝑋𝑋 are 0, 1, 2, ⋯, 14.
• Suppose it is given that 𝐹𝐹 0 = 0.58, 𝐹𝐹 1 = 0.72, 𝐹𝐹 2 =
0.76 , 𝐹𝐹 3 = 0.81, 𝐹𝐹(4) = 0.88, and 𝐹𝐹(5) = 0.94.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-69


Example 2 (Continued)
• Then
Pr 2 ≤ 𝑋𝑋 ≤ 5 = 𝐹𝐹 5 − 𝐹𝐹 2−
= 𝐹𝐹 5 − 𝐹𝐹 1
= 0.94 − 0.72 = 0.22.
and
Pr 𝑋𝑋 = 3 = 𝐹𝐹 3 − 𝐹𝐹 3−
= 𝐹𝐹 3 − 𝐹𝐹 2
= 0.81 − 0.76 = 0.05.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-70


Example 3
• Many manufacturers have quality control programs that
include inspection of incoming materials for defects.
• Suppose a computer manufacturer receives computer
boards in lots of five.
• Two boards are selected from each lot for inspection.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-71


Example 3 (Continued)

(a) List all possible inspections.


(b) Suppose that boards 1 and 2 are the only defectives in a
lot of five.
Two boards are chosen randomly.
Define X to be the number of defective boards observed
among those inspected.
Find the probability distribution of X.
(c) Let 𝐹𝐹(𝑥𝑥) denote the c.d.f. of X. Obtain 𝐹𝐹(𝑥𝑥) for all 𝑥𝑥.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-72
Solution to Example 3
(a) #(𝑆𝑆) = 5 𝐶𝐶2 = 5!/(2! 3!) = 10.
The possible selections are
{(1, 2), (1, 3), (1,4), (1,5), (2,3), (2,4), (2,5), (3,4), (3,5), (4,5)}.
(b) X takes values 0, 1, and 2.
𝑓𝑓 0 = Pr 𝑋𝑋 = 0 = Pr 3, 4 , 3, 5 , (4, 5) = 3/10,
𝑓𝑓 2 = Pr 𝑋𝑋 = 2 = Pr 1, 2 = 1/10,
𝑓𝑓 1 = Pr 𝑋𝑋 = 1 = 1 − (𝑓𝑓 0 + 𝑓𝑓(2)) = 6/10,
and 𝑓𝑓 𝑥𝑥 = 0 for 𝑥𝑥 ≠ 0, 1, 2.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-73


Solution to Example 3 (Continued)

(c)
𝐹𝐹 0 = Pr 𝑋𝑋 ≤ 0 = Pr 𝑋𝑋 = 0 = 0.3,
𝐹𝐹 1 = Pr 𝑋𝑋 ≤ 1 = Pr 𝑋𝑋 = 0 or 1
= Pr 𝑋𝑋 = 0 + Pr 𝑋𝑋 = 1
= 0.3 + 0.6 = 0.9,
𝐹𝐹 2 = Pr 𝑋𝑋 ≤ 2 = 1.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-74


Solution to Example 3 (Continued)

(c)
The c.d.f. is thus given by
0, if 𝑥𝑥 < 0,
0.3, if 0 ≤ 𝑥𝑥 < 1,
𝐹𝐹 𝑥𝑥 =
0.9, if 1 ≤ 𝑥𝑥 < 2,
1, if 2 ≤ 𝑥𝑥.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-75


Example 4
• The p.d.f. of a random variable X is given by

2𝑥𝑥, for 0 < 𝑥𝑥 < 1,


𝑓𝑓 𝑥𝑥 = �
0, otherwise.

• Find the c.d.f of X.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-76


Solution to Example 4
𝑥𝑥
𝐹𝐹 𝑥𝑥 = � 𝑓𝑓 𝑡𝑡 𝑑𝑑𝑑𝑑
−∞
𝑥𝑥
� 0 𝑑𝑑𝑑𝑑 , for 𝑥𝑥 < 0,
−∞
0 𝑥𝑥
= � 0 𝑑𝑑𝑑𝑑 + � 2𝑡𝑡 𝑑𝑑𝑑𝑑 , for 0 ≤ 𝑥𝑥 < 1,
−∞ 0
0 1 𝑥𝑥
� 0 𝑑𝑑𝑑𝑑 + � 2𝑡𝑡 𝑑𝑑𝑑𝑑 + � 0𝑑𝑑𝑑𝑑 , for 𝑥𝑥 ≥ 1.
−∞ 0 1
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-77
Solution to Example 4 (Continued)
𝑥𝑥
𝐹𝐹 𝑥𝑥 = � 𝑓𝑓 𝑡𝑡 𝑑𝑑𝑑𝑑
−∞
=⋯
0, for 𝑥𝑥 < 0,
= � 𝑥𝑥 2 , for 0 ≤ 𝑥𝑥 < 1,
1, for 𝑥𝑥 ≥ 1.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-78


Example 5
• Let X denote the vibratory stress (psi) on a wind turbine
blade at a particular wind tunnel.

• The following p.d.f. for X is proposed

𝑥𝑥 −𝑥𝑥 2 / 2𝜃𝜃2
𝑒𝑒 , for 𝑥𝑥 > 0,
𝑓𝑓 𝑥𝑥; 𝜃𝜃 = �𝜃𝜃 2
0, otherwise.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-79


Example 5 (Continued)

(a) Verify that 𝑓𝑓(𝑥𝑥; 𝜃𝜃) is a legitimate p.d.f.


(b) Suppose that 𝜃𝜃 = 100.
What is the probability that X is at most 200? Less than
200?
At least 200?
(c) Give an expression for Pr(𝑋𝑋 ≤ 𝑥𝑥).
(d) What is the probability that X is between 100 and 200?

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-80


Solution to Example 5
(a) It is obvious that 𝑓𝑓(𝑥𝑥) > 0 for 𝑥𝑥 > 0.
∞ ∞ 2
𝑥𝑥 − 𝑥𝑥 2
� 𝑓𝑓 𝑥𝑥; 𝜃𝜃 𝑑𝑑𝑑𝑑 = � 2 𝑒𝑒 2𝜃𝜃 𝑑𝑑𝑑𝑑
−∞ 0 𝜃𝜃
∞ 𝑥𝑥 2

= � 𝑑𝑑 𝑒𝑒 2𝜃𝜃2
0

𝑥𝑥 2

= 𝑒𝑒 2𝜃𝜃2 0
= 0 − −1 = 1.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-81


Solution to Example 5 (Continued)

(b)
200
Pr 𝑋𝑋 ≤ 200; 𝜃𝜃 = 100 = � 𝑓𝑓 𝑥𝑥; 𝜃𝜃 𝑑𝑑𝑑𝑑
−∞
200 𝑥𝑥 2
𝑥𝑥 −
=� 𝑒𝑒 2 100 2 𝑑𝑑𝑑𝑑
0 1002
200
𝑥𝑥 2
− 20000
= −𝑒𝑒 0 = −𝑒𝑒 −2 + 𝑒𝑒 0
= −0.1353 + 1 = 0.8647.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-82


Solution to Example 5 (Continued)

(b)
• Pr 𝑋𝑋 < 200 = Pr(𝑋𝑋 ≤ 200) = 0.8647 since X is a
continuous random variable.

• Pr 𝑋𝑋 ≥ 200 = 1 − Pr(𝑋𝑋 ≤ 200) = 0.1353.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-83


Solution to Example 5 (Continued)

(c) For 𝑥𝑥 > 0,


𝑥𝑥
𝐹𝐹 𝑥𝑥; 𝜃𝜃 = Pr 𝑋𝑋 ≤ 𝑥𝑥; 𝜃𝜃 = � 𝑓𝑓 𝑡𝑡; 𝜃𝜃 𝑑𝑑𝑑𝑑
−∞
𝑥𝑥
𝑡𝑡 − 𝑡𝑡 2
= � 2 𝑒𝑒 2𝜃𝜃 2 𝑑𝑑𝑑𝑑
0 𝜃𝜃
𝑥𝑥
𝑡𝑡 2

= −𝑒𝑒 2𝜃𝜃2 0
𝑥𝑥 2

=1 − 𝑒𝑒 2𝜃𝜃2 .
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-84
Solution to Example 5 (Continued)

(d)
Pr 100 ≤ 𝑋𝑋 ≤ 200 = 𝐹𝐹 200 − 𝐹𝐹 100
= 1 − exp − 200 2 /20000
− 1 − exp − 100 2 /20000
= 𝑒𝑒 −1/2 − 𝑒𝑒 −2
= 0.4712.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-85


Solution to Example 5 (Continued)

(d)
Alternatively,
200 𝑥𝑥 2
𝑥𝑥 −
Pr 100 ≤ 𝑋𝑋 ≤ 200 = � 𝑒𝑒 2 100 2 𝑑𝑑𝑑𝑑
100 1002
200
𝑥𝑥 2
− 20000
= −𝑒𝑒 100 = 0.4712.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-86


2.5 Mean and Variance of a Random Variable
2.5.1 Expected Values
Definition 2.7a
• If X is a discrete random variable. taking on values
𝑥𝑥1 , 𝑥𝑥2 , ⋯ with probability function 𝑓𝑓𝑋𝑋 (𝑥𝑥),
• then the mean or expected value (or mathematical
expectation) of X, denoted by 𝑬𝑬(𝑿𝑿) as well as by 𝜇𝜇𝑋𝑋 , is
defined by
𝜇𝜇𝑋𝑋 = 𝐸𝐸 𝑋𝑋 = � 𝑥𝑥𝑖𝑖 𝑓𝑓𝑋𝑋 (𝑥𝑥𝑖𝑖 ) = � 𝑥𝑥 𝑓𝑓𝑋𝑋 (𝑥𝑥)
ST2334 Probability and Statistics 𝑖𝑖 CYM 𝑥𝑥 Concepts of Random Variables 2-87
Mean and Variance of a Random Variable (Continued)
2.5.1 Expected Values (Continued)

Note : The expected value is not necessarily a possible value


of the random variable X.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-88


Expected Values (Continued)

Definition 2.7b
• If X is a continuous random variable with probability
density function 𝑓𝑓𝑋𝑋 (𝑥𝑥), the mean of X is defined by

𝜇𝜇𝑋𝑋 = 𝐸𝐸 𝑋𝑋 = � 𝑥𝑥 𝑓𝑓𝑋𝑋 𝑥𝑥 𝑑𝑑𝑑𝑑 .
−∞

• Roughly speaking, the mathematical expectation is an


“average” (or more precisely, a “weighted average”).
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-89
Remarks
1. The expected value exists provided the sum or the integral in
the above definitions exists.

2. In the discrete case, if 𝑓𝑓𝑋𝑋 𝑥𝑥 = 1/𝑁𝑁 for each of the N values of 𝑥𝑥,
hence the mean,

1
𝐸𝐸 𝑋𝑋 = � 𝑥𝑥𝑖𝑖 𝑓𝑓(𝑥𝑥𝑖𝑖 ) = � 𝑥𝑥𝑖𝑖 ,
𝑁𝑁
𝑖𝑖 𝑖𝑖
becomes the average of the N items.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-90


Example 1
• In a gambling game, a man gains 5 if he gets all heads or all
tails in tossing a fair coin 3 times,
• and he pays out 3 if either 1 or 2 heads show.
• What is his expected gain?

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-91


Solution to Example 1
• Let X be the amount he can gain.
• Then X = 5 or −3 with the following probabilities:
Pr(𝑋𝑋 = 5) = Pr({𝐻𝐻𝐻𝐻𝐻𝐻, 𝑇𝑇𝑇𝑇𝑇𝑇}) = 1/8 + 1/8 = 1/4
Pr(𝑋𝑋 = −3) = 1 − Pr(𝑋𝑋 = 5) = 3/4.
1 3
• Therefore 𝐸𝐸 𝑋𝑋 = 5 + −3 = −1.
4 4
• Hence, he will lose 1 per toss in a long run.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-92


Example 2
• Suppose a game consists of rolling a balanced die.
• We pay c to play the game and we get i if number i occurs.
• How much should we pay if the game is fair?
(We say a game is “fair” if E(gain) = 0.)

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-93


Solution to Example 2
• Let X denote the amount that one gets when rolling a die.
• Then clearly Pr(𝑋𝑋 = 1) = ⋯ = Pr(𝑋𝑋 = 6) = 1/6.
1
• 𝐸𝐸 𝑋𝑋 = 1 + 2 + ⋯ + 6 = 3.5.
6
• To be a fair game, E(paying) = E(getting), and hence for a
fair game, the admission fee should be 𝑐𝑐 = 𝐸𝐸(𝑋𝑋) = 3.5 .

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-94


Solution to Example 2 (Continued)

Alternate Solution,
• Let Y denote the amount that one gains when rolling a die.
• Then 𝑌𝑌 = 𝑖𝑖 − 𝑐𝑐, where 𝑖𝑖 = 1, 2, ⋯ , 6
• Then clearly Pr 𝑌𝑌 = 1 − 𝑐𝑐 = ⋯ = Pr 𝑌𝑌 = 6 − 𝑐𝑐 = 1/6.
1
• 𝐸𝐸 𝑌𝑌 = 1 − 𝑐𝑐 + ⋯ + 6 − 𝑐𝑐 = 3.5 − 𝑐𝑐.
6
• To be a fair game, 𝐸𝐸(𝑌𝑌) = 0, and hence the admission fee, c,
satisfies
3.5 − 𝑐𝑐 = 0 or 𝑐𝑐 = 3.5
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-95
Example 3
• A private pilot wishes to insure his airline for 1,000,000.
• The insurance company estimates that a total loss may
occur with probability 0.0002, a 50% loss with probability
0.001, and a 25% loss with probability 0.01, and a 10% loss
with probability 0.01.
• Ignoring all other partial losses, what premium should the
insurance company charge each year to realize an average
profit of 5,000?

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-96


Solution to Example 3
• The expected loss is given by
1000000 0.0002 + 500000 0.001 + 250000 0.01 +
100000 0.01 + 0 1 − 0.0002 − 0.001 − 0.01 − 0.01
= 4200.

• Therefore, the insurance company should charge the


premium 9200 so as to realize an average profit of 5000.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-97


Example 4
The p.d.f. of weekly gravel sales X is

3 2 ,
𝑓𝑓𝑋𝑋 𝑥𝑥 = � 2 1 − 𝑥𝑥 for 0 < 𝑥𝑥 < 1,
0, otherwise.
Find E(X).

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-98


Solution to Example 4
∞ 1
3
𝐸𝐸 𝑋𝑋 = � 𝑥𝑥 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑 = � 𝑥𝑥 1 − 𝑥𝑥 2 𝑑𝑑𝑑𝑑
−∞ 0 2
4 1
3 1 3 𝑥𝑥 2
𝑥𝑥
= � 𝑥𝑥 − 𝑥𝑥 3 𝑑𝑑𝑑𝑑 = −
2 0 2 2 4 0
3
= .
8

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-99


Example 5
• The probability density function of a continuous random
variable X, the total number of hours, in units of 100 hours,
that a family runs a vacuum cleaner over a period of one
year, was given as follows.
𝑥𝑥, for 0 < 𝑥𝑥 < 1,
𝑓𝑓𝑋𝑋 𝑥𝑥 = � 2 − 𝑥𝑥, for 1 ≤ 𝑥𝑥 ≤ 2,
0, otherwise.
• Find the average number of hours per year that families
run their vacuum cleaners.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-100
Solution to Example 5

𝐸𝐸 𝑋𝑋 = � 𝑥𝑥 𝑓𝑓𝑋𝑋 𝑥𝑥 𝑑𝑑𝑑𝑑
−∞
0 1 2 ∞
= � 𝑥𝑥(0) 𝑑𝑑𝑑𝑑 + � 𝑥𝑥 2 𝑑𝑑𝑑𝑑 + � 𝑥𝑥 2 − 𝑥𝑥 𝑑𝑑𝑑𝑑 + � 𝑥𝑥 0 𝑑𝑑𝑑𝑑
−∞ 0 1 2
3 1 3 2
𝑥𝑥 𝑥𝑥
= + 𝑥𝑥 2 −
3 0
3 1

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-101


Solution to Example 5 (Continued)

𝐸𝐸 𝑋𝑋 = � 𝑥𝑥 𝑓𝑓𝑋𝑋 𝑥𝑥 𝑑𝑑𝑑𝑑 = ⋯
−∞
3 1 3 2
𝑥𝑥 2
𝑥𝑥
= + 𝑥𝑥 −
3 0 3 1
1 8 1
= −0 + 4− − 1− = 1.
3 3 3
• Families run their vacuum cleaners 100 hours per year on
average.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-102
2.5.2 Expectation of a Function of a RV
Definition 2.8
For any function 𝑔𝑔(𝑋𝑋) of a random variable X with p.f. (or
p.d.f.) 𝑓𝑓𝑋𝑋 (𝑥𝑥),
(a) 𝐸𝐸 𝑔𝑔 𝑋𝑋 = ∑𝑥𝑥 𝑔𝑔 𝑥𝑥 𝑓𝑓𝑋𝑋 𝑥𝑥
if X is a discrete r.v. providing the sum exists; and

(b) 𝐸𝐸 𝑔𝑔 𝑋𝑋 = ∫−∞ 𝑔𝑔 𝑥𝑥 𝑓𝑓𝑋𝑋 𝑥𝑥 𝑑𝑑𝑑𝑑
if X is a continuous r.v. providing the integral exists.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-103


Some Special Cases
1. 𝑔𝑔 𝑥𝑥 = 𝑥𝑥 − 𝜇𝜇𝑋𝑋 2 .
This leads to the definition of variance of a given random
variable X.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-104


Some Special Cases (Continued)
Definition 2.9
• Let X be a random variable with p.f. (or p.d.f.) 𝑓𝑓(𝑥𝑥), then the
variance of X is defined as
𝜎𝜎𝑋𝑋2 = 𝑉𝑉 𝑋𝑋 = 𝐸𝐸 𝑋𝑋 − 𝜇𝜇𝑋𝑋 2
2
� 𝑥𝑥 − 𝜇𝜇𝑋𝑋 𝑓𝑓𝑋𝑋 𝑥𝑥 , if 𝑋𝑋 is discrete,
= 𝑥𝑥

2
� 𝑥𝑥 − 𝜇𝜇𝑋𝑋 𝑓𝑓𝑋𝑋 𝑥𝑥 𝑑𝑑𝑑𝑑 , if 𝑋𝑋 is continuous.
−∞
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-105
Some Special Cases (Continued)

Remarks:
(a) 𝑉𝑉(𝑋𝑋) ≥ 0.
(b) 𝑉𝑉 𝑋𝑋 = 𝐸𝐸 𝑋𝑋2 − 𝐸𝐸 𝑋𝑋 2.

• The positive square root of the variance is called the


standard deviation of X. That is
𝜎𝜎𝑋𝑋 = 𝑉𝑉 𝑋𝑋

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-106


Some Special Cases (Continued)

2. 𝑔𝑔 𝑥𝑥 = 𝑥𝑥 𝑘𝑘 .

Then 𝐸𝐸(𝑋𝑋 𝑘𝑘 ) is called the k-th moment of X.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-107


Example 1
Let the p.d.f. of X be given by:

𝑥𝑥 –1 0 1 2
𝑓𝑓𝑋𝑋 (𝑥𝑥) 1/8 2/8 1/8 4/8

(a) Find 𝐸𝐸(𝑋𝑋) and 𝑉𝑉(𝑋𝑋).


(b) Define 𝑌𝑌 = 𝑋𝑋 2 + 2. Find 𝐸𝐸(𝑌𝑌) and 𝑉𝑉(𝑌𝑌).

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-108


Solution to Example 1
(a)
𝐸𝐸 𝑋𝑋 = � 𝑥𝑥 𝑓𝑓𝑋𝑋 (𝑥𝑥)
𝑥𝑥
1 2 1 4
= −1 +0 +1 +2 = 1.
8 8 8 8

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-109


Solution to Example 1 (Continued)
(a) (Continued)

𝑉𝑉 𝑋𝑋 = � 𝑥𝑥 − 1 2 𝑓𝑓𝑋𝑋 (𝑥𝑥) , since 𝜇𝜇𝑋𝑋 = 1


𝑥𝑥
2
1 2
= −1 − 1 + 0−1 2
8 8
2
1 4 5
+ 1−1 + 2−1 2 = .
8 8 4

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-110


Solution to Example 1 (Continued)

(a) (Continued)
Alternatively, we can find 𝐸𝐸(𝑋𝑋 2 ) first and then obtain
𝑉𝑉(𝑋𝑋) using the formula 𝑉𝑉 𝑋𝑋 = 𝐸𝐸 𝑋𝑋 2 − 𝐸𝐸 𝑋𝑋 2 .
𝐸𝐸 𝑋𝑋 2 = � 𝑥𝑥 2 𝑓𝑓𝑋𝑋 (𝑥𝑥)
𝑥𝑥
1 2
2 2
2
1 2
4 9
= −1 +0 +1 +2 = .
8 8 8 8 4
2 2
9 2
5
𝑉𝑉 𝑋𝑋 = 𝐸𝐸 𝑋𝑋 − 𝐸𝐸 𝑋𝑋 = −1 = .
4 4
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-111
Solution to Example 1 (Continued)

(b)
𝐸𝐸 𝑌𝑌 = 𝐸𝐸 𝑋𝑋 2 + 2 = � 𝑥𝑥 2 + 2 𝑓𝑓𝑋𝑋 (𝑥𝑥)
𝑥𝑥
2
1 2 1
= −1 + 2 + 02 + 2 + 12 + 2
8 8 8
2
4 17
+ 2 +2 = .
8 4
9 17
Alternatively, 𝐸𝐸 𝑌𝑌 = 𝐸𝐸 𝑋𝑋 2 +2= + 2= .
4 4
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-112
Solution to Example 1 (Continued)

(b)
2
2
17
𝑉𝑉(𝑌𝑌) = � 𝑥𝑥 + 2 − 𝑓𝑓𝑋𝑋 (𝑥𝑥)
4
𝑥𝑥
2 2
17 1 17 2
= 3− + 2−
4 8 4 8
2 2
17 1 17 4 51
+ 3− + 6− = .
4 8 4 8 16

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-113


Solution to Example 1 (Continued)

(b) (Continued)
Alternatively, we can find 𝐸𝐸(𝑌𝑌 2 ) first and then obtain
𝑉𝑉(𝑌𝑌) using the formula
𝑉𝑉 𝑌𝑌 = 𝐸𝐸 𝑌𝑌 2 − 𝐸𝐸 𝑌𝑌 2 ,
where
2 2
1 2
2 2
1 2
4 170
𝐸𝐸 𝑌𝑌 = 3 +2 +3 +6 =
8 8 8 8 8
2
170 17 51
𝑉𝑉 𝑌𝑌 = − = .
8 4 16
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-114
Example 2
• Suppose that the random variable X is continuous with the
following p.d.f.:
𝑥𝑥
, for 0 < 𝑥𝑥 < 15,
225
𝑓𝑓𝑋𝑋 𝑥𝑥 = 30 − 𝑥𝑥
, for 15 ≤ 𝑥𝑥 ≤ 30,
225
0, otherwise.

• Find 𝐸𝐸(𝑋𝑋) and 𝑉𝑉(𝑋𝑋).


ST2334 Probability and Statistics CYM Concepts of Random Variables 2-115
Solution to Example 2
15 30
𝑥𝑥 30 − 𝑥𝑥
𝐸𝐸 𝑋𝑋 = � 𝑥𝑥 𝑑𝑑𝑑𝑑 + � 𝑥𝑥 𝑑𝑑𝑑𝑑
0 225 15 225
15 30
1 𝑥𝑥 3 𝑥𝑥 3
= + 15𝑥𝑥 2 −
225 3 0
3 15
1 153 2−
303 15 3
= + 15 30 − 15 15 2 +
225 3 3 3
= 15.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-116


Solution to Example 2 (Continued)
15 30
𝑥𝑥 30 − 𝑥𝑥
𝐸𝐸 𝑋𝑋 2 = � 𝑥𝑥 2 𝑑𝑑𝑑𝑑 + � 𝑥𝑥 2 𝑑𝑑𝑑𝑑
0 225 15 225
4 15 4 30
1 𝑥𝑥 𝑥𝑥 525
= + 10𝑥𝑥 3 − = = 262.5.
225 4 0
4 15
2
Therefore,
𝑉𝑉 𝑋𝑋 = 𝐸𝐸 𝑋𝑋 2 − 𝐸𝐸 𝑋𝑋 2
= 262.5 − 152 = 37.5.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-117


Example 3
• Let X denote the amount of time for which a book on 2-
hour reserve at the science library is checked out by a
randomly selected student and suppose X has the
probability density function

𝑥𝑥
, for 0 ≤ 𝑥𝑥 < 2,
𝑓𝑓𝑋𝑋 𝑥𝑥 = � 2
0, otherwise.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-118


Example 3 (Continued)
(a) Compute 𝐸𝐸(𝑋𝑋).
(b) Compute 𝑉𝑉(𝑋𝑋) and 𝜎𝜎𝑋𝑋 .
(c) If the borrower is charged an amount ℎ 𝑋𝑋 = 𝑋𝑋 2 when
checkout duration is X, compute the expected charge
𝐸𝐸[ℎ(𝑋𝑋)].

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-119


Solution to Example 3
(a)
2
𝑥𝑥
𝐸𝐸 𝑋𝑋 = � 𝑥𝑥 𝑑𝑑𝑑𝑑
0 2
3 2
𝑥𝑥 4
= = .
6 0 3

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-120


Solution to Example 3 (Continued)
(b)
2 4 2
𝑥𝑥 𝑥𝑥
𝐸𝐸 𝑋𝑋 2 =� 𝑥𝑥 2 𝑑𝑑𝑑𝑑 = = 2.
0 2 8 0
2
4 2
𝑉𝑉 𝑋𝑋 = 𝐸𝐸 𝑋𝑋 2 − 𝐸𝐸 𝑋𝑋 2 =2− = .
3 9
𝜎𝜎𝑋𝑋 = 2/9

(c) 𝐸𝐸[ℎ(𝑋𝑋)] = 𝐸𝐸[𝑋𝑋 2 ] = 2.


ST2334 Probability and Statistics CYM Concepts of Random Variables 2-121
2.5.3 Properties of Expectation
Property 1

𝐸𝐸 𝑎𝑎𝑎𝑎 + 𝑏𝑏 = 𝑎𝑎 𝐸𝐸(𝑋𝑋) + 𝑏𝑏,


where a and b are constants.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-122


Properties of Expectation (Continued)

Property 1 (Continued)
• Proof: For discrete case,
𝐸𝐸 𝑎𝑎𝑎𝑎 + 𝑏𝑏 = � 𝑎𝑎𝑎𝑎 + 𝑏𝑏 𝑓𝑓𝑋𝑋 (𝑥𝑥)
𝑥𝑥

= � 𝑎𝑎𝑎𝑎 𝑓𝑓𝑋𝑋 𝑥𝑥 + � 𝑏𝑏 𝑓𝑓𝑋𝑋 (𝑥𝑥)


𝑥𝑥 𝑥𝑥

= 𝑎𝑎 � 𝑥𝑥 𝑓𝑓𝑋𝑋 𝑥𝑥 + 𝑏𝑏 � 𝑓𝑓𝑋𝑋 𝑥𝑥 = 𝑎𝑎𝑎𝑎 𝑋𝑋 + 𝑏𝑏.


𝑥𝑥 𝑥𝑥
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-123
Properties of Expectation (Continued)
Two special cases:
(a) Put 𝑏𝑏 = 0, we have 𝐸𝐸 𝑎𝑎𝑎𝑎 = 𝑎𝑎 𝐸𝐸(𝑋𝑋).
(b) Put 𝑎𝑎 = 1, we have 𝐸𝐸(𝑋𝑋 + 𝑏𝑏) = 𝐸𝐸(𝑋𝑋) + 𝑏𝑏.

In general,
𝐸𝐸 𝑎𝑎1 𝑔𝑔1 𝑋𝑋 + 𝑎𝑎2 𝑔𝑔2 𝑋𝑋 + ⋯ + 𝑎𝑎𝑘𝑘 𝑔𝑔𝑘𝑘 𝑋𝑋
= 𝑎𝑎1 𝐸𝐸 𝑔𝑔1 𝑋𝑋 + 𝑎𝑎2 𝐸𝐸 𝑔𝑔2 𝑋𝑋 + ⋯ + 𝑎𝑎𝑘𝑘 𝐸𝐸[𝑔𝑔𝑘𝑘 (𝑋𝑋)]
where 𝑎𝑎1 , 𝑎𝑎2 , ⋯ , 𝑎𝑎𝑘𝑘 are constants.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-124
Properties of Expectation (Continued)
Property 2

𝑉𝑉 𝑋𝑋 = 𝐸𝐸 𝑋𝑋 2 − 𝐸𝐸 𝑋𝑋 2
.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-125


Properties of Expectation (Continued)
Property 2 (Continued)
Proof:
𝑉𝑉 𝑋𝑋 = 𝐸𝐸[ 𝑋𝑋 − 𝜇𝜇𝑋𝑋 2 ]
= 𝐸𝐸[𝑋𝑋 2 − 2𝑋𝑋𝜇𝜇𝑋𝑋 + 𝜇𝜇𝑋𝑋2 ]
= 𝐸𝐸 𝑋𝑋 2 − 𝐸𝐸(2𝑋𝑋𝑋𝑋𝑋𝑋 ) + 𝐸𝐸(𝜇𝜇𝑋𝑋2 )
= 𝐸𝐸 𝑋𝑋 2 − 2𝜇𝜇𝑋𝑋 𝐸𝐸(𝑋𝑋) + (𝜇𝜇𝑋𝑋2 )
= 𝐸𝐸 𝑋𝑋 2 − 2𝜇𝜇𝑋𝑋2 + 𝜇𝜇𝑋𝑋2 = 𝐸𝐸 𝑋𝑋 2 − 𝜇𝜇𝑋𝑋2
Notice that 𝜇𝜇𝑋𝑋 = 𝐸𝐸(𝑋𝑋) is a constant.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-126
Properties of Expectation (Continued)
Property 3
𝑉𝑉 𝑎𝑎𝑎𝑎 + 𝑏𝑏 = 𝑎𝑎2 𝑉𝑉(𝑋𝑋),
where a and b are constants

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-127


Properties of Expectation (Continued)
Property 3 (Continued)
Proof:
𝑉𝑉 𝑎𝑎𝑎𝑎 + 𝑏𝑏 = 𝐸𝐸 𝑎𝑎𝑎𝑎 + 𝑏𝑏 2 − 𝐸𝐸 𝑎𝑎𝑎𝑎 + 𝑏𝑏 2
= 𝐸𝐸 𝑎𝑎2 𝑋𝑋 2 + 2𝑎𝑎𝑎𝑎𝑎𝑎 + 𝑏𝑏 2 − 𝑎𝑎𝜇𝜇𝑋𝑋 + 𝑏𝑏 2
= 𝑎𝑎2 𝐸𝐸 𝑋𝑋 2 + 2𝑎𝑎𝑎𝑎 𝐸𝐸 𝑋𝑋 + 𝑏𝑏 2 − (𝑎𝑎2 𝜇𝜇𝑋𝑋2 + 2𝑎𝑎𝑎𝑎𝜇𝜇𝑋𝑋 + 𝑏𝑏 2 )
= 𝑎𝑎2 𝐸𝐸 𝑋𝑋 2 − 𝑎𝑎2 𝜇𝜇𝑋𝑋2
= 𝑎𝑎2 𝐸𝐸 𝑋𝑋 2 − 𝜇𝜇𝑋𝑋2
= 𝑎𝑎2 𝑉𝑉 𝑋𝑋 .
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-128
Example 4
• A jewelry shop purchased three necklaces of a certain type
at $500 a piece.
• It will sell them for $1000 a piece. The designer has
agreed to repurchase any necklace still unsold after a
specified period at $200 a piece.
• Let X denote the number of necklaces sold and suppose X
follows the following probability distribution.
𝑥𝑥 0 1 2 3
𝑓𝑓𝑋𝑋 (𝑥𝑥) 0.1 0.2 0.3 0.4
• Find the expected gain and the variance of the gain.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-129
Solution to Example 4
• With 𝑔𝑔 𝑋𝑋 = revenue − cost = 1000𝑋𝑋 + 200(3 − 𝑋𝑋) −
3(500) = 800𝑋𝑋 − 900.
• 𝐸𝐸 𝑔𝑔 𝑋𝑋 = 𝑔𝑔 0 𝑓𝑓𝑋𝑋 0 + 𝑔𝑔 1 𝑓𝑓𝑋𝑋 1 + 𝑔𝑔 2 𝑓𝑓𝑋𝑋 2 + 𝑔𝑔 3 𝑓𝑓𝑋𝑋 3
= −900 0.1 + −100 0.2 + 700 0.3 + 1500 0.4
= 700.
• Hence the expected profit is $700.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-130


Solution to Example 4 (Continued)
2 2 2 2
• 𝐸𝐸 𝑔𝑔 𝑋𝑋 = −900 0.1 + −100 0.2 + 700 0.3 +
15002 0.4 = 1130000.

• Hence
𝑉𝑉 𝑔𝑔 𝑋𝑋 = 1130000 − 7002 = 640000
and
𝑉𝑉 𝑔𝑔 𝑋𝑋 = 640000 = 800

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-131


Example 5
• The distribution of the amount of gravel (in tons) sold by a
particular construction supply company in a given week is
a continuous random variable X with p.d.f.
3 2 ,
𝑓𝑓𝑋𝑋 𝑥𝑥 = � 2 1 − 𝑥𝑥 for 0 ≤ 𝑥𝑥 ≤ 1,
0, otherwise.

• Find 𝐸𝐸(𝑋𝑋) and 𝑉𝑉(𝑋𝑋).

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-132


Solution to Example 5
∞ 1
3
𝐸𝐸 𝑋𝑋 = � 𝑥𝑥 𝑓𝑓𝑋𝑋 𝑥𝑥 𝑑𝑑𝑑𝑑 = � 𝑥𝑥 1 − 𝑥𝑥 2 𝑑𝑑𝑑𝑑
−∞ 0 2
1
3 𝑥𝑥 2 𝑥𝑥 4 3 1 3
= − = = .
2 2 4 0 2 4 8

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-133


Solution to Example 5 (Continued)
∞ 1
3
𝐸𝐸 𝑋𝑋 2 =� 𝑥𝑥 2 𝑓𝑓𝑋𝑋 𝑥𝑥 𝑑𝑑𝑑𝑑 = � 𝑥𝑥 2 1 − 𝑥𝑥 2 𝑑𝑑𝑑𝑑
−∞ 0 2
3 1
3 𝑥𝑥 𝑥𝑥 5 3 2 1
= − = = .
2 3 5 0
2 15 5
2
1 3 19
𝑉𝑉 𝑋𝑋 = − = = 0.0594.
5 8 320

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-134


Example 6
• The hospital period, in days, for patients following
treatment for a certain type of kidney disorder is a random
variable 𝑌𝑌 = 𝑋𝑋 + 4, where X has the probability density
function
32
, for 𝑥𝑥 > 0,
𝑓𝑓𝑋𝑋 𝑥𝑥 = � 𝑥𝑥 + 4 3
0, otherwise.
• Find the average number of days that a person is
hospitalized following treatment for this disorder.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-135
Solution to Example 6

32
𝐸𝐸 𝑌𝑌 = � 𝑥𝑥 + 4 3
𝑑𝑑𝑑𝑑
0 𝑥𝑥 + 4

32
=� 2
𝑑𝑑𝑑𝑑
0 𝑥𝑥 + 4
32 ∞
= − = 8.
𝑥𝑥 + 4 0

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-136


2.6 Chebyshev’s Inequality
• If we know the probability distribution of a random
variable X, we may then compute 𝐸𝐸(𝑋𝑋) and 𝑉𝑉(𝑋𝑋).
• However, the converse is not true. From the knowledge of
𝐸𝐸(𝑋𝑋) and 𝑉𝑉(𝑋𝑋) we cannot reconstruct the probability
distribution of X and
• hence, we cannot compute quantities such as
Pr 𝑋𝑋 − 𝐸𝐸 𝑋𝑋 ≤ 𝑐𝑐 ,
where c is a positive constant.
[Note: Pr 𝑌𝑌 ≤ 𝑎𝑎 is equivalent to Pr −𝑎𝑎 ≤ 𝑌𝑌 ≤ 𝑎𝑎 .
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-137
Chebyshev’s Inequality (Continued)
• Nevertheless, the Russian mathematician Chebyshev gave
a very useful upper (or lower) bound to such probability.

• This result is known as Chebyshev's inequality.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-138


Chebyshev’s Inequality (Continued)

• Let X be a random variable (discrete or continuous) with


𝐸𝐸(𝑋𝑋) = 𝜇𝜇 and 𝑉𝑉 𝑋𝑋 = 𝜎𝜎 2 .
• Then for any positive number k we have
Pr(|𝑋𝑋 − µ| ≥ 𝑘𝑘𝑘𝑘) ≤ 1/𝑘𝑘2.
• That is, the probability that the value of X lies at least k
standard deviation from its mean is at most 1/k2.
• Alternatively,
Pr(|𝑋𝑋 − µ| < 𝑘𝑘𝑘𝑘) ≥ 1 − 1/𝑘𝑘2.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-139


Remarks
1. The quantity k in Chebyshev's Inequality can be any
positive number.

2. This inequality is true for all distributions with finite mean


and variance.

3. The theorem gives a lower bound on the probability that


|𝑋𝑋 − µ| < 𝑘𝑘𝑘𝑘. No guarantee that this lower bound is close
to the exact probability.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-140
Example 1
• Number of telephone calls X in a day has 𝜇𝜇𝑋𝑋 = 14, 𝜎𝜎𝑋𝑋 =
3.5.
• What can you say about Pr(7 < 𝑋𝑋 < 21)?

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-141


Solution to Example 1

Pr 7 < 𝑋𝑋 < 21 = Pr 14 − 2 3.5 < 𝑋𝑋 < 14 + 2 3.5


= Pr −2 3.5 < 𝑋𝑋 − 14 < 2 3.5
= Pr 𝑋𝑋 − 14 < 2 3.5
2
1 3
≥1− = .
2 4
where we apply the Chebyshev in quality with 𝑘𝑘 = 2

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-142


Example 2
The p.f. X is given as follows.

𝑥𝑥 0 1 2 3 4 5 6
𝑓𝑓𝑋𝑋(𝑥𝑥) 0.1 0.15 0.2 0.25 0.2 0.06 0.04

It can be shown that 𝐸𝐸(𝑋𝑋) = 2.64 and 𝜎𝜎2 = 2.37.


Hence 𝜎𝜎 = 1.54.

ST2334 Probability and Statistics CYM Concepts of Random Variables 2-143


Solution to Example 2
By Chebyshev's Inequality,
Pr(|𝑋𝑋 − 𝜇𝜇| ≥ 2𝜎𝜎) ≤ 1/22 = 0.25.
But
Pr(|𝑋𝑋 − 𝜇𝜇| ≥ 2𝜎𝜎)
= Pr(𝑋𝑋 − 𝜇𝜇 ≤ −2𝜎𝜎 or 𝑋𝑋 − 𝜇𝜇 ≥ 2𝜎𝜎)
= Pr 𝑋𝑋 ≤ 𝜇𝜇 − 2𝜎𝜎 or 𝑋𝑋 ≥ 𝜇𝜇 + 2𝜎𝜎
= Pr 𝑋𝑋 ≤ −0.44 or 𝑋𝑋 ≥ 5.72
= Pr 𝑋𝑋 = 6 = 0.04. (From the given p.f.)
Chebyshev's bound of 0.25 is too conservative.
ST2334 Probability and Statistics CYM Concepts of Random Variables 2-144

You might also like