Professional Documents
Culture Documents
Department of ISE
Faculty of Computing - SLIIT
1 Mathematical Objects
Mathematical symbol: Z
Numbers such as -3,-1,0,10,2000,...
(Almost) most natural mathematical object
Good for computer arithmetic, if not too big
Surprisingly difficult to prove mathematical properties
(Proving is for mathematicians)
Number theory = "Queen of mathematics"
Believed to be without serious applications, before the invention of
cryptography
Will need large numbers for good security
Rational numbers: Fractions
Maths Introduction 3 / 36
Number systems
1 Mathematical Objects
x y x AND y x OR y x ⊕y x⇒y x ⇔y
0 0 0 0 0 1 1
0 1 0 1 1 1 0
1 0 0 1 1 0 0
1 1 1 1 0 1 1
Compute
17 mod 5
343 mod 2
0 mod 77
97 mod 98
98 mod 97
−4 mod 6
Compute
5 + 7 mod 10
1 + 1 mod 2
1 − 1 mod 2
4 ∗7 mod 27
147 mod 13
with αi , βi ≥ 0, pi prime.
Then Y
gcd(a, b) = pmin(α i ,βi ).
i
Let a, n be integers
The inverse of a modulo n is an integer x such that ax = 1 mod n
Also write: a− 1 mod n
Note: inverse does not always exist Fact:
inverse of a exists ⇔gcd(a, n) = 1 Of
course, then also xa = 1 mod n
Example:
a = 3, n = 20
The inverse of a is x = 7 since 3 ∗7 = 21 = 1 mod 20
Of course, also 7 ∗3 = 1 mod 20
How can inverse be computed?
From multiplication table
Try and error
Extended Euclidean Algorithm
ua + vb = gcd(a, b)
1 Mathematical Objects
Hint: Use Euler’s theorem and the fact that φ(nm) = φ(n)φ(m).