http://www.sw.it.aoyama.ac.jp/2013/Math1/lecture2.html
© 2005-13 Martin J. Dürst 青山学院大学
(資料: Georges Ifrah: The Universal History of Numbers, John Wiley & Sons, 1998)
(ペアノの公理; Peano Axioms; Guiseppe Peano, 1858-1932)
(現在は 1 のではなく 0 からのスタートが普通)
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)))))) |
... | ... |
公理 (Axiom):
2 + 3 をペアノ風で計算:
足算の結合律: (a + b) + c = a + (b + c)
c = 1 の場合: (a + b) + 1 = s(a + b) = a + s(b) = a + (b + 1)
c = k+1 の場合 (c = k の場合を前提に):
(a + b) + k = a + (b + k) ⇒? (a + b) + (k+1) = a + (b + (k+1))
(a + b) + (k+1) = (a +
b) + s(k) = s((a + b) +
k) = s(a + (b + k)) = a
+ s(b + k) = a + ((b +
k) + 1) = a + (b + (k + 1))
Q.E.D.
Exponentiation:
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 three is eight-one.
Modulo operation (remainder):
Twenty modulo six is two.
Twenty-five modulo seven is four.
Number representations before positional notation:
Chinese (Han) numerals: 二百五十六、二千十三
Roman numerals: CCLVI, MMXIII
Example of decimal notation: 256 = 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.56 = 3×101 + 4×100 + 5×10-1 + 6×10-2
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 b, the zeroth power for the rightmost digit.
The power increases by one when moving one position to the left.
Take the number to convert as the first quotient.
Repeatedly take the quotient of the previous division, and divide it by the base b,
adding the remainder as a digit to the result from right to left.
dividend | quotient | remainder | digits of the result |
---|---|---|---|
23 | |||
23 | 11 | 1 | 1 |
11 | 5 | 1 | 11 |
5 | 2 | 1 | 111 |
2 | 1 | 0 | 0111 |
1 | 0 | 1 | 10111 |
23 divided by 2 is 11 remainder 1
11 divided by 2 is 5 remainder 1
5 divided by 2 is 2 remainder 1
2 divided by 2 is 1 remainder 0
1 divided by 2 is 0 remainder 1
23 = 11×21 + 1×20
= 5×22 + 1×21 + 1×20
= 2×23 + 1×22 + 1×21 + 1×20
= 1×24 + 0×23 + 1×22 + 1×21 +
1×20 = 10111
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
1AF = 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 |
base | name (adjective) and abbreviation | (reason for) use | constants in programming languages |
---|---|---|---|
2 | binary, bin | used widely in logic and circuits | 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 | 8 | 16 |
---|---|---|---|
0 | 0000 | 0 | 0 |
1 | 0001 | 1 | 1 |
2 | 0010 | 2 | 2 |
3 | 0011 | 3 | 3 |
4 | 0100 | 4 | 4 |
5 | 0101 | 5 | 5 |
6 | 0110 | 6 | 6 |
7 | 0111 | 7 | 7 |
8 | 1000 | 10 | 8 |
9 | 1001 | 11 | 9 |
10 | 1010 | 12 | A |
11 | 1011 | 13 | B |
12 | 1100 | 14 | C |
13 | 1101 | 15 | D |
14 | 1110 | 16 | E |
15 | 1111 | 17 | F |
16 | 10000 | 20 | 10 |
n | 2n | 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 | 1024 ≈103 (kilo) | 400 |
11 | 2048 | 800 |
12 | 4096 | 1000 |
16 | 65536 | 10000 |
20 | 1048576 ≈ 106 (mega) | 100000 |
30 | 1073741824 ≈ 109 (giga) | 40000000 |
40 | 1099511627776 ≈ 1012 (tera) | 10000000000 |
Q: Why do computer scientist always think Christmas and Halloween are the same ?
質問: なぜ情報テクノロジーの専門家はクリスマスとハロウィーンをいつも誤解するか。
質問: 情報テクノロジーで還暦は何歳か