Skip to content
AI-grafen
CBuilderStatistics and probability· about 30 min· fundamentals that rarely change· verified 2026-09-20· EN

Probability — the basics

Calculate probabilities for simple events, combine independent events, and interpret the probability output of a model — for example, '83% cat'.

Practise in Mattegrafen ↗ · Sannolikhet och statistik

Prerequisites

Intuition

Probability is a number between 0 (impossible) and 1 (certain). Dice: P(six) = 1/6. Roll two dice: P(two sixes) = 1/6 · 1/6 = 1/36, because the rolls are independent.

The probabilities of all possible outcomes always sum to 1. This is one of the most important rules — and the one AI models rely on constantly.

Formal

When an image model says 'cat 0.83, dog 0.15, other 0.02', it is providing a probability distribution over categories: the sum is 1. The model is not certain — it distributes its confidence.

A language model does the same for the next word: a distribution over the entire vocabulary. "The cat's tail is …" → long 0.31, soft 0.22, striped 0.08 … To 'generate text' is to draw words from such distributions, one at a time.

Basic rules: P(A or B) = P(A) + P(B) if A and B cannot happen at the same time; P(A and B) = P(A) · P(B) if they are independent; P(not A) = 1 − P(A).

Mastery means

  • Calculates probability as favourable outcomes divided by possible outcomes
  • Multiplies probabilities for independent events

Sign in to do the exercises and build your mastery up.

Sources

All the sources and licences