DS Lecture 10 Number T
DS Lecture 10 Number T
DS Lecture 10 Number T
Lecture 10
Today's Lecture
• Rational Number
• Properties of Rational Numbers
• Irrational numbers
• Absolute values
• Triangular inequality
• Floor and Ceiling functions
• Mod Functions
• Divisibility and Floor
• Mod Congruence
Rational Numbers
A real number r is rational if, and only if, r = a/b for some
integers a and b with b ≠ 0. A real number that is not
rational is irrational.
More formally, r is a rational number ↔ ∃ integers a and
b such that r = a/b, b ≠ 0.
Determine whether following numbers are rational?
a) 10/3
b) -(5/39)
c) 2/0
d) 0.121212121212………
Cont….
a) Yes, 10/3 is quotient of the integers 10 and 3.
b) Yes, -5/39, which is a quotient of the integers.
c) No, 2/0 is not a number (division by 0 is not
allowed)
d) Yes,
2 3
2 =1.41421356237309……
Note: Product of two irrational is not irrational.
2* 2 2
Cont….
Visualizing some irrational numbers .
Absolute Number
For any real number x, the absolute value of x, denoted |
x|, is defined as follows:
x : x 0
| x |
x : x < 0
Examples
|5|= 5, |-4/7|= -(-4/7)=4/7, |0|=0
Absolute Number
Lemma: For all real numbers r, −| r | ≤ r ≤ | r |.
Proof: Suppose r is any real number. We divide into
cases according to whether r ≥ 0 or r < 0.
Case 1: (r ≥ 0): In this case, by definition of absolute
value, |r| = r . Also, since r is positive and −|r | is
negative, −|r | < r . Thus it is true that −|r| ≤ r ≤ |r |.
Case 2: (r<0): both sides by −1 gives that −|r| = r .
Also, since r is negative and |r | is positive ,r < |r |. Thus
it is also true in this case that −|r| ≤ r ≤ |r |.
Hence, in either case,
−|r| ≤ r ≤ |r |
Cont…..
Theorem: For any real number a.
a 2 | a |
Proof:
Since a 2 ( a) 2 ( a) 2 , the number +a and -a are square roots of a 2 .
if a 0, then +a is the non negative square root of a 2 , if a<0, then -a is
the non negative square root of a 2 . Since a 2 denotes the non negative
square root of a 2 , we have a 2 a, if a 0 Also a 2 a, if a < 0
that is a 2 | a |
Triangular Inequality
Theorem: For all real numbers x and y,
|x + y| ≤ |x| + |y|.
Proof: Suppose x and y, are any real numbers.
Case 1: (x + y ≥ 0):
In this case, |x + y| = x + y, x ≤ |x| and y ≤ |y|.
Hence, |x + y| = x + y ≤ |x| + |y|.
Case 2 (x + y<0):
In this case, |x + y| = −(x + y)
and also, −x ≤ |−x| = |x| and −y ≤ |− y| = |y|.
It follows, that
|x + y| = (−x) + (−y) ≤ |x| + |y|.
Hence in both cases |x + y| ≤ |x| + |y|
Floor and Ceiling
Given any real number x, the floor of x, denoted x , is
defined as follows:
a ). 1370 / 40 34.25 34
b). 1370/40 34.25 35
General Values of Floor
If k is an integer, what are k and k 1/ 2 ? Why?
Solution:
n 2k
2 2 k k
Sol:
Mod Congruence's
Let a, b be integers and n be a positive integer. We say
that a is congruent to b modulo n (i.e. a b(mod n) )
iff n | (b-a), implies that there exist some integer k such
that b-a = n·k.
Note: a mod n = b mod n
Which of the following are true?
1. 3 3 (mod 17)
2. 3 -3 (mod 17)
3. 172 177 (mod 5)
4. -13 13 (mod 26)
Cont…
1. 3 3 (mod 17) True: any number is congruent to
itself (3-3 = 0, divisible by all)
2. 3 -3 (mod 17) False: (-3-3) = 6 isn’t divisible by
17.
3. 172 177 (mod 5) True: 177-172 = 5 is a multiple
of 5
4. -13 13 (mod 26) True: 13-(-13) = 26 divisible by
26.
Congruence's Identities
Let n > 1 be fixed and a, b, c, d be arbitrary integers.
Then the following properties holds:
a) (Reflexive Property ) a a (mod n).
b) (Symmetric Property) If a b(mod n) then b a(mod
n).
c) ( Transitive Property) If a b(mod n) and b c (mod
n) then a c(mod n).
d) If a b(mod n) and c d (mod n) then a + c (b
+ d ) (mod n) and a·c b·d(mod n).
e) If a b(mod n) then a + c b+c(mod n) and a·c
b·c(mod n).
f) If a b(mod n) then a k b k (mod n) for any positive
integer k.
Theorem
If k is any integer such that k 1 (mod 3),
then k3 1 (mod 9).
Proof: k Z, k 1(mod 3) k 31(mod 9)
k 1(mod 3)
n, k-1 = 3n n, k = 3n + 1
n, k 3 = (3n + 1)3
n, k 3 = 27n 3 + 27n 2 + 9n + 1
n, k 3-1 = 27n 3 + 27n 2 + 9n
n, k 3-1 = (3n 3 + 3n 2 + n)·9
m, k 3-1 = m·9 where m = 3n 3 + 3n 2 + n
k 31(mod 9)
Lecture Summary
• Rational Number
• Properties of Rational Numbers
• Irrational numbers
• Absolute values
• Triangular inequality
• Floor and Ceiling
• Mod Functions