Number Systems
Remark. Probability and statistics count with the integers and natural numbers and measure with the real numbers. This page defines those number systems. It also defines the words that sort their members: even and odd integers, and rational and irrational real numbers.
1 Natural numbers
Exercise 1 (Which numbers are natural?) List the elements of the set \(\mathopen{}\left\{n \in \mathbb{N}: n < 3\right\}\mathclose{}\). Is your answer the same in every textbook?
Definition 1 (Integers) The integers [1] are the whole numbers, together with their negatives and \(0\):
\[\mathbb{Z} \stackrel{\text{def}}{=}\mathopen{}\left\{\ldots, -3, -2, -1, 0, 1, 2, 3, \ldots\right\}\mathclose{}\]
An integer is an element of \(\mathbb{Z}\).
Definition 2 (Positive integers) The integers (Definition 1) greater than \(0\) are the positive integers.
Definition 3 (Negative integers) The integers (Definition 1) less than \(0\) are the negative integers.
Example 1 (Integers and non-integers)
- \(-7\), \(0\), and \(12\) are integers.
- \(\frac{1}{2}\) and \(-2.5\) are not integers.
- \(\frac{6}{3}\) is an integer, because \(\frac{6}{3} = 2\).
Definition 4 (Even integer) An integer (Definition 1) \(n\) is even [2] if \(n = 2k\) for some integer \(k\).
Definition 5 (Odd integer) An integer (Definition 1) \(n\) is odd [2] if \(n = 2k + 1\) for some integer \(k\).
Example 2 (Even and odd integers)
- \(6\) is even, because \(6 = 2 \cdot 3\).
- \(0\) is even, because \(0 = 2 \cdot 0\).
- \(-3\) is odd, because \(-3 = 2 \cdot(-2) + 1\).
- \(7\) is odd, because \(7 = 2 \cdot 3 + 1\).
- \(2.5\) is neither even nor odd, because it is not an integer.
Definition 6 (Natural numbers (our convention)) In these notes, the natural numbers [3] are the positive integers (Definition 2):
\[\mathbb{N}\stackrel{\text{def}}{=}\mathopen{}\left\{1, 2, 3, \ldots\right\}\mathclose{}\]
Definition 7 (Non-negative integers) The non-negative integers are the natural numbers (Definition 6) together with \(0\):
\[\mathbb{N}_0 \stackrel{\text{def}}{=}\mathopen{}\left\{0, 1, 2, 3, \ldots\right\}\mathclose{} = \mathbb{N}\cup \mathopen{}\left\{0\right\}\mathclose{}\]
Example 3 (Natural numbers in a data analysis)
- Observation indices start at \(1\), so we write \(i \in \mathopen{}\left\{1, \ldots, n\right\}\mathclose{}\) with \(n \in \mathbb{N}\).
- A count outcome, such as the number of hospital visits in a year, can be \(0\), so the set of values it can take is \(\mathbb{N}_0\), not \(\mathbb{N}\).
Other sources may define \(\mathbb{N}\) differently, so check each source’s definition before reading its formulas:
- Many sources include \(0\) in \(\mathbb{N}\). The international standard ISO 80000-2 defines \(\mathbb{N}\) to include \(0\), continuing the earlier standard ISO 31-11 (1978).
- Other sources start \(\mathbb{N}\) at \(1\), as these notes do.
- To remove the ambiguity, some sources write \(\mathbb{N}_1\) or \(\mathbb{Z}^+\) for \(\mathopen{}\left\{1, 2, 3, \ldots\right\}\mathclose{}\), and \(\mathbb{N}_0\) or \(\mathbb{Z}^{0+}\) for \(\mathopen{}\left\{0, 1, 2, \ldots\right\}\mathclose{}\).
- The words vary too. “Positive integers” (\(\mathopen{}\left\{1, 2, 3, \ldots\right\}\mathclose{}\)) and “non-negative integers” (\(\mathopen{}\left\{0, 1, 2, \ldots\right\}\mathclose{}\)) are unambiguous. “Whole numbers” usually includes \(0\), but can also mean all of the integers, negative ones included. “Counting numbers” usually starts at \(1\), but some sources include \(0\).
- Some older texts write \(J\) for the natural numbers.
When a formula’s meaning depends on whether \(0\) is included, we write the set out explicitly, for example \(\mathopen{}\left\{0, 1, 2, \ldots\right\}\mathclose{}\) or \(\mathopen{}\left\{1, \ldots, n\right\}\mathclose{}\).
Source: Wikipedia, “Natural number”, “Terminology and notation” and “Zero as natural number”, which cites ISO 80000-2:2019 and the textbooks using each notation.
2 Rational, real, and irrational numbers
Definition 8 (Rational numbers) A rational number [4] is a number that can be written as a fraction \(\frac{a}{b}\), where \(a\) and \(b\) are integers (Definition 1) and \(b \ne 0\). The set of rational numbers is written \(\mathbb{Q}\):
\[\mathbb{Q} \stackrel{\text{def}}{=}\mathopen{}\left\{\frac{a}{b} : a \in \mathbb{Z},\ b \in \mathbb{Z},\ b \ne 0\right\}\mathclose{}\]
Example 4 (Rational numbers)
- \(\frac{3}{4}\) is rational, with \(a = 3\) and \(b = 4\).
- \(0.75\) is rational, because \(0.75 = \frac{3}{4}\).
- Every integer is rational: for example, \(-5 = \frac{-5}{1}\).
- \(0.333\ldots\), with the \(3\)s repeating forever, is rational, because \(0.333\ldots = \frac{1}{3}\).
Definition 9 (Real numbers) A real number [5] is a number that can be written as a decimal expansion: an integer part, followed by a decimal point and a finite or infinite list of decimal places after it. Equivalently, the real numbers are the points on the number line. The set of real numbers is written \(\mathbb{R}\).
Remark 1 (A working definition). Definition 9 is a working definition, not a construction: it does not say what an infinite decimal expansion is, or how to add or multiply two of them. Rudin [6], Appendix to Chapter 1 constructs the real numbers rigorously. Some real numbers have two decimal expansions: for example, \(0.999\ldots\) and \(1.000\ldots\) are the same real number, \(1\).
Example 5 (Real numbers)
- \(3\), \(-0.5\), and \(\frac{1}{3} = 0.333\ldots\) are real numbers.
- \(\pi = 3.14159\ldots\) is a real number.
- Every rational number (Definition 8) is a real number, so \(\mathbb{N}\subseteq \mathbb{Z} \subseteq \mathbb{Q} \subseteq \mathbb{R}\).
Definition 10 (Irrational numbers) An irrational number [7] is a real number (Definition 9) that is not rational (Definition 8).
Example 6 (Irrational numbers)
- \(\sqrt{2} = 1.41421\ldots\), the square root of \(2\), is irrational: no fraction of integers \(\frac{a}{b}\) squares to \(2\) [8].
- \(\pi = 3.14159\ldots\) is irrational [9].
- \(1.5\) is not irrational, because \(1.5 = \frac{3}{2}\) is rational.