Introduction to Business statistics, a computer
integrated approach by Alan H. Kvanli, €
Stephen Guynes and Robert J Pavur
Random Variable
» Whenever an experiment results in a
numerical outcome, such as the total value of
two dice, we can represent various possible
outcomes and their corresponding
probabilities much more conveniently by
using a random variable.
» A random variable is a function that assigns
a numerical value to each outcome of an
experiment.
Types of Random Variables
There are two types of Random variables
» Discrete Random Variables
Continuous Random Variables
Discrete Random Variable
IV alle possible values of à random variable can
e listed slong with the probability
then such à variable if said to be
random variable
For Example, X = No of heads in 3 flips of a coin
X» Total value of 2 dice
Continuous Random Variable
If we can assume any value over a particular range
fora random variable then such a fandom variable
is called Continuous Random Variable.
unple; X= Height, X = Weight
Discrete Random Variable (Example)
» Flip a coin 3 times. The possible outcomes
for each flip are Heads (+) and Tails (D)
» According to the counting rule 1, there are
total eight possible outcomes (2*2"2)
» These outcomes are TTT, TTH, THT, HIT,
HHT,THH and HHH. Suppose we are
interested in number of heads. Let
A = Event of observing O heads in 3 flips(TTT)
B = Event of observing 1 head in 3 flips (1TH,
THT, HTT)
C = Event of observing 2 heads in 3 flips
HTH, THH)
a ng 3 heads:in:3 flips (HH) .
Discrete Random Variable (Example)
» By simply counting the number of outcomes
for each event, we know that
P(A) = 1/8
P(B) = 3/8
PIC) =3/8
P(D) = 1/8
» The variable of interest in this example is X,
defined as
X = number of heads out of 3 flips.
We have already defined all possible outcomes
of X by defining four events, A, B, Cand D and
has calculated their corresponding
les, which may be listed as below:
Discrete Random Variable (Example)
m
318 var, TH TH
Note that 1/8+3/8
NE EN
Vatueorx@Nocr | Prebabliy
heads out of 3 ps)
Discrete Probability Distribution
» The value of the random variable X is not
known in advance, but there is a probability
associated with each possible value of X
» The list of all possible values of a random
variable X and their corresponding
probabilities is a probability distribution.
» It may be written in general form as
Discrete Probability Distribution
[raro EE
Discrete Random Variable
Other examples of a discrete random variable
include
» X= the number of cars that drive up to a
bank within a 5 minute period (X
0,1,2,3,...
» X = the number of people out of a group of
50 who will suffer a fatal accident within the
next 10 years (X= 0,1,2...50)
» X= the number of calls arriving at a telephone
Switchboard over a 2 minute period (X
EXAMPLE 5.1
» You roll two dice, a red die and a blue die.
What is a possible random variable X for this
situation? What are its possible values and
corresponding probabilities (Hint: Roll the
dice and observe a particular number. This
number is your value of the random variable ,
X. What observations are possible from the
roll of the two dice
EXAMPLE 5.1 (Solution)
Possibilities for random variable
» X = total of two dice
» X= average of two di
»X = the higher of the two numbers that
appear (Possible values = 1,2,3,4,5,6)
»X = the number of dice with 3 appearing
(Possible values:0, 1, 2)
Suppose random variable X = total of the two
dice.
EXAMPLE 5.1 (Solution)
Possible values and corresponding probabilities
for random variable X = total of two dice:
» Total number of possible outcomes = 6*6 = 36
» All these outcomes are equally likely or have)
same chance of occurrence and the probability of
each outcome is thus 1/36
» Now we will see the list of all possible outcomes
from this experiment and the corresponding
values of our random variable X
EXAMPLE 5.1 (Solution)
EXAMPLE 5.1 (Solution)
For getting to know the associated
probabilities for each possible value of X, an
easy way is to get to know the number of
possible outcomes for each value of random
variable X.
EXAMPLE 5.1 (Solution)
1 olinga 1.1)
2 Roling à 1,2 072.1) 236
EXAMPLE 5.1 (Solution)
Note that the sum of all probabilities is
always equal to 1
Suppose X = average of the two dice
Still X is a discrete random variable with a
limited set of possible values (with gaps in
them) that is 1,1.5,2,2.5,3,3.5,4,4.5,5,5
and 6
Similarly we can also come up with the
probability distribution of this variable X by
finding out the associated probabilities for all
these values of X,
Continuous Random Variables
» A continuous random variable is a variable, for which
any value 1s possible over some range of values
» For a random variable of this type, there are no gaps
inthe set of possible values
Example: Consider two random variables X and Y
where
X = Number of days it rained in Peshawar during
August
Y = Amount of rainfall during this month
Here X is a discrete random variable, because there are
‘gaps in the possible values ( suppose 5
possible) and Y 15 a continuous random variable
Value 1s possible over a particular range
Continuous Random Variables
(Example)
, Suppose the heights of all adult males in the
unfted states range from 3 feet to 7.5 feet. Your
task is to describe these heights using such
statements as
15 % of the heights are under 5.5 ft
88 % of the heights are between 5 ft and 6 ft
» We first define the random variable
X = Height of a randomly selected adult male in
United States.
» Here for a continuous random variable, we are
unable to list all possible values of X as any value
is possible over a particular range.
Continuous Random Variables
(Example)
» However we can still discuss probabilities
associated with X
» For example, the preceding statements may bel
written as
PX < 5.5) - 0.15
POX is between 5 ft and 6 ft) = P(S<X<6) - 0.88
» Here X is a continuous random variable and
probabilities for a continuous random variable can
be found only for intervals.
» Determining the probabilities for a continuous
random variable will be discussed in the next
Representing Probability Distributions
For Discrete Random Variabl
There are 3 popular methods of describing the
probabilities associated with a discrete random
variable
» List each value of X and its corresponding
probability.
» Use a histogram to convey the probabilities
corresponding to the various values of X.
» Use a function that assigns a probability to
each value of X.
1* Method: Listing all Possible Values
» The first method of listing all possible val
works well when there is a small number of
possible values of X, for example, observing
the no of heads in 3 flips of a coin but this
method doesn’t work well suppose for 100
flips of a coin.
2"d Method: Using Histogram
» Histogram is also a convenient way to
represent the shape of a discrete distribution
having a small number of possible va
» The histogram is constructed in a way that
the height of each bar is the probability of
observing that value of X.
» For the coin flipping example, possible values
of X and their associated probabilities are 0,
1,2 and 3 with the corresponding
probabilities 1/8, 3/8, 3/8 and 1/8
2°4 Method: Using Histogram
» The histogram for the coin flipping example can
be seen as under
» It can be clearly seen from this histogra
the probability. distribution for this
'd Method: Using Probability mass
function
Using a function (that is an algebraic formula to
assign probabilities is the most convenient
method of describing the probability distribution
of a discrete random variable
The function that assigns a probability to each
value of X is called probability mass function
(em).
However this function may or may not be known,
» The requirements of a PMF are
1- PO is between O and 1 (inclusively) for each x
2- Sum of probabilities for all values of x is always
EXAMPLE 5.2
Consider a random variable X having possible
values of 1,2, or 3. The corresponding
probability for each value is:
x; =1 with probability 1/6
x= 2 with probability 1/3
x= 3 with probability 1/2
Determine an expression for the PMF
Example 5.2
sider the function
PK = x) = Px) = x/6 for x = 1,2,
This function provides the probabilities
PX =1) = P(1) = 1/6 (OK)
1/3 (OK)
POX =2) = P(2) = 2/6
3/6 = 1/2 (OK)
POX =3) = P(3)
This functions satisfies the requirements for a
PME as
» Each probability is between 0 and land
» PC) + P(2) + P(3) = 1/6 +1/3+1/2 1
Consequently, the function P(x) = x/6 for
2.3 (and zero elsewhere) is the PMF for
fandom variable.
» Check out Example 5.3 from book yourself.
Mean of a discrete Random Variablı
» The mean of a discrete random variable ,
written as y represents the average value of
the random variable if you were to observe this
variable over an indefinite period of time.
Reconsider our coin flipping example, Where X
is the number of heads in three flips of a coin.
Suppose you flip the coin three times, record
the value of X, and repeat this process ten
times. Now you have 10 observations of X
Suppose they are
2,1,1,0,2,3,2,1,1,3
Mean of a discrete Random Variable
» The mean of these data is the statistic, rwhere
Sample mean=x= (2+1.....+1+3) / 10 =1.6 heads
If you observed X indefinitely, what would X be on
the avera
Following are the list of possible values of X along
with their corresponding probabilities
x, = Owith probability 1/8
Xp = 1 with probability 3/8
x3 = 2 with probability 3/8
3 with probability 1/8
Mean of a discrete Random Variable
» So the average value of X, wis
(0)(1/8) + (18/8) + (2)(3/8) + (3)(1/8) = 1.5 heads
Notice that X cannot be 1.5, this is merely the value|
of X on the average.
The following formula can be used to compute the|
mean of a discrete random variable
WEL x,* POT
Example 5.4
A personnel manager in a large production facility
is Investigating the number of reported on the job
Accidents over a period of 1 month, We define the
random variable
X - Number of reported accidents per month.
Based on past records, she has derived the
following probability distribution for X
Owith probability 0.50
1 with probability 0.25
2 with probability 0.10
3 with probability 0.10
4 with probability 0,05
10
Example 5.4
During 50 % of the months there were no
reported accidents, 25 % of the months had
one accident, and so on.
What is the mean or average value of X?
Solution
B= EL x," PO) |
= (0)*(.5) +(1)*(.25) +(2)01) +031) + 4)*(.05)_
= 0.95 reported accident on average per
/ariance of discrete Random Variables
» Reconsider the coin flipping example, Where X is
the number of heads in three flips of a coin,
Suppose you flip the coin three times, record the
value of X, and repeat this process ten times. Now
you have 10 observations of X. Suppose they are
2,1,1,0,2,3,2,1,1,3
If we use the formulas studied in chapter 3 for
sample data to calculate mean and variance, the
values thus obtained are
Mean = à = 1.6
Variance = s?= 0.933
er each of these measure describes the
a statistic
riance of discrete Random Variables
If we consider observing X indefinitely, then the
variance is defined to be the variance of the
random variable X and is written as 0?
variance of the discrete random variable X.
The variance of a discrete random variable X, is a
parameter describing tl corresponding
population and can be obtained by using one of
the following expressions, which are
mathematically equivalent:
E(x p)? . PO)
Calculating variance for coin flipping
example
For the con flipping example
o? = EXPO - 1?
100/8) +WB/8
(8/8)+(3)2:(1/81 (1.5
2.25 = 0.75
EXAMPLE 5.5
Determine the variance and standard deviation
of the random variable described in example
5.4 concerning on the job accidents
Example 5.5
nel manager in a large production, facil is
the number of reported’ on the Job accidents
14 oF | month We define the random variable
Number of reported accidents per month
past records, she has derived the following
probabihty distabution for À
‘Owith probability 0.50
Y with pro
‘with probably 0
1.0
Determine the variance and the standard deviation of the
Fandom Variable delined above
Example 5.5 (Solution)
DT Ter Is 1
10
So, u = Z { x,* Pox) ]= 0.95 accident
2 = Ex?P(x) u? = 2.35 - (95)? = 1.45 accident ?
Binomial Random Variable
» Three popular discrete random variables are
Binomial, hypergeometric and Poisson
random variables
We will study only Binomial Random variable.
A binomial random variable counts the
number of successes out of n independent
trials,
The random variable X representing the
number of heads in three flips of a coin is a
special type of discrete random variabl
called a binomial random variable.
Conditions for a binomial random
variable
The following are the conditions for a binomial
random variable in general and as applied to
the coin flipping example,
Conditions for a binomial random
variable
| [A binomial Situation (in gener) |For Coin fpping Example
Example 5
In example 4.3, it was noted that 30% of the
people in a particular city read the evening
newspaper. Select four people at random from
this city. Consider the number of people out of
these four that read the evening paper. Does
this satisfy the requirements of a binomial
situation? What is your random variable here
Example 5.6 (Solution)
Referring to the conditions 1 through 5 for a binomial
person at random fom the no
Success - The person reads the evening newspaper
Fallure = The person does not read the evening
the trails are independent
fed Yat’ random ERS the Wening
Sous we may define our random y
newspaper (no fof successes out of inde
able X thus satisfies all the requirements and
Praia binomial-randomvariable
Counting successes for a Binomial
Situation
» For any binomial situation, the number of
ways of getting k successes out of n trials is
» We are thus able to determine the probability
mass function for any binomial random
variable as well
» EXAMPLE:
Let X equal the number of heads out of 3 flips.
Here X Is a binomial random variable with
possible values 0,1,2 and 3
Counting successes for a Binomial
Situation
» In order to find probability or derive a probability
mass function for each value of x , we must first
be able to find out the number of ways of getting
k successes out of n trials (that is no of ways of
getting O heads, 1 head, 2 heads n 3 heads out
of 3 flips of a coin)
Suppose if we have to find out the number of
ways of getting 2 heads out of 3 flips of a c
then this may be calculated as °C, = 3 HI
HTH, THH)
Similarly we can do it for each value of our
binomial random variable.
Probability mass function for a
Binomial Random Variable.
The probability mass function for a binomial
random variable may be expressed as
P(x) = "C,PX(1-p)"* for x= 0,1,2, .......n
EXAMPLE: Derive the probabilities for each
value of random variable X , where X equal the
number of heads out f 3 flips with probability
of success or heads in each trial = p=0.5
Probability mass function for Coin
flipping example.
We already know that the possible values of the]
random variable X are 0, 1, 2 and 3 with
probabilities 1/8, 8 and 1/8.
This can be calculated from the probability mass!
function for the random variable as well
In example 5.6, the binomial random variable x
is the number of people (out of four) who read
the evening newspaper. Also there are n= 4
trials (people) with p =0.3 (30 % of the people
read the evening newspaper). Let S denote a
success and F a failure. Then define:
S = a person reads the evening newspaper
F = a person does not read the evening
newspaper
What is the probability that exactly two people
(out of four) will read the evening newspaper?
Example 5.7
We know that Probability mass function for a
binomial random variable is
Pox) = CPI forx=0,1,2,....n
Here x= 2, n=4, p= 0.3, 1-p =0.7
Putting the values,
PQ) -0.2646
xactly two people out of
four willread the evening newspaper
Example 5.7 (Probability Distribution
For coming up with the probability Distribution for
the random variable X in this case, we need to find
out the corresponding probabilities for each value
of X as shown below:
PO) = *C,(0.3)90.7)1= 0.240
PC) = 4C,(0.3)'(0.7)°= 0.412
PL?) = *C,(0.3}(0.7) = 0.265
PG) (0.3)(0.7)'= 0.076
PEA) = *C.(0.3):(0.7)"- 0.008
‘One may check, that sum of all probabilities is
equal to 1 (or very close to 1 due to rounding
errors)
Example 5.7 (Histogram)
A graphical representation of the probability
mass function for the above example may be
n below:
Cumulative Probability
» Suppose in example 5.6, you are interested in
finding out the probability that no more than
two people will read the evening paper
» This is called cumulative probability and is
obtained by summing PG) over the
approximate values of X
POX <2) = Plx=0) +P(x=1) +P(X=2)
P(X <2) =0.240 +0.412 +0.265
P(X <2) =0.917.
Shape of a Binomial Distribution
The shape of a binomial distribution is
» Skewed left for p > 4 and small n
» Skewed right for p < % and small
» Approximately bell-shaped (symmetric) if p is
near ¥ or if the number of trials is large.
Check out the figures A, B, C and D.
Shape of a Binomial Distribution
del A
Mean and Variance of Binomial
Random variables
» Although one may use the formulas described
earlier to find out the mean and variance of a
of a binomial random variable but there are
convenient shortcuts as well as given below.
Mean of a Binomial random variabl Pp
Variance of a Binomial variable=0? =np(1-p)
Mean and Variance of Binomial
Random variables (Example 5.6)
Mean = u-np
Mean = (4 0.3) =1.2
Variance = 0? =np(1=p)
Variance = 1.2(0.7
Variance = 0.84
Example 5.8
If you repeat example 5.6, using n-50 people
rather than n=4, how many evening newspaper
readers will you observe on the average.
Mean = u =np
Mean = = (50 *0.3) = 15people
Variance np(1-p)
Variance 15 (0.7) = 10.5
Varian 10.5 = 3.24 people
Example 5.9
Airline overbooking is a common practice. Many
people make reservations on several flights due to
tncertain plans and then cancel at the last minute
or simply fall to show up. Eagle air is a small
commuter airline, Their plans hold only 15 people.
Past records indicate that 20% of the ‘people
making a reservation do not show up for the flight.
Suppose that Eagle Air decides to book 18 people
for each flight.
1- Determine the probability that on any given
flight, at least one passenger holding a reservation
will not have a seat
What is the probability that there will be one or
more empty seats for any one flight?
Determine the mean and standard deviation for
is random variable
Example 5.9 (Solution)
Determine the probability that on any given flight,
a last one passenger holding a reservation wil
X= Number of people(out of 18) who book a flight
And actually do appear. a
Here we are interested in the probabilities that a
person comes up for the flight
Son 18, p- (10.2) 0.8, 1-p
There are 15 seats in the plane and 18 reservation
are made soi 16 or more than 18 people come for
ite fight then the condition wil hold tu
We see that if the airline follows this policy, 27%
of the time one or more passengers will be
deprived of a seat which is not a good situation,
Example 5.9 (Solution)
What is the probability that there will be one
or more empty seats for any one flight?
plane holds only 15 people , so if 14
than 14 people come up for the flight
here will be 1 or more empty seats.
» POG<14) = P(x=14) +P(x=13) Pix=1)
Pix=0)
» POCS14) 0.215
0.151+...+0.003+0.001+0+0+0+0 = 0.50
with this booking policy, the airline will have
flights with one or more empty seats
approximately one half of the time.
Example 5.9 (Solution)
3- Determine the mean and standard deviation
for this random variable.
Mean = y =np
Mean = u = (18 °0.8) = 14.4 people
So the average number of people who book a
flight and do appear is 14.4
Variance =<? =np(1-p)
Variance =02 = 14.4 (0.2) = 2.88 people
Standard deviation = 1.697 or 1.70 people
Example 5.10
It is estimated that one out of 10 vouchers examined
by the audit staff employed by a branch of the
Department of Health and Human services will
ntain an error. Define X to be no of vouchers in
error out of 20 randomly selected vouchers.
1- What is the probability that at least three
vouchers will contain an error?
What is the probability that no more than one
contains an error?
3- Determine the mean and standard deviation of X.
Example 5.10 (Solution)
» X = no of vouchers in error out of 20 randomly
selected vouchers.
» n=20, p= 0.10, 1-p = 0.90
1- What is the probability that at least three
vouchers will contain an error?
If there are 3 or more than 3 vouchers with error
then this condition will satisfy, that is
P(X>3) = P(x=3) + P(X=4)+ PIx=5)+....+P(«=20)
OR we may write it as
PO=3) = 1- PIX<3) = 1- [Pix-0) +P=1)
P(x=2)]
Example 5.10 (Solution)
P(X=3) = 1- [P(O) +P(1) +P(2)]
P(X>3) = 1- [0.122 +0.270+0.285]
POC>3) = 0.323
The probability that at leas three vouchers will
contain an error is 32.3%
2- What is the probability that no more than
one contains an error?
POX<1) = P(x=0) +P(x=1)
P(X<1) = 0.122 +0.270 =0.392
Example 5.10 (Solution)
3- Determine the mean and standard deviation of
Mean = u =np
Mean = w= (20*0.10) = 2
So the average number of vouchers in error is 2
Variance =o? =np(1-p)
A situation that requires the use of a binomial
random variable is lot acceptance sampling,
where you decide to accept or send back a lot.
A shipment of 500 calculator chips arrives at
Cassidy Electronics. The contract specifies that
Cassidy will accept this lot if a sample size of
10 from the shipment has no more than one
defective chip. What is the probability of
accepting the lot if, in fact, 10% of the lot (50
chips) are defective? If 20 % are defective?
Example 5.11 (Solution)
This is the case of a binomial random variable where
X = no of defective chips out of 10 randomly selected
hips
So there are n =10 trials
Where each trial has 2 outcome
Success = chip is defect
Failure = chip is not defective
IF 10% are defective, then
P=0.10, 1-p =0.90
Probability of acceptance = POC<1) =P(x=0) +PO=1)
This shows that in this sampling procedure, Cassidy
will accept the entire batch 73.08 of the tiie
Example 5.11 (Solution)
If 20% are defective, then
P-0.20, 1-p =0.80
Probability of acceptance = Plx<1) =P(x=¢
P(x=1) = 0.107 +0.268 =0.375