Lecture Transcript 1 (Random Variables and Their Probability Distribution)
Lecture Transcript 1 (Random Variables and Their Probability Distribution)
Learning Objectives:
In the previous lecture we discussed the basic concepts of probability. Now, we are going to learn about
another concept called random variables and their corresponding probability distributions .
After reading this transcript, it is hoped that the knowledge acquired on the topic will help form a greater
understanding about modeling and describing phenomena that is random in nature.
References Used:
Calaca, N., Uy, C., Noble, N., Manalo, R. (2016). Statistics and Probability. Vibal Group, Inc., Quezon City
Lim, Y., Nocon, R., Nocon, E., Ruivivar, L. (2016). Math for Engaged Learning: Statistics and Probability.
Sibs Publishing House, Inc., Quezon City
Melosantos, L., Antonio, J., Robles, S., Bruce, R., and Sacluti, J (2016). Math Connections in the Digital Age
Statistics and Probability. Quezon City: Sibs Publishing House, Inc., 2016.
Mendelhall, W., Beaver, R., Beaver, B. (2013). Introduction to Probability and Statistics. Pacific Grove,
Calif. : Brooks/Cole ; Andover : Cengage Learning [distributor], 2013.
Lecture 1.1.
Introduction to Random Variables
Introduction
Recall that an experiment is an activity that produces outcomes or generates data. Further, note that
these outcomes have a corresponding chance (or probability). Some examples of which are a) tossing
three coins and counting the number of heads, b) recording the time a person can squat before he/she
gets exhausted, c) counting the class attendance of students for today, etc. In this lecture, we will be
talking about a way to map the outcomes of these statistical experiments determined by probabilities to a
real number.
Lesson Proper
Def. A random variable is variable that assumes real number values that is derived from the outcomes
of an experiment. Alternatively, we say that a random variable is a function that maps the outcomes of
a random process to a numeric value. That is,
X : Outcome → Number
Note that random variables are classified as discrete or continuous according to the values it assumes.
The random variables X and Y stated above are considered as discrete random variables since these
variables are defined over a finite (countable) sample space. Given this, we have the following definition:
Meanwhile, the random variables Z and W are considered as continuous because these random variables
are defined over an uncountablly infinite sample space. This leads us then to the following definition:
Example 1.1.1. Classify the following random variables as discrete or continuous random variable:
2
8. The number of defective cell phones produced by a company
9. Speed of a falling object
10. Number of students in a class
11. The average amount of water consumption per household per month
12. The amount of rainfall in August
13. Number of athletes joining the Olympics
14. The number of cakes baked
15. Monthly income of a pharmacist
Answer: Numbers 2, 4, 5, 7, 8, 10, 13, 14 are discrete random variables, while the
rest are continuous random variables.
As discussed previously, a random variable is a mapping of a random outcome to a number. Now, in this
part of the lecture, we will learn how to identify the possible outcomes and the value of a random
variable.
Example 1.1.2. In a box are two (2) balls — one white and one black, two balls are picked one at a time
with replacement. List down all the possible outcomes and the values of the random variable X
representing the number of white balls drawn using the table below.
Solution to Example 1.1.2. Let X represent the number of white balls drawn. First, we create a table with
the following heading
After which, we list the possible outcomes of the experiment. Clearly, if two balls are picked one at a time
with replacement, the possible outcomes are WW (White, White), WB (White, Black), BW (Black, White),
and BB (Black, Black). We now have the following:
Lastly, we determine the value of each of the possible outcome of the random variable:
3
WB 1
BW 1
BB 0
Remark. There are various ways to list the possible outcomes and values of a random variable. In fact,
different texts may show different ways. This tabular way of showing the sample space and the values of
the random variable is one of the many ways to show its possible outcomes and values.
Example 1.1.3. Three coins are tossed, list down all the possible outcomes and the values of the random
variable Y representing the number of heads that occur.
Example 1.1.4. In a family with three children, list down all the possible outcomes of their sexes and the
values of the random variable Z representing the number of male children.
Supplementary Exercises
List all possible outcomes and find the values of the random variable:
4
1. A manufacturer produces laptops. Suppose three units are tested by the quality assurance team and
they want to find the number of defective units that occur. Let D represent the defective units and N
the non-defective units. Show the values of the random variable X representing the number of
defective units.
Number of defective
Possible Outcomes
laptops
2. In an experiment four coins are tossed. Let M be the random variable representing the number of
tails that occur. Find the values of the random variable M .
Lecture 1.2.
Discrete Probability Distribution
Introduction
After learning the concept of random variables, we will now learn how to construct the probability
distribution of a discrete random variable. Our understanding about the probability of an event is
important in this lesson.
Lesson Proper
Generally, the notation used to represent the probability distribution of a discrete random variable is
P( X ) or P( X =x) where x represents a possible value of the random variable X .
Remark. Recall that the classical and empirical (relative frequency) probabilities are computed as
5
number of observations of a specified event
Empirical Probability P ( E )=
total number of observations
respectively. In this section, these formulas will be used to determine the probability associated to each
value of the random variable.
a) The probability of each event in the sample space must be between or equal to 0 and 1.
0 ≤ P( X )≤ 1
b) The sum of the probabilities of all the events in the sample space must be equal to 1 (or in
percentages, 100%).
∑ P ( X )=1
Example 1.2.1. In a box are 2 balls, one red and one blue. Two balls are picked one at a time with
replacement. With the number of red balls drawn, construct the probability distribution table.
Further, the sample space for the random variable is S={(blue, blue), (blue, red), (red, blue), (red, red) }.
This means that the number of sample space, n ( S ) , is equal 4. From here we create a table containing the
following information:
X P(X )
0
1
2
∑ P ( X )=1
Example 1.2.2. Suppose a die is rolled 2 times. Let X =¿ the number of times a 6 comes up. Answer the
following:
Now, it should be clear that the values of the random variable is X =0 , 1, 2. This is because in rolling a die
twice, the face could show one (1) six, or two (2) sixes, or none at all.
Next, to get the values that will be used to compute for the probability, we may write down all the
possible outcomes (e.g. 1,1; 1,2; 1,3; 1,4; 1,5; 1,6; …; 6,6) and list the number of times a 6 comes up.
Alternatively, we may also list the possible outcomes using a matrix shown on the illustration below:
1 2 3 4 5 6
1 1,1 1,2 1,3 1,4 1,5 1,6
2 2,1 2,2 2,3 2,4 2,5 2,6
3 3,1 3,2 3,3 3,4 3,5 3,6
4 4,1 4,2 4,3 4,4 4,5 4,6
5 5,1 5,2 5,3 5,4 5,5 5,6
6 6,1 6,2 6,3 6,4 6,5 6,6
7
From here we see that n ( S )=36 ; n ( no 6 comes up )=25; n ( one (1)six comes up ) =10; and
n ( two (2) six comes up )=1 . This brings us to the following probability distribution table:
X P(X )
10
P ( X=1 ) =P ( 1 ) = =0.2778 or (27.78 %)
36
Example 1.2.3. The result of a survey given to Senior High School students is shown below
Task: Construct the probability distribution for the random variable Y , the number of pets that they have
at home, and determine the chance that a senior high school student have three (3) pets at home.
Number of Pets at
P(Y = y)
Home (Y ¿
0
1
2
3
4
8
5
Further, recall that the given survey result is an outcome of making an observation (or experiment).
f
Thus, the formula for the experimental probability , P ( Y = y )= , should be used. Note that in this
N
formula, f represents the frequency of the desired observation, while N is the total number of
observations. Now, based on the given table, this means that N=5+ 4 +6+8+1+1=25. Also, the frequency
of having no pets at home is five (5); the frequency of having one pet at home is four (4); the frequency of
having two pets at home is six (6) and so on…
As such, the use of this formula brings us to complete the table shown as follows:
Number of Pets at
Home (Y ¿ P(Y = y)
5
0 P ( Y =0 )=
25
4
1 P ( Y =1 )=
25
6
2 P ( Y =2 )=
25
8
3 P ( Y =3 ) =
25
1
4 P ( Y =4 )=
25
1
5 P ( Y =5 ) =
25
Lastly, it should be clear that the chance that a senior high school student have three (3) pets at home is
8
P ( a senior high school student have three pets at home )=P ( Y =3 ) =P ( 3 )= =0.32 or 32 %
25
Example 1.2.4. A nursing school is investigating the number of reported laboratory accidents committed
by their students while on their internship program. These are on-the-job training related accidents over
a period of one month. The following are records on the laboratory accidents that were documented:
Laboratory
accidents, P(X)
X
25
0 P ( X=0 )= =0.5
50
15
1 P ( X=1 ) = =0.3
50
2
2 P ( X=2 )= =0.04
50
5
3 P ( X=3 )= =0.10
50
2
4 P ( X=4 )= =0.04
50
1
5 P ( X=5 )= =0.02
50
P ( having at least four laboratory accidents )=P ( X ≥ 4 )=P ( X=4∨X=5 )=P ( X=4 )+ P ( X =5 )=0.06
10
P ( having at most three laboratory accidents )=P ( X ≤3 )=P ( X=0∨X =1∨ X=2∨ X=3 )=P ( X=0 )+ P ( X =1 ) +
Supplementary Exercises
1 1 1 1 1 1
P(X )
6 6 6 6 6 6
b)
X 0 5 10 15 20
P(X ) −0.5 0.7 0.3 0.2 0.3
c)
X 2 4 6 8 10
P(X ) 1.22 0.54 0.25 0.48 0.01
d)
X 0 1 2 3 4
P(X ) 0.10 0.15 0.15 0.25 0.35
X −20 −10 0 10 20 30
P(X ) 0.125 0.175 0.150 0.200 m 0.100
3. The table below shows the number of cars sold in a month by 25 car dealers.
11
3 4
4 8
5 6
4. The household of a local community were surveyed about the number of occupants who are
working. It was found that 25 households have one occupant working, 18 have two occupants
working, 12 have three occupants working and 5 have four occupants working.
Let X be the number of occupants working from a randomly selected household, create a
probability distribution for the random variable X .
Lecture 1.3
Mean and Variance of a Discrete Random Variable
Introduction
Previously, we have discussed how to construct probability distributions for discrete random variables.
Further, significant questions such as “What fraction of the time will intern students at a certain nursing
school incur three laboratory accidents?” among others, were answered.
Now, in this lecture, we will respond to other important questions such as “On the average, what number
of laboratory accidents will we expect our intern students to incur, based on the data that we got?”. In
other words, this lecture will teach us how to make expectations about a random phenomenon we choose
to observe.
Lesson Proper
Recall that the Population Mean, μ, is a parameter or population characteristic that describes the center
or common data in the distribution. Now, with regards to the discrete random variable, this is defined as:
μ= E ( X )=∑ [ X ∙ P ( X ) ]
12
Let us look at an intuitive justification for the formula of the expected value of a discrete random variable:
Toss two fair coins again and let X be the number of heads observed. Recall that the probability
distribution for X (computed using theoretical probability) is
X P(X )
1
0
4
2
1
4
1
2
4
Now, suppose that we perform this experiment by large number of times, say 400 times. Intuitively, for
each of the possible value (or outcomes) of the random variable, one would observe approximately 100
outcomes where no heads appear, 100 outcomes where a head and a tail appears, 100 outcomes where a
tail and a head appears, and lastly, 100 outcomes where two heads appear (remember, the coin is
assumed to be fair). This means then that that through the formula of the average, we have
∑ of outcomes
total number of trials
100 ( no heads are observed )+ 200 ( one head isobserved ) +100(two heads are observed)
[Equation1]
400
1 2 1
( 0) + ( 1) + ( 2) .
4 4 4
Note that the resulting equation is just the sum of product of the random variable and its corresponding
probability. This is exactly what the formula of the expected value (∑ [ X ∙ P ( X ) ]¿ states.
Remark. We could use a similar intuitive justification to justify formulas for the measures of dispersion—
the population variance (a parameter that measures the average squared distance or deviation of each
item in the data from the mean) and the standard deviation (a measure of the average distance between
the values of the data in the set and the mean, or how spread out the values in a data set are around the
mean.
13
). However, to delegate an ample amount of time for the priority areas of the lecture, we will go straight
to their definitions and applications in real-life situations.
σ =∑ [(X−μ)¿¿ 2 ∙ P( X)]¿
2
Remark. The standard deviation ¿) of a random variable X is equal to the principal square root (positive
square root) of its variance. That is
σ =√ variance
Example 1.3.1. A young professional wish to venture into an investment. Two venture capitalists (VC)
offered an investment plan which indicates the return on investment (ROI) for a period of 5 years. In
addition, the probabilities associated with each ROI’s are provided in the table:
50 0.2
Plan B (offered
30 1
by VC2)
We multiply X and P(X ) values per row and write the results on another column with a heading
entitled “ X ∙ P ( X )” .
Next, we get the sum of the X ∙ P ( X ) column.
14
ROI in thousand Probability
Investment Plan
pesos ( X ) (P ( X ) ) X ∙ P (X )
10 0.2 2
20 0.2 4
30 0.2 6
Plan A (Bank A)
40 0.2 8
50 0.2 10
μ=∑ [ X ∙ P ( X ) ] =30
The resulting computation indicates that the average return of investment for Plan A is 30,000 pesos.
Take note that for Plan B, since the ROI is fixed, its mean is also 30,000 pesos.
We see that both plans yield the same average ROI. Hence, at this point, this information should make us
realize that in terms of the ROI average, there is no plan that could be regarded as the better investment.
Given the absence of a decision, we can look at another aspect of this event through making computations
that will shed light on the means’ variability. We can do this through computing for the variance or the
standard deviation.
Recall that one of the things that the variance or standard deviation tells us is the “consistency” or
“closeness” of data points towards the mean. Note that using this measure as basis for further
comparison is justified since the means of the two plans are the same.
Now, to compute for the variance and standard deviation, we do the following:
First we append three columns entitled “ (X −μ)”, “( X −μ)2”, and “(X −μ)2 ∙ P (X )” on the right side
of the table we previously created accordingly.
Next, we continue to fill out the table (tip: it may be easier to compute if one is to work by rows).
Last, we compute for the sum of the last column to get the value of the variance, then we take the
principal square root of the variance to get the standard deviation. Thus we have,
ROI in
Investment Probability
Plan
thousands (
, (P ( X ) )
X ∙ P (X ) (X −μ) (X −μ)2 ( X −μ)2 ∙ P (X )
X¿
Plan A 10 0.2 2 10−30=−20 (−20)2=400 400 ∙ 0.2=80
(Bank A)
20 0.2 4 20−30=−10 (−10)2=100 100 ∙ 0.2=20
2
30 0.2 6 30−30=0 (0) =0 0 ∙ 0.2=0
μ=∑ [ X ∙ P ( X ) ]
15
σ 2=∑ [( X−μ)¿¿ 2 ∙ P( X)]¿
μ=30 2
σ =200
σ =14.1421
Hence the standard deviation for Plan A is 14,142.1 pesos. Meanwhile, for Plan B, since the ROI is
guaranteed to be 30,000 pesos in 5 years, this means that the variance σ 2 or the standard deviation σ for
Plan B is equal to 0.
Therefore, since the average ROI is the same for both plans, but Plan B has zero variability, then Plan B
may be characterized as a “consistent” or “stable” plan, which, to some people, is an indication of a good
investment. Meanwhile, others may look at the risks that come with investing in Plan A as a potential
avenue for getting more so Plan A could still be equally considered.
Remark. Decision making based on a close statistical result may depend on a person’s preference.
Example 1.3.2. The owner of a computer store chain is set to choose the “Top Branch of the Year” and his
decision is completely based on the over-all selling performance (number of laptops sold) for the past
twelve months. The table below shows the data of the two finalists. :
Branch A Branch B
No. of Months No. of Months
Number of Number of
Before the Before the
Laptops Sold Laptops Sold
Target was Met Target was Met
(X ¿ (X ¿
¿) ¿)
20 1 20 2
25 3 25 2
30 2 30 2
35 3 35 2
40 2 40 1
45 1 45 3
Help the owner determine the “Top Branch of the Year” using statistics.
Number of Probability,
Finalists No. of months, f X ∙ P (X )
laptops sold, X P( X )
Branch A 20 1 1 1.6670
=0.0833
12
16
3
25 3 =0.2500 6.2500
12
2
30 2 =0.1667 5.0010
12
3
35 3 =0.2500 8.7500
12
2
40 2 =0.1667 6.6680
12
1
45 1 =0.0833 3.7485
12
N=12 μ=∑ [ X ∙ P ( X ) ]
=32.0835
2
20 2 =0.1667 3.3340
12
2
25 2 =0.1667 4.1675
12
2
30 2 =0.1667 5.0010
12
2
Branch B 35 2 =0.1667 5.8345
12
1
40 1 =0.0833 3.3320
12
3
45 3 =0.25 11.2500
12
N=12 μ=∑ [ X ∙ P ( X ) ]
=32.9190
Based on these results, Branch B could be regarded as the “Top Branch of the Year”.
Remark. It should be interesting to consider, however, the consistency of sales, since the means are
relatively close to each other. The computation is given below:
Number of
No. of Probability,
Finalists laptops sold,
months, f P(X ) X ∙P (X) ( X −μ) (X −μ)2 (X −μ)2 ∙ P ( X )
X
Branch A 20 1 1 1.6660 −12.0835 146.0110 12.1627
=0.0833
12
17
3
25 3 =0.2500 6.2500 −7.0835 50.1760 12.5440
12
2
30 2 =0.1667 5.0010 −2.0835 4.3410 0.7236
12
3
35 3 =0.2500 8.7500 2.9165 8.5060 2.1265
12
2
40 2 =0.1667 6.6680 7.9165 62.6710 10.4473
12
1
45 1 =0.0833 3.7485 12.9165 166.8360 13.8974
12
σ =∑ [( X−μ)¿¿ 2 ∙ P( X)]¿
2
N=12 μ=∑ [ X ∙ P ( X ) ] 2
=32.0835
σ =51.9015
σ =7.2042
2
20 2 =0.1667 3.3340 −12.9190 166.9006 27.8223
12
2
25 2 =0.1667 4.1675 −7.9190 62.7106 10.4539
12
2
30 2 =0.1667 5.0010 −2.9190 8.5206 1.4204
12
2
35 2 =0.1667 5.8345 2.0810 4.3306 0.7219
Branch B 12
1
40 1 =0.0833 3.3320 7.081 50.1406 4.1767
12
3
45 3 =0.25 11.2500 12.0810 145.9506 36.4876
12
σ 2=∑ [( X−μ)¿¿ 2 ∙ P( X)]¿
N=12 μ=∑ [ X ∙ P ( X ) ] 2
=32.9190
σ =81.0828
σ =9.0046
Since the means are relatively close to each other, and the results above show that Branch B has greater
variability compared to Branch A, thus, the owner could still consider Branch A to receive the “Top
Branch of the Year” award.
Example 1.3.3. You attended your school fair and a Cube Game (six-sided die game) caught your
attention. In this game, you roll a die you have to pay 20 pesos. If the face of a die shows a “one” you win
100 pesos, otherwise you lose. You have the money and time to spare; do you think it will be
advantageous for you to play a considerable number of games?
18
Solution to Example 1.3.3.
Recall that computing for the mean will give us an idea of our “expected winnings” if we played for large
number of times. This is exactly why the mean is also regarded as the “expected value”. Given this, we can
determine whether it is advantageous for us to play a considerable of number of games if we have an
idea of our expected winnings through computing the mean.
And so, to compute for the mean, first, we let X represent possible monetary outcomes for playing the
game. Clearly, the values of X could be 80 pesos (this if you won; you get 100 pesos but recall that you
paid 20 pesos to play the game) and −20 pesos (if you lost). Similarly, we see that the total number of
possible outcomes is six 6. We can now construct our probability distribution that contains the X ∙ P (X )
column:
Possible
X P(X ) X ∙ P (X )
outcomes
1
1 80 =0.1667 13.34
6
5
2, 3, 4, 5, 6 −20 =0.8333 -16.67
6
E ( X ) =∑ X ∙ P ( X )
E( X)=−3.33
The negative (−¿) sign on the expected value means that you will lose in the long run or alternatively, it
means that the game is designed so that the host of the fair always win.
Thus, we conclude that it is not advantageous for us to play a considerable number of games.
Example 1.3.4. With the same game as Example 1.3.3, let us modify it as follows: To play the game you
have to pay 20 php. If the die shows a “one” you win P120, or else you lose. Do you think you will win in
the long run?
Possible
X P( X ) X ∙ P (X )
outcomes
1
1 120−20=100 =0.1667 16.67
6
5
2, 3, 4, 5, 6 −20 =0.8333 −16.67
6
E ( X ) =∑ X ∙ P ( X )
E( X)=0
The expected value of this game is 0, which means that theoretically, you will even out your winnings and
losses in the long run. Thus, we will neither win or lose by playing the game.
19
Remark. A game is said to be “fair” if the expected value is 0. For the most part of playing a gambling
game, you will not find this type of game of chance where the expected value is equal to 0. Most games of
chance are designed in favor of the house.
Example 1.3.5. The organizing committee of a high school reunion placed 150 balls inside a box. Ten of
the balls are red, five are blue, one is gold, and the rest are white. A player has a chance to draw one ball
from the box. A red ball will let a player win 500 pesos, a blue ball will let a player win 1000 pesos, and
the single gold ball will let a player win 5000 pesos. A player doesn’t get anything if he gets a white ball.
What would be the fair price to pay for a chance to draw a ball from the box?
Possible
X P(X ) X ∙P (X)
Outcomes
10
Red – 10 balls 500 =0.0667 33.35
150
5
Blue – 5 balls 1000 =0.0333 33.30
150
1
Gold – 1 ball 5000 =0.0067 33.50
150
134
White – 134 balls 0 =0.8933 0
150
E ( X ) =∑ X ∙ P ( X )
E( X)=100.15
Thus, the fair price for playing the gaming is 100.15 pesos. However, if the organizing committee wants to
profit from this game, the price to play the game should be greater than 100.15 pesos.
Example 1.3.6. A car insurance company offers to pay 500,000 pesos if a car is stolen or is destroyed
beyond repair. The insurance policy costs 24,000 pesos and company research shows that the
probability that the company will need to pay the amount of insurance is 0.002. Find the expected value
of the insurance to car owners.
20
Further, say that during the entire life of the policy, a car owner did not meet such accidents, the value of
insurance is −24,000 php. As such, we construct the probability distribution as follows:
X P( X ) X ∙ P (X )
E ( X ) =−23,000
Therefore, the expected value of the insurance to the car owner is −23,000 php. The negative expected
value shows that the policy is designed to the advantage of the insurance company.
However, car owners still buy insurance policies because the security it provides in the event of a loss is
worth the cost of purchasing it.
Supplementary Exercises
1. A salesperson has found that the probability of making various numbers of sales per day, given
that calls on 10 sales prospects can be made, is presented in the table below. Calculate the average
number of sales per day, variance and the standard deviation of the number of sales. Use the table
below to show your solution.
21
b. Variance of the number of sales
c. Standard deviation of the number of sales
2. The arrival of customers during randomly chosen 10-min intervals at a drive-in facility
specializing in photo development and film sales has been found to follow the probability
distribution in the following table. Calculate the expected number of arrivals for 10-min intervals
and the standard deviation of the arrivals. Use the table below to show your solution.
3. A company makes electronic gadgets. One out of every 50 gadgets is faulty, but the company
doesn't know which ones are faulty until a buyer complains. Suppose the company makes a 150
php profit on the sale of any working gadget, but suffers a loss of 4000 php for every faulty gadget
because they have to repair the unit. Check whether the company can expect a profit in the long
term.
4. A local club plans to invest 10,000 php to host a baseball game. They expect to sell tickets
worth 15,000 php. But if it rains on the day of the game, they won't sell any tickets and the club
will lose all the money invested. If the weather forecast for the day of the game is a 20% possibility
of rain, is this a good investment?
Enrichment
Determining the Expected Value, Variance and Standard Deviation of Discrete Probability Distributions
using a Scientific Calculator
There are many of brands and models of scientific calculators. They also have different ways of finding
the mean, variance, and standard deviation. The succeeding examples will give you an illustration (two
22
types of calculators) on how to use the function of your calculator in finding the mean, variance and
standard deviation.
Let us go back to Example 1.3.1. Using the Statistics function of our calculator, let us determine the mean,
variance and standard deviation.
ROI in thousands,
Investment Plans Probability, P( X )
X
10 0.2
20 0.2
50 0.2
24