# I'm trying to find the Covariance of X and Y I

I'm trying to find the Covariance of X and Y
I see that the $$\displaystyle{C}{o}{v}{\left({X},{Y}\right)}={E}{\left[{X}{Y}\right]}-{E}{\left[{X}\right]}{E}{\left[{Y}\right]}$$
I know how to find the expection of single variables. I'm having troubles evaluation E[XY]. Can it be $$\displaystyle{X}\cdot{E}{\left[{Y}\right]}$$?
$\begin{array}{|c|c|}\hline&\text{Smoker}&\text{Non-Smoker}&\text{Total}\\\hline\text{Heart Attack}&0.03&0.03&0.06\\\hline\text{No Heart Attack}&0.44&0.50&0.94\\\hline\text{Totals}&0.47&0.53\\\hline\end{array}$

• Live experts 24/7
• Questions are typically answered in as fast as 30 minutes
• Personalized clear answers

### Plainmath recommends

• Get a detailed answer even on the hardest topics.
• Ask an expert for a step-by-step guidance to learn to do it yourself.

Mespirst
Nope, $$\displaystyle{X}\cdot{E}{\left({Y}\right)}$$ is not avalid option. That is a random variable while E(XY) is a constant.
What we can say is that: $$\displaystyle{E}{\left({X}{Y}\right)}={E}{\left({X}{E}{\left({Y}{\mid}{X}\right)}\right)}$$
But we really do need to know what the joint distribution is to say more (or at least a marginal and conditional distribution).
$$\displaystyle{E}{\left({X}{Y}\right)}=\int\int_{{{\mathbb{{{R}}}}^{{2}}}}{x}{y}{{f}_{{{X},{Y}}}{\left({x},{y}\right)}}{\left.{d}{x}\right.}{\left.{d}{y}\right.}=\sum_{{x}}\sum_{{y}}{x}{y}{P}{\left({X}={x},{Y}={y}\right)}$$
$$\displaystyle{E}{\left({\left({X}{E}{\left({Y}{\mid}{X}\right)}\right)}=\int_{{{\mathbb{{{R}}}}}}{x}{{f}_{{X}}{\left({x}\right)}}\int_{{{\mathbb{{{R}}}}}}{y}{{f}_{{{Y}{\mid}{X}={x}}}{\left({y}\right)}}{\left.{d}{y}\right.}{\left.{d}{x}\right.}=\sum_{{y}}{P}{\left({X}={x}\right)}\sum_{{y}}{y}{P}{\left({Y}={y}{\mid}{X}={x}\right)}\right.}$$
And so forth.