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

The real numbers

Say it: "R", "the reals"

What it means

The set of all numbers on the number line, including decimals and negatives. Rd\mathbb{R}^d is the set of lists (vectors) of dd real numbers; Rm×n\mathbb{R}^{m \times n} is the set of m×nm \times n matrices.

Example

x∈R3 means x=(x1,x2,x3)x \in \mathbb{R}^3 \text{ means } x = (x_1, x_2, x_3)

A point in 3-dimensional space.

In code

import numpy as np
x = np.array([0.5, -2.0, 3.1])
print(x.shape)

Output

(3,)

Where it appears in machine learning

Shapes in papers: an image batch might be X∈R32×3×224×224X \in \mathbb{R}^{32 \times 3 \times 224 \times 224}, which is its NumPy or PyTorch shape.

Related symbols

Learn it properly in the free lesson Vectors, Norms & the Dot Product, with practice questions that check your answers.