This commit is contained in:
Miloslav Ciz 2025-04-10 22:26:01 +02:00
parent 8ac0ebb55b
commit f19efc7b70
18 changed files with 1962 additions and 1936 deletions

View file

@ -1,6 +1,6 @@
# Real Number
Real numbers are all [numbers](number.md) found on the infinite, continuous one dimensional number line, they often represent what we generally just mean by the term "number" and include for example [zero](zero.md), [pi](pi.md) or -39/11. The [set](set.md) or real numbers includes all [whole numbers](integer.md) as well as all [rational numbers](rational_number.md) (fractions with integer numerator and denominator), but in addition contains infinitely many "special" numbers such as [pi](pi.md), [e](e.md) or [square root](sqrt.md) of 2, numbers that are mathematically very interesting because they for example produce infinitely many digits in our traditional number notation without showing any obvious patterns. However it has to be noted real numbers still do NOT include for example [infinity](infinity.md) or [complex numbers](complex_number.md) (kind of "2D extension" of real numbers) such as [i](i.md). Real numbers really represent a **[continuum](continous.md)**, between any two numbers that are not the same there is always infinitely many real numbers that have no gaps in between -- this leads to the fact that not only is there infinitely many real numbers, but there is **[uncountably many](uncountable.md)** of them, i.e. simply put there is "more than traditional infinity" of real numbers. [Mathematically](math.md) the set of real numbers and operations with them form a structure called a *[field](field.md)* (so you'll often hear the term "field of real numbers").
Real numbers are all [numbers](number.md) found on the [infinite](infinity.md), continuous one dimensional number line, they often represent what we generally mean by the term "number" and include for example [zero](zero.md), [pi](pi.md) or -39/11. The [set](set.md) or real numbers includes all [whole numbers](integer.md) as well as all [rational numbers](rational_number.md) (fractions with integer numerator and denominator), but in addition contains infinitely many "special" numbers such as [pi](pi.md), [e](e.md) or [square root](sqrt.md) of 2, numbers that are mathematically very [interesting](interesting.md) because they for example produce infinitely many digits in our traditional number notation without showing any obvious patterns. However it has to be noted real numbers still do NOT include for example [infinity](infinity.md) or [complex numbers](complex_number.md) (kind of "2D extension" of real numbers) such as [i](i.md). Real numbers form a **[continuum](continous.md)**, between any two distinct numbers there is always infinitely many real numbers that have no gaps in between -- this leads to the fact that not only is there infinitely many real numbers, but there is **[uncountably many](uncountable.md)** of them, i.e. simply put there is "more than traditional infinity" of real numbers. [Mathematically](math.md) the set of real numbers and operations with them form a structure called a *[field](field.md)* (so you'll often hear the term "field of real numbers").
WATCH OUT: even though in programming we sometimes encounter [data types](data_type.md) named *real*, they usually don't represent true real numbers! In [programming](programming.md) we mostly only [approximate](approximation.md) real numbers with [floating](float.md) or [fixed](fixed_point.md) point numbers, which really are only rational numbers -- this is practically always [good enough](good_enough.md), we don't ever need an exact value of pi, a few decimal digits of accuracy is enough to an engineer, but to a mathematician real numbers represent a completely new, different world with some fundamental differences, which even a mere programmer should be at least aware of. Real numbers are tied to questions of the continuum, infinitely big and infinitely small, and they can really eventually lead to deep philosophical debates.
@ -12,9 +12,9 @@ Compared to the basic sets of numbers, such as [natural](natural_number.md) and
At first this is usually confusing and hard to comprehend, keep in mind we are dealing with [infinities](infinity.md) here and so intuition fails us, what we mean by "size" of an infinite set is better called a [cardinality](cardinality.md) because this is not really a size as we understand it with finite sets, it's a kind of generalization of it that allows us to examine infinity, but as we start dealing with infinities we have to be careful as things we usually take for granted may no longer hold -- for example here we may have a superset of a set of numbers (e.g. all integers, including negative ones, is a superset of natural numbers, which exclude negative numbers) with both sets having the same "size"/cardinality, i.e. something that with finite sets can't happen. With infinities we cannot measure size with counting elements -- there are always infinitely many -- but we can try with making mappings between the sets, which does tell us new things. But we are still in a different realm where our traditional language doesn't work and at best we sometimes have only "close enough" terms for things we encounter there.
**Is this of use to a programmer?** Not to a "normal" programmer, in practical programming we basically never deal with true real numbers in all their generality, we just [approximate](approximation.md) them with [floats](float.md) (i.e. rational numbers), though a programmer should definitely at least be aware of all this, this is just very basics of higher math and should be common knowledge to anyone dealing with math in any way. Of course some specialized programming (e.g. symbolic computation) and theoretical computer science will come to deal with this, so there it is a must know.
**Is this of use to a programmer?** Not to a "normal" programmer, in everyday programming we practically never deal with true real numbers in all their glory, we just [approximate](approximation.md) them with [floats](float.md) (i.e. rational numbers), though a programmer should definitely at least be aware of all this, this is just very basics of higher math and should be common knowledge to anyone dealing with math in any way. Of course some specialized programming (e.g. symbolic computation) and theoretical computer science will come to deal with this, so there it is a must know.
Here is a **[proof](proof.md)** by contradiction of not being able to create an ordered list of real numbers, by so called *diagonalization*. Let us only consider (without loss of generality) real numbers between 0 and 1, written in [binary](binary.md), i.e. numbers written only with digits 0 and 1 that always start with `0.`. Suppose we have found ordering of ALL real numbers in which real numbers go one after another like this: *R1*, *R2*, *R3* etc., each *RN* having the digits (after `0.`) *RN_1*, *RN_2*, *RN_3* etc. We can write these numbers into a table that expands infinitely to the right and bottom:
Here is a **[proof](proof.md)** by contradiction of the impossibility to order real numbers, by so called *diagonalization*. Let us only consider (without loss of generality) real numbers on the interval 0 to 1, written in [binary](binary.md), i.e. numbers written only with digits 0 and 1 that always start with `0.`. Suppose we have found ordering of ALL real numbers wherein real numbers go one after another like this: *R1*, *R2*, *R3* etc., each *RN* having the digits (after `0.`) *RN_1*, *RN_2*, *RN_3* etc. We can write these numbers into a table that expands infinitely to the right and bottom:
| number | digit 1 | digit 2 | digit 3 | digit 4 | ... |