Home / Maths for AI / Symbols / Probability and statistics

Probability

Say it: "the probability of A"

What it means

A number from 0 (impossible) to 1 (certain). P(A∩B)P(A \cap B) or P(A,B)P(A, B) is "A and B"; P(A∪B)P(A \cup B) is "A or B".

Example

P(six on a die)=16≈0.167P(\text{six on a die}) = \tfrac{1}{6} \approx 0.167

One outcome out of six equally likely ones.

In code

import numpy as np
rolls = np.random.default_rng(0).integers(1, 7, 60000)
print(round((rolls == 6).mean(), 3))

Output

0.165

Where it appears in machine learning

Classifiers output probabilities; language models give P(next word∣previous words)P(\text{next word} \mid \text{previous words}).

Related symbols

Learn it properly in the free lesson Probability & Distributions, with practice questions that check your answers.