BRAGA

02 Writing02-02 Notes02-02-342

Zero Factorial

Published 16 Apr 20263 min read
Contents
  1. 01Deep Breakdown
  2. 02Flowchart
  3. 03Real-world use
  4. 04The formula, piece by piece
  5. 05The formula in words
  6. 06Critical Concepts
  7. 07Step-by-step calculation (tiny example)
  8. 08Code examples
0!=10! = 1
(1)

Deep Breakdown

What it tells me (Situation Awareness): 0!=10! = 1 is the conventional base case that makes all combinatorial formulas consistent. Without it, (n0)\binom{n}{0} and (nn)\binom{n}{n} would be undefined. It appears everywhere factorials appear: binomial coefficients, Poisson PMF, Taylor series, and probability mass functions for distributions defined at 0.

Flowchart

Empty set: 0objectsHow many waysto arrangenothing?Exactly 1 way:do nothingConvention: 0! =1EnablesC(n,0)=1,Poisson P(X=0),Taylor seriesk=0 term

Real-world use

Where it is used

Any time a combinatorial formula evaluates at the boundary condition k=0k=0 or k=nk=n: choosing 0 items from a set, computing (n0)=1\binom{n}{0}=1, evaluating P(X=0)P(X=0) in Poisson/Binomial distributions, or initializing the k=0k=0 term in a Taylor expansion.

Problem it solves

Prevents division by zero in formulas like (nr)=n!/(r!(n−r)!)\binom{n}{r} = n! / (r!(n-r)!) when r=0r=0 or r=nr=n.

How it solves the problem

By defining the empty product as 1 (the multiplicative identity), it ensures the convention 0!=10! = 1 is mathematically consistent with the recursive definition n!=n⋅(n−1)!n! = n \cdot (n-1)!.

Example in a business

Poisson model for rare events (e.g., customer support tickets per hour): P(X=0∣λ)=e−λλ0/0!=e−λP(X=0 \mid \lambda) = e^{-\lambda} \lambda^0 / 0! = e^{-\lambda}. Without 0!=10! = 1, the probability of zero events is undefined.

The formula, piece by piece

0!=10! = 1: the empty product convention.

  • Comes from the recursive identity: n!=n⋅(n−1)!n! = n \cdot (n-1)!
  • Setting n=1n=1: 1!=1⋅0!1! = 1 \cdot 0! so 0!=1!/1=10! = 1!/1 = 1.

The formula in words

"There is exactly one way to arrange zero objects: do nothing."

Critical Concepts

  • This is a definition, not something derived from multiplication.
  • Ensures (n0)=1\binom{n}{0} = 1 (there is exactly 1 way to choose nothing).
  • Enables the k=0k=0 term in Taylor series: f(0)(x0)/0!=f(x0)f^{(0)}(x_0)/0! = f(x_0).
  • Python: math.factorial(0) returns 1. R: factorial(0) returns 1.

Step-by-step calculation (tiny example)

Step 1: Recognize the edge case We need 0!0! to evaluate (50)\binom{5}{0}.

Step 2: Apply the definition 0!=10! = 1 by convention.

Step 3: Use it (50)=5!0!⋅5!=1201⋅120=1\binom{5}{0} = \frac{5!}{0! \cdot 5!} = \frac{120}{1 \cdot 120} = 1. There is exactly 1 way to choose 0 items from 5.

Code examples

Beginner example (Python)

python
import math   # Validate that 0! = 1
print(math.factorial(0))   # 1 # Poisson P(X=0)
import math as m
lam = 3.0   # avg 3 events per hour
prob_zero = (m.e ** (-lam)) * (lam ** 0) / m.factorial(0)
print(f"P(X=0 | lambda=3) = {prob_zero:.4f}")   # ~0.0498

Beginner example (R)

r
# Validate 0! = 1
cat(factorial(0), "\n")  # 1 # Poisson P(X=0)
lam <- 3.0
prob_zero <- exp(-lam) * lam^0 / factorial(0)
cat("P(X=0 | lambda=3) =", round(prob_zero, 4), "\n")  # 0.0498

Professional example (Python)

python
import math
import numpy as np
from scipy.stats import poisson
LAMBDA_VALUES = [0.5, 1.0, 2.0, 3.0, 5.0]
print("Poisson P(X=0) using 0! = 1 convention:")
print(f"{'lambda':>10} {'manual':>12} {'scipy':>12} {'match':>8}")
for lam in LAMBDA_VALUES:
    # Manual: relies on 0! = 1
    manual = (math.e ** (-lam)) * (lam ** 0) / math.factorial(0)   # scipy reference
scipy_val = poisson.pmf(0, lam)
match = abs(manual - scipy_val) < 1e-12
print(f"{lam:>10.1f} {manual:>12.6f} {scipy_val:>12.6f} {str(match):>8}")

Source: AIO p. 83

#probability-statistics#combinatorics#factorials

Keyboard shortcuts

Single keys, ignored while typing in a field or with Cmd, Ctrl or Alt held.

0
Home
1 2 3 4
Work, Writing, Tools, About
j / k
Next / previous section on this page
n / p
Next / previous project or essay
u
Up one level
l
Deutsch
t
Light or dark theme
?
This list
Esc
Close