220 likes | 475 Views
Section 4.2 Direct proof and Counterexample II: Rational numbers. Definition: A real number r is rational if, and only if, it can be expressed as a quotient of two integers with a non-zero denominator. A real number that is not rational is irrational .
E N D
Section 4.2 Direct proof and Counterexample II:Rational numbers Definition: A real number r is rational if, and only if, it can be expressed as a quotient of two integers with a non-zero denominator. A real number that is not rational is irrational. More formally, if r is a real number, then r is rational integers a and b such that and b 0
More on generalizing the Generic Particular. Example: The sum of two rationals is rational. Example: The product of two rationals is rational.
Section 4.3 Direct Proof and Counterexample III:Divisibility Definition: If n and d (≠ 0) are integers, then n is divisible by d if and only if n = d×k for some integer k. Alternatively, we say that n is a multiple of d, or d is a factor of n, or d is a divisor of n, or ddividesn. The notation d|n reads “d divides n”.
Properties of Divisibility Theorem • Every non-zero integer d divides 0. • 1 divides any integer. • no integer is divisible by 0. Theorem If d divides a and d divides b, then d divides (a+b) Transitive property of divisibility If a divides b, and b divides c, then a divides c.
Several simple Divisibility Tests Theorem An integer n is divisible by 3 if and only if the sum of its digits is divisible by 3. Theorem An integer n is divisible by 4 if and only if the number represented by the last 2 digits of n is divisible by 4. Theorem An integer n is divisible by 11 if and only if the alternate sum of its digits is divisible by 11. ex. 37162 is not div. by 11 b/c (3–7+1–6+2) is not.
The Unique Factorization Theorem (Fundamental theorem of Arithmetic) Given any integer n > 1, there exist a positive integer k, distinct prime numbers p1, p2, ···, pk (in increasing order) and positive integers e1, e2, ···, ek such that n = p1e1p2e2···pkek and this expression is unique. Example: 7800= 233152131
Section 4.4Direct Proof and Counterexample IV:Division into Cases and the Quotient-Remainder Theorem The Quotient–Remainder Theorem Given any integer n and positive integer d, there exist unique integers q and r such that n = dq + r and 0 ≤r < d. Definition: Given a non-negative integer n and a positive integer d, n div d = the integer quotient obtained when n is divided by d. n mod d = the integer remainder obtained when n is divided by d.
Modulo Arithmetic Definition Given integers a, b, and a whole number n >1, we say that a is congruent to b modulo n, ab (mod n) if (a – b) is divisible by n. Or in other word, ab (mod n) if both a and b have the same remainder when divided by n. Examples 19 3 (mod 4) because 19 – 3 = 16, and 16 is divisible by 4. If a number n is of the form 8k + 7, then clearly n – 7 = 8k is divisible by 8, hence we write n 7 (mod 8).
Modulo Arithmetic Theorem Given integers a, b, c, d and a whole number n>1. If ab (mod n) and cd (mod n) then • a + cb + d (mod n) • a ×cb × d (mod n) • ak bk (mod n) for any whole number k. Exercise: 1. Compute 2100MOD 7 without a calculator. 2. Compute 10100MOD 13 without a calculator. Hint: 100 9 (mod 13), 92 3 (mod 13), 33 1 (mod 13).
Theorem The square of any odd integer has the form 8m+1 for some integer m. Theorem The sum of two squares will never be of the form 4n + 3.
Theorem Every whole number can be written as the sum of four (or less) squares of whole numbers. Examples 1 = 12 2 = 12 + 12 3 = 12 +12 + 12 4 = 22 5 = 22 +12 6 = 22 + 12 + 12 7 = 22 + 12 + 12 + 12 8 = 22 + 22 9 = 32 10 = 32 + 12 11 = 32 + 12 + 12 12 = 22 + 22 + 22 13 = 32 + 22 14 = 32 + 22 + 12 15 = 32 + 22 + 12 + 12 16 = 42 17 = 42 + 12 18 = 32 + 32 19 = 32 + 32 + 12 20 = 42 + 22 21 = 42 + 22 + 12 22 = 32 + 32 + 22 23 = 32 + 32 + 22 + 12 24 = 42 + 22 + 22 25 = 52 26 = 52 + 12 27 = 52 + 12 + 12 28 = 52 + 12 + 12 +12 29 = 52 + 22 30 = 52 + 22 + 12 As you can see, most whole numbers can be written as the sum of just 3 squares. So the question is, what type of numbers cannot written as the sum of 3 (or less) squares?
Theorem If a whole number n is of the form 8k + 7 for some whole number k, then n cannot be written as the sum of 3 (or less) squares of whole numbers. Note: the inverse of the above theorem is also true, i.e. if n is not of the form 4m(8k + 7), then n can be written as the sum of 3 (or less) squares of whole numbers. However, this is very difficult to prove. To prove the above theorem, all we need are the following Facts • If b is of the form 4m, then b2 is of the form 8k. • If b is of the form 4m+1, then b2 is of the form 8k + 1. • If b is of the form 4m+2, then b2 is of the form 8k + 4. • If b is of the form 4m+3, then b2 is of the form 8k + 1.
Russian Postal Puzzle Once upon a time the Russian postal system was notoriously corrupt. Any letter, package or box which was open or easily openable would be opened in the sorting office, and anything inside would be removed whether or not it had any value. However, since the pickings were so rich the sorters never bothered to open anything that was locked, even if they suspected it contained valuables. Now, Boris in Moscow had bought a beautiful gem for his girlfriend, Natasha who lived in St. Petersburg, and he wanted to get it to her as quickly as possible. Neither he nor Natasha could travel to the other's city, so what was he to do? He had a strongbox with a hasp to which a number of padlocks could be attached. If he bought a padlock and key he could put the gem in the box, lock the padlock and send the box through the postal system knowing that it would not be pried open and that it would be delivered to his beloved. But what good would that do? Natasha would not have a key to open the padlock. Boris couldn't send the key separately by letter as it would be opened and the key removed. However, Boris phoned Natasha and between them they hatched a clever scheme by which they could get the precious jewel from Moscow to St. Petersburg in safety despite the corrupt postal system. How did they do it? Source: Sarah Flannery. In Code. Workman, 2001
How to send secret message through unsecured channels? Bob needs to send a password (which is a 5-digit number) to his associate Alice by e-mail. However, the channel that they send e-mails is unsafe; many people can read their e-mails and steal the password. Bob can encode the password with a private key and tell her how to decode it. But Alice cannot decode it unless she knows the private key. And if Bob sends her the private key, other people will also know that private key as well! How can Bob do that without telling her the private key and yet let everybody know the encoding method?
First we need to know a bit more about modular arithmetic. Theorem If p is a prime number and a is a positive integer less than p, then there is a unique positive integer b < p such that ab mod p = 1 Note: this b is called the inverse of a. Example: If p = 97, and a = 46, then we can find b = 19 by an algorithm (similar to the Euclidean algorithm for GCF), we check that 46 × 19 = 874 and 874 mod 97 = 1. Website for modulo arithmetic http://ptrow.com/perl/calculator.pl
Solution (easy version) to secret message. Bob first chooses a big prime number, such as p = 362,443 ( in reality, p should be as big as 147186545399385502660887614137521979) Next he picks a whole number 8715 (<p), and find the number 264835 such that 8715 × 264835 MOD p = 1 These two numbers will be Bob’s private keys.Bob then tell Alice the number p, and asks her to pick two private keys c and d with the same property that c × d MOD p = 1(Since p is so big, it is highly unlikely that Alice picks the same set of private keys; but Bob can send a test message first to double check.)
In order to send a password 11738 (a 5-digit number) to Alice, • Bob encodes the password with his private key a=8715, • 11738 × 8715 MOD p = 87744and then send this number 87744to Alice. • (2) When Alice receives 87744, she encodes further with her private key c,let z = 87744 × c MOD pand then send this number zback to Bob.(3) Bob then removes his “lock” by removing his encoding, let w = z × 264835 MOD pand then sends this number w back to Alice.(4) Finally, Alice decodes the number by the formulaw × d MOD pand this number will be exactly the password 11738 !!!
Section 4.6 Indirect Argument: Contradiction and Contraposition Method of proof by contradiction • Suppose the statement to be proved is false. • Show that this supposition leads logically to a contradiction. • Conclude that the original statement to be proved is true. More formally, we have ~p→ C p Example: Prove that the sum of any rational number and any irrational number is irrational.
Method of Proof by Contraposition • Express the statement to be proved in the form x in D, P(x) →Q(x) • Suppose that x is a generic particular in D such that Q(x) is false. • Prove that P(x) is false for that x chosen in step 2. Example: Prove that for all integers n, if n2 is even then n is even. Example: Prove that if π2 is irrational, then π is irrational. Example: If the equation x4 + y4 = z2 has no positive integer solution, then neither will the equation x4 + y4 = z4
Theorem For any set S (finite or infinite), there is no onto function from S to (S). Proof: It is only necessary to consider the case where S is infinite, because if S is finite, we know that (S) has more elements. Assume to the contrary that there is a onto functionf : S → (S) We then consider the subset A = { xS : xf(x) }
Section 4.7 Two Classical Theorems Theorem 1 is irrational. Generalized theorem If n is a positive integer that is not a perfect square, then is irrational. Theorem 2 The set of prime numbers is infinite.
Section 4.7 Two Classical Theorems Theorem 3 If p and q are different prime numbers, then logpq is irrational. Example log27 is irrational.