# The Dropout Learning Algorithm: Math Review

Review of combinatorics and probability theory for Baldi & Sadowski (2014).

## Combinatorics

We have a set $I$ of $n$ elements. The set of all subsets of $I$, the powerset $\mathcal{P}(I)$, has $2^n$ elements (including the empty subset), which can be seen

**algebraically**, by grouping all subsets of $I$ by cardinality, and noting that for $0 \leq k \leq n$ we have ${n \choose k}$ subsets of cardinality $k$. The sum of these terms is the left side of the binomial theorem $\sum_{k=0}^n {n \choose k} x^{n-k} y^k = (x + y)^n$ with $x = y = 1$, so $\mathcal{P}(I) = 2^n$.**combinatorially**, simply by observing that we can form a subset of $I$ by deciding for each element, whether to include it in the set or not. Thus, there are $2^n$ ways of forming a subset.

How often does each element of $I$ appear in all of the $2^n$ subsets of $I$? Again, consider each group of subsets with equal cardinality: We can form all subsets of $I$ of cardinality $k > 0$ that contain the same element $e$ by choosing element $e$ out of $n$ elements and combining it with each subset of carndinality $k-1$ of the remaining $n-1$ elements. Thus, each element of $I$ appears $\sum_{k=1}^{n} {n-1 \choose k-1} = 2^{n-1}$ times.

## Stochastic functions

### Expectation

For a discrete random variable $X$ with $k$ possible outcomes $x_1, x_2, \ldots, x_k$ occuring with probabilities $P(X = x_i) = p_i$, $1 \leq i \leq k$, the expectation (**first moment**) of $X$ is defined as

So, in the special case of a Bernoulli random variable with $x_1 = 1$, $x_2 = 0$ and $p_1 = p$, $p_2 = 1-p = q$, we have $E[X] = p$.

From the general definition, we can prove the **linearity of expectation**: (1) The expected value of the sum of two (or any finite number of) random variables equals the sum of the expected values of the individual random variables.

(2) The expected value scales linearly with a multiplicative constant.

By definition, two discrete random variables are independent iff $P(X=x, Y=y) = P(X=x) P(Y=y)$ for all $x, y$. Thus for **independent random variables**, the expectation of the product equals the product of the expectations.

### Variance

Variance (the **second central moment**) is defined as the expected squared deviation of a random variable $X$ from its mean $\mu = E[X]$.

For the special case of a **Bernoulli random variable** we can simplify as follows:

If its argument is scaled by a constant, variance is **scaled by the square** of that constant. This follows from the definition of variance and linearity of expectation:

### Covariance

Covariance is defined as the expected value of the product of the squared deviations of two jointly distributed random variables from their means.

Variance is a special case of covariance, where $X = Y$. If $X$ and $Y$ are independent random variables, then $E[XY] = E[X]E[Y]$, that is, $Cov(X, Y) = 0$ (this implication does not hold in the opposite direction in general).

The **variance of the sum** of two random variables equals the sum of their individual variances plus two times their covariance.

Because $Cov(X, Y) = 0$ for independent random variables, variance is linear if $X$ and $Y$ are independent.

Baldi, P., & Sadowski, P. (2014). The dropout learning algorithm. Artificial intelligence, 210, 78-122.