Home / Maths for AI / Symbols / Sums, products and sets

Pi (product)

Say it: "the product of"

What it means

Multiply a list of terms: ∏i=1nxi=x1×x2×⋯×xn\prod_{i=1}^{n} x_i = x_1 \times x_2 \times \dots \times x_n.

Example

∏i=14i=1×2×3×4=24\prod_{i=1}^{4} i = 1 \times 2 \times 3 \times 4 = 24

This is 4 factorial.

In code

import numpy as np
print(np.prod([1, 2, 3, 4]))

Output

24

Where it appears in machine learning

The likelihood of independent data points is a product of their probabilities (which is why we take logs and get a sum).

Related symbols

Learn it properly in the free lesson Reading ML Maths, with practice questions that check your answers.