Correlation Coefficient of Random Variables Question: 

My work for parts a and b:


Now I'm stuck with part c and don't know where to go or how to get the answer from parts a and b. any help?
 A: First calculate out Cov(X,Y) using $Cov(X,Y)=\sum(X-\mu_X)(Y-\mu_Y)f(X,Y)$ where f(X,Y) is the correspondig pdf.
Then use the formula of correlation coefficient: $cor(X,Y)=\frac{Cov(X,Y)}{\mu_X\mu_Y}$You can take a look at this example: https://onlinecourses.science.psu.edu/stat414/book/export/html/94 
However, I think you made a few mistake in part a) and b).
The pdf for P(0, 0) is not 0 but 1/4
P(2, 1) should be $\frac{p(1 − p)}{2}$
A: Here is a simulation using R statistical ssoftware of a million performances of this experiment,
where $P(Heads) = .3$ for the biased coin. Results should be
accurate to a couple of decimal places. You can use them as a
'reality check' for your work.
 m = 10^6;  x = y = numeric(m)
 for(i in 1:m) {
  x[i] = rbinom(1, 2, .5)
  y[i] = rbinom(1, x[i], .3) }
 table(x,y)/m  # simulated joint distribution
    y
 x          0        1        2
 0   0.250946 0.000000 0.000000
 1   0.349674 0.149577 0.000000
 2   0.121993 0.105225 0.022585

 table(x)/m  # simulated x-marginal
 x
        0        1        2 
 0.250946 0.499251 0.249803 

 table(y)/m  # simulated y-marginal
 y
        0        1        2 
 0.722613 0.254802 0.022585 

 mean(x); mean(y)
 ## 0.998857
 ## 0.299972
 sd(x); sd(y)
 ## 0.7076356
 ## 0.5051327

 cov(x,y)  # simulated covariance
 ## 0.1507380

 cor(x,y)  # simulated correlation
 ## 0.4217039

