The commonly known rational numbers (fractions) are not sufficient for a rigorous foundation of mathematical analysis. The historical development shows that for issues concerning analysis, the rational numbers have to be extended to the real numbers. For clarity we introduce the real numbers as decimal numbers with an infinite number of decimal places. We illustrate exemplarily how the rules of calculation and the order relation extend from the rational to the real numbers in a natural way.
A further section is dedicated to floating point numbers, which are implemented in most programming languages as approximations to the real numbers. In particular, we will discuss optimal rounding and in connection with this the relative machine accuracy.
1.1 The Real Numbers







Let M
and N be arbitrary sets. A
mapping from
M to N is a rule which assigns to each element
in M exactly one element in
N.1 A mapping is called
bijective , if for each
element there exists exactly one element in M which is assigned to n.
Definition 1.1
Two sets M and N have the
same cardinality if there exists a bijective mapping between
these sets. A set M is called
countably infinite if it has
the same cardinality as .









The real line




Diagonal in the unit square
Proposition 1.2
.
Proof
This statement is proven indirectly.
Assume that were rational. Then
can be represented as a reduced
fraction
. Squaring this equation gives
and thus
would be an even number. This is only
possible if k itself is an even
number, so
. If we substitute this into the above
we obtain
which simplifies to
. Consequently n would also be even which is in
contradiction to the initial assumption that the fraction
was reduced.



In the following we will take up a pragmatic point of view and construct the missing numbers as decimals.
Definition 1.3




Proposition 1.4
(Representing rational numbers as decimals) Each rational number can be written as a finite or periodic decimal.
Proof
Let and consequently
with
and
. One obtains the representation of
q as a decimal by successive
division with remainder. Since the remainder
always fulfils the condition
, the remainder will be zero or
periodic after a maximum of n
iterations.
Example 1.5
Let us take as an example. Successive division
with remainder shows that
with remainders
5, 1, 3, 2,
The period of this decimal is
six.
Each nonzero decimal with a finite
number of decimal places can be written as a periodic decimal (with
an infinite number of decimal places). To this end one diminishes
the last nonzero digit by one and then fills the remaining
infinitely many decimal places with the digit 9. For example, the
fraction becomes periodic after the third
decimal place. In this way
can be considered as the set of all
decimals which turn periodic from a certain number of decimal
places onwards.
Definition 1.6







Proposition 1.7
The set is not countable and has therefore
higher cardinality than
.
Proof











Babylonian cuneiform inscription YBC 7289
(Yale Babylonian Collection, with authorisation) from 1900 before
our time with a translation of the inscription according
to [1]. It represents a square with side length 30 and
diagonals 42; 25, 35. The ratio is
1.2 Order
Relation and Arithmetic on 
In the following we write real numbers (uniquely) as decimals with an infinite number of decimal places, for example, we write 0.2999... instead of 0.3.
Definition 1.8
(Order relation) Let
and
be non-negative real numbers in
decimal form, i.e.
.
- (a)
One says that a is less than or equal to b (and writes
), if
or if there is an index
such that
and
for
.
- (b)
Furthermore one stipulates that always
and sets
whenever
.
This definition extends the known orders
of and
to
. The interpretation of the order
relation
on the real line is as follows:
holds true, if a is to the left of b on the real line, or
.










Addition and multiplication can be
carried over from to
in a similar way. Graphically one
uses the fact that each real number corresponds to a segment on the
real line. One thus defines the addition of real numbers as the
addition of the respective segments.










Proposition 1.9


Note that does not imply
. For example
, but nonetheless
. However, for
it always holds that
.
Definition 1.10

![$$\begin{aligned}{}[a, b]= & {} \{x \in \mathbb {R}\;;\; a \le x \le b\} \quad \text {closed interval;} \\ (a, b]= & {} \{x \in \mathbb {R}\;;\; a< x \le b\} \quad \text {left half-open interval;}\\\left[ a, b\right)= & {} \{x \in \mathbb {R}\;;\; a \le x< b\} \quad \text {right half-open interval;}\\ (a, b)= & {} \{x \in \mathbb {R}\;;\; a< x < b\} \quad \text {open interval.} \end{aligned}$$](/epubstore/O/M-Oberguggenberger/Analysis-For-Computer-Scientists/OEBPS/images/215236_2_En_1_Chapter/215236_2_En_1_Chapter_TeX_Equ11.png)

The intervals (a, b), [c, d] and (e, f] on the real line







Definition 1.11

As an application of the properties of the order relation given in Proposition 1.9 we exemplarily solve some inequalities.
Example 1.12






Example 1.13




![$$ S=\{x \in \mathbb {R}\;;\; x\ge 3 \text { or } x\le -1\} = (-\infty ,-1]\cup [3,\infty ). $$](/epubstore/O/M-Oberguggenberger/Analysis-For-Computer-Scientists/OEBPS/images/215236_2_En_1_Chapter/215236_2_En_1_Chapter_TeX_Equ21.png)
1.3 Machine Numbers
The real numbers can be realised only
partially on a computer. In exact arithmetic, like for
example in maple, real numbers are
treated as symbolic expressions, e.g. . With the help of the command
evalf they
can be evaluated, exact to many decimal places.












Floating point numbers on the real line









1.4 Rounding











Definition 1.14
The number is called relative machine accuracy.
The following proposition is an important application of this concept.
Proposition 1.15




Proof



Experiment 1.16




1.5 Exercises
- 1.
-
Show that
is irrational.
- 2.
-
Prove the triangle inequality
.
Hint. a and b have either the same or different signs.
- 3.
-
Sketch the following subsets of the real line:
(for
,
). Convince yourself that
is the set of points of distance less than r to the point a.
- 4.
-
Solve the following inequalities by hand as well as with maple (using solve). State the solution set in interval notation.
- 5.
-
Determine the solution set of the inequality
- 6.
-
Sketch the regions in the (x, y)-plane which are given by
Hint. Consult Sects. A.1 and A.6 for basic plane geometry.
- 7.
-
Compute the binary representation of the floating point number
in single precision IEEE arithmetic.
- 8.
-
Experimentally determine the relative machine accuracy eps.
Hint. Write a computer program in your programming language of choice which calculates the smallest machine number z such that
.