BERNOULLI Function (Gnumeric)
Calculate Bernoulli point probabilities in Gnumeric, validate 0/1 outcomes and probability bounds, and build weighted and independent-trial checks.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =BERNOULLI(1,0.2) returns the probability 0.2, while =BERNOULLI(0,0.2) returns 0.8. This is a deterministic probability-mass calculation, not a random draw.
Availability and evidence
- Introduction: Gnumeric 1.1.7. NEWS explicitly introduces BERNOULLI among the new statistical functions. This is separate from older random-generator functions with similar names.
- Source support: Registered in the Gnumeric 1.12.62 plugin. No retirement is established. The last functioning application version is unverified for this guide.
- Evidence dates: Official source was retained October 13–14, 2026 and reviewed October 15. Independent exact-rational and high-precision mathematical checks are reference calculations. No native Gnumeric, headless application, GUI or random-generator execution was performed.
Exact syntax and interpretation
=BERNOULLI(k,p)
Both numeric arguments are required. k must be exactly 0 or 1; p is the probability assigned to outcome 1 and must lie from 0 through 1, inclusive. The source rejects every other k with #NUM!, including a fractional value such as 0.9. It does not round or truncate the outcome into the permitted set.
The formula is especially simple: at k=0 return 1-p; at k=1 return p. The output is the mass at that outcome, not a cumulative distribution. For example, BERNOULLI(1,0.2) is 0.2, not one. It also does not report whether an actual observation succeeded; the function evaluates a probability model you supply.
The labels success and failure mean outcome 1 and outcome 0 respectively. Success need not be a desirable event. You might define 1 as a defect, a missed delivery or any other binary outcome, provided the model and p use that same definition consistently.
Reproducible probability worksheet
Create BinaryMass. Enter numeric 0 in A2 and 1 in A3. Put probability 0.2 in D2. Enter B2 =BERNOULLI(A2,$D$2) and fill through B3. The reference values are 0.8 and 0.2. B5 =B2+B3 gives 1.
The absolute reference keeps the probability fixed while the outcome reference moves. Changing D2 to 0.35 in a copy produces 0.65,0.35, still summing to one. Reversing the meanings of zero and one without updating the probability would describe a different model.
For a normalization check across different inputs, put probabilities 0,0.2,0.5,1 in F2:F5. In G2 use =BERNOULLI(0,F2)+BERNOULLI(1,F2) and fill down. Every reference result is 1. That identity tests the probability table, not the accuracy of an estimated p in the real world.
Exact reference controls
| Formula | Independent reference or source contract |
|---|---|
=BERNOULLI(0,0) |
1 |
=BERNOULLI(1,0) |
0 |
=BERNOULLI(0,.2) |
0.800000000000 |
=BERNOULLI(1,.2) |
0.200000000000 |
=BERNOULLI(0,.5) |
0.500000000000 |
=BERNOULLI(1,.5) |
0.500000000000 |
=BERNOULLI(0,1) |
0 |
=BERNOULLI(1,1) |
1 |
=BERNOULLI(9/10,.2) |
#NUM! |
=BERNOULLI(-1,.2) |
#NUM! |
=BERNOULLI(2,.2) |
#NUM! |
=BERNOULLI(0,-.1) |
#NUM! |
=BERNOULLI(1,1.1) |
#NUM! |
The decimal controls were checked using exact rational arithmetic. Invalid inputs follow the pinned callback guards. No application execution is implied. The endpoint rows are valid probability distributions concentrated entirely on one outcome.
Advanced: compute a model’s expected amount
Keep p=0.2 and the original 0/1 outcome table. Enter amounts 3 for outcome 0 in C2 and 15 for outcome 1 in C3. In E2 use =B2*C2 and in E3 use =B3*C3. Their reference contributions are 2.4 and 3, so =E2+E3 is 5.4.
Equivalently, (1-p)*3+p*15 is 5.4. This is an expected amount across the specified distribution; a single outcome still has amount 3 or 15, not 5.4. If p changes to 0.5, the expected amount becomes 9. Keeping both weighted contributions visible makes the change auditable.
For the binary outcome itself, the model mean is p and its variance is p*(1-p). At p=0.2 these are 0.2 and 0.16. The variance uses squared outcome units and is not another probability assigned to outcome 1.
Advanced: combine two explicitly independent trials
If two trials each have success probability 0.2 and are independent, the probability of two successes is =BERNOULLI(1,0.2)*BERNOULLI(1,0.2), giving 0.04. Two failures have probability 0.64. Exactly one success has probability 0.32, accounting for both orders, and at least one success has probability 0.36.
The three mutually exclusive counts, zero, one and two successes, sum to one. Multiplication is justified by the independence assumption, not by the function name. Shared causes or conditional probabilities require a different joint model. BERNOULLI does not infer independence from adjacent worksheet cells.
Errors and troubleshooting
A negative p or p above one gives #NUM!. Enter 20% or 0.2 for a twenty-percent probability; the numeric input 20 is outside the domain. The same guard rejects k=-1, k=2 and nonintegral outcomes. An upstream error propagates through numeric argument evaluation; the function does not turn it into zero probability.
Use explicit numeric cells for the reproducible controls. Locale-dependent numeric text, array evaluation, extreme precision requirements and native export behavior are outside the checked scope. Formatting a probability as a percentage changes its display, not its stored value or the model’s meaning.
If a result seems reversed, verify which outcome is coded as one. If a total differs from one, check that both rows use the same p and that one row uses k=0 while the other uses k=1. A correct arithmetic model still does not establish that the supplied probability describes actual observations.