(整数の表現)
http://www.sw.it.aoyama.ac.jp/2018/Math1/lecture2.html
© 2005-18 Martin J. Dürst Aoyama Gakuin University
The video of the first lecture is available via a link from Moodle.
The video application is widely supported. Please contact me if you have problems with your OS or browser.
Userid and password are the same as for other Aoyama websites.
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.
(Georges Ifrah: The Universal History of Numbers, John Wiley & Sons, 1998)
Peano Axioms (Guiseppe Peano, 1858-1932)
(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)
ℕ: 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)
1 | 1 |
2 | s(1) |
3 | s(s(1)) |
4 | s(s(s(1))) |
5 | s(s(s(s(1)))) |
6 | s(s(s(s(s(1))))) |
7 | s(s(s(s(s(s(1)))))) |
... | ... |
Axioms of addition:
Calculate 2 + 3 using Peano arithmetic:
(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:
Counterexamples:
What we want to prove:
Associative law for addition: (d + e) + f = d + (e + f)
Let's prove this for all values of f.
(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+k2018 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)]
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.
Twenty modulo six is two.
Twenty-five modulo seven is four.
(written "25 % 7
" in C and many other programming languages,
"25 mod 7" in Mathematics)
Number representations before positional notation:
Chinese (Han) numerals: 二百五十六、二千十七
Roman numerals: CCLVI, MMXVII
Example of decimal notation:
25610 = 2·102 + 5·101 + 6·100
Example containing 0: 206 = 2·102 + 0·101 + 6·100
Generalization: dn...d1d0 = dn·10n+...+d1·101+d0·100
Example with decimal point:
34.5610 = 3·101 + 4·100 + 5·10-1
+ 6·10-2
(the base of a number is often given as a subscript)
10100112 = 1·26 + 0·25 + 1·24 + 0·23 + 0·22 + 1·21 + 1·20 =
1·64 + 0·32 + 1·16 + 0·8 + 0·4 + 1·2 + 1·1 =
64 + 16 + 2 + 1 = 83
Calculate the sum of each of the digits multiplied by its positional weight.
The positional weight is a power of the base b, the 0th power for the rightmost digit.
The power increases by one when moving one position to the left.
dn...d1d0 (in base b) = dn·bn+...+d1·b1+d0·b0
Take the number to convert as the first quotient.
Repeatedly:
dividend | divisor | quotient | remainder | digits of the result |
---|---|---|---|---|
65↙ | ||||
65 | 3 | 21↙ | 2↑ | 2 |
21 | 3 | 7↙ | 0↑ | 02 |
7 | 3 | 2↙ | 1↑ | 102 |
2 | 3 | 0→done! | 2↑ | 2102 |
65 divided by 3 is 21 remainder 2
21 divided by 3 is 7 remainder 0
7 divided by 3 is 2 remainder 1
2 divided by 3 is 0 remainder 2
65 = 65·30
= 21·31 + 2·30
= 7·32 + 0·31 + 2·30
= 2·33 + 1·32 +
0·31 + 2·30 =
21023
Using Horner's rule: 65 = (((2×3 + 1)×3 + 0)×3 + 2)
left operand | operator | right operand | result | |
---|---|---|---|---|
Addition | augend (also: summand or addend) | + | addend (also: summand) | sum |
Subtraction | minuend | - | subtrahend | difference |
Multiplication | multiplicand (also: factor) | ×, ·, * , nothing |
multiplier (also: factor) | product |
Division | dividend | ÷, / | divisor | quotient |
Modulo operation | dividend | mod, % |
divisor | remainder |
Exponentiation | base | superscript, ^ , ** |
exponent | power |
dividend | divisor | quotient | remainder | digits of the result |
---|---|---|---|---|
65↙ | ||||
65 | 27 | 2↓ | 11↙ | 2 |
11 | 9 | 1↓ | 2↙ | 21 |
2 | 3 | 0↓ | 2↙ | 210 |
2 | 1 | 2↓ | 0→done! | 2102 |
Convert 47623 (base 8) to base 4.
8 = 23, 4 = 22, therefore convert base 8 → base 2 → base 4
476238 →
4 | 7 | 6 | 2 | 3 | base 8 |
100 | 111 | 110 | 010 | 011 | convert each base-8 digit to three base-2 digits |
1001111100100112
1 | 00 | 11 | 11 | 10 | 01 | 00 | 11 | split base 2 into groups of two digits |
1 | 0 | 3 | 3 | 2 | 1 | 0 | 3 | convert two base-2 digits to one base-4 digit |
→ 103321034
1AF16 = 1×162 + A×161 + F×160 = 1×256 + 10×16 + 15×1 = 256 + 160 + 15 = 431
digit (upper case) | digit (lower case) | value (decimal) |
A | a | 10 |
B | b | 11 |
C | c | 12 |
D | d | 13 |
E | e | 14 |
F | f | 15 |
The number of different digits in base b is b.
The lowest digit is 0, the highest digit is b-1.
Base | Number of Digits | Lowest Digit | Highest Digit | Digits |
2 | 2 | 0 | 1 | 0, 1 |
3 | 3 | 0 | 2 | 0, 1, 2 |
4 | 4 | 0 | 3 | 0, 1, 2, 3 |
5 | 5 | 0 | 4 | 0, 1, 2, 3, 4 |
8 | 8 | 0 | 7 | 0, 1, 2, 3, 4, 5, 6, 7 |
10 | 10 | 0 | 9 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 |
12 | 12 | 0 | B (11) | 0123456789 A B |
16 | 16 | 0 | F (15) | 0123456789 A B C D E F |
22 | 22 | 0 | L (21) | 0123456789 ABCDEFGHIJ KL |
base | name (adjective) and abbreviation | (reason for) use | constants in programming languages |
---|---|---|---|
2 | binary, bin | used widely in logic and circuits (hardware) | 0b101100 (Ruby,...) |
8 | octal, oct | shortened form of binary (rare these days) | 024570 (C and many others) |
10 | decimal, dec | for humans | 1234567 (all languages) |
16 | hexadecimal, hex | shortened form of binary, 1 byte (8bits) can be represented with two digits | 0xA3b5 (C and many others) |
10 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 16 |
---|---|---|---|---|---|---|---|---|---|
0 | 0000 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1 | 0001 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
2 | 0010 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
3 | 0011 | 10 | 3 | 3 | 3 | 3 | 3 | 3 | 3 |
4 | 0100 | 11 | 10 | 4 | 4 | 4 | 4 | 4 | 4 |
5 | 0101 | 12 | 11 | 10 | 5 | 5 | 5 | 5 | 5 |
6 | 0110 | 20 | 12 | 11 | 10 | 6 | 6 | 6 | 6 |
7 | 0111 | 21 | 13 | 12 | 11 | 10 | 7 | 7 | 7 |
8 | 1000 | 22 | 20 | 13 | 12 | 11 | 10 | 8 | 8 |
9 | 1001 | 100 | 21 | 14 | 13 | 12 | 11 | 10 | 9 |
10 | 1010 | 101 | 22 | 20 | 14 | 13 | 12 | 11 | A/a |
11 | 1011 | 102 | 23 | 21 | 15 | 14 | 13 | 12 | B/b |
12 | 1100 | 110 | 20 | 22 | 20 | 15 | 14 | 13 | C/c |
13 | 1101 | 111 | 21 | 23 | 21 | 16 | 15 | 14 | D/d |
14 | 1110 | 112 | 22 | 24 | 22 | 20 | 16 | 15 | E/e |
15 | 1111 | 120 | 23 | 30 | 23 | 21 | 17 | 16 | F/f |
16 | 10000 | 121 | 100 | 31 | 24 | 22 | 20 | 17 | 10 |
n | 2n | in base 16 |
---|---|---|
0 | 1 | 1 |
1 | 2 | 2 |
2 | 4 | 4 |
3 | 8 | 8 |
4 | 16 | 10 |
5 | 32 | 20 |
6 | 64 | 40 |
7 | 128 | 80 |
8 | 256 | 100 |
9 | 512 | 200 |
10 | 1'024 ≈103 (kilo) | 400 |
11 | 2'048 (the game) | 800 |
12 | 4'096 | 1000 |
16 | 65'536 | 1'0000 |
20 | 1'048'576 ≈ 106 (mega) | 10'0000 |
30 | 1'073'741'824 ≈ 109 (giga) | 4000'0000 |
40 | 1'099'511'627'776 ≈ 1012 (tera) | 100'0000'0000 |
Question: Why do computer scientist always think Christmas and Halloween are
the same?
(Hint: In the USA, Halloween is October 31st only)
Your answer:
Question: At what age do Information Technologists celebrate "Kanreki" (還暦)
Your answer: