Lecture6 Slides

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

Concept of a Random Variable

Definition: A random variable is a function that assigns a real number to each outcome in the sample
space of a random experiment.
A random variable with a countable number of values is said to be discrete; one that may
assume any value in some interval on the real number line is said to be continuous.
Example 8.1: Two balls are drawn in succession without replacement from an urn containing 4
red balls and 3 black balls. The possible outcomes and the values y of the random
variable Y, where Y is the number of red balls, are

Sample Space y

RR 2
RB 1
BR 1
BB 0

Example 8.3: Suppose a sampling plan involves sampling items from a process until a
defective is observed. The evaluation of the process will depend on how many
consecutive items are observed. In that regard, let X be a random variable defined
by the number of items observed before a defective is found. With N a
nondefective and D a defective, sample spaces are S = {D} given X = 1, S = {ND}
given X = 2, S = {NND} given X = 3, and so on.

Discrete Probability Distributions

Definition: The set of ordered pairs (x, f(x)) is a probability function, probability mass
function, or probability distribution of the discrete random variable X if, for each possible
outcome x,
1. f(x) ≥ 0,
2. ∑ f ( x) = 1
x

3. P(X = x) = f(x).
x=b

∑ f ( x)
4. P(a ≤ X ≤ b) =
x=a

Example 8.6: A shipment of 20 similar laptop computers to a retail outlet contains 3 that are
defective. If a school makes a random purchase of 2 of these computers, find the
probability distribution for the number of defectives.
Solution: Let X be a random variable whose values x are the possible numbers of defective
computers purchased by the school. Then x can only take the numbers 0, 1, and 2. Now

PHM111s - Probability and Statistics


 3  17 
 0  2 
f(0) = P(X = 0) =    = ,
68
 20  95
 2
 
 3  17 
 1  1 
f(1) = P(X = 1) =    =
51
,
 20  190
 2
 
 3  17 
 2  0 
f(2) = P(X = 2) =    =
3
.
 20  190
 2
 
Thus, the probability distribution of X is
x 0 1 2
68 51 3
f(x)
95 190 190
Example 8.7: Suppose that our experiment consists of tossing 3 fair coins. If we let Y denote
the number of heads that appear. Find the probability distribution for the number of
heads.

Solution: Let Y be a random variable whose values y are the possible numbers of heads that
appear. Then Y is a random variable taking on one of the values 0, 1, 2, and 3 with
respective probabilities
1
f(0) = P(Y = 0) = P((T, T, T)) =
8
3
f(1) = P(Y = 1) = P((T, T, H), (T, H, T), (H, T, T)) =
8
3
f(2) = P(Y = 2) = P((T, H, H), (H, T, H), (H, H, T)) =
8
1
f(3) = P(Y = 3) = P((H, H, H)) =
8

PHM111s - Probability and Statistics


Definition: The cumulative distribution function F(x) of a discrete random variable X with
probability distribution f(x) is
F(x) = P(X ≤ x) = ∑ f (t ), for − ∞ < x < ∞.
t≤ x

The distribution function F of X is a step function. That is, the value of F is constant in the
intervals [x i−1 , x i ) and then takes a step (or jump) of size p(x i ) at x i .

Example 8.9: If X has a probability mass function given by


1 1 3 1 1
f(0) = , f(1) = , f(2) = , f(3) = and f(4) =
16 4 8 4 16
Find the cumulative distribution function of the random variable. Using F(x),
verify that f(2) = 3/8.
Solution: The cumulative distribution function is
1
F(0) = f(0) = ,
16
5
F(1) = f(0) + f(1) = ,
16
11
F(2) = f(0) + f(1) + f(2) = ,
16
15
F(3) = f(0) + f(1) + f(2) + f(3) = ,
16
F(4) = f(0) + f(1) + f(2) + f(3) + f(4) = 1.
Hence,
0 x<0
1
 0 ≤ x <1
 16
5
 1≤ x < 2
 16
F(x) = 
 11 2≤ x<3
16
 15
 3≤ x < 4
16
 1 x≥4

Now
11 5 3
f(2) = F(2) − F(1) = − =.
16 16 8

PHM111s - Probability and Statistics


Mathematical Expectation (Mean of a Random Variable)

Definition: Let X be a random variable with probability distribution f(x). The mean, or
expected value, of X is

μ X = E(X) = ∑ xf ( x)
x
if X is discrete

Example 8.10: A purse contains 5 gold pounds and 7 half gold pounds pieces. A player is to
retain the two coins that he draws from the purse. What is the price to pay for the
privilege of participating?

Solution: Let X be a r. v. represents the number of winning pounds, x = 2, 1.5, 1.


 5  7 
 2  0 
f(2) = P(x = 2) = P(2P) =    =
10
Try P(P 1 P 2 )
 12  66
2
 
 5  7 
 1  1 
f(1.5) = P(x = 1.5) = P(1HP& P) =    =
35
Try P(P 1 HP 2 or HP 1 P 2 )
 12  66
2
 
 5  7 
 0  2 
f(1) = P(x = 1) = P(2HP) =    =
21
Try P(HP 1 HP 2 )
 12  66
2
 
Therefore, the expectation of winning any prize is defined as the value of the prize
times the probability of winning it.
10 35 21
μ = E(X) = (2)( ) + (1.5)( ) + (1)( ) = 1.42 L.E.
66 66 66

Theorem: Let X be a random variable with probability distribution f(x). The expected value of
the random variable g(X) is

μ g(X) = E[g(X)] = ∑ g ( x) f ( x) if X is discrete


x

Example 8.13: Suppose that the number of cars X that pass through a car wash between 4:00
P.M. and 5:00 P.M. on any sunny Friday has the following probability
distribution:
PHM111s - Probability and Statistics
x 4 5 6 7 8 9
1 1 1 1 1 1
P(X = x)
12 12 4 4 6 6
Let g(X) = 2X−1 represent the amount of money, in dollars, paid to the attendant
by the manager. Find the attendant’s expected earnings for this particular time
period.
Solution: The attendant can expect to receive
9
E[g(X)] = E(2X − 1) = ∑ (2 x − 1) f ( x)
x=4

1 1 1 1 1 1
= (7)( ) + (9)( ) + (11)( ) + (13)( ) + (15)( ) + (17)( ) = $12.67.
12 12 4 4 6 6

Means of Linear Combinations of Random Variables

Theorem: If a and b are constants, then


E(aX ± b) = aE(X) ± b.
Corollary 1: Setting a = 0, we see that E(b) = b.
Corollary 2: Setting b = 0, we see that E(aX) = aE(X).

Example 8.17: Applying the previous theorem to the discrete random variable f(X) = 2X − 1,
rework Example 8.13.
Solution: According to the theorem, we can write
E(2X − 1) = 2E(X) − 1.
Now
9
μ = E(X) = ∑ x f ( x)
x=4

1 1 1 1 1 1 41
= (4)( ) + (5)( ) + (6)( ) + (7)( ) + (8)( ) + (9)( ) = .
12 12 4 4 6 6 6
Therefore,
 41 
µ2 X −1 (2)  =
=  − 1 $12.67,
 6

as before.

Variance of Random Variables


The mean describes where the probability distribution is centered. By itself, however, the mean
does not give an adequate description of the shape of the distribution. We also need to
characterize the variability in the distribution. In the following figure, we have the histograms
of two discrete probability distributions that have the same mean, μ = 2, but differ considerably
in variability, or the dispersion of their observations about the mean.

PHM111s - Probability and Statistics


The most important measure of variability of a random variable X is obtained by applying
previous theorem with g(X) = (X − μ)2. The quantity is referred to as the variance of the
random variable X or the variance of the probability distribution of X and is denoted by
Var(X) or the symbol σ X2 , or simply by σ 2 when it is clear to which random variable we refer.

Definition: Let X be a random variable with probability distribution f(x) and mean μ. The
variance of X is
σ 2 = E[(X − μ)2] = ∑ ( x − µ ) 2 f ( x), if X is discrete
x

The positive square root of the variance, σ, is called the standard deviation of X.

The quantity x −μ is called the deviation of an observation from its mean. Since the deviations
are squared and then averaged, σ2 will be much smaller for a set of x values that are close to μ
than it will be for a set of values
that vary considerably from μ.

Theorem: The variance of a random variable X is


σ 2 = E(X2) − μ2. or σ 2 = E(X2) – E2(X).
Note: If a and b are constants, then Var(b) = 0 & Var(aX) = a2 Var(X) & Var(aX ± b) = a2
Var(X)
Example 8.15: Let the random variable X represent the number of defective parts for a machine
when 3 parts are sampled from a production line and tested. The following is the
probability distribution of X.

x 0 1 2 3
f(x) 0.51 0.38 0.1 0.01
calculate σ 2 .
Solution: First, we compute
μ = (0)(0.51) + (1)(0.38) + (2)(0.10) + (3)(0.01) = 0.61.
Now,
E(X2) = (0)(0.51) + (1)(0.38) + (4)(0.10) + (9)(0.01) = 0.87.
Therefore,
σ = 0.87 − (0.61)2 = 0.4979.
2
Also σ = 0.7056 (Var(2X-1) = ???)
PHM111s - Probability and Statistics

You might also like