Calculate Subgaussian Norm Of A Bernoulli Random Variable

Calculate Subgaussian Norm of a Bernoulli Random Variable

Use this interactive calculator to estimate the subgaussian parameter for a Bernoulli random variable X ~ Bernoulli(p). Choose the exact Kearns-Saul proxy for the centered variable X – p, or compare it with the Hoeffding upper bound.

Centered Bernoulli Exact Proxy Variance Chart.js Visualization
Enter a value strictly between 0 and 1.
The exact method uses the sharp Kearns-Saul variance proxy.
Used to display MGF and the subgaussian upper bound at a chosen lambda.
Adjust result precision for reporting.

Expert Guide: How to Calculate the Subgaussian Norm of a Bernoulli Random Variable

A Bernoulli random variable is one of the most fundamental objects in probability. It takes value 1 with probability p and value 0 with probability 1 – p. Despite its simple two-point support, it appears everywhere: A/B testing, binary classification, coin-flip models, quality control, reliability analysis, epidemiology, randomized algorithms, and concentration inequalities. When analysts ask how to calculate the subgaussian norm of a Bernoulli random variable, they are usually trying to quantify how sharply the variable concentrates around its mean. This matters because subgaussian estimates feed directly into tail bounds, confidence inequalities, sample complexity analysis, and finite-sample guarantees.

For a Bernoulli variable X ~ Bernoulli(p), the mean is E[X] = p and the variance is Var(X) = p(1 – p). However, the subgaussian analysis is most natural for the centered variable X – p, not for X itself. Centering matters because the standard subgaussian definition is built around a mean-zero random variable. Once centered, X – p takes values 1 – p with probability p and -p with probability 1 – p. Since those values are bounded, the variable is automatically subgaussian. The practical question is not whether it is subgaussian, but what the best or most useful subgaussian parameter is.

What quantity is this calculator computing?

This calculator focuses on the centered Bernoulli random variable Y = X – p. A mean-zero random variable Y is subgaussian with parameter sigma if its moment generating function satisfies

E[exp(lambda Y)] <= exp((sigma^2 lambda^2) / 2) for all real lambda.

For a centered Bernoulli, the exact sharp proxy variance is often written as

sigma^2(p) = (1 – 2p) / (2 log((1 – p) / p)), for p in (0,1), p != 1/2, and sigma^2(1/2) = 1/4 by continuity.

This is closely related to the Kearns-Saul inequality for Bernoulli random variables. The corresponding subgaussian norm in the variance-proxy sense is sigma(p) = sqrt(sigma^2(p)). At p = 1/2, the exact parameter is 1/2. For extreme probabilities close to 0 or 1, the parameter gets smaller than the universal Hoeffding bound, reflecting the fact that highly skewed Bernoulli variables fluctuate less than symmetric ones.

Why not just use variance?

Variance tells you the average squared deviation, but the subgaussian parameter is designed to control the entire moment generating function and therefore the tails. For Gaussian variables, the variance proxy and the variance line up perfectly. For bounded non-Gaussian variables such as Bernoulli, the subgaussian proxy can be larger than the variance, because the MGF must be controlled uniformly over all lambda, not just locally near zero. In fact, one always has sigma^2(p) >= p(1 – p), with equality only in a limiting local sense around lambda = 0.

Centered Bernoulli MGF

To compute the subgaussian norm, start from the exact moment generating function of the centered variable Y = X – p:

M_Y(lambda) = E[exp(lambda(X – p))] = (1 – p) exp(-lambda p) + p exp(lambda(1 – p)).

The smallest sigma that makes

M_Y(lambda) <= exp((sigma^2 lambda^2)/2)

hold for every lambda is the sharp subgaussian parameter for the centered Bernoulli. The Kearns-Saul formula above provides this exact value. This is the strongest practical answer if you want an optimal concentration proxy.

Hoeffding bound versus exact Bernoulli constant

Because X – p is bounded in the interval [-p, 1 – p], Hoeffding’s lemma gives a generic upper bound. For any mean-zero random variable bounded in [a,b], the subgaussian parameter can be bounded by (b – a)/2. Here, b – a = 1, so Hoeffding yields sigma = 1/2 and sigma^2 = 1/4 for every p. That bound is valid and simple, but it is not tight unless p = 1/2. If p = 0.1, for example, the exact proxy variance is well below 0.25, so using the exact Bernoulli formula can give meaningfully sharper tail estimates.

p Mean E[X] Variance p(1 – p) Exact proxy variance sigma^2(p) Hoeffding proxy variance
0.10 0.10 0.0900 0.182048 0.250000
0.25 0.25 0.1875 0.227560 0.250000
0.50 0.50 0.2500 0.250000 0.250000
0.75 0.75 0.1875 0.227560 0.250000
0.90 0.90 0.0900 0.182048 0.250000

The symmetry in the table is expected: replacing p by 1 – p does not change the centered Bernoulli distribution up to sign, so the exact proxy variance is symmetric around p = 1/2. The maximum occurs at p = 1/2, where the Bernoulli behaves most like a fair coin and has the largest spread.

Step-by-Step Method to Calculate the Subgaussian Norm

  1. Specify the Bernoulli parameter p with 0 < p < 1.
  2. Center the variable by writing Y = X – p.
  3. Use the exact MGF formula: M_Y(lambda) = (1 – p)e^{-lambda p} + p e^{lambda(1 – p)}.
  4. Compute the exact proxy variance:
    sigma^2(p) = (1 – 2p) / (2 log((1 – p)/p))
    if p is not 1/2.
  5. At p = 1/2, use the continuity limit sigma^2 = 1/4.
  6. Take the square root if you want the subgaussian parameter sigma itself.
  7. If you only need a simple universal bound, use Hoeffding: sigma = 1/2.

Interpretation of the result

If your calculator returns sigma^2(p) = 0.182048 for p = 0.1, then the centered Bernoulli behaves no worse than a mean-zero subgaussian random variable with variance proxy about 0.182. This means you can bound tails of sums of independent centered Bernoulli variables more sharply than if you used the rough 0.25 Hoeffding constant. In applications like online experiments or binary event monitoring, that difference can improve confidence bounds and reduce conservative overestimation.

Common mistakes when computing Bernoulli subgaussian norms

  • Forgetting to center the variable. The standard subgaussian definition applies most naturally to mean-zero variables. For Bernoulli, use X – p.
  • Confusing variance with subgaussian proxy variance. The exact proxy variance is not simply p(1 – p).
  • Using the Hoeffding bound as if it were exact. Hoeffding is valid, but often conservative away from p = 1/2.
  • Ignoring the p = 1/2 limit. The exact formula has a removable 0/0 form there, and the correct value is 1/4.
  • Mixing different definitions of norm. Some texts use Orlicz psi_2 norms, while others use the MGF variance proxy parameter. Always state which convention you are using.

Bernoulli Concentration in Practice

The Bernoulli family sits at the heart of concentration theory because sums of Bernoulli variables produce binomial counts, empirical proportions, and indicators of events. Suppose you observe n independent Bernoulli trials and estimate the success rate by the sample mean. The centered sample mean can be controlled using the subgaussian parameter of each centered Bernoulli summand. If each Xi – p is subgaussian with parameter sigma(p), then the sample mean obeys concentration on the scale sigma(p) / sqrt(n). This gives a principled way to derive finite-sample error bars.

In machine learning, binary labels and one-hot event indicators appear in loss functions, calibration metrics, and feature engineering. In econometrics and biostatistics, treatment assignment, event occurrence, and default indicators are all Bernoulli-based. In network reliability, packet receipt and component survival are Bernoulli events. Across all of these domains, concentration quality depends on the correct tail parameter, not just the variance.

p Exact sigma(p) Hoeffding sigma Improvement in variance proxy vs 0.25 Distribution shape
0.05 0.412506 0.500000 31.95% Highly skewed
0.20 0.466299 0.500000 13.02% Moderately skewed
0.50 0.500000 0.500000 0.00% Symmetric fair coin
0.80 0.466299 0.500000 13.02% Moderately skewed
0.95 0.412506 0.500000 31.95% Highly skewed

Relationship to sample proportions and confidence analysis

If S_n = X_1 + … + X_n with independent Bernoulli(p) trials, then S_n – np is the sum of centered Bernoulli variables. The exact Bernoulli subgaussian constant gives tighter exponential tail control than a generic bounded-difference argument when p is not close to 1/2. This can improve analyses for rare event detection, defect-rate monitoring, click-through estimation, and safety event incidence. The gain becomes more noticeable when probabilities are extreme because the exact constant shrinks as p moves toward 0 or 1.

Authority References and Further Reading

For foundational background in probability, concentration, and moment generating functions, the following educational sources are useful:

When should you use the exact formula?

Use the exact formula when you want the best concentration constant for a centered Bernoulli variable and you care about sharp tail estimates. This is especially relevant for theoretical derivations, proofs, algorithmic guarantees, or finite-sample bounds. Use the Hoeffding bound when you need a quick universal estimate, when implementation simplicity matters more than sharpness, or when you are building a bound that already contains multiple conservative steps.

Summary

To calculate the subgaussian norm of a Bernoulli random variable, first center it: Y = X – p. Then compute the exact subgaussian variance proxy using the sharp expression

sigma^2(p) = (1 – 2p) / (2 log((1 – p)/p)), with sigma^2(1/2) = 1/4.

The corresponding parameter is sigma(p) = sqrt(sigma^2(p)). This exact Bernoulli constant is always at most the universal Hoeffding constant 1/2, and it is strictly smaller except at p = 1/2. In short: variance measures spread, but the subgaussian norm controls tails; for Bernoulli variables, the exact centered formula gives the most informative concentration description.

This calculator reports the MGF-based subgaussian parameter for the centered Bernoulli variable X – p. Some books define a psi_2 Orlicz norm instead; while related, that is a different normalization convention.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top