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.
| Measure | What it tells you | Our claims |
|---|---|---|
| Mean (average) | Total ÷ count | 6,200 ÷ 5 = 1,240, pulled up by one large claim |
| Median | The middle value once sorted | 300: a better "typical" value when there are outliers |
| Mode | The most common value | 300 |
| Range | Largest minus smallest | 4,800 |
| Variance and standard deviation | How far values usually sit from the mean | Large here, because of the 5,000 claim |
| Percentiles and IQR | Split sorted data into parts; the middle 50% is the interquartile range | Values 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
| Covariance | Correlation | |
|---|---|---|
| Tells you | Whether two things rise and fall together | Direction and strength |
| Scale | Any size; depends on the units | Always between −1 and +1 |
| Easy to compare? | No | Yes |
| Correlation | Meaning | Example |
|---|---|---|
| Close to +1 | Strong, move together | Age and premium |
| Close to −1 | Strong, move opposite | Higher deductible, fewer small claims |
| Close to 0 | No straight-line link | Shoe 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
P(A | B) = P(B | A) × P(A) ÷ P(B)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
| Distribution | Describes | Example |
|---|---|---|
| Normal (bell curve) | Values that cluster around an average; about 68% fall within 1 standard deviation and 95% within 2 | Heights, measurement errors |
| Bernoulli | A single yes/no outcome | Will this claim be approved? |
| Binomial | Number of yeses in a fixed number of tries | Approvals out of 20 claims |
| Poisson | Number of events in a time window | Claims arriving per hour |
| Exponential | Time until the next event | Minutes until the next helpdesk call |
| Uniform | Every outcome equally likely | Rolling 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 minSee an outlier move the average
- In a spreadsheet, list 10 claim amounts between 200 and 600.
- Use
=AVERAGE,=MEDIANand=STDEV.Son them. - 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.