Starting from:

$20

CSE544-Probability and Statistics for Data Science Assignment2 Solved

. Introduction to Covariance 
The covariance of two RVs X and Y is defined as: Cov(X,Y) = E[(X ‐ E[X]) (Y ‐ E[Y])] = E[XY] ‐ E[X] E[Y]. 
Covariance of independent RVs is always zero. 
(a) In an experiment, an unbiased/fair coin is flipped 3 times. Let X be the number of heads in the first two flips and Y be the number of heads in the last two flips. Calculate Cov(X,Y). (2 points) (b) Let X be a fair 5‐sided dice with face values {‐5, ‐2, 0, 2, 5}. Let Y = X2. Calculate Cov(X,Y). (
(c) Does a zero covariance imply that the RVs are independent? Justify your answer. 

Inequalities 
Let X be a non‐negative RV with mean 𝜇 and variance 𝜎 , and let t 0 be some real number. 
(a) Prove that 𝐸 𝑋 𝑥𝑓 𝑥 𝑑𝑥. (3 points) (b) Using part (a), prove that Pr 𝑋 𝑡(
(c) Using part (b), prove that Pr |𝑋 𝜇| 𝑡 )


Functions of RVs 
(a) Let 𝑋 , 𝑋 , … , 𝑋 be 𝑘 independent exponential random variables with pdfs given by 
𝑓 𝑥 𝜆𝑒 , 𝑥 0, ∀ 𝑖 ∈ 1, 2, … , 𝑘 . Let 𝑍 min 𝑋 , 𝑋 , … , 𝑋 . 
i. Find the pdf of Z. 
ii. Find E[Z]. (1 point) 
iii. Find Var(Z). 
(b) Let 𝑋 and 𝑌 be two random variables with joint density function: (2 points) 
2, 0 𝑥 𝑦 1
𝑓 𝑥, 𝑦 . Find the pdf of 𝑍 𝑋𝑌. 
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 

Daenerys returns to King’s Landing, almost. 
In an alternate universe of Game of Thrones (or A Song of Ice and Fire, for fans of the books), Daenerys Targaryen is finally ready to leave Meereen and return to King’s Landing. However, she does not know the way. From Meereen, if she goes East, she will wander around for 20 days in the Shadow Lands and return back to Meereen. If she goes West from Meereen, she will immediately arrive at the city of Mantarys. From Mantarys , she can go West by road or South via ship. If she goes South, her ship will get lost in the Smoking Sea and will be swept back to Meereen after 10 days. However, if she goes West from Mantarys, she will eventually reach King’s Landing in 5 days. Let X denote the time spent by Daenerys before she reaches King’s Landing. Assume that she is equally likely to take either of two paths whenever presented with a choice and has no memory of prior choices. 
(a) What is E[X]? (3 points) 
(b) What is Var[X]? 
(
Dependence on past 2 states 
Consider the Clear‐Snowy problem from class. However, this time, assume that the weather tomorrow depends on the weather today AND the weather yesterday. While this does not seem to follow the Markovian property, you can modify the state space to work around this issue. Use the following notation and transition probability values: 
Pr[ Weather tomorrow is Xi+1, given that weather today is Xi and weather yesterday was Xi‐1 ] 
= Pr[ Xi+1 | Xi Xi‐1 ] (note that each X is either c or s). 
Pr[ c | c c ] = 0.9; Pr[ c | c s ] = 0.8; Pr[ c | s c ] = 0.5; Pr[ c | s s ] = 0.1. 
(a) Find the eventual (steady‐state) Pr[ c c ], Pr[ c s ], Pr[ s c ], and Pr[ s s ]. Show your Markov chain and the transition probabilities. (7 points) 
(b) In steady‐state, what is the probability that it will be snowy 3 days from today. (3 points) 
(c) Solve the problem of finding the steady state probability via simulation (in python). You need to find the steady state by raising the transition matrix to a high power (𝝅 𝑃 ; 𝑘 ≫ 1) and then take any row of the exponentiated matrix (𝝅 𝑖, ∶ ) as the steady state. For taking power of matrix in python, you can use np.linalg.matrix_power(matrix, power). After you obtain the steady state distribution, solve part (b) numerically. (5 points) 

Submit your code along with your solution as part of the zip/tar file on BB. Name your python file a2_5.py. The script should have a function a  steady_state_power (transition matrix), where steady_state_power () should have the implementation of Power method and the return value a is the final steady state. Also, in the hardcopy submission, you should 
mention the final steady state you obtained in the following format: 
Steady_State: Power iteration [xx, xx, xx, xx] 


Multivariate Normal
A random vector X = (X1, …, Xk) is said to have a Multivariate Normal distribution if every linear combination of Xj has a Normal distribution. That is, we require t1X1 + t2X2 + … + tkXK to have a Normal distribution for any real values of t1, …, tk. As a special case, we consider t1X1 + t2X2 + … + tkXK to be a degenerate normal distribution with variance 0 if t1X1 + t2X2 + … + tkXK is a constant (such as when all tj’s are 0). 
(a) If X = (X1, …, Xk) is a Multivariate Normal, show that the distribution of any Xj is Normal. (1 point) (b) It is possible to have normally distributed random variables X1, …, Xk such that (X1, …, Xk) is not 
Multivariate Normal: Let X = Normal(0, 1) and S = 1 with probability ½ and ‐1 with probability ½. 
Then Y = SX is normal due to the symmetry of the Standard Normal. In this case show that (X, Y) is 
not a Multivariate Normal. (2 points) 
(c) Let Z, W be i.i.d Normal(0, 1) random variables. Show that (Z, W) and (Z + 2W, 3Z + 5W) are Multivariate Normals. (2 points) 
(d) If X = (X1, …, Xn) and Y = (Y1, …, Ym) are Multivariate Normal vectors with X independent of Y, then show that the concatenated vector W = (X1, …, Xn, Y1, …, Ym) is also a Multivariate Normal. (2 points) 
(e) Fact 1 (Uncorrelated implies independence): If X is a Multivariate Normal that can be written as X = (X1, X2), where X1 and X2 are subvectors, and every component of X1 is uncorrelated with every component of X2, then X1 and X2 are independent. 
Fact 2 (Property of Covariance): For any random variables X, Y, W, and V, we have: 
Cov(aX + bY, cW + dV) = ac Cov(X, W) + ad Cov(X, V) + bc Cov(Y, W) + bd Cov(Y, V). 

Let X, Y be i.i.d. standard Normals. Use Fact 1 and Fact 2 to show that (X+Y, X‐Y) is a Multivariate Normal. 

Pokémon Go fanatic
Let us assume there are only n distinct types of Pokémons to capture in the entire Pokémon world, though there is an infinite supply of each type. Every day, you capture exactly one Pokémon. The Pokémon that you capture could be any one of the n types of Pokémons with equal probability. Your goal is to capture at least one Pokémon of all n distinct types. Let X denote the number of days needed to complete your goal. 
(a) What is E[X]? ) 
(b) What is Var[X]? 
We do not need closed‐forms here for parts (a) and (b). 

More products