Statistics and probability for AI

Statistics describes data: what is typical, how spread out it is, and how two things move together. Probability measures how likely something is, from 0 (impossible) to 1 (certain). AI models rarely give certainties; they give probabilities, so these ideas sit underneath every prediction.

Everyday analogy

A weather forecast. Statistics summarises the past ("July averages 42°C"), and probability talks about tomorrow ("20% chance of rain"). An AI model is a forecaster for whatever it was trained on.

Example

A fraud model scores a claim at 0.87. That isn't "fraud" or "not fraud"; it's an estimated 87% likelihood. The business sets the cut-off, for example: send anything above 0.8 for manual review.

Describing data

Five claim amounts: 200, 300, 300, 400 and 5,000.

MeasureWhat it tells youOur claims
Mean (average)Total ÷ count6,200 ÷ 5 = 1,240, pulled up by one large claim
MedianThe middle value once sorted300: a better "typical" value when there are outliers
ModeThe most common value300
RangeLargest minus smallest4,800
Variance and standard deviationHow far values usually sit from the meanLarge here, because of the 5,000 claim
Percentiles and IQRSplit sorted data into parts; the middle 50% is the interquartile rangeValues far outside it are flagged as outliers

Tip: when the mean and median are far apart, look for outliers. In claims data, that's often where fraud or data-entry mistakes hide.

Descriptive statistics summarise the data you have. Inferential statistics use a sample to draw conclusions about a bigger group, e.g. checking 500 claims to estimate the error rate in 50,000.

Correlation and covariance

CovarianceCorrelation
Tells youWhether two things rise and fall togetherDirection and strength
ScaleAny size; depends on the unitsAlways between −1 and +1
Easy to compare?NoYes
CorrelationMeaningExample
Close to +1Strong, move togetherAge and premium
Close to −1Strong, move oppositeHigher deductible, fewer small claims
Close to 0No straight-line linkShoe size and claim amount

Correlation is not causation. Ice-cream sales and swimming accidents both rise in summer, but one doesn't cause the other: hot weather drives both.

Probability basics

  • Every probability is between 0 and 1.
  • Not A: P(not A) = 1 − P(A).
  • A or B: P(A) + P(B) − P(A and B), so overlaps aren't counted twice.
  • Independent events: P(A and B) = P(A) × P(B). Two coin tosses both heads: 0.5 × 0.5 = 0.25.
  • Conditional probability: P(A | B) means "the probability of A, given that B has happened".

Bayes' theorem: updating a belief with new evidence

Bayes' theorem
P(A | B) = P(B | A) × P(A) ÷ P(B)
Worked example: a fraud flag
1% of claims are fraudulent.
The detector flags 90% of fraudulent claims.
It also wrongly flags 5% of honest claims.

Out of 10,000 claims:
  Fraud:   100   → 90 flagged
  Honest: 9,900  → 495 flagged
  Total flagged = 585

P(fraud | flagged) = 90 ÷ 585 ≈ 15%

The surprise: even a good detector produces mostly false alarms when the thing it looks for is rare. That's why flagged claims go to a human reviewer instead of being rejected automatically. The same maths powers Naive Bayes spam filters.

Common probability distributions

DistributionDescribesExample
Normal (bell curve)Values that cluster around an average; about 68% fall within 1 standard deviation and 95% within 2Heights, measurement errors
BernoulliA single yes/no outcomeWill this claim be approved?
BinomialNumber of yeses in a fixed number of triesApprovals out of 20 claims
PoissonNumber of events in a time windowClaims arriving per hour
ExponentialTime until the next eventMinutes until the next helpdesk call
UniformEvery outcome equally likelyRolling a fair dice

Where AI uses it

  • Softmax turns a model's scores into probabilities.
  • Temperature changes how a chatbot samples from those probabilities.
  • Scaling features with a z-score: (value − mean) ÷ standard deviation.
  • Evaluation metrics, A/B tests and spotting outliers during data cleaning.

Try it yourself

About 10 min

See an outlier move the average

  1. In a spreadsheet, list 10 claim amounts between 200 and 600.
  2. Use =AVERAGE, =MEDIAN and =STDEV.S on them.
  3. Change one amount to 20,000 and watch the three results.

What you should see: The mean and standard deviation jump while the median barely moves. That's why analysts check both.

Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot) where needed. Never paste private or confidential information.

Test what you learned

Take a quick quiz, or look up any word in the glossary.