probability and expectation of random variable coin If the probability that head is 1/2 and the probability that the back is 1/2, coin is repeatedly throws
 twice. 
w1=(H,H)
w2=(T,H),
w3 = (H,T),
w4= (T,T),
The sample space is Ω = {w1,w2,w3,w4}
The random variable X: Ω →
 R and the random variable Y: Ω → R for all w∈Ω, the probability P is P ({w)) = ¼ and is defined
X (w) = 0 for w∈{w1,w3}
X(w)=1,  for w ∈ {w2, w4}
Y (w) =0, for w∈{w1,w2}
Y(w)=1, for w∈{w3,w4}
Further, the random variable
 Z: Ω → R is defined by Z (ω) = max {X (w), Y (w)} with respect to ωEΩ.  


*

*Show P (X = i, Z = k) for
i, k = 0,1,2

*Show P (Z = k) for k =
0,1.


*Find E [X] and E [Z].

*Find E [XZ].  


*Find E[X | Z = 1].  

*Find the variance V of
V[X] and the variance V[Z]

*Find the correlation coefficient
p (X, Z) of X and Z
1.P(X=0,Z=0)=1/4　
P(X=0,Z=1) =1/3 
P(X=1,z=1) =2/3 
2.P(Z=0)=1/4  
P(Z=1) = 12/16 
3.E[X]=0 + 1.P(X=1)=P{w2,w4}=1.2/4=1/2 
 E[Z]= E[Z=0]+E[Z=1]=1.P(Z=0) = 12/36 
4. im not sure
5.$E[X|Z=1]= 1.p(1,1)/p_z(1)=1 + 0= \frac{2}{3}$ 
6.V[X]=E[X^2]-(E[x])2 
E[X^2]=0 + 1.P(X=1)=P{w2,w4}=1.2/4=1/2 
1\2-1\4=3\4
as for variance im not quite sure whether E[X} is right or not, am i right so far ? how can i findE[XZ] too?
 A: Comment: @JMoravitz has given you excellent guidance.
Here is a simulation in R statistical software that gives
some answers (accurate to 2 or 3 places), along with some formulas you may have seen in your course (or may see soon).
set.seed(611)
x = rbinom(10^6, 1, .5);  y = rbinom(10^6, 1, .5)
z = pmax(x,y)
mean(x); mean(z); mean(x*z)
[1] 0.500266   # aprx E(X) = 1/2
[1] 0.750259   # aprx E(Z) = 3/4
[1] 0.500266   # aprx E(XZ) = 1/2

mean(x[z==1])
[1] 0.6667911  # aprx E(X|Z=1) = 2/3

mean(z^2)
[1] 0.750259   # note E(Z) = E(Z^2): WHY?
mean(z^2) - mean(z)^2
[1] 0.1873704
var(x); var(z)
[1] 0.2500002
[1] 0.1873706

mean(x*z) - mean(x)*mean(z)
[1] 0.1249369
cov(x,z);  cov(x,z)/(sd(x)*sd(z))
[1] 0.1249371
[1] 0.5772585
cor(x,z)
[1] 0.5772585

Because $$Cov(X,Z) = E[(X-E(X))(Z-E(Z)) \\= E(XZ) - E(X)E(Z),$$ the simulation approximates $Cov(X,Z)$ in two different ways (using the R function cov and using the formula). 
Also, by definition,
$$\rho_{{}_{X,Z}} = Cor(X,Z) = \frac{Cov(X,Z)}{SD(X)SD(Z)},$$
which is approximated in two ways.
