# How to calculate dependent random variables without a contingency table

I have 2 random variables X and Y and I know the following about them:

E(X) = 50 and Var(X) = 16

Furthermore Y is defined as:

Y = 0,5 X + 20

I am looking for the correlation between X and Y.

Corr(X,Y) = Cov(X,Y) / [Var(X)^(1/2) * Var(Y)^(1/2)]

I already figured out that E(Y) = E(0,5X + 20) = 20 + 25 = 45

and I also know that the covariance is Cov(X,Y) = E(XY) - E(X)E(Y)

Now, here is the question: How can I get E(XY)? I know that you can calculate it when you have a contingency table. However, the excercise does not give any information about acutal values of X and Y. Moreover, I know that if the variables are independent you can calculate E(XY) by multiplying X and Y's means. But I think Y must depend upon X because it actually contains it.

Solution:

$$\mathsf{Corr(X,aX+b)}=\frac{\mathsf{Cov(X,aX+b)}}{\sqrt{\mathsf{Var}X}\sqrt{\mathsf{Var}(aX+b)}}=\frac{a\mathsf{Cov}(X,X)}{\sqrt{\mathsf{Var}X}\sqrt{a^{2}\mathsf{Var}X}}=\frac{a}{|a|}\in\{-1,1\}$$

to make the solution easier to understand I will add the following rules that lead to this result:

Var(aX + b) = a^2 Var(X)

and

Cov(a1X + b1, a2Y + b^2) = a1 a2 Cov(X,Y)

finally,

Cov(X,X) = Var(X)

• In this case you can compute $E[XY]$ if you know $E[X]$ and $E[X^2]$. One is given, the other can be computed. – Ian Apr 14 '18 at 18:03
• Hint: $XY = \frac{X^2}2 + 20X$ – Tim Apr 14 '18 at 18:03

If $\mathsf{Var}(X)>0$ and $a\neq0$ then:
$$\mathsf{Corr(X,aX+b)}=\frac{\mathsf{Cov(X,aX+b)}}{\sqrt{\mathsf{Var}X}\sqrt{\mathsf{Var}(aX+b)}}=\frac{a\mathsf{Cov}(X,X)}{\sqrt{\mathsf{Var}X}\sqrt{a^{2}\mathsf{Var}X}}=\frac{a}{|a|}\in\{-1,1\}$$
In words: if $X$ is not degenerated with $\mathsf EX^2<\infty$ and $a\neq0$ then the correlation between $X$ and $Y=aX+b$ will be $1$ if $a>0$ and will be $-1$ if $a<0$.