Review decimal number representation, binary number representation, and
n-ary number representation based on high-school notes and Web
resources
Check out/buy/lend a textbook or reference book
Problems with Moodle Registration
Wrong name (Latin letters),...: Click on your name in the upper left
corner, then choose Settings → My profile settings → Edit Profile
(exception: username)
Account not created? Just try to log in, anyway
Enrollment key:
Not yet enrolled: Enrollment open again; deadline: Sept. 22 (today!),
22:00
(if you miss that, come to my office on Monday)
First quiz not completed: Do your best for the rest of the course!
Special problems: Talk to me after this lecture
How to Watch Videos
The video of the first lecture is available via a link from Moodle.
The video plugin/application is widely supported. Please contact me if you
have problems with your OS or browser.
Userid and password are available on the Moodle course page.
They are the same for all students, but only for students of this lecture!
Please use the video soon to review the lecture.
Please be careful when watching the video on a mobile device (may be
expensive!).
The video can be watched at different speeds, and you can jump easily to the
next slide.
History of Numbers and Numerals
(Georges Ifrah: The Universal History of Numbers, John Wiley
& Sons, 1998)
Humans have used many different representations of numbers throughout
history
The first number represented was 1
Representations such as |, ||, |||,... are most frequent
For bigger numbers, using groups of 10 is most frequent
(20 (French 80: quatre-vingt=4-20) and 60 (minutes, seconds) also exist
The Shape of Numerals
Chinese numerals: 一、二、三、亖
Roman numerals: I, II, III, IIII (or IV)
(Arabic-)Indic numerals: ١, ٢, ٣ (used in
Arabic)
(European-)Arabic numerals: 1, 2, 3
Chinese numerals: 十、廿、...
Roman numerals: X, XX,...
Creating the Natural Numbers Starting with 1
Peano Axioms (Guiseppe Peano, 1858-1932)
1 is a natural number
(1∈ℕ)
If a is a natural number, then s(a) is a
natural number (s(a) is the successor of
a)
(a∈ℕ ⇒ s(a)∈ℕ)
There is no natural number x so that
s(x) = 1
If two natural numbers are different, then their successors are
different
(a∈ℕ, b∈ℕ, a ≠ b ⇒
s(a) ≠ s(b))
If we can prove a property for 1,
and we can prove, for any natural number a, that if a
has this property then s(a) also has this
property,
then all natural numbers have this property.
(Nowadays, it is usual to start natural numbers with 0 rather than with
1.)
(We will learn how to express axioms 3 and 5 as formulæ in the lesson about
Predicate Logic)
Symbols Used
ℕ: The set of natural numbers
∈: Set membership (a ∈ B: a is an
element of set B)
If a and b are natural numbers, a +
s(b) = s(a + b)
(a∈ℕ, b∈ℕ ⇒ a + s(b)
= s(a + b))
Calculate 2 + 3 using Peano arithmetic:
Associative Law
(associative property)
A binary operation (represented by operator △) is associative if and only
if for all operands a, b, and c:
(a△b) △ c = a △
(b△c)
Examples:
Addition of (natural) numbers is associative.
((a+b) + c = a +
(b+c))
Multiplication of (natural) numbers is associative.
((a·b) · c = a ·
(b·c))
Multiplication of matrices is associative.
Counterexamples:
Subtraction of (natural) numbers
((a-b) - c ≠ a -
(b-c))
Exponentiation
((ab)c≠
a(bc))
Proof of Associativity of Addition using Peano Axioms
What we want to prove:
Associative law for addition: (d + e) + f =
d + (e + f)
Let's prove this for all values of f.
Let's distinguish two cases: f=1 and
f=k+1
If f = 1, then (d + e) + 1 = s(d + e) [by
the 1st axiom of addition, with (d+e) for
a]
= d + s(e) [by the 2nd axiom of addition, with
d for a and e for b]
= d + (e + 1) [by the 1st axiom of addition,
backwards, with e for a]
Assuming that associativity holds for f = k (i.e.
(d + e) + k = d + (e
+ k)),
let's prove associativity for f = k+1, i.e let's
prove
(d + e) + k = d + (e
+ k) ⇒ (d + e) +
(k+1) = d + (e + (k+1)):
(d + e) + (k+1) = (d +
e) + s(k) [by the 1st axiom of addition, with
k for a]
= s((d + e) + k) [by the 2nd axiom of
addition, with (d+e) for a and k for
b]
= s(d + (e + k)) [using the assumption]
= d + s(e + k) [by the 2nd
axiom of addition, backwards, with d for a and
(e+k) for b]
= d + ((e + k) + 1) [by the 1st axiom of
addition, with (e+k) for a]
= d + (e + (k + 1)) [using the case
f=1, with e for d and k for
e]
Q.E.D. [using the 5th Peano axiom, with f for a and
the property (d + e) + f = d +
(e + f)]
Comments on Proof
We have to be careful that we are only using the axioms, not any 'general
knowledge'.
Proofs include two aspects:
Originality (human imagination)
Mechanics (e.g. automated proof checking)
Because we have not yet established associativity, we always have to use
parentheses.
Once we have proved associativity, we can eliminate the parentheses.
This proof uses mathematical induction.
Peano Axiom 5 can be seen as the basis for mathematical
induction.
We will look at mathematical induction more closely later.
Comments on Axioms
Mathematics tries to start with very few facts or rules
These are usually called axioms
The axioms should be self-evident
Other facts and rules (theorems) are deduced from the axioms using
proofs
The less axioms and the more interesting theorems, the better (from a
mathematical viewpoint)
The Discovery of 0
The latest (natural/integer) number discovered by humans
Discovered around 800 A.D. in India
Discovery spread West to Arabia and Europe, Easts to China and Japan
0 is very important for positional notations such as decimal,
binary,...
More Arithmetic Operations
Exponentiation (e.g. 23)
Two raised to the power of three is eight.
Two to the power of three is eight.
Two to the three (third) is eight.
The third power of two is eight.
Five to the power of four is six hundred
twenty-five.
Three raised to the power of four is eight-one.
Modulo operation (remainder)
Twenty modulo six is two.
Twenty-five modulo seven is four.
Positional Notation: Decimal Notation
Number representations before positional notation:
Chinese (Han) numerals: 二百五十六、二千十七
Roman numerals: CCLVI, MMXVII
Example of decimal notation:
256 = 2·102 + 5·101 + 6·100
Base Conversion: Base 10 to Base b (second method)
It is possible to start from the most significant digit
When starting with a, first find n so that
bn+1 > a ≧
bn
Divide by bn, then by
bn-1, and so on
dividend
divisor
quotient
remainder
digits of the result
23↙
23
16
1↓
7↙
1
7
8
0↓
7↙
10
7
4
1↓
3↙
101
3
2
1↓
1↙
1011
1
1
1↓
0↙
10111
Base Conversion: Base b to Base c
General method: Convert via base 10
base b → base 10 → base c
Example: base 3 → base 10 → base 5
Shortcut 1: If b is a power of c (or the other way
round), then convert the digits in groups
Example 1: base 3 → base 9 (9 is 32, therefore make groups of
two digits and convert to a single digit)
Example 2: base 8 → base 2 (8 is 23, therefore convert each
digit to a group of three digits)
Shortcut 2: If both b and c are powers of
d, then convert via base d
Example: base 4 → base 8
because 4 = 22 and 8 = 23, d = 2
therefore, convert base 4 → base 2 → base 8 (use shortcut 1 two
times)
Base Conversion Shortcut Example
Convert 47623 (base 8) to base 4.
8 = 23, 4 = 22, therefore convert base 8 → base 2
→ base 4