# Thread: Covariance of two random variables

1. ## Covariance of two random variables

Given two non-negative discrete random variables A and B, is the following true?

$E\left[A\vert B=b_{1}\right]\ge E\left[A\vert B=b_{2}\right],\ \forall b_{1}>b_{2}\ge0\implies\text{cov}\left(A,B\right) \ge 0$

Intuitively, it looks correct to me but I haven't been able to prove it. Attempt so far:

$\text{cov}\left(A,B\right)=E\left[\left(A-\bar{A}\right)\left(B-\bar{B}\right)\right]=\sum_{b=0}^{\infty}\Pr\left(B=b\right)E\left[\left(A-\bar{A}\right)\left(B-\bar{B}\right)\vert B=b\right]=\sum_{b=0}^{\infty}\Pr\left(B=b\right)\left(b-\bar{b}\right)\left(E\left[A\vert B=b\right]-\bar{A}\right)=\sum_{b=0}^{\infty}\Pr\left(B=b \right)\left(b-\bar{b}\right)E\left[A\vert B=b\right]$

I got stuck at this point and I'm not sure how to work the condition given into what I have, or maybe my approach is wrong in the first place.