Calculate expectation and variance of max for 2 random variables

random variables

i have following problem,

Random variables X and Y have the joint distribution below, and Z=max{X,Y}.

\begin{array}{c|ccc}
X\setminus Y & 1 & 2 & 3\\
\hline
1 & 0.12 & 0.08 & 0.20\\
2 & 0.18 & 0.12 & 0.30
\end{array}

calculate E[Z] and V[Z].

i tried to calculate the expectation through sum of max value for each combination of the 2 variables times probability in the table divided over number of all possible combinations, however i am not getting the correct answer. my question, when both variables are equal, what we should consider the max value and what probability should be used?

Best Answer

$Z=1$ iff $X=Y=1$. $Z=2$ iff $X=1,Y=2$ or $X=2,Y=1$ or $X=2,Y=2$ so $P\{Z=2\}=0.08+0.18+0,12$, $Z=3$ iff $X=3,Y=1$ or $X=3,Y=2$ or $X=1,Y=3$ or $X=2,Y=3$ or $X=Y=3$, so add the probabilities of these. Now you have the distribution of $Z$. Can you take it from here?