CH2010 Engineering Statistics AY2023 - 2024 Tutorial 3. Random variables 1. A student rolls a fair cubic die twice. Let X1 be the result of the first roll and X2 be the result of the second roll. Plot the graph of f(x) and F(x) for: i. X = X1 + X2, ii. X = X1 – X2, iii. X = X1 × X2, iv. X = X1 – 2X2. Sample space {x| 2 ≤ x ≤ 12}. 1 0,18 0,9 0,16 0,8 0,14 0,7 0,12 0,6 0,1 0,5 0,08 0,4 0,06 0,3 0,04 0,2 0,02 0,1 0 0 2 3 4 5 6 7 8 X1 + X2 ii. Sample space {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}. -1- 9 10 11 12 Probability mass function Cumulative probability distribution i. AY2023 - 2024 1 0,18 0,9 0,16 0,8 0,14 0,7 0,12 0,6 0,1 0,5 0,08 0,4 0,06 0,3 Probability mass function Cumulative probability distribution CH2010 Engineering Statistics 0,04 0,2 0,02 0,1 0 0 -5 -4 -3 -2 -1 0 1 2 3 4 5 X1 - X2 iii. Sample space {1, 2, 3, 4, 5, 6, 8, 9,10, 12, 15, 16, 18, 20, 24, 25, 30, 36}. 1 0,12 0,1 0,8 0,7 0,08 0,6 0,5 0,06 0,4 0,04 0,3 0,2 0,02 0,1 0 0 0 5 10 15 20 25 30 X1X2 iv. Sample space {-11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4}. -2- 35 Probability mass function Cumulative probability distribution 0,9 AY2023 - 2024 1 0,09 0,9 0,08 0,8 0,07 0,7 0,06 0,6 0,05 0,5 0,04 0,4 0,03 0,3 Probability mass function Cumulative probability distribution CH2010 Engineering Statistics 0,02 0,2 0,01 0,1 0 0 -11 -9 -7 -5 -3 -1 1 3 5 X1 - 2X2 Let X1 be the result of the first throw and X2 be the results of the second throw. What are the sample space of X1 – X2, X1 × X2 and X1 – 2X2. X1 – X2: {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5} X1 × X2: {1, 2, 3, 4, 5, 6, 8, 9,10, 12, 15, 16, 18, 20, 24, 25, 30, 36} X1 – 2X2: {-11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4} (Easy) 2. Three production units A, B, and C produce 60%, 30% and 10% of a certain product, with defective rates of 2%, 3% and 4%, respectively. If a product selected at random is found defective, what is the probability that the defective product comes from production unit C? (Medium) Let A be the event the sample comes from production unit A, B be the event the sample comes from production unit B, C be the event the sample comes from production unit C and D be the event the sample is defective. 𝑝(𝐶|𝐷) = 𝑝(𝐶 ∩ 𝐷) 𝑝(𝐷) The total defect probability: 𝑝(𝐷) = 𝑝(𝐴 ∩ 𝐷) + 𝑝(𝐵 ∩ 𝐷) + 𝑝(𝐶 ∩ 𝐷) According to product rule: 𝑝(𝐷) = 𝑝(𝐴)(𝐷|𝐴) + 𝑝(𝐵)(𝐷|𝐵) + 𝑝(𝐶)(𝐷|𝐶) ∴ 𝑝(𝐶|𝐷) = 𝑝(𝐶 ∩ 𝐷) 𝑝(𝐴)(𝐷|𝐴) + 𝑝(𝐵)(𝐷|𝐵) + 𝑝(𝐶)(𝐷|𝐶) -3- CH2010 Engineering Statistics AY2023 - 2024 𝑝(𝐶|𝐷) = 𝑝(𝐶)(𝐷|𝐶) 𝑝(𝐴)(𝐷|𝐴) + 𝑝(𝐵)(𝐷|𝐵) + 𝑝(𝐶)(𝐷|𝐶) 3. You are participating in a game in which there are three doors. Behind one of them there is a prize (say a Porsche); behind the other two there is nothing. Your goal is to win the prize. You pick one door at random, then the game host opens a different door to show you there is nothing behind. Then, you are given an opportunity to change your original choice. Will you make the change? Why? (Medium) Without revealing any door, the probability of winning a prize is 1/3 and the probability of not winning a prize is 2/3. In other words, in the first pick, there is a 1/3 probability that you pick a car and a 2/3 probability that you pick is nothing. This is also the probability of winning a Porsche if you do not make the change. After an empty door is revealed. Making a change can either make you switch from a car to nothing or switch from nothing to a car, depending on what your first pick was (of course you don’t know it). Since your first pick is more likely to be nothing, switching is more likely to win you a car. This can also be visualised by the table below. Your pick – Door 1 Door 2 Door 3 Result if staying with door one Result if switching door Nothing Nothing Porsche Nothing Porsche Nothing Porsche Nothing Nothing Porsche Porsche Nothing Nothing Porsche Nothing This is a very famous problem called The Monty Hall problem. It is so famous because the results is extremely counter-intuitive that all the mathematicians are fully convinced after a computer simulation in 1999. 4. Suppose that the joint density of X and Y is given by: -4- CH2010 Engineering Statistics AY2023 - 2024 𝑒 −𝑥/𝑦 𝑓(𝑥, 𝑦) = { 𝑦𝑒 𝑦 0 : 0 < 𝑥 < ∞, 0 < 𝑦 < ∞ : otherwise Find P(X > 1|Y = y). (Medium) The question is about conditional probability. First, we need to formulate f(x|y): ∞ 𝑃(𝑋 > 1|𝑦) = ∫ 𝑓(𝑥|𝑦)𝑑𝑥 1 ∞ =∫ 1 𝑓(𝑥, 𝑦) 𝑑𝑥 ℎ(𝑦) ∞ ∫ 𝑓(𝑥, 𝑦)𝑑𝑥 = 1 ℎ(𝑦) ∞ = ∫1 𝑓(𝑥, 𝑦)𝑑𝑥 ∞ ∫0 𝑓(𝑥, 𝑦)𝑑𝑥 ∞ 𝑒 −𝑥/𝑦 ∫1 𝑦𝑒 𝑦 𝑑𝑥 = ∞ 𝑒 −𝑥/𝑦 ∫0 𝑦𝑒 𝑦 𝑑𝑥 ∞ = ∫1 𝑒 −𝑥/𝑦 𝑑𝑥 ∞ ∫0 𝑒 −𝑥/𝑦 𝑑𝑥 ∞ = −𝑦[𝑒 −𝑥/𝑦 ]1 −𝑦[𝑒 −𝑥/𝑦 ]1∞ 0 − 𝑒 −1/𝑦 = 0−1 = 𝑒 −1/𝑦 5. The joint density of X and Y is given by: Find the density of the random variable X/Y. -5- CH2010 Engineering Statistics AY2023 - 2024 (Difficult) In this case, directly computing f(X/Y) is difficult. Computing F(X/Y) is easier, as it is a probability statement, which can be transformed: F(x/y = a) = P(X/Y ≤ a) = P(X ≤ aY) 𝑃(𝑋 < 𝑎𝑌) = ∬ 𝑒 −(𝑥+𝑦) 𝑑𝑥𝑑𝑦 𝑋<𝑎𝑌 ∞ 𝑎𝑦 ∞ = ∫ ∫ 𝑒 −(𝑥+𝑦) 𝑑𝑥𝑑𝑦 = ∫ (1 − 𝑒 −𝑎𝑦 )𝑒 −𝑦 𝑑𝑦 0 0 0 -6-