# Math Help - cov

1. ## cov

given that f and g are random variables where
values of f and g are( seen in the table below)

f: 8 5 3 5 7
g:9 7 3 8 8

find the sample covariance and variance of f and g.

may i know what formula i have to use to find that?

i thought that the cov of two constants are 0?

2. Originally Posted by alexandrabel90
given that f and g are random variables where
values of f and g are( seen in the table below)

f: 8 5 3 5 7
g:9 7 3 8 8

find the sample covariance and variance of f and g.

may i know what formula i have to use to find that?
Sample mean and sample covariance - Wikipedia, the free encyclopedia

i thought that the cov of two constants are 0?
That's right, but the two functions are not constant, obviously.
First you have to determine the means $\overline{f},\overline{g}$ of f and g, respectively. Then you get your sample covariance like this

$\mathrm{cov}(f,g)=\frac{1}{5-1}\sum_{i=1}^5(f_i-\overline{f})\cdot (g_i-\overline{g})$
since your sample size is 5. The sample variance of f and of g are just $\mathrm{var}(f)=\mathrm{cov}(f,f)$ and $\mathrm{var}(g)=\mathrm{cov}(g,g)$, respectively.