ENG5001_Lab2 2023-03-12 solution
ENG5001_Lab2 2023-03-12 solution
Lab 02
ENG5001/6001 Advanced Engineering Data Analysis
1. Tennis tournament
Consider in a tennis tournament, your next opponent may be one of the three players: A, B or C. Your probabilities of
playing against and winning these players are:
• 50% chance of playing against A, and 0.3 of winning A,
• 25% chance of playing against B, and 0.4 of winning B,
• 25% chance of playing against C, and 0.5 of winning C.
What is the probability of you winning the next match?
Solution
Let 𝑊 be the event of “winning the next match”. Playing against 𝐴, 𝐵 and 𝐶 are mutually exclusive and exhaustive
events. So we can apply the total probability theorem:
ℙ(𝑊 ) = ℙ(𝑊|𝐴) ⋅ ℙ(𝐴) + ℙ(𝑊|𝐵) ⋅ ℙ(𝐵) + ℙ(𝑊|𝐶 ) ⋅ ℙ(𝐶 ) = 0.5 × 0.3 + 0.25 × 0.4 + 0.25 × 0.5 = 0.37.
2. Two dice
Two fair 6-sided dice (that is, the probabilities of resulting in any particular side are equal) are tossed. Let 𝑋 be the
random variable which is the sum of the scores on the two dice.
(a) Determine the probability mass and cumulative distribution functions of random variable 𝑋 (just fill the table below;
fractional answers allowed; no equation/formula required).
𝑋 2 3 4 5 6 7 8 9 10 11 12
ℙ(𝑋 = 𝑥)
𝐹(𝑥)
Solution
Let the pair (𝑥, 𝑦) be the results of each of the two dice, then the sample space is
(1,1), (1,2), (1,3), (1,4), (1,5), (1,6)
(2,1), (2,2), (2,3), (2,4), (2,5), (2,6)
(3,1), (3,2), (3,3), (3,4), (3,5), (3,6)
𝑆 =
(4,1), (4,2), (4,3), (4,4), (4,5), (4,6)
(5,1), (5,2), (5,3), (5,4), (5,5), (5,6)
{(6,1), (6,2), (6,3), (6,4), (6,5), (6,6)}
The possible values of 𝑋 can take are 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 and 12. Since each pair in 𝑆 is equally likely, the
probability distribution and cumulative distribution functions of 𝑋 are
𝑋 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 5 4 3 2 1
ℙ(𝑋 = 𝑥) 36 36 36 36 36 36 36 36 36 36 36
1 3 6 10 15 21 26 30 33 35 36
𝐹(𝑥) 36 36 36 36 36 36 36 36 36 36 36
1
ENG5001/6001 Advanced Engineering Data Analysis Lab 02
(b) What is the probability that the sum of the scores is 5, 6, 7 or 8?
Solution
4 + 5 + 6 + 5 20 5
ℙ(5 ≤ 𝑋 ≤ 8) = ℙ(𝑋 = 5) + ℙ(𝑋 = 6) + ℙ(𝑋 = 7) + ℙ(𝑋 = 8) = = = = 0.556.
36 36 9
1
(c) If ℙ(𝑋 = 𝑥) = 12, what is the value of 𝑥?
Solution
Looking at the second row of the list above in Part (a), we find
1 1
ℙ(𝑋 = 4) = 𝑎𝑛𝑑 ℙ(𝑋 = 10) = .
12 12
So there are two solutions: 𝑥 = 4 or 𝑥 = 10.
Solution
First we observe that 𝑓(𝑥) ≥ 0 for 0 ≤ 𝑥 ≤ 1. Also
1 1 1
∫ 𝑓(𝑥) 𝑑𝑥 = ∫ 4𝑥 3 𝑑𝑥 = 𝑥 4 | = 1.
0 0 0
As probability in the given range is always non-negative and summed up to 1, 𝑓(𝑥) is a valid probability density function.
Solution
1 1
3 4
ℙ(0.5 ≤ 𝑋 ≤ 1) = ∫ 4𝑥 𝑑𝑥 = 𝑥 | = 1 − 0.54 = 0.9375.
0.5 0.5
Solution
For a continuous random variable, the probability is defined as the area under the curve of the PDF. If we use the integral
definition for a single value, we get a probability of 0. Therefore for a continuous random variable it does not make
sense to talk about the probability of a single value occurring, but of a range of values instead.
Solution
First we note that when 0 ≤ 𝑥 ≤ 1,
𝑥 𝑥
4|
𝐹(𝑥) = ∫ 𝑓(𝑡) 𝑑𝑡 = 𝑡 = 𝑥4 .
0 0
2
ENG5001/6001 Advanced Engineering Data Analysis Lab 02
Solution
For 𝑓(𝑥) to be a valid PDF, we need
1 1
2)
𝑥3
∫ 𝜂(1 + 𝑥 𝑑𝑥 = 𝜂(𝑥 + ) | = 6𝜂 = 1,
−2 3 −2
1
which implies that 𝜂 = 6. So the PDF of random variable 𝑋 becomes
1 + 𝑥2
𝑓(𝑥) = { 6 , −2 < 𝑥 < 1.
0, otherwise
For the CDF when −2 < 𝑥 < 1
𝑥 𝑥 𝑥
1 + 𝑡2 1 𝑡3 𝑥 3 + 3𝑥 + 14
𝐹 (𝑥) = ∫ 𝑓(𝑡) 𝑑𝑡 = ∫ 𝑑𝑡 = (𝑡 + ) | = .
−2 −2 6 6 3 −2 18
To also include 𝐹 (𝑥 ≤ −2) = 0 and 𝐹 (𝑥 ≥ 1) = 1, finally we have
0, 𝑥 ≤ −2
3
𝑥 + 3𝑥 + 14
𝐹 (𝑥) = { , −2 < 𝑥 < 1.
18
1, 𝑥≥1