Expectation, variance and conditional probability of combined discrete and continuous random variables

181 Views Asked by At

Category: Introductory Probability

I have seen many of the other questions with similar titles (there are quite a few!), but unfortunately I am struggling to apply the concepts and knowledge I have learned to different problems/examples.

Problem Info: A black and white screen has pixels which either take the value $1$ with probability $p$ or a value of $0$ with probability $1-p$, with $p$ being the value of a random variable $P$ which is uniform on $[0,1]$. $X_j$ is the value of pixel $j$, but we observe $Y_j = X_j + noise$ for each pixel. The noise is normal and has mean $= 2$ and unit variance. The $p$ and $noise$ is the same for every pixel, and conditioned on $P$, every $X_j$ is independent. The noise is independent of $P$ and every $X_j$. $A$ is the event that the actual values of $X_1$ and $X_2$, (the first and second pixels) are $= 0$.

I want to find:$ E[Y_j]$, $Var[Y_j]$ and $f_{P|A}(p)$ for $0 \leq p \leq 1$

My attempt:

$$ E[Y_j] = E[X_j + noise]$$ $$ E[Y_j] = E[X_j]+E[noise] \,\,\,\,\,(independent)$$

Now, from the problem info, it seems that $X_j$ is a Bernoulli random variable with a mean of $p$, so: $$E[Y_j]= p + 2$$ Since $p$ is the realized value of $P$ which is uniformly distributed, it has an expected value of $\frac{1}{2}(a+b) = \frac{1}{2}$ So, $E[Y_j] = 2.5$

Similarly, $$Var[Y_j]=Var[X_j] + Var[noise] $$ $$Var[Y_j] = p(1-p) + 1$$ $$Var[Y_j] = 0.25 + 1 = 1.25 $$

The last part is where I am having the most trouble. I know that the probability of the first pixel being $0$ is $(1-p)$, and the same for the second. I am not quite sure if I have to use Bayes rule, or even how to use it in this case. I know the answer will be a function of $p$.

$$f_{P|A}(p)= \frac{f_P(p)*f_{A|P}(p)}{f_{A}(p)}$$ $$f_{P|A}(p)= \frac{1*(1-p)(1-p)}{f_{A}(p)}$$ $$f_A(p) = \int_{0}^{1} f_p(p) *f_{A|P}(p)dp$$ $$f_{P|A}(p)= \frac{(1-p)(1-p)}{\int_{0}^{1} 1 *(1-p)(1-p)dp}$$ $$f_{P|A}(p)= \frac{(1-p)^2}{\frac{1}{3}}$$

Edits:

$$E[X_j] = E[E[X_j|P]] = E[P] = p $$ $$E[Y_j] = 0.5 + 2 = 2.5$$ $$$$ $$Var(X_j) = (E[Var(X_j|P)] + Var(E[X_j|P]))$$ $$Var(Y_j) = Var(X_j) + var(noise)$$ $$Var(Y_j) = (E[Var(X_j|P)] + Var(E[X_j|P])) + 1$$ $$Var(Y_j) = E[P(1-P)] + Var(P) + 1$$ $$Var(Y_j) = E[P]-E[P^2] + Var(P) + 1$$ $$Var(Y_j) = E[P]-(Var(P)+(E[P])^2) + Var(P) + 1$$ $$Var(Y_j) = E[P]-Var(P)-(E[P])^2 + Var(P) + 1$$ $$Var(Y_j) = 0.5-\frac{1}{12}-0.25 +\frac{1}{12} + 1$$ $$Var(Y_j) = 1.25$$

same answers as before, but correct notation I believe.

Still having a hard time trying to get an answer for $f_{P|A}(p) $ though.