# Random Variable Reference

### Discrete Random Variables

Bernoulli Random Variable

Notation: $X \sim \Ber(p)$ A boolean variable that is 1 with probability $p$ $p$, the probability that $X=1$. $x$ is either 0 or 1 $\p(X=x) = \begin{cases} p && \text{if }x = 1\\ 1-p && \text{if }x = 0 \end{cases}$ $\p(X=x) = p^x(1-p)^{1-x}$ $\E[X] = p$ $\var(X) = p (1-p)$
Parameter $p$:

Binomial Random Variable

Notation: $X \sim \Bin(n, p)$ Number of "successes" in $n$ identical, independent experiments each with probability of success $p$. $n \in \{0, 1, \dots\}$, the number of experiments.$p \in [0, 1]$, the probability that a single experiment gives a "success". $x \in \{0, 1, \dots, n\}$ $$\p(X=x) = {n \choose x}p^x(1-p)^{n-x}$$ $\E[X] = n \cdot p$ $\var(X) = n \cdot p \cdot (1-p)$
Parameter $n$:
Parameter $p$:

Poisson Random Variable

Notation: $X \sim \Poi(\lambda)$ Number of events in a fixed time frame if (a) the events occur with a constant mean rate and (b) they occur independently of time since last event. $\lambda \in \{0, 1, \dots\}$, the constant average rate. $x \in \{0, 1, \dots\}$ $$\p(X=x) = \frac{\lambda^xe^{-\lambda}}{x!}$$ $\E[X] = \lambda$ $\var(X) = \lambda$
Parameter $\lambda$:

Geometric Random Variable

Notation: $X \sim \Geo(p)$ Number of experiments until a success. Assumes independent experiments each with probability of success $p$. $p \in [0, 1]$, the probability that a single experiment gives a "success". $x \in \{1, \dots, \infty\}$ $$\p(X=x) = (1-p)^{x-1} p$$ $\E[X] = \frac{1}{p}$ $\var(X) = \frac{1-p}{p^2}$
Parameter $p$:

Negative Binomial Random Variable

Notation: $X \sim \NegBin(r, p)$ Number of experiments until $r$ successes. Assumes each experiment is independent with probability of success $p$. $r > 0$, the number of success we are waiting for.$p \in [0, 1]$, the probability that a single experiment gives a "success". $x \in \{r, \dots, \infty\}$ $$\p(X=x) = {x - 1 \choose r - 1}p^r(1-p)^{x-r}$$ $\E[X] = \frac{r}{p}$ $\var(X) = \frac{r \cdot (1-p)}{p^2}$
Parameter $r$:
Parameter $p$:

### Continuous Random Variables

Uniform Random Variable

Notation: $X \sim \Uni(\alpha, \beta)$ A continuous random variable that takes on values, with equal likelihood, between $\alpha$ and $\beta$ $\alpha \in \R$, the minimum value of the variable.$\beta \in \R$, $\beta > \alpha$, the maximum value of the variable. $x \in [\alpha, \beta]$ $$f(x) = \begin{cases} \frac{1}{\beta - \alpha} && \text{for }x \in [\alpha, \beta]\\ 0 && \text{else} \end{cases}$$ $$F(x) = \begin{cases} \frac{x - \alpha}{\beta - \alpha} && \text{for }x \in [\alpha, \beta]\\ 0 && \text{for } x < \alpha \\ 1 && \text{for } x > \beta \end{cases}$$ $\E[X] = \frac{1}{2}(\alpha + \beta)$ $\var(X) = \frac{1}{12}(\beta - \alpha)^2$
Parameter $\alpha$:
Parameter $\beta$:

Exponential Random Variable

Notation: $X \sim \Exp(\lambda)$ Time until next events if (a) the events occur with a constant mean rate and (b) they occur independently of time since last event. $\lambda \in \{0, 1, \dots\}$, the constant average rate. $x \in \mathbb{R}^+$ $$f(x) = \lambda e^{-\lambda x}$$ $$F(x) = 1 - e^{-\lambda x}$$ $\E[X] = 1/\lambda$ $\var(X) = 1/\lambda^2$
Parameter $\lambda$:

Normal (aka Gaussian) Random Variable

Notation: $X \sim \N(\mu, \sigma^2)$ A common, naturally occurring distribution. $\mu \in \mathbb{R}$, the mean.$\sigma^2 \in \mathbb{R}$, the variance. $x \in \mathbb{R}$ $$f(x) = \frac{1}{\sigma \sqrt{2 \pi}} e^{-\frac{1}{2}\Big(\frac{x-\mu}{\sigma}\Big)^2}$$ \begin{align} F(x) &= \phi(\frac{x-\mu}{\sigma}) && \text{Where \phi is the CDF of the standard normal} \end{align} $\E[X] = \mu$ $\var(X) = \sigma^2$
Parameter $\mu$:
Parameter $\sigma$:

Beta Random Variable

Notation: $X \sim \Beta(a, b)$ A belief distribution over the value of a probability $p$ from a Binomial distribution after observing $a-1$ successes and $b- 1$ fails. $a > 0$, the number successes + 1 $b > 0$, the number of fails + 1 $x \in [0, 1]$ $$f(x) = B \cdot x^{a-1} \cdot (1-x)^{b-1}$$ No closed form $\E[X] = \frac{a}{a+b}$ $\var(X) = \frac{ab}{(a+b)^2(a+b+1)}$
Parameter $a$:
Parameter $b$: