If a is a natural number, then s(a) is a
natural number (s(a) is read "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)
=: Equality (a = b: a is equal to
b)
≠: Inequality (a ≠ b: a is not equal to
b)
→: Implication (a → b: If a, then
b, or: a implies b)
If a is a natural number, then a + 1 =
s(a)
(a∈ℕ ⇒ a + 1 = s(a))
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 an 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:
(AB)C =
A(BC)
Counterexamples:
Subtraction of (natural) numbers is not associative:
((a-b) - c ≠ a -
(b-c))
Exponentiation is not associative:
(ab)c≠
a(bc)
Proof of Associativity of Addition using Peano Axioms
What we want to prove:
Associative law for addition: (d+e) + h =
d + (e+h)
Let's prove this for all values of h.
Let's distinguish two cases: h=1 and
h=k+1
If h = 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]
Proof of Associativity (continued)
Assuming that associativity holds for h = k
(i.e. (d+e) + k = d +
(e+k)),
let's prove associativity for h = 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
h=1, with e for d and k for
e]
Q.E.D. [using the 5th Peano axiom, with h for a and
the property (d+e) + h = d +
(e+h)]
Comments on Proof
We have to be careful that we only use axioms, not any
'general knowledge'.
Proofs include two aspects:
Originality (human imagination)
Mechanics (careful execution or automated proof checking)
Because we have not yet established associativity, we always have to use
parentheses.
Once we have proven 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
This is called the axiomatic method
The less axioms and the more interesting theorems, the better
(from a mathematical viewpoint)
What Mathematicians Do
Identify objects (example: natural numbers)
Identify operations between objects (example: addition)
Define axioms (example: Peano axioms)
Identify and prove properties and theorems (example: associativity of
addition)
The Discovery of 0
The latest (natural/integer) number (and numeral) discovered by
humans
Used as a placeholder in sexagesimal (base 60) number system by the
Babylonians
Base Conversion: Base 10 to Base b (second method)
Start with the number to convert (a) as the first remainder.
Start with an empty list of result digits.
Determine the first exponent n so that
bn ≦ a <
bn+1
Repeatedly, as long as the exponent is ≧0:
Take the remainder of the previous division as the
dividend
Divide that dividend by bn, then
by bn-1, and so on
Add the quotient of the division as a digit to the right
of the previous result digits
Base 10 to Base b (second method), Example
Example: Convert 65 to base 3: 33 ≦ 65 <
34 ⇒ n=3
dividend
exponent
divisor
quotient
remainder
digits of the result
4 (=n+1)
34=81
65↙
(empty)
65
3 (=n)
33=27
2↓
11↙
2
11
2
32=9
1↓
2↙
21
2
1
31=3
0↓
2↙
210
2
0→done!
30=1
2↓
0
2102
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
Alternate method (not recommended, very difficult for humans): Calculate
in base b or base c instead of base 10
Shortcut 1: If b is a power of c (b =
cn) or the other way around (c
= bn), then convert the digits in
groups
Example 1: base 3 → base 9 (32 = 9, therefore make groups of 2
digits and convert to a single digit)
Example 2: base 8 → base 2 (8 = 23, therefore convert each
digit to a group of 3 digits)
Shortcut 2: If both b and c are powers of
d (b = dn,
c=dm), 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 476238 to base 4.
8 = 23, 4 = 22, therefore convert base 8 → base 2
→ base 4
476238 →
base 8
4
7
6
2
3
convert each base-8 digit to 3 base-2 digits
100
111
110
010
011
1001111100100112
split base 2 into groups of 2 digits (start at the right)
1
00
11
11
10
01
00
11
convert two base-2 digits to one base-4 digit
1
0
3
3
2
1
0
3
→ 103321034
Addition in Different Numeral Systems
Works the same as in the decimal system:
Progress from least signifinant digit to more significant digits
Question: Why do computer scientist always think Christmas and Halloween are
the same?
(Hint: In the USA, Halloween is October 31st only)
Your answer:
Second Joke
Question: At what age do Information Technologists celebrate "Kanreki"
(還暦)
Your answer:
Summary of This Lecture
The history of numbers starts with the natural numbers 1, 2, 3,...
Across different cultures, the numerals for 1, 2, 3,... and 10, 20,...
look similar
Peano created a set of 5 axioms using "1" and "successor" only
These axioms form a base for arithmetic on natural numbers
The numeral 0 was discovered very late.
It is important in positional number representation.
Positional number representation can use various bases, and these bases
can be converted
In Information Technology, the bases 2, (8,) 10, and 16 are used
This Week's Homework
Solve Arithmetic
and Base Conversion (repeat until you get it 100% correct; deadline:
Thursday, October 1, 22:00, 15 minutes time limit for each
attempt)
Learn binary and hexadecimal numbers up to 16, and powers of 2 up to
212
Try to find an answer to the joke questions (no need to submit)
Use highschool texts or the Web to refresh your knowledge about
propositions, logic, and functions