Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Assignment Two 1. Two independent random variables have the following probability distributions: X= 5 10 15 P[X] 0.25 0.50 0.25 Y= 0 3 5 P[Y ] 0.20 0.50 0.30 a. Calculate the theoretical mean and variance of X . E[X] = 5 ⋅ 0.25 + 10 ⋅ 0.50 + 15 ⋅ 0.25 = 1.25 + 5.00 + 3.75 = 10 . Var(X) = (5 − 10)2 ⋅ 0.25 + (10 − 10)2 ⋅ 0.50 + (15 − 10)2 ⋅ 0.25 = 25 ⋅ 0.25 + 0 + 25 ⋅ 0.25 = 12.5 b. Calculate the theoretical mean and variance of Y . E[Y ] = 0 ⋅ 0.2 + 3 ⋅ 0.5 + 5 ⋅ 0.3 = 1.5 + 1.5 = 3 Var(Y ) = (0 − 3)2 ⋅ 0.2 + (3 − 3)2 ⋅ 0.5 + (5 − 3)2 ⋅ 0.3 = 9 ⋅ 0.2 + 4 ⋅ 0.3 = 1.8 + 1.2 = 3 c. Let Z = X + Y . Write out the probability distribution of Z , and use it to calculate the mean and variance of Z . There are three possible values for X; for each of these, there are three possible values for Y; in total, there are nine combinations of X and Y. Since the variables are independent, P[X = a & Y = b] = P[X = a] ⋅ P[Y = b] . X= 5 5 5 10 10 10 15 15 15 Y= 0 3 5 0 3 5 0 3 5 Z= 5 8 10 10 13 15 15 18 20 P 0.05 0.125 0.075 0.1 0.25 0.15 0.05 0.125 0.075 You’d probably want to combine probabilities for some of the repeated values of Z: Z= 5 8 10 13 15 18 20 P 0.05 0.125 0.175 0.25 0.20 0.125 0.075 With this table, you can calculate the expected value of Z and the variance in Z, just as in the previous parts of this problem. : d. Let W = XY . Write out the probability distribution of W , and use it to calculate the mean and variance of W . Similar to part c. e. Let T = 2X . Write out the probability distribution of T , and use it to calculate the mean and variance of T . The probability distribution for T is the same as X, except that each value gets doubled. X= 5 10 15 T= 10 20 30 P 0.25 0.50 0.25 E[T ] = 10 ⋅ 0.25 + 20 ⋅ 0.50 + 30 ⋅ 0.25 = 2.5 + 10 + 7.5 = 20 . Var(T ) = (10 − 20)2 ⋅ 0.25 + (20 − 20)2 ⋅ 0.5 + (30 − 20)2 ⋅ 0.25 = 100 ⋅ 0.25 + 0 + 100 ⋅ 0.25 = 50 2. The duration of a pregnancy (measured in weeks) is a random variable t whose distribution can be approximated with the PDF f (t) = 401 e−t 40 . a. Calculate the probability that t is between 40 and 42 . 42 P[40 < t < 42] = ∫ 42 40 f (t)dt = ∫ 40 1 40 e−t 40 dt = −e−t 40 t = 42 t = 40 = e− 40 40 − e− 42 40 = 0.3678 − 0.3499 = 0.0179 b. Find the CDF of t. The CDF tells you the probability of being below a particular value. To find this, we would integrate from the bottom of the range (zero, in this case) up to an arbitrary value b. P[t < b] = ∫ b0 f (t)dt == −e−t 40 t =b t =0 = e0 − e−b 40 = 1 − e−b 40 c. If someone has been pregnant for at least 34 weeks, what is the probability that t is between 40 and 42 ? The rule for conditional probabilities is that P[A | B] = P[A & B] / P[B] . In this problem, A = "40 < t < 42" and B = "t > 34" . Being in both A and B simply means that 40 < t < 42 . P[40 < t < 42 | t > 34] = P[40 < t < 42] / P[t > 34] = ∫ 42 40 0.0179 / 0.4274 = 0.0419 . 1 40 e−t 40 dt / (1 − CDF(34)) = d. If someone has been pregnant for at least 34 weeks, what is the expected duration of her pregnancy? To calculate the expected value conditional on something, you integrate over all values in the range that satisfy that condition (in this case, integrate from 34 to ∞ ), and you replace the usual PDF with the conditional PDF. For this problem, you need to calculate: E[t t > 34] = ∫ t ⋅ f (t) dt 34 P[t > 34] ∞ 3. Suppose that the variances and covariances between three random variables are: X Y Z X 4 0 1 Y 0 3 0 Z 1 0 5 That is, Cov(X, Z ) = 1 , Cov(Z, Z ) = Var(Z ) = 5 , and so forth. following: a. Corr(X, Z ) = Cov(X, Z ) = Var(X) ⋅Var(Z ) Calculate the 1 4⋅5 b. Var(X + 2Y ) = Var(X) + Var(2Y ) + 2Cov(X, 2Y ) = 4 + 2 2 ⋅ 3 + 4 ⋅ 0 = 16 c. Var(2X + 3Z ) = Var(2X) + Var(3Z ) + Cov(2X, 3Z ) = 2 2 ⋅ 4 + 32 ⋅ 5 + 6 ⋅1 d. Cov(X + Y , X + Z ) = Cov(X, X) + Cov(X, Z ) + Cov(Y , X) + Cov(Y , Z ) = 4 + 1 + 0 + 0 4. Suppose that people’s IQ scores are distributed normally with a mean of 100 and variance of 225 . You obtain a random sample of 10 observations: 84,106,102,104, 107, 81,104, 76,112,108 . Find E[IQ] , IQ , Var(IQ) , and Vâr(IQ) . The true mean and variance are given: E[IQ] = 100 and Var(IQ) = 225 . Using your sample, you can calculate the sample mean and variance: IQ = 98.4 and Vâr(IQ) = 166.26 . 5. The variable X is distributed normally with mean 20 and variance 25 . a. Calculate P[X > 30] . You need to calculate a z-score and look up the chance of obtaining this score or greater: z = (30 − 25) 25 = 1 ; P[z > 1] = 0.1586 . b. Suppose that we know that this value of X will be at least 15 . Calculate P[X > 30 X > 15] . For conditional probability, P[A B] = P[A and B] P[B] . In this problem, A= “ X > 30 ” and B= “ X > 15 ”. Values that satisfy both A and B are just X > 30 , so P[X > 30 X > 15] = P[X > 30] P[X > 15] = 0.1586 0.8413 . c. You collect a sample of four independent X values. Calculate P[X > 25] . If X ~ N( µ, σ 2 ) , then the average of N observations is a random variables with the distribution X ~ N( µ, σ 2 N ) . In this case, X would have a mean of 20 and a variance of 25 4 . The z-score is z = (25 − 20) 25 / 4 = 2 ; P[z > 2] = 0.0227 . 6. You know that the random variable X is distributed normally with variance 25 , but you are uncertain of its true mean. You hypothesize that the true mean is 20 . You collect a sample of four independent Xs, and your sample mean is 28 . What would be the chance of observing this sample (or one further from the true mean) if the hypothesis is true? (Do a two-tailed test.) Assuming that the null hypothesis were true, X would be a random variable distributed with a mean of 20 and a variance of 25 4 . Your observed X is 28 , which is z = (28 − 20) 25 / 4 = 16 5 = 3.2 standard deviations above the mean. The probability of drawing a random variable 3.2 or more standard deviations above the mean is 0.00068 ; the probability of getting a sample 3.2 or more standard deviations from the mean in either direction is 2 ⋅ 0.00068 . 7. You know that the random variable X is distributed normally, but you are uncertain of its true mean or variance. You hypothesize that the true mean is 20 . You collect a sample: 20, 32, 36, 26 . What is the probability of observing this sample (or one further from the mean) if the hypothesis is true? This is like the last problem, except that you have to calculate the variance in X yourself. Since you use calculated variance instead of true variance, you need to check the tdistribution instead of the z-distribution. 8. Take the following matrices: ⎡2 8 1 ⎤ E = ⎢⎢ 7 2 8 ⎥⎥ ⎢⎣ 1 8 2 ⎥⎦ ⎡ 3 1 2⎤ P = ⎢⎢ 1 5 6 ⎥⎥ ⎢⎣ 4 9 5 ⎥⎦ a. Find E+P and P+E. ⎡ 2 8 1 ⎤ ⎡ 3 1 2 ⎤ ⎡ 5 9 3 ⎤ ⎢ ⎥ ⎢ ⎥ E + P = ⎢ 7 2 8 ⎥ + ⎢ 1 5 6 ⎥ = ⎢ 8 7 14 ⎥ = P + E ⎢ ⎥ ⎢⎣ 1 8 2 ⎥⎦ ⎢⎣ 4 9 5 ⎥⎦ ⎢⎣ 5 17 7 ⎥⎦ b. Find EP and PE. ⎡ 2 8 1 ⎤ ⎡ 3 1 2 ⎤ ⎡ 18 51 57 ⎤ EP = ⎢ 7 2 8 ⎥ ⎢ 1 5 6 ⎥ = ⎢ 55 89 66 ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢⎣ 1 8 2 ⎥⎦ ⎢⎣ 4 9 5 ⎥⎦ ⎢⎣ 19 59 60 ⎥⎦ ⎡ 3 1 2 ⎤ ⎡ 2 8 1 ⎤ ⎡ 15 44 15 ⎤ PE = ⎢ 1 5 6 ⎥ ⎢ 7 2 8 ⎥ = ⎢ 43 66 53 ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢⎣ 4 9 5 ⎥⎦ ⎢⎣ 1 8 2 ⎥⎦ ⎢⎣ 76 90 86 ⎥⎦ c. Write the transposes of E and P. ⎡ 2 7 1 ⎤ E′ = ⎢ 8 2 8 ⎥ ⎢ ⎥ ⎢⎣ 1 8 2 ⎥⎦ ⎡ 3 1 4 ⎤ ⎢ ⎥ P′ = ⎢ 1 5 9 ⎥ ⎢⎣ 2 6 5 ⎦⎥ 9. Take the following matrices: ⎡1 1 ⎤ A = ⎢⎢ 1 0 ⎥⎥ ⎢⎣ 0 7 ⎥⎦ ⎡1 0 ⎤ B = ⎢⎢ 7 6 ⎥⎥ ⎢⎣ 1 9 ⎥⎦ ⎡ 1 1 ⎤ ⎡ 1 0 ⎤ ⎡ 2 1 ⎤ ⎢ ⎥ ⎢ ⎥ a. Find A + B : ⎢ 1 0 ⎥ + ⎢ 7 6 ⎥ = ⎢ 8 6 ⎥ ⎢ ⎥ ⎢⎣ 0 7 ⎥⎦ ⎢⎣ 1 9 ⎥⎦ ⎢⎣ 1 16 ⎥⎦ ⎡ 1 ⎡ 1 1 0 ⎤⎢ b. Calculate A′B = ⎢ ⎥⎢ 7 ⎣ 1 0 7 ⎦⎢ 1 ⎣ ⎡ 1 1 ⎤ ⎢ ⎥⎡ 1 c. Calculate AB′ . AB′ = ⎢ 1 0 ⎥ ⎢ ⎣ 0 ⎣⎢ 0 7 ⎦⎥ 0 6 9 ⎤ ⎥ ⎡ 8 6 ⎤ ⎥ = ⎢ 8 63 ⎥ ⎦ ⎥⎦ ⎣ ⎡ 1 13 10 ⎤ 7 1 ⎤ ⎢ ⎥ ⎥=⎢ 1 7 1 ⎥ 6 9 ⎦ ⎢⎣ 0 42 63 ⎥⎦ 10. Repeat the previous exercise, using the matrices: ⎡ −1 2 ⎤ C = ⎢⎢ 4 −3⎥⎥ ⎢⎣ 6 7 ⎥⎦ ⎡5 0 ⎤ B = ⎢⎢ 0 5 ⎥⎥ ⎢⎣ 4 −7 ⎥⎦ ⎡ −1 2 ⎤ ⎡ 5 0 ⎤ ⎡ 4 2 ⎤ ⎢ ⎥ ⎢ ⎥ a. Find C + B = ⎢ 4 −3 ⎥ + ⎢ 0 5 ⎥ = ⎢ 4 2 ⎥ ⎢ ⎥ ⎢⎣ 6 7 ⎥⎦ ⎣⎢ 4 −7 ⎦⎥ ⎢⎣ 10 0 ⎥⎦ ⎡ 5 0 ⎤ ⎡ −1 4 6 ⎤ ⎢ ⎥ ⎡ 19 −22 ⎤ b. Calculate C′B = ⎢ ⎥⎢ 0 5 ⎥ = ⎢ ⎥ ⎣ 2 −3 7 ⎦ ⎢ 4 −7 ⎥ ⎣ 42 −64 ⎦ ⎣ ⎦ ⎡ −1 2 ⎤ ⎡ −5 10 −18 ⎤ ⎢ ⎥⎡ 5 0 4 ⎤ ⎢ ⎥ c. Calculate CB′ = ⎢ 4 −3 ⎥ ⎢ ⎥ = ⎢ 20 −15 −5 ⎥ 0 5 −7 ⎦ ⎢ 30 35 −25 ⎥ ⎢⎣ 6 7 ⎥⎦ ⎣ ⎣ ⎦ ⎡ 1 ⎡ 2 −5 ⎤ 1 ⎤ −1 11. Calculate the inverse of D = ⎢ : D = ⎢ ⎥ ⎥ ⎣ −1 5 ⎦ ⎣ 1/ 5 2 / 5 ⎦