Every dataset you will ever touch is built from numbers, but not all numbers behave the same way. Some count discrete things like customers or clicks. Others measure continuous quantities like temperature or revenue growth. A few even help engineers and data scientists model signals that oscillate over time. To use numbers correctly in analysis, you first need to know which “family” a number belongs to. This post walks through the complete hierarchy of number sets, from the simplest counting numbers to the more abstract complex numbers, and shows how each set builds on the one before it.
Table of Contents
- Natural, whole and integer numbers: the building blocks
- Natural numbers (N)
- Whole numbers (W)
- Integers (Z)
- Rational numbers and irrational numbers: understanding real numbers
- Rational numbers (Q)
- Irrational numbers
- Real numbers (R)
- Complex numbers: beyond the real number system
- The imaginary unit
- Why complex numbers matter
- Solving what real numbers cannot
- Containment relations in number sets
- What do you think?
Natural, whole and integer numbers: the building blocks
Every number system starts with the numbers we use to count. These form the base layer, and everything else in mathematics is constructed on top of them.
Natural numbers (N)
Natural numbers are the counting numbers: 1, 2, 3, 4, and so on, continuing forever. They do not include zero, fractions, decimals, or negative values. When you count the number of rows in a spreadsheet or the number of respondents in a survey, you are using natural numbers.
Whole numbers (W)
Whole numbers include every natural number plus zero: 0, 1, 2, 3, and so forth. The addition of zero might look trivial, but it matters. Zero represents the idea of “nothing,” which natural numbers alone cannot express. Interestingly, several modern textbooks and mathematical bodies now treat zero as part of the natural numbers themselves, since it behaves consistently under addition and is essential in fields like computer science, where counting often starts at zero. Because of this, you will sometimes see natural numbers defined as starting from 0 rather than 1, depending on the convention a particular course or country follows.
Integers (Z)
Integers extend whole numbers by adding negative values: …, -3, -2, -1, 0, 1, 2, 3, …. The symbol Z comes from the German word “Zahlen,” meaning numbers. Integers let you represent a loss as easily as a gain, which is why every profit-and-loss statement, temperature scale, or bank balance depends on them.
These three sets are nested inside one another. Every natural number is a whole number, and every whole number is an integer, but the reverse is not true. Zero is a whole number but not a natural number under the classical definition, and -5 is an integer but neither a whole number nor a natural number.
Rational numbers and irrational numbers: understanding real numbers
Integers alone cannot represent everything you encounter in data analysis. Averages, proportions, and ratios often fall between whole numbers, which is where the next two sets come in.
Rational numbers (Q)
A rational number is any number that can be written as a fraction p/q, where p and q are integers and q is not zero. This definition, formalised in classical arithmetic, means all integers are automatically rational too, since any integer n can be written as n/1. Rational numbers include every fraction, along with all decimals that either terminate or repeat in a pattern. For example, 0.75 is rational because it equals 3/4, and 0.333… is rational because it equals 1/3. This is why the symbol used for this set is Q, referring to the word “quotient.”
Irrational numbers
Some numbers refuse to be written as a simple fraction, no matter how hard you try. These are irrational numbers. An irrational number is any real number that cannot be expressed as the ratio of two integers, and its decimal expansion goes on forever without settling into a repeating pattern. The square root of 2 is the classic example. It first appeared as a problem in geometry, when mathematicians tried to calculate the diagonal of a square with sides of length one and found that no fraction could describe it exactly. Other well-known irrational numbers include pi (used constantly in circular and periodic calculations) and Euler’s number e (central to exponential growth models used in statistics and finance).
Real numbers (R)
Put rational and irrational numbers together, and you get the real numbers, denoted R. Real numbers include every positive and negative integer, every fraction built from those integers, and every irrational number, making up the complete, unbroken number line you likely first encountered in school. What makes the real number line special is a property called completeness: there are no “gaps” on it. Every point on the line corresponds to a real number, and every real number corresponds to a point. Rational numbers alone do not have this property, since there are infinitely many “holes” on the rational line where irrational values like the square root of 2 should sit.
In practical terms, almost every measurement you record in a dataset (heights, weights, prices, percentages, sensor readings) is a real number. Whether that real number happens to be rational or irrational rarely matters for everyday analysis, but understanding the difference matters when you study number theory, computational limits, or the behaviour of algorithms that round decimals.
Complex numbers: beyond the real number system
Real numbers cover almost everything you will measure, but they cannot solve every equation. Consider xยฒ + 1 = 0. Solving for x means finding a number whose square is -1. No real number satisfies this, because squaring any real number, positive or negative, always produces a non-negative result.
The imaginary unit
To solve this class of problem, mathematicians introduced a new number called i, defined so that iยฒ = -1. Any real multiple of this imaginary unit is called an imaginary number. This was not an easy idea for mathematicians to accept at first. The concept emerged gradually during the 16th century, when Italian mathematicians working on cubic equations found that intermediate steps in their formulas required the square roots of negative numbers, even when the final answers turned out to be perfectly ordinary. It took a few more centuries before the idea was placed on solid theoretical footing and connected to geometry, which finally gave imaginary numbers a legitimate place in mathematics rather than being dismissed as a curious trick.
Why complex numbers matter
A complex number combines a real part and an imaginary part, written as x + iy, where x and y are real numbers. The set of all such numbers is denoted C. Complex numbers are not just an abstract exercise. They are essential in electrical engineering for analysing alternating current, in signal processing for handling waveforms, and in quantum mechanics for describing particle behaviour. The complex number system also contains ordinary real numbers as a special case, where the imaginary part is simply zero. This means 7 can be written as 7 + 0i, making it a complex number as well as a real one.
Solving what real numbers cannot
The real reason complex numbers exist is to guarantee that every polynomial equation has a solution. This idea, known as the fundamental theorem of algebra, states that any polynomial equation of degree n has exactly n solutions once you allow complex numbers. Real numbers alone cannot make this promise, since equations like xยฒ + 1 = 0 have no real roots at all.
Containment relations in number sets
Now that you have met every set, it helps to see them as one continuous chain, each one nested inside the next:
โ โ N โ W โ Z โ Q โ R โ C
Here is what each step in this chain represents:
โ โ N: The empty set is contained in every set, including the natural numbers, simply by the definition of subset relationships in set theory.
N โ W: Every counting number is a whole number, since whole numbers are just natural numbers with zero added.
W โ Z: Every whole number is an integer, since integers are whole numbers extended to include negatives.
Z โ Q: Every integer is rational, because any integer n can be expressed as the fraction n/1.
Q โ R: Every rational number is real, since real numbers include both rationals and irrationals together.
R โ C: Every real number is complex, because it can be written as x + 0i.
Each containment is strict, meaning the larger set always has elements the smaller one lacks. Zero sits in W but not N. Negative five sits in Z but not W. One-half sits in Q but not Z. The square root of two sits in R but not Q. And i itself sits in C but not R. This chain is not arbitrary. Each extension exists to solve a problem the previous set could not handle: whole numbers gave us zero, integers gave us negative values, rational numbers gave us division and fractions, real numbers gave us continuous measurement, and complex numbers gave us complete solutions to polynomial equations.
For anyone working with data, this hierarchy is more than a classification exercise. It determines what kind of arithmetic and statistical operations make sense on a variable, how a programming language stores and rounds a value, and why certain equations in modelling and simulation require complex numbers to solve completely. A solid grip on where a number “lives” in this chain makes every later concept in quantitative reasoning easier to follow.
What do you think?
What do you think? If zero was only added to the natural numbers later, why do you think some modern definitions now include it from the start? And can you think of a real-world dataset where the difference between a rational and an irrational value would actually change your analysis?
References
- https://www.britannica.com/science/rational-number
- https://www.britannica.com/science/irrational-number
- https://www.britannica.com/science/real-number
- https://www.britannica.com/science/imaginary-number
- https://www.sciencefocus.com/science/a-brief-introduction-to-imaginary-numbers
- https://www.britannica.com/science/number-mathematics
Leave a Reply