1) Suppose Prob(Tail) = p. What is the probability distribution of N, where N is the event:
The first Head shows up at the N-th toss.
Ans:
The (discrete) probability density is simply
Pr(event) = p^(N-1) (1-p)
What is the expectation value of N?
Ans:
E[N] = Sum_(i=1)^(inf) i*p^(i-1) (1-p)
How to do this sum? Trick:
i*p^(i-1) = (d/dp)p^i
Using this and exchanging the order of summation and differentiation, we get
E[N] = 1/(1-p)
2) Suppose X and Y are two random variables with the same cdf, X, Y > 0 and E[X/Y] = 1. Show that E[X] = E[Y].
Ans:
Cauchy-Schwarz inequality, but how?
See here for more interview questions/brainteasers
We can apply geometry distribution for the first one. So the answer will be directly 1/(1-p)
ReplyDeleteI am intrigued by the 2nd one.
ReplyDeleteBut the variables are independents or not?
I think if they're independent, the equality does not hold:
ReplyDelete1 = E(X/Y) = E(X) E(1/Y)
E(1/Y) > 1/E(Y), by Jensen's, so:
1 > E(X) / E(Y)
For the problem 2):
ReplyDeleteX, Y ~ f (density function), X/Y = Z, Z > 0
E(X) = E (ZY) = E(E(ZY|Y)) = E(Y E(Z|Y)).
where E(Z) = 1 = E(E(Z|Y)) = \int_{0}^{\inf} E(Z|y) f(y)dy.
Let E(Z|y) f(y) = g(y), g is another density function of y because the integral over the domain of y is equal to one, hence
E(X) = E(Y E(Z|Y)) = \int_{0}^{\inf} y E(Z|y) f(y)dy = \int_{0}^{\inf} y g(y)dy = E(Y), hence proved.
For the problem 2):
ReplyDeleteX, Y ~ f (density function), X/Y = Z, Z > 0
E(X) = E (ZY) = E(E(ZY|Y)) = E(Y E(Z|Y)).
where E(Z) = 1 = E(E(Z|Y)) = \int_{0}^{\inf} E(Z|y) f(y)dy.
Let E(Z|y) f(y) = g(y), g is another density function of y because the integral over the domain of y is equal to one, hence
E(X) = E(Y E(Z|Y)) = \int_{0}^{\inf} y E(Z|y) f(y)dy = \int_{0}^{\inf} y g(y)dy = E(Y), hence proved.