Escolar Documentos
Profissional Documentos
Cultura Documentos
uwe.wystup@mathfinance.com
February 2010
1
Uwe Wystup - Highlights of Computing 2
Contents
1 Numeral Systems 3
1.1 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Vedic Mathematics 4
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.1 The 16 Sutras . . . . . . . . . . . . . . . . . . . . . . . 5
2.1.2 Jagadguru Swami Sri Bharati Krsna Tirthaji Maharaja 6
2.2 Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.4 Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.4.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.5 Divisibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.5.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.6 Square Roots (Vargamula) . . . . . . . . . . . . . . . . . . . . 14
2.6.1 Duplex Process (Dvandvayoga) . . . . . . . . . . . . . 15
2.6.2 Square Root of a Perfect Square . . . . . . . . . . . . . 15
2.6.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4 Credit Cards 21
4.1 The Luhn Algorithm . . . . . . . . . . . . . . . . . . . . . . . 22
4.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5 Cryptography 24
5.1 The Inventors of the RSA-Algorithm (1978) . . . . . . . . . . 24
5.2 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.4 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6 Definitions 28
6.1 Prime Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.2 Modulus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Uwe Wystup - Highlights of Computing 3
7 Contact Information 29
1. Numeral Systems
2. Vedic Mathematics
4. Credit Cards
5. Cryptography
6. Definitions
1 Numeral Systems
• Fundamentals: Any integer has a unique representation as a weighted
sum of powers of a chosen base.
• More on http://en.wikipedia.org/wiki/Numeral_system
1.1 Exercise
Write the hexadecimal number CAF E in the dual, decimal and Maya number
system.
Uwe Wystup - Highlights of Computing 4
2 Vedic Mathematics
1. Introduction
2. Multiplication
3. Squares
4. Division
5. Divisibility
6. Square Roots
2.1 Introduction
veda (Sanskrit) means: knowledge
Veda Upaveda
Rigveda Ayurveda
Samaveda Gandharvaveda
Yajurveda Dhanurveda
Atharvaveda Sthapatyaveda
9. Differential calculus
2.2 Multiplication
Example with working base 10:
9 - 1 7 - 3 13 + 3 12 + 2
× × × ×
7 - 3 6 - 4 12 + 2 8 - 2
6 / 3 3 /1 2 15 / 6 10 / 4̄
= 63 = 42 = 156 = 96
91 - 9 111 + 11 108 + 8
× × ×
96 - 4 109 + 9 97 - 3
87 / 36 120 / 99 105 / ¯
24
= 8736 = 12099 = 10476
100/2=50 100/2=50
49 - 1 54 + 4
× ×
49 - 1 46 - 4
2)48 / 01 2)50 / 1̄6̄
24 / 01 25 / 1̄6̄
= 2401 = 2484
2.2.1 Exercises
Multiply the following
a 94 × 94
b 97 × 89
c 87 × 99
d 87 × 98
e 87 × 95
f 95 × 95
g 79 × 96
h 98 × 96
i 92 × 99
j 88 × 88
k 97 × 56
l 97 × 63
m 92 × 196
Uwe Wystup - Highlights of Computing 9
a 667 × 998
b 768 × 997
c 989 × 998
d 885 × 997
e 883 × 998
f 8×6
g 891 × 989
h 8888 × 9996
i 6999 × 9997
j 90909 × 99994
k 78989 × 99997
l 9876 × 9989
Uwe Wystup - Highlights of Computing 10
a 133 × 103
b 107 × 108
c 171 × 101
d 102 × 104
e 132 × 102
f 14 × 12
g 18 × 13
h 1222 × 1003
i 1051 × 1007
j 15111 × 10003
k 125 × 105
l 10607 × 10008
2.3 Squares
Using the sutra Ekadhikena Purvena (“by one more than the previous one”) we
get
2.3.1 Exercises
Multiply the following mentally
a 652
b 852
c 0.52
d 7.52
e 0.02252
f 10502
g 1752
2.4 Division
• Lots of tricks are available. We do only some highlights.
1
• Find the exact decimal representation of 19
.
. 0 5 2 6 3 1 5 7 8 / 9 4 7 3 6 8 4 2 1
1 1 1 1 1 1 1 1 1
Uwe Wystup - Highlights of Computing 12
. 0 5 2 6 3 1 5 7 8
+ 9 4 7 3 6 8 4 2 1
= 9 9 9 9 9 9 9 9 9
1
• The same works for all periodic decimals, e.g. 7
. 1 4 2
+ 8 5 7
= 9 9 9
2.4.1 Exercises
Compute the exact decimal number of
1
a 29
1
b 49
Uwe Wystup - Highlights of Computing 13
2.5 Divisibility
• Use Ekadhika as an osculator.
• For 3, 13, 23, 33 etc. multiply them by 3 and you get 1, 4, 7, 10, etc. as
the Ekadhikas.
• For 7, 17, 27, 37 etc. multiply them by 7 and you get 5, 12, 19, 26, etc.
as the Ekadhikas.
• For 1, 11, 21, 31 etc. multiply them by 9 and you get 1, 10, 19, 28, etc.
as the Ekadhikas.
• Therefore: yes
2 7 7 4
+ 8
2 8 5
+ 1 0
3 8
+ 1 6
1 9
Uwe Wystup - Highlights of Computing 14
5 2 9 3 2 4 0 0 9 6
139 89 36 131 29 131 19 51 93
• Answer: yes
2.5.1 Exercises
Using the osculation method, check if
a 32896 is divisible by 29
b 93148 is divisible by 29
c 4914 is divisible by 39
d 14061 is divisible by 43
• Squares of complements from 10 have the same last digit; thus 12 and 92
end in 1, 22 and 82 end in 4 etc.
D(4) = 42 = 16 (1)
D(43) = 2 · 4 · 3 = 24 (2)
D(137) = 2 · 1 · 7 + 32 = 23 (3)
D(1034) = 2·1·4+2·0·3=8 (4)
D(10345) = 2 · 1 · 5 + 2 · 0 · 4 + 32 = 19 (5)
Got it?
Group in pairs, taking a single extra digit on the left as extra digit.
1 8 — 4 9
8) 2
4
1 8 — 4 9
8) 2 0
4 3
Now we see 09 and we deduct from this the duplex of the last answer figure 3,
i.e. 09 − D(3) = 09 − 32 = 09 − 9 = 0. This means that the answer is exactly
43.
Uwe Wystup - Highlights of Computing 16
1 3 — 6 9
6) 4
3
1 3 — 6 9
6) 4 4
3 7
2.6.3 Exercises
Find the square root of the following.
a 3136
b 3969
c 5184
d 3721
e 6889
f 1296
Find out how the method extends to 6-digit squares and find the square roof
of the numbers
a 119025
b 524176
c 519841
d 375769
f (x̂) = 0. (6)
Starting with x0 we take the tangent to the curve through the point (x0 , f (x0 ))
and use its intersection with the x-axis x1 as a new starting point. We repeat
this method until no further changes occur. The recursive relation is
f (xn )
xn+1 = xn − (7)
f 0 (xn )
3.1.1 Problems
Problems can occur due to
1. multiple solutions
4. |f 0 | = ∞
5. pathological cases
Uwe Wystup - Highlights of Computing 20
en+1 = xn+1 − x̂
f (xn )
= xn − 0 − x̂
f (xn )
f (xn )
= en − 0
f (xn )
0
en f (xn ) − f (xn )
= (10)
f 0 (xn )
1 f 00 (ξn ) 2 1 f 00 (x̂) 2
en+1 = 0
e n ≈ 0
en = Ce2n (14)
2 f (xn ) 2 f (x̂)
This equation tells us that en+1 is roughly a constant times e2n . This desirable
state of affairs is called quadratic convergence.
Uwe Wystup - Highlights of Computing 21
• The Greek Engineer Heron who lived sometime between 100 B.C. and 100
A.D. had used the recursion
1 R
xn+1 = xn + (15)
2 xn
4 Credit Cards
We follow An Introduction to the Mathematics of Money by Lovelock, Mendel
and Wright [3].
•
9876
|{z} 5432
| 1987
{z 654} |{z}
3 (16)
BIN cardholder ID checksum
• BIN: Bank Identification Number
• More on http://en.wikipedia.org/wiki/Credit_card_numbers
• Luhn algorithm
Uwe Wystup - Highlights of Computing 22
The Luhn algorithm or Luhn formula, also known as the modulus 10 or mod
10 algorithm, is a simple checksum formula used to validate a variety of
identification numbers, such as credit card numbers and Canadian Social
Insurance Numbers.
It was created by IBM scientist Hans Peter Luhn and described in US Patent
2,950,048, filed on January 6, 1954, and granted on August 23, 1960.
Uwe Wystup - Highlights of Computing 23
9876
|{z} 5432
| 1987
{z 654} |{z}
3
BIN cardholder ID checksum
9 8 7 6 5 4 3 2 1
×2 ↓ ×2 ↓ ×2 ↓ ×2 ↓ ×2 ↓
18 8 14 6 10 4 6 2 2
9 8 7 6 5 4 add up
×2 ↓ ×2 ↓ ×2 ↓ digits
9 16 7 12 5 8 82
9876
|{z} 5432
| 1987
{z 654} |{z}
3
BIN cardholder ID checksum
• Add the checksum 3 to the 82 and obtain 85.
• If the new total is divisible by 10, then the credit card number has passed
the validation test.
9876
|{z} 5432
| 1987
{z 654} |{z}
8
BIN cardholder ID checksum
passes.
• Note: Amex has one digit less and starts with the second digit.
Uwe Wystup - Highlights of Computing 24
4.2 Exercises
1. Implement the Luhn-Algorithm in Excel.
3. In your group think of a credit card number and ask another group to
verify it.
4. Does the Luhn Algorithm pick up any incorrect entry of a single digit?
5 Cryptography
1. The Inventors of the RSA-Algorithm
2. Method
3. Examples
4. Exercise
Ronald L. Rivest
Andrew and Erna Viterbi Professor of Electrical Engineering and Computer
Science in MIT’s Department of Electrical Engineering and Computer Science
http://theory.lcs.mit.edu/~rivest/
Adi Shamir
Paul and Marlene Borman Professor of Applied Mathematics at Weizmann
Institute
http://www.weizmann.ac.il/math/profile04/scientists/
shamir-prof04.html
Uwe Wystup - Highlights of Computing 26
http://www.usc.edu/dept/molecular-science/fm-adleman.htm
5.2 Method
We follow Francis Litterio’ instructions on http://world.std.com/~franl/
crypto/rsa-guts.html.
Your public key is the pair (P Q, E). Your private key is the number D
(reveal it to no one). The product P Q is the modulus (often called N in the
literature). E is the public exponent. D is the secret exponent.
You can publish your public key freely, because there are no known easy meth-
ods of calculating D, P , or Q given only (P Q, E) (your public key). If P
and Q are each 1024 bits long, the sun will burn out before the most powerful
computers presently in existence can factor your modulus into P and Q.
5.3 Examples
prime 1 P 5 11 37 61
prime 2 Q 7 7 41 53
public modulus N = PQ 35 77 1517 3233
P −1 4 10 36 60
Q−1 6 6 40 52
(P − 1)(Q − 1) 24 60 1440 3120
public exponent E 5 7 7 17
inverse of E D 5 43 823 2753
check DE 25 301 5761 46801
check DE − 1 24 300 5760 46800
check [DE − 1]/[(P − 1)(Q − 1)] 0 0 0 0
plaintext T 5 6 100 123
encryption function C = T E mod P Q 10 41 1062 855
decryption function T = C D mod P Q 5 6 100 123
Uwe Wystup - Highlights of Computing 28
5.4 Exercise
1. Set up an RSA tool in Excel/VBA and verify the examples.
2. Take two prime numbers P and Q between 100 and 200, e.g. from http:
//primes.utm.edu and compute E and D.
4. Give your public key and the ciphertext to the next group and determine
the plaintext of another group.
6 Definitions
6.1 Prime Numbers
a number that can only be divided evenly by 1 and the number itself.
6.2 Modulus
For integers K, R and N the equation
K = R mod N (17)
N · L + R = K. (18)
Uwe Wystup - Highlights of Computing 29
7 Contact Information
Professor Dr. Uwe Wystup
Ansua Dutta-Wystup
Managing Directors
MathFinance AG
Mainluststraße 4
60329 Frankfurt am Main
Germany
Phone +49-700-MATHFINANCE
More papers are available at
http://www.mathfinance.com/wystup/papers.php
These slides and handouts are available at
http://www.mathfinance.com/seminars/vedic.php
References
[1] Burden, R. L. and Faires, J. D. (1993). Numerical analysis. PWS
Publishing Company.
[5] Rivest, R.L., Shamir, A. and Adleman, L.M. (1978). A Method for
Obtaining Digital Signatures and Public-Key Cryptosystems. Commu-
nications of the ACM 21,2, 120–126.
division, 11, 13
dual system, 3
duplex, 15
dvandvayoga, 15
ekadhika, 13
Luhn algorithm, 22
Maya numerals, 3
modulus, 28
multiplication, 6
Newton’s Method, 18
numeral systems, 3
osculator, 13
prime number, 28
quadratic convergence, 20
RSA-Algorithm, 24
square root, 14
squares, 10
sutras, 5
vedas, 4
30