# Real numbers

All the numbers from $- \infin$ to $\infin$

## Real number line

Graph of real numbers $\R$

## Absolute value

Absolute value of number $x$, written $|x|$ is distance from $x$ to 0.

For any $x \in \R$

$|x| = \begin{cases} \enspace\: x, &\text{if }\enspace x \enspace\ is \enspace non-negative \\ -x, &\text{if }\enspace x\enspace\ is\enspace\ negative \end{cases}$

## Basic algebra rules

### With equalities

• If $a=b$ then $a+c = b+c$
• If $a$, $b$, and $c$ are numbers, and $c\neq0$, and $a = b$, then $c · a = c · b$.

### With inequalities

• If $a < b$, then $a + c < b + c$.

• but with multiplication:

Suppose $a < b$.
If $c > 0$, then $a · c < b · c$.
If $c < 0$, then $a · c > b · c$.

## Intervals

Closed intervals

Include the endpoints

$[2, 3.1] = \lbrace x \in \R : 2 \le x \le 3.1 \rbrace$

$\:\enspace 1 \notin [2, 3.1]$
$\:\enspace 2 \in [2, 3.1]$
$2.7 \in [2, 3.1]$
$3.1 \in [2, 3.1]$
$3.2 \notin [2, 3.1]$

Open intervals

Don't include the endpoints

$(5, 8) = \lbrace x \in \R : 5 \lt x \lt 8 \rbrace$

$\quad 5.5 \in (5,8)$
$5.001 \in (5,8)$
$\quad\enspace\; 5 \notin (5,8)$

Half-open intervals

Include one endpoint

$(-7.1, 15] = \lbrace x \in \R : -7.1 \lt x \le 15 \rbrace$

Based on course material by Paul Bendich and Daniel Egger from Data Science Maths Skills