TL;DR
A Rademacher random variable takes the value plus 1 or minus 1, each with probability one half. It is the simplest symmetric random sign: nothing favours either side. Its mean is 0 and its variance is 1, and sums of independent Rademacher variables are a standard tool for modelling random noise and for randomising algorithms.
Builds on: Probability Mass Function, Mean and Variance · Leads to: Rademacher Complexity
Where it's used
Learning theory. The Rademacher complexity of a family of prediction functions is defined by averaging over random sign variables. It measures how well the family can fit pure noise, and that ability bounds how far training error can fall below test error. The theory uses Rademacher variables because each sign has an exact mean of 0 and variance of 1.
Stochastic optimisation. The simultaneous perturbation method, proposed by James Spall in 1992, estimates the gradient of a loss with many parameters by moving all of them at once. The random direction is a vector of Rademacher signs, one per parameter. A model with 100 parameters can therefore be tuned with two loss evaluations per step. A finite-difference estimate, which moves one parameter at a time, would need 200.
Random projections and sketching. A random matrix with independent Rademacher entries projects high-dimensional data down to a smaller space while roughly preserving distances. Because every entry is plus or minus 1, the matrix is cheap to store and to multiply.
How it works
Start with a fair coin. Heads and tails each have probability one half. Turn the coin into a random variable by setting for heads and for tails.
flowchart LR
A["Fair coin flip"] --> B{"Heads or tails?"}
B -- heads --> C["X = +1"]
B -- tails --> D["X = -1"]
-
Define the variable. Heads gives , tails gives . Every outcome of the flip is now a number. Check: there are exactly two possible values, and .
-
Assign the probabilities. Each outcome of a fair coin has probability , so and . Check: , so the probabilities cover every outcome.
-
Find the average. Multiply each value by its probability and add: . In a long run of flips the running average settles near 0, as the law of large numbers says it must. Check: the positive and negative contributions cancel exactly.
-
Find the spread. Every value squared is 1, because and . So the average of is 1. The variance is . Check: each value sits exactly one unit from the mean of 0, so the typical squared distance is 1.
-
Add several flips. Let for four independent flips. Each has mean 0 and variance 1, so has mean 0 and variance 4. Its possible values are . Check: each sign is odd, and a sum of four odd numbers is even, so can only be even.
Step 1 gives the definition, step 2 gives the rule, and steps 3 and 4 give the two numbers that the rest of the lesson uses. Step 5 shows why independent signs are useful: their sum spreads out in a predictable way.
The math
A random variable has the Rademacher distribution when . Its probability mass function is for , and for every other value. We write .
Here means probability and means expected value. The math below follows the steps above.
Step 2 in symbols: the probability mass function
The two values have probabilities , as required.
Step 3 in symbols: the mean
Step 4 in symbols: the variance
Since for both values, . Then
The formula is the same as the one in mean and variance.
A link to the Bernoulli distribution
If is a Bernoulli variable with success probability , then is Rademacher. When , ; when , . This gives the same mean and variance by a different route. Since , we get . Since , we get .
Step 5 in symbols: sums of independent signs
If are independent Rademacher variables and , then the means add and the variances add, because the variables are independent. So and . The typical size of is therefore about . The central limit theorem makes this precise: becomes close to a Gaussian as grows.
Worked examples
Let be the sign of one fair coin flip, so is Rademacher.
- List the values and probabilities: with probability , and with probability .
- Compute the mean: .
- Compute for each value: and .
- Compute the second moment: .
- Compute the variance: .
Interpretation: the sign has no tendency to lean either way, so the mean is 0, and every outcome is exactly one unit from that mean.
Let for four independent Rademacher variables. If is the number of plus signs among the four, then , and follows the binomial distribution, with probabilities .
- Each value of gives one value of :
- : , probability .
- : , probability .
- : , probability .
- : , probability .
- : , probability .
- Check the probabilities: , so they sum to 1.
- Compute the mean: , all divided by 16, which is .
- Compute : the squares are , so .
- Since the mean is 0, the variance is , which equals , as step 5 of the walkthrough predicts.
Interpretation: four flips can land anywhere from to , but the most likely total is 0, and the spread matches the count of flips.
The simultaneous perturbation method estimates a gradient by perturbing all parameters at once with a random Rademacher vector . Let be a loss function and the current parameter vector, and let be the size of the perturbation. The estimate of the -th gradient component is
- Draw . Each entry is plus or minus 1.
- Since , dividing by gives the same result as multiplying by it, so .
- Suppose that measuring the loss gives and . The difference is .
- Divide the difference by to get . This is the common numerator for all three components.
- Divide by each , which by step 2 is the same as multiplying: .
Interpretation: two loss measurements gave an estimate for all three components at once. The same two measurements would serve for a model with any number of parameters.
Try it: A model has 100 parameters. Using the same method, how many loss measurements does one gradient estimate need?
Answer: Two. The two measurements and are enough, because every parameter is perturbed in the same step.
Common mistakes and tradeoffs
It is tempting to think that a fair sign is the same as a fair coin with values 0 and 1. In fact the Rademacher values are and , so the mean is 0. A Bernoulli variable with success probability one half has mean one half. The two are related by , but they are different variables.
It is tempting to think that the sum of signs is typically near or . In fact a sum of independent signs is typically of size about , because positive and negative values cancel. The extreme values occur only with probability .
It is tempting to think that a Rademacher variable is a Gaussian with a different name. In fact the Rademacher variable takes only two values, so it is bounded and discrete, while a Gaussian has no upper bound. Analysts often use Gaussian variables because the mathematics is smoother, and use Rademacher variables because they are cheap to generate and store.
When to use a Rademacher variable: the noise or perturbation should be symmetric and bounded, and each unit should carry the same magnitude, as in gradient estimation, random projections and symmetrisation arguments. When not to use one: the outcomes are not symmetric, the values should be spread over a range, or the model needs a continuous noise distribution. Alternatives: the Bernoulli distribution for yes or no outcomes, the uniform distribution for values spread evenly over an interval, and the Gaussian distribution when a smooth bell-shaped noise is needed.
History
Hans Rademacher, a German-American mathematician, studied sequences of functions that take the values plus and minus 1 in 1922. Those functions, now called Rademacher functions, became a standard example in the theory of orthogonal series, and the name of the distribution comes from them.
Probability theorists used random signs for symmetrisation arguments, where replacing each variable by a random sign simplified a proof. In 2002 Peter Bartlett and Shahar Mendelson used the same idea to define Rademacher complexity, a measure of how well a class of functions fits noise, which then became central to learning theory.
In 1992 James Spall proposed the simultaneous perturbation method for stochastic optimisation. Its random perturbation direction is a vector of random signs, which made the method cheap in high-dimensional problems.
Recap
- A Rademacher variable takes the values and with probability one half each.
- Its mean is 0 and its variance is 1, so every outcome lies one unit from the centre.
- It is the same as a Bernoulli variable with probability one half, after the change .
- Sums of independent signs have mean 0, variance , and typical size .
- Read next: Rademacher Complexity, which builds on random signs to measure how well a family of functions fits noise.
Check yourself
QuestionWhat are the possible values of a Rademacher variable, and what is the probability of each?Show answer
The possible values are and . Each has probability one half, so the two probabilities add up to 1.
QuestionLet be Rademacher. Compute .Show answer
When , and . When , and . The mean is .
QuestionWhy is dividing by a Rademacher sign the same as multiplying by it?Show answer
Each sign is or , and in both cases its square is 1. Multiplying by gives , so is its own reciprocal: .
QuestionThree independent fair sign flips are added together to give . What is the probability that ?Show answer
The possible values of are . The value needs two plus signs and one minus sign, which happens in of the equally likely patterns. The value needs two minus signs and one plus sign, which also happens in 3 patterns. So .
Sources
- "Rademacher distribution", Wikipedia: https://en.wikipedia.org/wiki/Rademacher_distribution
- "Rademacher complexity", Wikipedia: https://en.wikipedia.org/wiki/Rademacher_complexity