Chapter (2) (1) CCCCCCCCCCCC
Chapter (2) (1) CCCCCCCCCCCC
x-axis
x
Sx
Fig.1 A random variable assigns a number X(ρ) to each outcome ρ in the sample space S of a random experiment.
Example 1: Toss a fair coin three times, and let X denotes the number of heads find
S and Sx.
Solution
The sample space S = {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT}, Fig.2
H
T
H
H
T
H
H
T
T
H
T
T
Event ‘ρ’ HHH HHT HTH HTT THH THT TTH TTT
RV ‘X’ 3 2 2 1 2 1 1 0
Random variable
Discrete continuous
Fig.3. Classification of RV
Probability distribution
function
Discrete Continuous
probability mass probability density
function(pmf) function(pdf)
Example 2: Suppose that a fair coin is tossed twice, let X represent the number of
heads that can come up. Find the probability function corresponding to the random
variable X.
Solution
SX ={0, 1, 2}.
H
X 0 1 2 Sum T
T
P(X) 1 1 1 1 1 1
+ =
4 4 4 2 4
Fig.5. Sample space of Ex. 2
Remark ∑𝑥 𝑓(𝑥) = 1.
Sample space S = {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT}, N = 8.
Sample space of the random variable SX ={0, 1, 2, 3}.
Chapter 2| Discrete Random Variables
Sample HHH HHT HTH HTT THH THT TTH TTT Sum
space
RV (X) 3 2 2 1 2 1 1 0 ---
P(X) 1 1 1 1 1 1 1 1 1
8 8 8 8 8 8 8 8
Reward Y $1 $8 $0 Sum
P(Y) 3 1 4 1
8 8 8
1
𝑃(𝑌 = 8) =
8
1 3
𝑃(𝑌 = 1) = 3 ∗ =
8 8
1 4 1
𝑃(𝑌 = 0) = 4 ∗ = =
8 8 2
Fig.6. Example 4
indicates that the data points tend to be close to the mean of the set, while a high
standard deviation indicates that the data points are spread out over a wider range of
values.
Standard deviation σ = √σ2 = √var(𝑥).
Example 5: A random number generator produces sequences of independent digits,
each of which is as likely to be any digit from 0 to 9 as any other. If X denotes any
single digit, find E(X), Var(X) and 𝜎.
Solution
X 0 1 2 3 4 5 6 7 8 9 Sum
P(X=x) 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1
XiP(Xi) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 4.5
X2iP(Xi) 0 0.1 0.4 0.9 1.6 2.5 3.6 4.9 6.4 8.1 28.5
𝐸(𝑋) = ∑𝑛𝑖=0 𝑥𝑖 𝑃(𝑥𝑖 ) = 4.5
𝑉𝑎𝑟(𝑋) = 𝐸[𝑋 2 ] − (𝐸[𝑋])2 = 28.5 − (4.5)2 = 8.25.
X 1 2 3 4 5 6 7
P(X) 𝐶 2𝐶 2𝐶 3𝐶 𝐶2 2𝐶 2 7𝐶 2 + 𝐶
Find the value of C. Also find the mean, Var(X) and 𝜎 of distribution.
Solution
∑𝑛𝑖=1 𝑃(𝑋𝑖 ) = 1=𝑐 + 2𝑐 + 2𝑐 + 3𝑐 + 𝑐 2 + 2𝑐 2 + 7𝑐 2 + 𝑐
10𝑐 2 + 9𝑐 − 1 = (10𝑐 − 1)(𝑐 + 1) = 0
𝑐 = 0.1 𝑐 = −1 𝑟𝑒𝑗𝑒𝑐𝑡𝑒𝑑
Chapter 2| Discrete Random Variables
X 1 2 3 4 5 6 7 Sum
P(X) 0.1 0.2 0.2 0.3 0.01 0.02 0.17 1
XiP(Xi) 0.1 0.4 0.6 1.2 0.05 0.12 1.19 3.66
X2iP(Xi) 0.1 0.8 1.8 4.8 0.25 0.72 8.33 16.8
𝐸(𝑋) = ∑𝑛𝑖=0 𝑥𝑖 𝑃(𝑥𝑖 ) = 3.66
𝑉𝑎𝑟(𝑋) = 𝐸[𝑋 2 ] − (𝐸[𝑋])2 = 16.8 − (3.66)2 = 3.4.
𝑥 2 −1
Example 7: A function 𝑓(𝑥) = , x=1, 2, 3, 4, check if 𝑓(𝑥) is a probability
25
𝑥 2 −1
Example 8: Consider function 𝑓(𝑥) = , x=1,2,3,4 for what values of m, 𝑓(𝑥)
𝑚
is a probability distribution function? Then find 𝑝(𝑥 = 2), 𝑝(𝑥 ≤ 3), 𝑝(𝑥 =
1.5), 𝑝(𝑥 < 4), 𝑝(𝑥 < 6), and the mean, variance and standard deviation.
Solution
Satisfy the properties of the probability mass function.
1−1 4−1 9−1 16−1
𝑓(1) + 𝑓(2) + 𝑓(3) + 𝑓(4) = + + + =1
𝑚 𝑚 𝑚 𝑚
0 + 3 + 8 + 15 = 𝑚 then 𝑚 = 26
𝑥 2 −1
𝑓(𝑥) = is a probability distribution function
26
Chapter 2| Discrete Random Variables
x 1 2 3 4 Sum
1−1 4−1 3 9−1 8 16−1 15 ------
𝒇(𝒙) =0 = = =
26 26 26 26 26 26 26
0 6 24 60 90
x𝒇(𝒙)
26 26 26 26
0 12 72 240 324
𝒙𝟐 𝒇(𝒙)
26 26 26 26
3
𝑃(𝑥 = 2) = 𝑓(2) =
26
3 8 11
𝑃(𝑥 ≤ 3) = 𝑓(1) + 𝑓(2) + 𝑓(3) = 0 + + =
26 26 26
𝑃(𝑥 = 1.5) = 0
11
𝑃(𝑥 < 4) = 𝑓(1) + 𝑓(2) + 𝑓(3) =
26
𝑝(𝑥 < 6) = 1
6 24 60 90
Mean μ = ∑ x f(x)=0 + + + = =3.4615
26 26 26 26
12 72 240 90 2
Variance =var(x)= 2 =∑ x 2 f(x) − μ2 =0 + + + − ( ) =0.4793
26 26 26 26
9
Standard deviation=√var(𝑥)= .
13
0 3 11 26
F(𝒙) =1
26 26 26
Find the value of C, find F(xi) and graph both f(x) and F(x)
Solution
∑𝑛𝑖=1 𝑃(𝑋𝑖 ) = 1 ⟹ 0.4 + 0.3 + 0.2 + 𝐶 = 1
∴ 𝐶 = 0.1
X 1 2 3 4
P(X) 0.4 0.3 0.2 0.1
F(x) 0.4 0.7 0.9 1
Chapter 2| Discrete Random Variables
X -1 0 1 4 Sum
P(X) 0.2 0.5 0.2 0.1 1
XP(X) -0.2 0 0.2 0.4 0.4
X2P(X) 0.2 0 0.2 1.6 2
Chapter 2| Discrete Random Variables
Bernoulli trials are a set of independent trials with two outcomes only “success”
and “failure”. Like tossing a coin where the success could be H and the failure could
be T or vice versa. Let the probability of success be p, then the probability of failure
is ‘q = 1-p’ Let k be the number of successes.
The binomial law states that:
P [k successes in n Bernoulli trials] = 𝑃𝑛 (𝑘) = (𝑛𝑘)𝑃𝑘 (1 − 𝑃)𝑛−𝑘 = (𝑛𝑘)𝑃𝑘 𝑞 𝑛−𝑘
𝑛!
where (𝑛𝑘) = , n is the number of trials,
𝑘!(𝑛−𝑘)!
10
𝑝(3) = (53)0.53 (1 − 0.5)5−3 =
32
5
𝑝(4) = (54)0.54 (1 − 0.5)5−4 =
32
1
𝑝(5) = (55)0.55 (1 − 0.5)5−5 =
32
Binomial Distribution
No. of heads 0 1 2 3 4 5
P(x) 1 5 10 10 5 1 ∑ P(x) = 1
32 32 32 32 32 32
4.3.1. The mean, the variance and the standard deviation of the binomial
distribution
The mean (Expectation) of the binomial distribution
E(X)= = np
The variance of the binomial distribution
Var(X)= 2 = npq
The standard deviation of the binomial distribution
SD= =√𝑣𝑎𝑟 (𝑋)=√𝑛𝑝𝑞
Chapter 2| Discrete Random Variables
Example 13: For the previous example 20, n = 5, p = ½ and q = ½ find the mean,
the variance and the standard deviation of the binomial distribution
Solution
Mean = E(X) = np = 5(½) = 2.5
SD= =√𝑛𝑝𝑞=√5 ∗ 0.5 ∗ 0.5 =1.12
Coefficient of Variation:
1.12
CV= ∗ 100 = ∗ 100 = 44.8%
2.5
Example 14: Suppose that a coin is tossed three times. If we assume that the tosses
are independent and the probability of heads is p, then find the probability of :
a) zero heads, b) 1 head, c) 2 heads, d) 3 heads
Solution
We have a Bernoulli experiment, then we can follow the Binomial Law, where n=3
and probability of heads is p then probability of tail is (1-p)
Let k be the number of heads
∵ 𝑝𝑛 (𝑘) = (𝑛𝑘)𝑝𝑘 (1 − 𝑝)𝑛−𝑘
Example 15: Let k be the number of active (non-silent) speakers in a group of eight
non-interacting (i.e., independent) speakers. Suppose that a speaker is active with
probability 1/3. Find the probability that the number of active speakers is greater
than six.
Solution
We have a Bernoulli trials with two outcomes only : success (non silent) and failure
(silent), so we can use the Binomial Law, where n = 8 and probability of active
speaker is p=1/3 then probability of non-active speaker is q=(2/3)
Let k be the number of active speakers in a group of 8,
1 7 2 8−7 1 8 2 8−8
𝑝[𝑘 > 6] = 𝑝[𝑘 = 7] + 𝑝[𝑘 = 8] = (87) ( ) ( ) + (88) ( ) ( )
3 3 3 3
Example 16: Based on past experience, the probability that a certain electrical
component will be satisfactory is 0.98. The components are sampled item by item
from continuous production. In a sample of five components, what are the
probabilities of finding:
Solution:
Example 19: A sharpshooter normally hits the target 70% of the time
➢ Find the probability that her first hit is on the second shot.
𝑃(2) = 𝑝 𝑞 𝑘−1 = 0.7 0.32−1 = 0.21
➢ Find the mean
mean = 1/p = 1/0.7 =1.43
➢ Find the variance
𝑞 0.3
𝜎2 = = ≈ 0.6122
𝑝2 0.49
The Poisson distribution applies in its own right where the possible number
of discrete occurrences is much larger than the average number of occurrences in a
given interval of time or space. The number of possible occurrences is often not
known exactly. The outcomes must occur randomly, that is, completely by chance,
and the probability of occurrence must not be affected by whether or not the
outcomes occurred previously, so the occurrences are independent. In many cases,
although we can count the occurrences, such as of a thunderstorm, we cannot count
the corresponding nonoccurrences. (We can’t count “non-storms”!)
Chapter 2| Discrete Random Variables
𝜆𝑥 𝑒 −𝜆
𝑃(𝑋) = 𝑥 = 0, 1, 2, …
𝑥!
where λ is the average number of occurrences per base unit, and t is the number of
base units inspected
1) Mean 𝜇 = 𝐸(𝑋) = 𝜆
2) Variance 𝜎 2 = 𝜆
3) Standard Deviation 𝜎 = √𝜆
Example 20: New cases of H5 N1 Virus in New England are occurring at a rate of
about 2 per month, Find the probabilities that: 0,1, 2, 3, 4, 5, 6 cases will occur in
New England in the next month
Chapter 2| Discrete Random Variables
Solution
20 𝑒 −2
𝑃(𝑥 = 0) = = 0.135
0!
21 𝑒 −2
𝑃(𝑥 = 1) = = 0.27
1!
22 𝑒 −2
𝑃(𝑥 = 2) = = 0.27
2!
23 𝑒 −2
𝑃(𝑥 = 3) = = 0.18
3!
24 𝑒 −2
𝑃(𝑥 = 4) = = 0.09
4!
Solution
𝜆0 𝑒 −𝜆
𝑎) 𝑃(0) = = 𝑒 −15 = 3.06 ∗ 10−7
0!
15𝑖 𝑒 −15
𝑏) 𝑃(𝑥 > 10) = 1 − 𝑃(𝑛 ≤ 9) = 1 − ∑9𝑖=0 = 0.8815
𝑖!
Example 22: The mean number of people arriving per hour at a shopping center is 18.
Find the probability that the number of customers arriving in an hour is 20.
Solution
18𝑥 𝑒 −𝜆
𝜆 = 18 𝑃(𝑋 = 𝑥) =
𝑥!
180 𝑒 −18
𝑃(0) = = 0.0798
0!
Chapter 2| Discrete Random Variables
Example 23: The number of meteors( )الشهبfound by a radar system in any 30-
second interval under specified conditions averages 1.81. Assume the meteors
appear randomly and independently.
a) What is the probability that no meteors are found in a one-minute interval?
b) What is the probability of observing at least five but not more than eight
meteors in two minutes of observation?
Solution
𝑎) 𝜆 𝑡𝑖𝑚𝑒
1.81 30 𝑠𝑒𝑐𝑜𝑛𝑑 𝜆𝑛𝑒𝑤1 = 3.62/𝑚𝑖𝑛
𝜆𝑛𝑒𝑤1 60 𝑠𝑒𝑐𝑜𝑛𝑑
3.62𝑥 𝑒 −𝜆 3.620 𝑒 −3.62
𝑃(𝑋 = 𝑥) = 𝑃(0) = = 0.0268
𝑥! 0!
𝑏) 𝜆 𝑡𝑖𝑚𝑒
1.81 30 𝑠𝑒𝑐𝑜𝑛𝑑 𝜆𝑛𝑒𝑤2 = 7.24/𝑚𝑖𝑛
𝜆𝑛𝑒𝑤2 120 𝑠𝑒𝑐𝑜𝑛𝑑
Example 24: Suppose the average number of car accidents on the highway in one
day is 4. What is the probability of no car accident in one day? What is the probability
of 1 car accidence in two days?
Solution
It is sensible to use Poisson random variable representing the number of car accidents
on the high way. Let X representing the number of car accidents on the high way in
one day. Then,
𝜆=4
Chapter 2| Discrete Random Variables
𝑒 −4 40
Then, P(No car accident in one day) = 𝑃(𝑋 = 0) = = 𝑒 −4 = 0.0183
0!
Since the average number of car accidents in one day is 4, thus the average number
of car accidents in two days should be 8. Let Y represent the number of car accidents
in two days. Then,
𝜆𝑛𝑒𝑤 = 8
𝑒 −8 81
Then, Then, P(one car accident in two days) = 𝑃(𝑋 = 1) = = 8𝑒 −8 = 0.002
1!
Chapter 2| Discrete Random Variables
Exercises
𝑥 2 3 5 𝑥 -5 -4 1 2
i) ii)
𝑓(𝑥) 1/3 1/2 1/9 𝑓(𝑥) 1/4 1/8 1/2 1/8
X 1 2 3 4 5 6 7
P(X) 𝐶 2𝐶 𝐶 2𝐶 𝐶 𝐶 2𝐶
Find the value of C. Also find the mean and variance of distribution.
4) A project manager for an engineering firm submitted bids on three projects. The
following table summarizes the firm’s chances of having the three projects
accepted.
Project A B C
Prob of accept 0.30 0.80 0.10
Assuming the projects are independent of one another, what is the probability that
the firm will have all three projects accepted?
5) A coin weighted so that P(H) =2/3 and P(T) =1/3 is tossed three times. The
random variable X gives the number of heads is recorded.
a) Find the random variable.
b) Find the probabilities assigns to each random variable.
Chapter 2| Discrete Random Variables
c) Find and graph the probability density function and the cumulative distribution
function.
d) Find the mean and variance of distribution
Additional Exercises
b) If there are five such memory boards in a given computer, what is the probability
that at least four of them operate satisfactorily?
c) State any assumptions.
5) 5% of a large lot of electrical components are defective. Six batches of four
components each are drawn from this lot at random.
a) What is the probability that any one batch contains fewer than two defectives?
b) What is the probability that at least five of the six batches contain fewer than
two defectives each?
c) State any assumptions.
6) A company is considering drilling four oil wells. The probability of success for
each well is 0.40, independent of the results for any other well. The cost of each
well is $200,000. Each well that is successful will be worth $600,000.
a) What is the probability that one or more wells will be successful?
b) What is the expected number of successes?
c) What is the expected gain?
d) What will be the gain if only one well is successful?
e) Considering all possible results, what is the probability of a loss rather than a
gain?
f) What is the standard deviation of the number of successes?
7) The number of cars entering a small parking lot is a random variable having a
Poisson distribution with a mean of 1.5 per hour. The lot holds only 12 cars.
a) Find the probability that the lot fills up in the first hour (assuming that all cars
stay in the lot longer than one hour).
b) Find the probability that more than 3 cars arrive between 9 am and 11 am.
8) Customers arrive at a checkout counter at an average rate of 1.5 per minute. What
distribution will apply if reasonable assumptions are made? List those
assumptions. Find the probabilities that
Chapter 2| Discrete Random Variables