# Discrete Random Variables

A discrete random variable maps outcomes to values of a countable set (e.g., the integers), with each value in the range having probability greater than or equal to zero.

## Discrete Probability

{\displaystyle {\begin{aligned}&P(x)\in [0,1]\\&\sum _{x}P(x)=1\\&F(a)=\sum _{x\leq a}P(x)=P(X\leq a)\\&F(a)\in [0,1]\\&F(a)\leq F(b)\ \forall aa)=1-P(X\leq a)=1-F(a)\end{aligned}}}

## Mean and Variance

Expected Value

${\displaystyle E(X)=\sum _{x}xP(x)=\mu _{x}}$

Variance

{\displaystyle {\begin{aligned}Var(X)&=E[(X-\mu _{x})^{2}]\\&=\sum _{x}(x-\mu _{x})^{2}P(x)\\&=E(X^{2})-\mu _{x}^{2}\end{aligned}}}

## Binomial Distribution

${\displaystyle X\backsim B(p)}$, where p is the probability of successes in n independent trials.

{\displaystyle {\begin{aligned}&\mu _{X_{B}}=E(X_{B})=p\\&Var(X_{B})=p(1-p)\\&P(x)=p^{x}(1-p)^{n-x}C_{x}^{n}\end{aligned}}}

## Jointly distributed variables

${\displaystyle P_{X,Y}(x,y)=P(X=x,Y=y)}$

${\displaystyle \sum _{X}\sum _{Y}P_{X,Y}(x,y)=1}$

{\displaystyle {\begin{aligned}P_{X}(x)&=\sum _{Y}P_{X,Y}(x,y)\\P_{Y}(y)&=\sum _{X}P_{X,Y}(x,y)\end{aligned}}}

### Conditional Probabilities

{\displaystyle {\begin{aligned}E(Y|X=x)&=\sum _{y}yP_{Y|X}(y|x)=\mu _{Y|X}\\Var(Y|X&=\sum _{y}(y-\mu _{Y|X})^{2}P_{Y|X}(y|x)\\&=E(Y^{2}|X=x)-\mu _{(}^{2}Y|X)\end{aligned}}}

### Covariance and Correlation

{\displaystyle {\begin{aligned}Cov(X,Y)&=E[(X-\mu _{X})(Y-\mu _{Y})]\\&=\sum _{x}\sum _{y}(x-\mu _{x})(y-\mu _{y})P_{X,Y}(x,y)\\&=E(XY)-\mu _{X}\mu _{Y}\end{aligned}}}

${\displaystyle \rho ={\frac {Cov(X,Y)}{\sigma _{X}\sigma _{Y}}},\ -1\leq \rho \leq a}$

### Other useful results

{\displaystyle {\begin{aligned}Var(X+Y)&=Var(X)+Var(Y)+2Cov(X,Y)\\Var(X-Y)&=Var(X)+Var(Y)-2Cov(X,Y)\\Var(aX+bY)&=a^{2}Var(X)+b^{2}Var(Y)+2abCov(X,Y)\end{aligned}}}