Probability & distributions

Statistics runs on probability: the language for saying how surprising an outcome is. A handful of standard distributions cover most business situations you will model.

The rules you need

  • A probability sits between 0 and 1, and all outcomes together sum to 1.
  • Complement: P(not A) = 1 - P(A). Often the fastest route ("at least one" = 1 minus "none").
  • Addition: P(A or B) = P(A) + P(B) - P(A and B).
  • Multiplication: P(A and B) = P(A) x P(B) only when A and B are independent.
  • Conditional: P(A given B) = P(A and B) / P(B). Most real business questions are conditional - the default rate given a credit score band, not overall.

Discrete distributions

Binomial counts successes in n independent yes/no trials with fixed probability p. A call centre dials 200 leads with a 12% conversion rate: how likely are at least 30 conversions?

from scipy import stats

n, p = 200, 0.12
dist = stats.binom(n, p)
print(dist.mean(), round(dist.std(), 2))          # 24.0  4.6
print(round(1 - dist.cdf(29), 4))                 # P(at least 30)

Poisson counts events in a fixed window when they arrive independently at an average rate: complaints per day, walk-ins per hour, machine faults per week.

walkins = stats.poisson(mu=18)                    # 18 customers/hour on average
print(round(walkins.pmf(18), 4), round(1 - walkins.cdf(24), 4))

The normal distribution

Continuous, symmetric, defined by a mean and a standard deviation. The empirical rule:

Within Share of values
1 standard deviation about 68%
2 standard deviations about 95%
3 standard deviations about 99.7%

A z-score, (value - mean) / std, says how many standard deviations a value sits from the mean, which lets you compare a delivery time with an invoice value.

z = (62 - 48) / 9                                  # a 62-minute delivery, mean 48, sd 9
print(round(z, 2), round(1 - stats.norm.cdf(z), 4))   # 1.56, about 6% are slower

Which distribution fits?

Question Distribution
How many of 500 EMIs will bounce? Binomial
How many support tickets tomorrow? Poisson
How heavy is a randomly chosen 1 kg packet? Normal
How long until the next walk-in? Exponential
Bill amounts across a retail chain Log-normal (right-skewed)

Why the normal keeps appearing

The central limit theorem says that averages of many independent samples are approximately normal whatever the population looks like. That is why we can put confidence intervals around a mean bill value even though bill values themselves are heavily skewed - it is the sampling distribution of the mean that turns normal, not your raw data.

Common mistakes

  • Assuming the raw data is normal. Incomes, bills and durations rarely are; test with a histogram first.
  • Multiplying probabilities of events that are not independent (two loans to the same family business).
  • Confusing P(A given B) with P(B given A) - the base-rate error behind most false-positive scares.
  • Using a normal model for counts near zero, which allows impossible negative values.
  • Treating a 5% tail event as impossible. Over 100 stores it happens roughly five times.

Practice

A sweets chain sells on average 40 kg of kaju katli per outlet per day (Poisson). Compute the chance of selling more than 55 kg, and the stock level that covers demand on 95% of days using stats.poisson.ppf. Then simulate 10,000 days with numpy.random.default_rng().poisson(40, 10_000) and check your answers.

B

Written by Bablu Kumar Jha

Founder, BeeProton AI · Mumbai, Maharashtra, India