資訊科學數學 8 : proof strategy, number and orders 陳光琦助理教授 (kuang-chi chen)...

82
資資資資資資 資資資資資資 8 8 : : Proof Strategy, Number a Proof Strategy, Number a nd Orders nd Orders 陳陳陳陳陳陳陳 陳陳陳陳陳陳陳 (Kuang-Chi Chen) (Kuang-Chi Chen) [email protected] [email protected]

Upload: esther-dorcas-mitchell

Post on 25-Dec-2015

245 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

資訊科學數學資訊科學數學 8 8 ::

Proof Strategy, Number and OProof Strategy, Number and Ordersrders

陳光琦助理教授 陳光琦助理教授 (Kuang-Chi Che(Kuang-Chi Chen)n)

[email protected]@mail.tcu.edu.tw

Page 2: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Mini Review & MoreMini Review & MoreProof MethodsProof Methods

Page 3: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Inference Rules - General Inference Rules - General FormForm

• Inference RuleInference Rule

- Pattern establishing that if we know that a set - Pattern establishing that if we know that a set of of antecedentantecedent statements of certain forms are statements of certain forms are all true, then a certain related all true, then a certain related consequentconsequent statement is true. statement is true.

• antecedent 1antecedent 1 antecedent 2 … antecedent 2 … consequent consequent ““” ” meansmeans “therefore” “therefore”

Page 4: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Inference Rules & Inference Rules & ImplicationsImplications

• Each Each logical inference rulelogical inference rule corresponds to an corresponds to an implicationimplication that is a that is a tautologytautology..

• antecedent 1 antecedent 1 Inference ruleInference rule antecedent 2 … antecedent 2 … consequentconsequent

• Corresponding tautology: Corresponding tautology: ((((ante. 1ante. 1) ) ( (ante. 2ante. 2) ) …) …) consequentconsequent

Page 5: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Some Inference RulesSome Inference Rules

• p p Rule of Rule of AdditionAddition ppqq

• ppq q Rule of Rule of SimplificationSimplification pp

• p p Rule of Rule of ConjunctionConjunction qq ppqq

Page 6: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Modus Ponens & TollensModus Ponens & Tollens

• pp Rule of Rule of modus ponens modus ponens 斷言法斷言法ppqq (a.k.a. (a.k.a. law of detachmentlaw of detachment))qq

• qqppqq Rule of Rule of modus tollens modus tollens 否定法否定法 pp

“the mode of affirming”

“the mode of denying”

a.k.a. “also known as”

Page 7: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Syllogism Inference RulesSyllogism Inference Rules

• ppqq Rule of Rule of hypotheticalhypothetical

qqr r syllogism syllogism 三段論三段論 pprr

• p p qq Rule of Rule of disjunctivedisjunctive p p syllogismsyllogism qq

Many valid inference rules were first described by Many valid inference rules were first described by Aristotle. He called these patterns of argument Aristotle. He called these patterns of argument

“syllogisms.”“syllogisms.”

Aristotle (ca. 384-322 B.C.)

Page 8: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Inference Rules for Inference Rules for QuantifiersQuantifiers

xx PP((xx))PP((oo)) (substitute (substitute anyany object object oo))

• PP((gg)) (for (for gg a a generalgeneral element of u.d.)element of u.d.)xx PP((xx))

xx PP((xx))PP((cc)) (substitute a (substitute a newnew constantconstant cc))

• PP((oo) ) (substitute (substitute any extantany extant object object oo) ) xx PP((xx))

Page 9: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Common Common FallaciesFallacies• A A fallacyfallacy is an inference rule or other proof method is an inference rule or other proof method

that is that is not logically validnot logically valid..

- May yield a false conclusion!- May yield a false conclusion!

• Fallacy of affirmingFallacy of affirming the conclusion:the conclusion:

“ “ppqq is true, and is true, and qq is true, so is true, so pp must be true.” ? must be true.” ?

(No, because (No, because FFTT is true.) is true.)

• Fallacy of denying the hypothesis:Fallacy of denying the hypothesis:

“ “ppqq is true, and is true, and pp is false, so is false, so qq must be false.”? must be false.”?

(No, again because (No, again because FFTT is true.) is true.)

Page 10: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Proving ExistentialsProving Existentials• A proof of a statement of the form A proof of a statement of the form xx PP((xx)) is c is c

alled an alled an existence proofexistence proof..

• If the proof demonstrates how to actually find If the proof demonstrates how to actually find or construct a or construct a specificspecific element element aa such that such that PP((aa)) is true, then it is a is true, then it is a constructive proofconstructive proof..

• Otherwise, it is Otherwise, it is nonconstructivenonconstructive..

Page 11: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Constructive Existence Constructive Existence ProofProof

Theorem:Theorem: There exists a positive integer There exists a positive integer nn that that is the sum of two perfect cubes in two is the sum of two perfect cubes in two different ways - equal to different ways - equal to jj33 + + kk33 and and ll33 + + mm33 where where jj, , kk, , ll, , mm are positive integers, and { are positive integers, and {jj, , kk} } ≠ {≠ {ll, , mm}.}.

Proof:Proof: Consider Consider nn = 1729, = 1729, jj = 9, = 9, kk = 10, = 10, ll = 1, = 1, mm = 12. Now just = 12. Now just check that the check that the equalities holdequalities hold..

Page 12: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Another Constructive Existence Another Constructive Existence ProofProof

Theorem: Theorem: For any integer For any integer nn>0, there exists a >0, there exists a sequence of sequence of nn consecutive composite integers. consecutive composite integers.

- Same statement in - Same statement in predicate logicpredicate logic::nn>0 >0 x x ii (1 (1iinn))((xx++ii is composite) is composite)

… … Proof follows on the next …Proof follows on the next …

Page 13: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Predicate LogicPredicate Logic

• Predicate logicPredicate logic is an extension of is an extension of propositional propositional logiclogic that permits concisely reasoning about that permits concisely reasoning about whole whole classesclasses of entities. of entities.

• Propositional logic (recall) treats simple Propositional logic (recall) treats simple propositionspropositions (sentences) as atomic entities. (sentences) as atomic entities.

• In contrast,In contrast, predicatepredicate logiclogic distinguishes thedistinguishes the subject subject of a sentence from itsof a sentence from its predicatepredicate..

- Remember these English grammar terms?- Remember these English grammar terms?

Page 14: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Applications of Predicate Applications of Predicate LogicLogic

• It is the formal notation for writing perfectly It is the formal notation for writing perfectly clear, concise, and unambiguous mathematical clear, concise, and unambiguous mathematical definitionsdefinitions, , axiomsaxioms, and, and theorems theorems for anyfor any branch of mathematics.branch of mathematics.

- Predicate logic with function symbols, the- Predicate logic with function symbols, the “=” “=” operator, and a fewoperator, and a few proof-building rules proof-building rules is is sufficient for definingsufficient for defining any conceivable any conceivable mathematical system, and for proving anything mathematical system, and for proving anything that can that can be provedbe proved within that system! within that system!

Page 15: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Practical Applications of Predicate Practical Applications of Predicate LogicLogic

• It is the basis for clearly expressed formal specIt is the basis for clearly expressed formal specifications for any complex system.ifications for any complex system.

• It is basis forIt is basis for automatic theorem provers automatic theorem provers and mand many other any other Artificial Intelligence systemsArtificial Intelligence systems..

E.g.E.g. automatic program verification systems automatic program verification systems..

• Predicate-logicPredicate-logic like statements are supported b like statements are supported by some of the more sophisticatedy some of the more sophisticated database que database query enginesry engines and and container class librariescontainer class libraries..

- these are types of programming tools- these are types of programming tools..

Page 16: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

… … Constructive Existence Constructive Existence Proof …Proof …

Theorem: Theorem: For any integer For any integer nn>0, there exists a >0, there exists a sequence of sequence of nn consecutive composite integers. consecutive composite integers.

• Given Given nn>0, let >0, let xx = ( = (nn + 1)! + 1. + 1)! + 1.• Let Let i i 1 and 1 and i i nn, and consider , and consider xx++ii..• Note Note xx++ii = ( = (nn + 1)! + ( + 1)! + (ii + 1). + 1).• Note (Note (ii+1)|(+1)|(nn+1)!, since 2 +1)!, since 2 ii+1 +1 nn+1.+1.• Also (Also (ii+1)|(+1)|(ii+1). So, (+1). So, (ii+1)|(+1)|(x+ix+i). ). x+ix+i is composite. is composite. nn x x 11iin n : : xx++ii is composite is composite. Q.E.D.. Q.E.D.

Page 17: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Nonconstructive Existence ProofNonconstructive Existence ProofTheorem:Theorem: “There are infinitely many prime numbers.” “There are infinitely many prime numbers.”

• Any finite set of numbers must contain a Any finite set of numbers must contain a maximal element, so we can prove the theorem maximal element, so we can prove the theorem if we can just show that there is if we can just show that there is no largestno largest prime number.prime number.

i.e.i.e., show that for any prime number, there is a , show that for any prime number, there is a larger number that is larger number that is alsoalso prime. prime.

• More generally: For More generally: For anyany number, number, a larger a larger prime.prime.

• Formally: Formally: Show Show nn p>n p>n : : pp is prime is prime..

Page 18: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

The Proof …using proof by The Proof …using proof by cases…cases…

• Given Given nn > 0, prove there is a prime > 0, prove there is a prime pp > > nn. .

• Consider Consider x x = = nn!+1. Since !+1. Since xx > 1, we know > 1, we know ((xx is prime) is prime)((x x is composite).is composite).

Case 1:Case 1: xx is prime. Obviously is prime. Obviously xx > > nn, so let , so let pp = = xx and we’re done.and we’re done.

Case 2:Case 2: xx has a prime factor has a prime factor pp. But if . But if pp nn, , then then pp mod mod xx = 1. So = 1. So pp > > nn, and we’re done., and we’re done.

Page 19: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

The Halting Problem The Halting Problem (Turing‘36)(Turing‘36)• The The halting problemhalting problem was the first mathematical was the first mathematical

function proven to have function proven to have no algorithmno algorithm that thatcomputes it! - We say, it is computes it! - We say, it is uncomputableuncomputable..

• The desired function is The desired function is HaltsHalts((PP, , II) :) :≡≡ the truth value of this statement: the truth value of this statement:

““Program P, given input I, eventually terminates.”Program P, given input I, eventually terminates.”

Theorem:Theorem: HaltsHalts is uncomputable! is uncomputable!i.e., there does i.e., there does notnot exist exist anyany algorithm algorithm AA that that

computes computes HaltsHalts correctly for correctly for allall possible inputs. possible inputs.• Its proof is thus a Its proof is thus a nonnon-existence proof.-existence proof.

Corollary: General impossibility of predictive analysis of aCorollary: General impossibility of predictive analysis of arbitrary computer programs.rbitrary computer programs.

Alan TuringAlan Turing1912-19541912-1954

Page 20: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

The Proof 1The Proof 1• Given any Given any arbitrary arbitrary program program HH((PP, , II).).

• Consider algorithm Consider algorithm BreakerBreaker, defined as:, defined as:procedureprocedure BreakerBreaker((PP: a program): a program) halts halts :=:= HH((PP, , PP)) ifif haltshalts then whilethen while T begin endT begin end

• Note that Note that BreakerBreaker((BreakerBreaker) halts iff) halts iff

HH((BreakerBreaker, , BreakerBreaker) = ) = FF..

• So So HH does does notnot compute the function compute the function HaltsHalts!!

Breaker makes a liar out of Breaker makes a liar out of HH,,by doing the opposite of whatever by doing the opposite of whatever HH predicts. predicts.

Page 21: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

The Proof 2The Proof 2• Given any arbitraryGiven any arbitrary program program HH((PP, , II), which generates ), which generates

either “loop forever” or “halts”either “loop forever” or “halts”• Consider algorithm Consider algorithm KK, defined as:, defined as:

procedureprocedure KK((PP: a program): a program) outputoutput :=:= HH((PP, , PP)) ifif output output==“==“loop foreverloop forever”” then halts ;then halts ;

else whileelse while T do {} /*loop forever*/;T do {} /*loop forever*/;

Now Now KK((KK) halts, otherwise ) halts, otherwise HH((KK, , KK) generate “halts”.) generate “halts”.By definition of By definition of K K. . KK((KK) loops forever.) loops forever.A violation of what A violation of what HH tell us! tell us!如果 如果 HH((KK, , KK) ) 產生 “產生 “ halts”, halts”, 則 則 KK 會會 loop forever, loop forever, HH 猜錯了猜錯了

KK makes a liar out of makes a liar out of HH, , by doing the by doing the oppositeopposite of of

whatever whatever HH predicts. predicts.

Page 22: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Limits on ProofsLimits on Proofs

• Some very simple statements of Some very simple statements of number theorynumber theory have have notnot been proved or disproved! been proved or disproved!

E.g. E.g. Goldbach’s conjectureGoldbach’s conjecture: Every : Every integer integer nn≥≥22 is is exactly the averageexactly the average?? of some two primes. of some two primes.

n≥n≥2 2 primes primes pp, , qq: : n n = (= (pp++qq)/2.)/2.

• There are There are true statementstrue statements of number theory (or of number theory (or any sufficiently powerful system) that can any sufficiently powerful system) that can nevneverer be provedbe proved (or disproved) (Gödel). (or disproved) (Gödel).

Page 23: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Goldbach's ConjectureGoldbach's Conjecture• Goldbach's conjectureGoldbach's conjecture is one of the oldest unsolved is one of the oldest unsolved

problems in number theory and in all of mathematics.problems in number theory and in all of mathematics. - - Every even integer greater than 2Every even integer greater than 2 can be written as the can be written as the

sum of two primessum of two primes..

• Expressing a given even number as a sum of two priExpressing a given even number as a sum of two primes is called a mes is called a Goldbach partitionGoldbach partition of the number of the number. F. For example,or example,

•     4 = 2 + 2 ,  6 = 3 + 3 ,  8 = 3 + 5 , 4 = 2 + 2 ,  6 = 3 + 3 ,  8 = 3 + 5 , 10 = 3 + 7 = 5 + 5 , 12 = 5 + 7 ,10 = 3 + 7 = 5 + 5 , 12 = 5 + 7 ,

14 = 3 + 11 = 7 + 7 , etc.14 = 3 + 11 = 7 + 7 , etc. • http://en.wikipedia.org/wiki/Goldbach's_conjecturehttp://en.wikipedia.org/wiki/Goldbach's_conjecture

Page 24: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

More about Goldbach's ConjectureMore about Goldbach's ConjectureOriginsOrigins• On 7 June 1742, the Prussian mathematician Christian GoldbaOn 7 June 1742, the Prussian mathematician Christian Goldba

ch wrote a letter to Leonhard Euler (letter XLIII) in which he pch wrote a letter to Leonhard Euler (letter XLIII) in which he proposed the following conjecture:roposed the following conjecture:

- Every integer greater than 2 can be written as the sum of three primes.- Every integer greater than 2 can be written as the sum of three primes.

• He considered 1 to be a prime number, a convention subsequeHe considered 1 to be a prime number, a convention subsequently abandoned. A modern version of Goldbach's original conjntly abandoned. A modern version of Goldbach's original conjecture is:ecture is:

- Every integer greater than 5 can be written as the sum of three primes.- Every integer greater than 5 can be written as the sum of three primes.

• EulerEuler, becoming interested in the problem, answered by noting , becoming interested in the problem, answered by noting that this conjecture would follow from a stronger version,that this conjecture would follow from a stronger version,

- Every even integer greater than 2 can be written as the sum of t- Every even integer greater than 2 can be written as the sum of two primeswo primes,,

Page 25: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Origins cont’d …Origins cont’d …• Euler provided a stronger version,Euler provided a stronger version, - Every even integer greater than 2 can be written as the sum of t- Every even integer greater than 2 can be written as the sum of t

wo primeswo primes, , adding that he regarded this a fully certain theorem ("adding that he regarded this a fully certain theorem ("ein ganz ein ganz

gewisses Theoremagewisses Theorema"), in spite of his being unable to prove it."), in spite of his being unable to prove it.

• The The former conjectureformer conjecture is today known as the is today known as the "ternary" Goldba"ternary" Goldbach conjecturech conjecture, the latter as the , the latter as the "strong" or "binary" Goldbach c"strong" or "binary" Goldbach conjectureonjecture. The conjecture that . The conjecture that all odd numbers greater than 7 aall odd numbers greater than 7 are the sum of three odd primesre the sum of three odd primes is called the "weak" Goldbach is called the "weak" Goldbach conjecture. Both questions have remained conjecture. Both questions have remained unsolved unsolved ever since, ever since, although the weak form of the conjecture is much closer to resalthough the weak form of the conjecture is much closer to resolution than the strong one..olution than the strong one..

• http://en.wikipedia.org/wiki/Goldbach's_conjecturehttp://en.wikipedia.org/wiki/Goldbach's_conjecture

Page 26: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

More about Goldbach's ConjectureMore about Goldbach's Conjecture• Heuristic justificationHeuristic justification• The majority of mathematicians believe the conjecture (in both The majority of mathematicians believe the conjecture (in both

the weak and strong forms) to be true, at least for sufficiently lthe weak and strong forms) to be true, at least for sufficiently large integers, mostly based on statistical considerations focusiarge integers, mostly based on statistical considerations focusing on the probabilistic distribution of prime numbers: the biggng on the probabilistic distribution of prime numbers: the bigger the number, the more ways there are available for that number the number, the more ways there are available for that number to be represented as the sum of two or three other numbers, er to be represented as the sum of two or three other numbers, and the more "likely" it becomes that at least one of these reprand the more "likely" it becomes that at least one of these representations consists entirely of primes.esentations consists entirely of primes.

• The prime number theorem asserts that The prime number theorem asserts that an integer an integer mm selected a selected at random has roughly a 1/ln(t random has roughly a 1/ln(mm) chance of being prime) chance of being prime. Thus if . Thus if nn is a large even integer and is a large even integer and mm is a number between 3 and is a number between 3 and n/2n/2, , then one might expect the probability of then one might expect the probability of mm and and n-mn-m simultaneo simultaneously being prime to be 1/[ln(usly being prime to be 1/[ln(mm)ln()ln(nn--mm)] )]

Page 27: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

More about Goldbach's ConjectureMore about Goldbach's Conjecture• Number of ways to write an even number n as the sum of two Number of ways to write an even number n as the sum of two

primes (4 ≤ n ≤ 1,000,000)primes (4 ≤ n ≤ 1,000,000)

Page 28: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Other ApplicationsOther Applications• Predicate logicPredicate logic is the foundation of the is the foundation of the

field of field of mathematical logicmathematical logic, which , which culminated in culminated in Gödel’s incompleteness Gödel’s incompleteness theoremtheorem, which revealed the ultimate , which revealed the ultimate limits of mathematical thought :limits of mathematical thought :

Given any finitely describable, consistent Given any finitely describable, consistent proof procedure, there will always remainproof procedure, there will always remain

somesome true statements that will true statements that will never be never be provenproven by that procedure.by that procedure.

i.e.i.e., we , we can’tcan’t discover discover allall mathematical truths, unless we mathematical truths, unless we sometimes resort to sometimes resort to making guessesmaking guesses..

Kurt Gödel1906-1978

Page 29: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

More Proof ExamplesMore Proof Examples

Q1: Is this argument correct or incorrect?Q1: Is this argument correct or incorrect? “ “All TAs compose easy quizzes. Bob is a TA. All TAs compose easy quizzes. Bob is a TA.

Therefore, Bob composes easy quizzes.”Therefore, Bob composes easy quizzes.”

First, separate the premises from conclusions:First, separate the premises from conclusions:Premise #1: All TAs compose easy quizzes.Premise #1: All TAs compose easy quizzes.Premise #2: Bob is a TA.Premise #2: Bob is a TA.

Conclusion: Bob composes easy quizzes.Conclusion: Bob composes easy quizzes.

Page 30: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Answer of Q1Answer of Q1

Next, re-render the example in logic notation.Next, re-render the example in logic notation.

• Premise #1: All TAs compose easy quizzes.Premise #1: All TAs compose easy quizzes.

- Let U.D. = all people- Let U.D. = all people

- Let - Let TT((xx) :) :≡ “≡ “xx is a TA” is a TA”

- Let - Let EE((xx) :≡ “) :≡ “xx composes easy quizzes” composes easy quizzes”

- Then Premise #1 says: - Then Premise #1 says: xx, , TT((xx)→)→EE((xx))

Page 31: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Answer cont’d …Answer cont’d …

• Premise #2: Bob is a TA.Premise #2: Bob is a TA.

- Let B :- Let B :≡ Bob≡ Bob

- Then Premise #2 says: - Then Premise #2 says: TT(B)(B)

- And the Conclusion says: - And the Conclusion says: EE(B)(B)

• The argument is correct, because it can be The argument is correct, because it can be reduced to reduced to a sequence of applications of valid a sequence of applications of valid inference rulesinference rules, as follows:, as follows:

Page 32: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

The Proof in Gory DetailsThe Proof in Gory Details

• StatementStatement How obtainedHow obtained

1.1.xx, , TT((xx) ) → → EE((xx)) (Premise #1)(Premise #1)

2.2.TT(Bob) → (Bob) → EE(Bob)(Bob) (Universal (Universal instantiation) instantiation)

3.3.TT(Bob)(Bob) (Premise #2)(Premise #2)

4.4.EE(Bob)(Bob) ((Modus PonensModus Ponens from statements #2 and #3) from statements #2 and #3)

Page 33: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Another ExampleAnother Example

Q2: Correct or incorrect: At least one of the 280 Q2: Correct or incorrect: At least one of the 280 students in the class is intelligent. Y is a studestudents in the class is intelligent. Y is a student of this class. Therefore, Y is intelligent.nt of this class. Therefore, Y is intelligent.

• First: Separate premises/conclusion,First: Separate premises/conclusion,& translate to logic:& translate to logic:

Premises: (1) Premises: (1) xx InClass( InClass(xx) ) Intelligent( Intelligent(xx))

(2) InClass(Y)(2) InClass(Y)

Conclusion: Intelligent(Y)Conclusion: Intelligent(Y)

Page 34: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Answer of Q2Answer of Q2• No, the argument is No, the argument is invalidinvalid; we can ; we can disprovedisprove it wi it wi

th a th a counter-examplecounter-example, as follows:, as follows:

• Consider a case where there is only one intelligent stuConsider a case where there is only one intelligent student X in the class, and Xdent X in the class, and X≠Y.≠Y.

- Then the premise - Then the premise xx InClass( InClass(xx) ) Intelligent( Intelligent(xx)) is tru is true, by existential generalization of e, by existential generalization of InClass(X) InClass(X) Intelligent(X) Intelligent(X)

- But the conclusion - But the conclusion Intelligent(Y)Intelligent(Y) is is falsefalse, since X is t, since X is the only intelligent student in the class, and Y≠X.he only intelligent student in the class, and Y≠X.

• Therefore, the premises do Therefore, the premises do notnot imply the conclusion. imply the conclusion.

Page 35: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Example : Q3Example : Q3

Q3: Prove that the sum of a rational number and Q3: Prove that the sum of a rational number and an irrational number is always irrational.an irrational number is always irrational.

• First, you have to understand exactly what the First, you have to understand exactly what the question is asking you to prove:question is asking you to prove:

- “For all real numbers - “For all real numbers xx, , y,y, if if xx is rational and is rational and yy is irrational, then is irrational, then xx + + yy is irrational.” is irrational.”

- - xx, , yy: Rational(: Rational(xx) ) Irrational(Irrational(yy) → Irrational() → Irrational(xx++yy))

Page 36: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Answer of Q3Answer of Q3

• Next, think back to the definitions of the terms Next, think back to the definitions of the terms used in the statement of the theorem:used in the statement of the theorem:

reals reals rr: Rational(: Rational(rr) ) ↔↔ Integer( Integer(ii) ) Integer( Integer(jj): ): rr = = ii//jj..

reals reals rr: Irrational(: Irrational(rr) ↔ ¬Rational() ↔ ¬Rational(rr))

(Almost always need the definitions of the terms(Almost always need the definitions of the terms

in order to prove the theorem!)in order to prove the theorem!)

- Next, let’s go through a valid proof.- Next, let’s go through a valid proof.

Page 37: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Proof of Q3Proof of Q3Thm: Thm: xx, , yy: Rational(: Rational(xx) ) Irr Irrational(ational(yy) → Irrational() → Irrational(xx++yy))

Proof:Proof: Let Let xx, , yy be any rational and irrational numbers, res be any rational and irrational numbers, respectively. … (universal generalization)pectively. … (universal generalization)

• Since Since xx is rational, we know that there must be some in is rational, we know that there must be some integers tegers ii and and jj such that such that xx = = ii//jj.. So, let So, let iixx, , jjxx be such integ be such integers.ers.

• What do we know about What do we know about yy? Only that ? Only that yy is irrational: is irrational: ¬¬ integers integers ii, , jj: : yy = = ii//jj..

• But, it’s difficult to use a direct proof here. We could tBut, it’s difficult to use a direct proof here. We could try indirect proof also, but in this case, it is simpler to jury indirect proof also, but in this case, it is simpler to just use proof by contradiction (similar to indirect).st use proof by contradiction (similar to indirect).

Page 38: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Proof cont’d …Proof cont’d …• Suppose that Suppose that xx++yy were not irrational. Then were not irrational. Then xx++yy w w

ould be rational, so ould be rational, so integers integers ii, , jj: : xx++yy = = ii//jj. So, le. So, let t iiss and and jjss be any such integers where be any such integers where xx++yy = = iiss/ / jjss..

• Now, with all these things named, we can start seeNow, with all these things named, we can start seeing what happens when we put them together.ing what happens when we put them together.

• So, we have that (So, we have that (iixx//jjxx) + ) + yy = ( = (iiss//jjss).).

- - Solving that equation for Solving that equation for yy, we have: , we have: yy = ( = (iiss//jjss) – () – (iixx//jjxx) = () = (iissjjxx – – iixxjjss)/()/(jjssjjxx))

Page 39: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Finishing the ProofFinishing the Proof

• yy = ( = (iiss//jjss) – () – (iixx//jjxx) = () = (iissjjxx – – iixxjjss)/()/(jjssjjxx))

• Now, since the numerator and denominator of Now, since the numerator and denominator of this expression are both integers, this expression are both integers, yy is (by defin is (by definition) rational. This ition) rational. This contradictscontradicts the assumptio the assumption that n that yy was irrational. Therefore, our hypothe was irrational. Therefore, our hypothesis that sis that xx++yy is rational must be false, and so the is rational must be false, and so the theorem is proved. theorem is proved. ■■

Page 40: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Example Example WrongWrong Answer Answer

• 1 is rational. √2 is irrational. 1+√2 is irrational. 1 is rational. √2 is irrational. 1+√2 is irrational. Therefore, the sum of a rational number and an Therefore, the sum of a rational number and an irrational number is irrational. (Direct proof.)irrational number is irrational. (Direct proof.)

• Why does this answer merit no credit?Why does this answer merit no credit?

- The student attempted to use an example to prove - The student attempted to use an example to prove a universal statement. a universal statement. This is always wrong!This is always wrong!

- - Even as an example, it’s incomplete, because the Even as an example, it’s incomplete, because the student never even proved that 1+student never even proved that 1+√2 is irrational!√2 is irrational!

Page 41: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Proof StrategiesProof Strategies

Page 42: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

OverviewOverview• In the previous, we already saw:In the previous, we already saw: - Several types of proofs of implications - Several types of proofs of implications pp→→qq:: . . Direct, Indirect, Vacuous, TrivialDirect, Indirect, Vacuous, Trivial . . - Types of existence proofs:- Types of existence proofs: . . Constructive vs. NonconstructiveConstructive vs. Nonconstructive.. - Some methods of proving general statements - Some methods of proving general statements pp:: . . Proof by cases, proof by contradictionProof by cases, proof by contradiction..

• Here, we will see examples of:Here, we will see examples of: - Forward vs. backward reasoning.- Forward vs. backward reasoning. . Proof by cases.. Proof by cases. - Adapting existing proofs.- Adapting existing proofs. . Turning conjectures into proofs.. Turning conjectures into proofs.

Page 43: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Forward ReasoningForward Reasoning

• Have premises Have premises pp, and want to prove , and want to prove qq..

1. Find a 1. Find a ss11 such that such that pp→→ss11

2. Then, 2. Then, modus ponensmodus ponens gives you gives you ss11..

3. Then, find an 3. Then, find an ss22 (such that) (such that) ss11→→ss22..

4. Then, 4. Then, modus ponensmodus ponens gives you gives you ss22..

5. And hope to eventually get to an 5. And hope to eventually get to an ssnn ssnn→→qq..

• The problem with this method is…The problem with this method is… It can be tough to see the path looking from It can be tough to see the path looking from pp..

Page 44: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Backward ReasoningBackward Reasoning• It can often be easier to see the It can often be easier to see the very same pathvery same path if you if you

just start looking from the conclusion just start looking from the conclusion qq instead… instead…

- That is, - That is, firstfirst find an find an ss−1−1 such that such that ss−1−1→→qq..

- Then- Then, find an , find an ss−2 −2 ss−2−2→→ss−1−1, and so on…, and so on…

- Working back to an - Working back to an ss−−nn pp→→ss−−nn..

• We We stillstill are using are using modus ponensmodus ponens to propagate truth to propagate truth foforwardsrwards down the chain down the chain from from pp to to ss−−nn to … to to … to ss11 to to qq!!

- We - We findfind the chain the chain backwardsbackwards, but , but applyapply it it forwardsforwards.. - This is - This is notnot quite the same thing as an indirect proof… quite the same thing as an indirect proof… In that, we would use In that, we would use modus tollensmodus tollens and ¬ and ¬qq to prove ¬ to prove ¬

ss−−11, , etc.etc. However, it is similar. However, it is similar.

Page 45: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Backward Reasoning Backward Reasoning ExampleExample

Theorem:Theorem: aa>0, >0, bb>0, >0, aa≠≠bb: (: (aa++bb)/2 > ()/2 > (abab))1/21/2..

Proof:Proof:

- Notice it is - Notice it is notnot obvious how to go from the pre obvious how to go from the premises mises aa>0, >0, bb>0, >0, aa≠≠bb directly directly forwardforward to the co to the conclusion (nclusion (aa++bb)/2 > ()/2 > (abab))1/21/2..

- So, let’s work - So, let’s work backwardsbackwards from the conclusion, from the conclusion, ((aa++bb)/2 > ()/2 > (abab))1/2 1/2 ! ■! ■

Page 46: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Steps of ExampleSteps of Example

1.1. ((aa++bb)/2 > ()/2 > (abab))1/21/2 (squaring both sides)(squaring both sides)

2.2. ((aa++bb))22/4 > /4 > abab (multiplying through by 4)(multiplying through by 4)

3.3. ((aa++bb))22 > 4 > 4abab (squaring (squaring aa++bb))

4.4. aa22+2+2abab++bb22 > 4 > 4abab (subtracting out 4(subtracting out 4abab))

5.5. aa22−−22abab++bb22 > 0 > 0 (factoring left side)(factoring left side)

6.6. ((aa−−bb))22 > 0 > 0

# Now, since # Now, since aa≠≠bb, (, (aa−−bb)≠0, thus ()≠0, thus (aa−−bb))22>0, and we can >0, and we can work our way back along the chain of steps…work our way back along the chain of steps…

Page 47: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

““Forward” ExampleForward” ExampleTheorem:Theorem: aa>0, >0, bb>0, >0, aa≠≠bb: (: (aa++bb)/2 > ()/2 > (abab))1/21/2..

Proof.Proof. Since Since aa≠≠bb, (, (aa−−bb)≠0, thus ()≠0, thus (aa−−bb))22>0, >0, i.e.i.e., , aa22−2−2abab++bb22 > 0. Adding 4 > 0. Adding 4abab to both sides, to both sides, aa22+2+2abab++bb22 > 4 > 4abab. . Then, we have (Then, we have (aa++bb))22 > 4 > 4abab, so (, so (aa++bb))22/4 > /4 > abab. Since . Since abab is positive, we can take the square root of both sid is positive, we can take the square root of both sides and getes and get ((aa++bb)/2 > ()/2 > (abab))1/21/2. ■. ■

- This is just a simple proof proceeding directly from pr- This is just a simple proof proceeding directly from premises to conclusion.emises to conclusion.

A common student reaction: “But how did you A common student reaction: “But how did you knowknow to to pick 4pick 4abab out of thin air, to add to both sides?” out of thin air, to add to both sides?”

Answer: By working Answer: By working backwardsbackwards from the conclusion! from the conclusion!

Page 48: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Stone Game ExampleStone Game Example• Game rules:Game rules: There are 15 stones in a pile. Two players take There are 15 stones in a pile. Two players take

turns removing either 1, 2, or 3 stones. Whoever turns removing either 1, 2, or 3 stones. Whoever takes the last stone wins.takes the last stone wins.

Theorem:Theorem: There is a strategy for the first player that There is a strategy for the first player that guarantees him a win.guarantees him a win.

- How do we prove this? - How do we prove this? Constructive proofConstructive proof……

- Looks complicated… How do we pick out the - Looks complicated… How do we pick out the winning strategy from among all possible strategies?winning strategy from among all possible strategies?

- Work - Work backwardsbackwards from the endgame! from the endgame!

Page 49: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Working Working BackwardsBackwards in the in the GameGame

• Player 1 wins if there is no stone on player 2’s Player 1 wins if there is no stone on player 2’s pseudo last turn …pseudo last turn …

• P1 can arrange this ifP1 can arrange this ifthere are 1, 2, or 3there are 1, 2, or 3stones on his last turn…stones on his last turn…

• This will be true asThis will be true aslong as player 2 hadlong as player 2 had4 stones or 44 stones or 4nn stones stoneson his turn…on his turn…

Player 1Player 1 Player 2Player 2

00

1, 2, 31, 2, 3

44

5, 6, 75, 6, 7

88

9, 10, 119, 10, 11

1212

13, 14, 1513, 14, 15

Page 50: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

““Forward” VersionForward” VersionTheorem.Theorem. Whoever moves first can always force a win. Whoever moves first can always force a win.

Proof.Proof. Player 1 can remove 3 stones, leaving Player 1 can remove 3 stones, leaving 1212. . After player 2 moves, there will then be either 11, After player 2 moves, there will then be either 11, 10, or 9 stones left. In any of these cases, player 1 10, or 9 stones left. In any of these cases, player 1 can then reduce the number of stones to can then reduce the number of stones to 88. Then, . Then, player 2 will reduce the number to 7, 6, or 5. player 2 will reduce the number to 7, 6, or 5.

Then, player 1 can reduce the number to Then, player 1 can reduce the number to 44. Then, . Then, player 2 must reduce them to 3, 2, or 1. player 2 must reduce them to 3, 2, or 1. Player 1 Player 1 then removes the remaining stones and winsthen removes the remaining stones and wins. ■. ■

Page 51: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Cases ExampleCases ExampleTheorem:Theorem: nnZZ ¬(¬(2|2|nn 3 3|n|n) → 24|() → 24|(nn22−1).−1).

Proof:Proof: Since 2·3 = 6, the value of Since 2·3 = 6, the value of nn mod 6 is sufficient to te mod 6 is sufficient to tell us whether 2|ll us whether 2|nn or 3| or 3|nn. If (. If (nn mod 6) mod 6){0, 3} then 3|{0, 3} then 3|nn; if i; if it is in {0, 2, 4} then 2|t is in {0, 2, 4} then 2|nn. Thus (. Thus (nn mod 6) mod 6){1, 5}.{1, 5}.

Case #1: Case #1: If If nn mod 6 = 1, then ( mod 6 = 1, then (kk) ) nn = 6 = 6kk+1. +1. nn22 = 36 = 36kk22+12+12kk+1, so +1, so nn22−1 = 36−1 = 36kk22+12+12kk = 12(3 = 12(3kk+1)+1)kk. Note 2|(3. Note 2|(3kk+1)+1)kk sinc since either e either kk or 3 or 3kk+1 is even. Thus 24|(+1 is even. Thus 24|(nn22−1).−1).

Case #2:Case #2: If If nn mod 6 = 5, then mod 6 = 5, then nn = 6 = 6kk+5. +5. nn22−1 = (−1 = (nn−1)·(−1)·(nn+1) +1) = (6= (6kk+4)·(6+4)·(6kk+6) = 12·(3+6) = 12·(3kk+2)·(+2)·(kk+1). Either +1). Either kk+1 or 3+1 or 3kk+2 i+2 i

s even. Thus, 24|(s even. Thus, 24|(nn22−1). −1). ■■

Page 52: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Proof by Examples ?Proof by Examples ?

• A universal statement can A universal statement can nevernever be proven by be proven by using examples, using examples, unlessunless the universe can be vali the universe can be validly reduced to only dly reduced to only finitelyfinitely many examples, an many examples, and your proof covers d your proof covers allall of them! of them!

Theorem:Theorem: ¬¬ x, yx, yZZ: : xx22+3+3yy22 = 8. = 8.

Proof:Proof: If | If |xx|≥3 or ||≥3 or |yy|≥2 then |≥2 then xx22+3+3yy22 >8. This leav >8. This leaves es xx22{0, 1, 4} and 3{0, 1, 4} and 3yy22{0, 3}. The largest pa{0, 3}. The largest pair sum to 4+3 = 7 < 8. ir sum to 4+3 = 7 < 8. ■■

Page 53: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Adapting Existing ProofsAdapting Existing Proofs

Theorem:Theorem: There are infinitely many primes of the There are infinitely many primes of the form 4form 4kk+3, where +3, where kkNN..

- One way to prove that there are infinitely many - One way to prove that there are infinitely many primes because if primes because if pp11,…,,…,ppnn were all the primes, th were all the primes, th

en (en (∏∏ppii)+1 must be prime or have a prime factor )+1 must be prime or have a prime factor

greater than greater than ppnn contradiction! contradiction!

Page 54: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Adapting Existing ProofsAdapting Existing Proofs

Theorem:Theorem: There are infinitely many primes of the form 4 There are infinitely many primes of the form 4kk+3, where +3, where kkNN..

Proof:Proof: Similarly, suppose Similarly, suppose qq11,…,,…,qqnn lists all primes of the fo lists all primes of the fo

rm 4rm 4kk+3, and analogously consider +3, and analogously consider QQ = 4(∏ = 4(∏qqii)+3.)+3.

Unfortunately, since Unfortunately, since qq11 = 3 is possible, 3| = 3 is possible, 3|QQ and so and so QQ does ha does ha

ve a prime factor among the ve a prime factor among the qqii, so this doesn’t work!, so this doesn’t work!

So instead, consider So instead, consider QQ = 4(∏ = 4(∏qqii)−1 = 4(∏)−1 = 4(∏qqii−1)+3. This −1)+3. This

has the right form, and has no has the right form, and has no qqii as a factor since as a factor since ii: : Q Q

≡ ≡ −1 (mod −1 (mod qqii).).

Page 55: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Conjecture and ProofConjecture and Proof• We know that some numbers of the form 2We know that some numbers of the form 2pp−1 are pri−1 are pri

me when me when pp is prime. is prime. - These are called the - These are called the Mersenne primes (Mersenne primes ( 梅森質數梅森質數 ))..

• Can we prove the inverse, that Can we prove the inverse, that aann−1 is composite whe−1 is composite whenever either never either aa>2, or (>2, or (aa=2 but =2 but nn is composite)? is composite)?

- All we need is to find a factor greater than 1.- All we need is to find a factor greater than 1.

• Note Note aann−1 factors into (−1 factors into (aa−1)(−1)(aann−1−1+…++…+aa+1).+1). - When - When aa>2, (>2, (aa−1)>1, and so we have a factor.−1)>1, and so we have a factor. - When - When nn is composite, is composite, r, sr, s>1: >1: nn==rsrs. Thus, given . Thus, given aa=2, =2,

aann = 2 = 2nn = 2 = 2rsrs = (2 = (2rr))ss, and since , and since rr>1, 2>1, 2r r > 2 so 2> 2 so 2nn − 1 = − 1 = bbss

−1 with −1 with bb = 2 = 2rr > 2, which now fits the first case. > 2, which now fits the first case.

Page 56: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

FYI : Mersenne PrimesFYI : Mersenne Primes梅森數 梅森數 & & 梅森質數梅森質數• 法國數學家梅森 法國數學家梅森 (Marin Mersenne 1588-1648) (Marin Mersenne 1588-1648) 和業和業

餘數學王子費馬 餘數學王子費馬 (Pierre de Fermat 1601-1665) (Pierre de Fermat 1601-1665) 是好是好友。十七世紀,費馬也曾對完全數 友。十七世紀,費馬也曾對完全數 (Perfect Numbe(Perfect Number) r) 的問題有興趣。他考察過如 的問題有興趣。他考察過如 22pp – 1 – 1 的數的質性。的數的質性。16401640 年 年 66 月,費馬給梅森的信中提出三個定理,月,費馬給梅森的信中提出三個定理,是研究整數質數的基礎:是研究整數質數的基礎:

1. 1. 若若 nn 不是質數,則 不是質數,則 22nn-1 -1 也不是質數。也不是質數。2. 2. 若 若 nn 是質數,則 是質數,則 22nn-2 -2 可被 可被 22nn 整除,即 整除,即 22nn-1-1 = 1 = 1

(mod (mod nn)) ,即後來的「,即後來的「費馬小定理費馬小定理」」 (Fermat's Little (Fermat's Little Theorem)Theorem) 。。

3. 3. 若若 nn 是質數除了 是質數除了 22knkn+1 +1 這種形式的數以外, 這種形式的數以外, 22nn-1 -1 不能被其他形式的質數整除。不能被其他形式的質數整除。

• http://hk.geocities.com/goodprimes/CMersenne1.htmhttp://hk.geocities.com/goodprimes/CMersenne1.htm

Page 57: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

More : Mersenne PrimesMore : Mersenne Primes梅森數 梅森數 & & 梅森質數梅森質數• 定理定理 (1)(1) 相當於若 相當於若 22nn-1 -1 是質數,則 是質數,則 nn 是質數,反是質數,反

之則未必成立。之則未必成立。• 梅森在其於梅森在其於 16441644 年出版的著作《物理—數學探年出版的著作《物理—數學探

索》的序言中提出在不超過 索》的序言中提出在不超過 257 257 的 的 55 55 個質數中,個質數中,僅當 僅當 pp = 2 = 2 、、 33 、、 55 、、 77 、、 1313 、、 1717 、、 1919 、、 3131 、、6767 、、 127 127 和 和 257257 ,這 ,這 11 11 個質數時,個質數時, 22pp-1 -1 為質數。為質數。他本人驗証了前七個數,後四個數因計自算量太大他本人驗証了前七個數,後四個數因計自算量太大而未能驗証。為了紀念他,後人把形如 而未能驗証。為了紀念他,後人把形如 22pp-1 -1 的數的數稱為梅森數 稱為梅森數 (Mersenne Number, Mp)(Mersenne Number, Mp) ,形如 ,形如 22pp-1 -1 的質數稱為梅森質數 的質數稱為梅森質數 (Mersenne Prime)(Mersenne Prime) ,上述斷,上述斷言稱為梅森猜想 言稱為梅森猜想 (Mersenne‘s Conjecture) (Mersenne‘s Conjecture) 。然而梅。然而梅森在其論作中竟有五個錯誤之多。森在其論作中竟有五個錯誤之多。

• http://hk.geocities.com/goodprimes/CMersenne1.htmhttp://hk.geocities.com/goodprimes/CMersenne1.htm

Page 58: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

More : Mersenne PrimesMore : Mersenne Primes梅森數 梅森數 & & 梅森質數梅森質數• 其後的梅森質數的發現都是借助 其後的梅森質數的發現都是借助 GIMPS GIMPS (Great Inte(Great Inte

rnet Mersenne Prime Search) rnet Mersenne Prime Search) 的程式協助。的程式協助。

•4444thth Known Mersenne Prime Found!! Known Mersenne Prime Found!!

•On September 4, 2006, in the same room just a few feeOn September 4, 2006, in the same room just a few feet away from their last find, Dr. Curtis Cooper and Dr. t away from their last find, Dr. Curtis Cooper and Dr. Steven Boone's Steven Boone's CMSUCMSU team broke their own team broke their own world recordworld record, discovering the 44th known Mersenne pr, discovering the 44th known Mersenne prime, 232,582,657-1. The new prime at ime, 232,582,657-1. The new prime at 9,808,358 digits9,808,358 digits is 650,000 digits larger than their previous record primis 650,000 digits larger than their previous record prime found last December. e found last December.

• http://www.mersenne.org/prime.htmhttp://www.mersenne.org/prime.htm

Page 59: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Conjecture & Conjecture & CounterexamplesCounterexamples

Conjecture: Conjecture: integers integers nn > 0, > 0, nn22−−nn+41 is prime.+41 is prime.

Hmm, let’s see if we can find any counter-examples:Hmm, let’s see if we can find any counter-examples:

1122−1+41 = 41 (prime)−1+41 = 41 (prime)

2222−2+41 = 4−2+41 = 43 (prime)−2+41 = 4−2+41 = 43 (prime)

3322−3+41 = 47 (prime) Looking good so far!!−3+41 = 47 (prime) Looking good so far!!

Can we conclude after showing that it checks out in, sCan we conclude after showing that it checks out in, say, 20 or 30 cases, that the conjecture must be true?ay, 20 or 30 cases, that the conjecture must be true?

• NEVER_NEVER_NEVER NEVER NEVER NEVER NEVER NEVER NEVER !!!NEVER !!!

# Of course, 41# Of course, 4122−41+41 is divisible by 41!!−41+41 is divisible by 41!!

Page 60: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Even Great Mathematicians Can Even Great Mathematicians Can Propose False Conjectures!Propose False Conjectures!

• EulerEuler conjectured that conjectured that for for nn > 2 > 2, the , the sum of sum of nn−1 −1 nnthth powers of positive integers is not an powers of positive integers is not an nnthth power power..

Remained true for all cases checked for 200 years, Remained true for all cases checked for 200 years, but but no proofno proof was found. was found.

• Finally, in 1966, someone noticed thatFinally, in 1966, someone noticed that272755 + 84 + 8455 + 110 + 11055 + 133 + 13355 = 144 = 14455..

Larger counter-examples have also been found for Larger counter-examples have also been found for nn = 4, but = 4, but none for none for nn > 5 yet > 5 yet..

Page 61: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Euler's ConjectureEuler's Conjecture• Euler's conjectureEuler's conjecture is a is a conjectureconjecture in in mathematicsmathematics rel rel

ated to ated to Fermat's last theoremFermat's last theorem which was proposed by which was proposed by LeonhardLeonhard Euler Euler in in 17691769. It states that for all . It states that for all integersintegers nn and and kk greater than 1, if the sum of greater than 1, if the sum of nn kkthth powers of po powers of positive integers is itself a sitive integers is itself a kkthth power, then power, then nn is not small is not smaller than er than kk. In symbols, that is if. In symbols, that is if

, for , for nn > 2 > 2

where each where each aaii's are some particular (positive) integer a's are some particular (positive) integer a

nd nd bb is another integer, is another integer, then then nn ≥ ≥ kk..

Page 62: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Euler's ConjectureEuler's Conjecture• The conjecture was disproven by The conjecture was disproven by L. J. LanderL. J. Lander and T. R. Parkin and T. R. Parkin

in 1966 when they found the following in 1966 when they found the following counterexamplecounterexample for for kk = = 5: 275: 2755 + 84 + 8455 + 110 + 11055 + 133 + 13355 = 144 = 14455. .

• In In 19861986, , NoamNoam ElkiesElkies found a found a methodmethod to construct counterexa to construct counterexamples for the mples for the kk = 4 case. His = 4 case. His smallestsmallest counterexample was the counterexample was the following: 2682440following: 268244044 + 15365639 + 1536563944 + 18796760 + 1879676044 = 20615673 = 2061567344. .

• In In 19881988, , Roger FryeRoger Frye subsequently found the subsequently found the smallest possible smallest possible kk = 4 counterexample = 4 counterexample by a by a direct computer searchdirect computer search using techni using techniques suggested by ques suggested by ElkiesElkies: 95800: 9580044 + 217519 + 21751944 + 414560 + 41456044 = 4224 = 4224818144. .

• In In 19661966 Lander, Parkin and Lander, Parkin and John F. John F. SelfridgeSelfridge conjectured that conjectured that for every for every kk > 3, if then > 3, if then nn++mm≥≥k k ..

Page 63: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Fermat’s “Last Theorem”Fermat’s “Last Theorem”Theorem:Theorem: xxnn++yynn = = zznn has no solutions in integers has no solutions in integers xyzxyz ≠ 0≠ 0 w w

ith integer ith integer nn > 2 > 2..

- In the 1600s, Fermat famously claimed in a marginal no- In the 1600s, Fermat famously claimed in a marginal note that he had a “wondrous proof” of the theorem.te that he had a “wondrous proof” of the theorem.

But unfortunately, if he had one, he never published it!But unfortunately, if he had one, he never published it! - The theorem remained a publicly unproven conjecture f- The theorem remained a publicly unproven conjecture f

or the next ~400 years!or the next ~400 years! - Finally, a proof that requires - Finally, a proof that requires hundreds of pages of advahundreds of pages of adva

nced mathematicsnced mathematics was found by was found by Wiles at Princeton in 1Wiles at Princeton in 1990990. It took him 10 years of work to find it!. It took him 10 years of work to find it!

• Challenge:Challenge: Find a Find a short, simpleshort, simple proof of Fermat’s last t proof of Fermat’s last theorem, and you will become instantly famous!heorem, and you will become instantly famous!

Page 64: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Some Open ConjecturesSome Open Conjectures

Conjecture 1:Conjecture 1: There are infinitely many primes of the fo There are infinitely many primes of the form rm nn22+1+1, where , where nnZZ..

Conjecture 2:Conjecture 2: (Twin Prime Conjecture) There are infinit (Twin Prime Conjecture) There are infinitely pairs of primes of the form ely pairs of primes of the form ((pp, , pp+2).+2).

Conjecture 3:Conjecture 3: (The Hailstone Problem) If (The Hailstone Problem) If hh((xx) = ) = xx/2/2 wh when en xx is even, and is even, and 33xx+1+1 when when xx is odd, then is odd, then xxNN nnNN hhnn((xx) = 1) = 1 (where the superscript denotes composition (where the superscript denotes composition of of hh with itself with itself nn times). times).

Prove any of these, and you can probably have a lifetimeProve any of these, and you can probably have a lifetimecareer sitting around doing pure mathematics…career sitting around doing pure mathematics…

Page 65: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Basic Number TheoryBasic Number Theory

Page 66: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

The Integers & DivisionThe Integers & Division

Of course, you already know what the integers Of course, you already know what the integers are, and what division is…are, and what division is…

But:But: There are some specific notations, There are some specific notations, terminology, and theorems associated with terminology, and theorems associated with these concepts which you may not know.these concepts which you may not know.

These form the basics of These form the basics of number theorynumber theory.. - Vital in many important algorithms today (hash - Vital in many important algorithms today (hash

functions, cryptography, digital signatures).functions, cryptography, digital signatures).

Page 67: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Divides, Factor, MultipleDivides, Factor, Multiple

Let Let aa,,bbZZ with with aa0.0.

Def.: Def.: aa||bb “ “aa dividesdivides bb” :” : ( (ccZZ:: b=acb=ac))“There is an integer “There is an integer cc such that such that cc times times a a equals equals b.b.””

E.g., 3E.g., 312 12 TrueTrue, but 3, but 37 7 FalseFalse..

Iff Iff aa divides divides bb, then we say , then we say aa is a is a factorfactor or a or a dividivisorsor of of bb, and , and bb is a is a multiplemultiple of of aa..

E.g., “E.g., “bb is even” : is even” :≡ 2|≡ 2|bb. Is 0 even? Is −4?. Is 0 even? Is −4?

Page 68: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Facts re: the Divides Facts re: the Divides RelationRelation

Theorem:Theorem: aa, , bb, , c c ZZ::

1. 1. aa|0|0

2. (2. (aa||bb aa||cc) ) aa | ( | (bb + + cc))

3. 3. aa||bb aa||bcbc

4. (4. (aa||bb bb||cc) ) aa||cc

ProofProof of (2): of (2): aa||bb means there is an means there is an ss such that such that bb==asas, and , and aa||cc means that there is a means that there is a tt such that such that cc==atat, so , so bb++cc = = asas++atat = = aa((ss++tt), so ), so aa|(|(bb++cc). ). ■■

Page 69: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

More Detailed Version of More Detailed Version of ProofProof

Show Show aa, , bb, , c c ZZ: (: (aa||bb aa||cc) ) aa | ( | (bb + + cc).).

• Let Let aa, , bb, , cc be any integers such that be any integers such that aa||bb and and aa||cc,, and show that and show that aa | ( | (bb + + cc))..

• By defBy defnn. of “ | ” , we know . of “ | ” , we know ss: : bb = as= as, and , and tt: : cc = at= at. Let . Let ss, , tt, be such integers., be such integers.

• Then Then bb++c = asc = as + + at at = = aa((ss++tt), so ), so uu: : bb++cc = = auau, namely , namely uu = = ss++t. t. Thus Thus aa|(|(bb++cc).).

Page 70: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Prime NumbersPrime Numbers

• An integer An integer pp>1 is >1 is primeprime iff it is not the prod iff it is not the product of two integers greater than 1:uct of two integers greater than 1:pp>1 >1 aa, , bbN:N: aa>1, >1, bb>1, >1, abab = = pp..

• The only positive factors of a prime The only positive factors of a prime pp are 1 are 1 and and pp itself. Some primes: 2, 3, 5, 7, 11,... itself. Some primes: 2, 3, 5, 7, 11,...

• Non-prime integers greater than 1 are called Non-prime integers greater than 1 are called compositecomposite, because they can be , because they can be composedcomposed b by multiplying two integers greater than 1.y multiplying two integers greater than 1.

Page 71: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Review So FarReview So Far

• aa||bb “ “aa dividesdivides bb” ” ccZZ:: b=acb=ac

• ““pp is is primeprime” ” pp>1 >1 aaN:N: (1 < (1 < a a < < p p a|pa|p))

• Terms Terms factorfactor, , divisordivisor, , multiplemultiple,, composite composite..

Page 72: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Fundamental Theorem of Fundamental Theorem of ArithmeticArithmetic

• Every positive integer has a Every positive integer has a uniqueunique representation as t representation as the he product of a non-decreasing series of zero or more product of a non-decreasing series of zero or more primesprimes. Examples:. Examples:

- 1 = (product of empty series) = 1- 1 = (product of empty series) = 1

- 2 = 2 (product of series with one element 2)- 2 = 2 (product of series with one element 2)

- 4 = 2·2 (product of series 2, 2)- 4 = 2·2 (product of series 2, 2)

- 2000 = 2·2·2·2·5·5·5; 2001 = 3·23·29;- 2000 = 2·2·2·2·5·5·5; 2001 = 3·23·29;

- 2002 = 2·7·11·13; 2003 = 2003 (no clear pattern!)- 2002 = 2·7·11·13; 2003 = 2003 (no clear pattern!)Later, we will see how to rigorously prove the

Fundamental Theorem of Arithmetic, starting from scratch!

Page 73: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

An Application of Primes!An Application of Primes!• When you visit a secure web site (https:… address, inWhen you visit a secure web site (https:… address, in

dicated by padlock icon in IE, key icon in Netscape), tdicated by padlock icon in IE, key icon in Netscape), the browser and web site may be using a technology cahe browser and web site may be using a technology called lled RSA encryptionRSA encryption..

• This This public-key cryptography public-key cryptography scheme involves exchanscheme involves exchanging ging public keyspublic keys containing the product containing the product pqpq of two ran of two random large primes dom large primes pp and and qq (a (a private keyprivate key) which must ) which must be kept secret by a given party.be kept secret by a given party.

• So, the security of your day-to-day web transactions dSo, the security of your day-to-day web transactions depends critically on the fact that all known factoring aepends critically on the fact that all known factoring algorithms are intractable! … lgorithms are intractable! … 密碼學 …密碼學 …

Note:Note: There There isis a tractable a tractable quantumquantum algorithm for factoring; so if we can algorithm for factoring; so if we can ever build big quantum computers, then RSA is not secure.ever build big quantum computers, then RSA is not secure.

Page 74: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

The Division “Algorithm”The Division “Algorithm”

• It’s really just a It’s really just a theoremtheorem, not an algorithm… , not an algorithm… – Only called an “algorithm” for historical reasons.Only called an “algorithm” for historical reasons.

Theorem: Theorem: For any integer For any integer dividenddividend aa and and divisdivisoror dd≠0≠0, there is a unique integer , there is a unique integer quotientquotient qq an andd remainder r remainder rNN such that such that a a = = dq dq + + rr and 0 and 0 r r < |< |d|d|. Formally, the thm. is: . Formally, the thm. is: aa, , ddZZ, , dd≠0:≠0: !!qq, , rrZZ: 0: 0rr<|<|d|d|, , a=dqa=dq++rr..

• We can find We can find qq and and rr by: by: qq = [ = [aadd], ], rr = = aadqdq..

Page 75: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Greatest Common DivisorGreatest Common Divisor

• The The greatest common divisor greatest common divisor gcd(gcd(aa, , bb)) of integers of integers aa, , bb (not both 0) is the largest (most positive) inte (not both 0) is the largest (most positive) integer ger dd that is a divisor both of that is a divisor both of aa and of and of bb..

dd = gcd( = gcd(aa, , bb) = ) = max(max(dd: : dd||a a dd||bb) )

dd||a a dd||bb eeZZ,, ((ee||aa ee||bb) → ) → d ≥ ed ≥ e

Example:Example: gcd(24, 36)=? gcd(24, 36)=?Positive common divisors: 1, 2, 3, 4, 6, 12.Positive common divisors: 1, 2, 3, 4, 6, 12.The largest one of these is 12.The largest one of these is 12.

Page 76: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

GCD ShortcutGCD Shortcut

• If the prime factorizations are written asIf the prime factorizations are written as and , and ,then the GCD is given by:then the GCD is given by:

• Example of using the shortcut:Example of using the shortcut:

aa=84=2·2·3·7 = 2=84=2·2·3·7 = 222·3·311·7·711

bb=96=2·2·2·2·2·3 = 2=96=2·2·2·2·2·3 = 255·3·311·7·700

gcd(84,96) = 2gcd(84,96) = 222·3·311·7·70 0 = 2·2·3 = 12.= 2·2·3 = 12.

nan

aa pppa 2121 nb

nbb pppb 2121

.),gcd( ),min(),min(2

),min(1

2211 nn ban

baba pppba

Page 77: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Relatively PrimeRelatively Prime

• Integers Integers aa and and bb are called are called relatively primerelatively prime or or coprimecoprime iff their gcd = 1. iff their gcd = 1.

E.g.,E.g., Neither 21 nor 10 is prime, but they are Neither 21 nor 10 is prime, but they are coprimecoprime. . 21= 3·721= 3·7 and and 10 = 2·510 = 2·5, so they hav, so they have no common factors > 1, so their gcd = 1.e no common factors > 1, so their gcd = 1.

• A set of integers {A set of integers {aa11, , aa22,…} is (,…} is (pairwisepairwise)) rel rel

atively primeatively prime if all pairs ( if all pairs (aaii, , aajj), for ), for iijj, are , are

relatively prime.relatively prime.

Page 78: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Least Common MultipleLeast Common Multiple

• lcm(lcm(aa,,bb)) of positive integers of positive integers aa, , bb, is the smalle, is the smallest positive integer that is a multiple both of st positive integer that is a multiple both of aa a and of nd of bb. . E.g.,E.g., lcm(6,10)=30 lcm(6,10)=30

mm = lcm( = lcm(aa,,bb) = min() = min(mm: : aa||mm bb||mm)) aa||mm bb||mm nnZZ: (: (aa||nn bb||nn) → () → (m ≤ m ≤ nn))

• If the prime factorizations are written asIf the prime factorizations are written as and , and ,

then the LCM is given bythen the LCM is given by

nan

aa pppa 2121 nb

nbb pppb 2121

.),(lcm ),max(),max(2

),max(1

2211 nn ban

baba pppba

Page 79: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

The mod OperatorThe mod Operator

• An integer “division remainder” operator.An integer “division remainder” operator.

• Let Let aa, , ddZZ with with d>d>11. Then . Then aa modmod dd denote denotes the remainder s the remainder rr from the division “algorith from the division “algorithm” with dividend m” with dividend aa and divisor and divisor dd; ; i.e.i.e. the re the remainder when mainder when aa is divided by is divided by dd..

- Using - Using e.g.e.g. long division. long division.

• We can compute We can compute ((aa modmod dd)) by: by: a a dd··[[aa//dd]]..

• In C/C++/Java languages, “%” = mod.In C/C++/Java languages, “%” = mod.

Page 80: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Modular CongruenceModular Congruence

• Let Let aa, , bbZZ, , mmZZ++ , , where where ZZ++ = { = {nnZ Z | | nn>0}=>0}=NN−{0}−{0} (the + integers). (the + integers).

• Then Then aa is is congruent tocongruent to bb modulomodulo mm, written “, written “aabb (mod (mod mm))”, iff ”, iff m m | | aabb . (. ( 同餘的同餘的 ))

Note: this is a different use of “Note: this is a different use of “” than the mean” than the meaning “is defined as” we’ve used before.ing “is defined as” we’ve used before.

• It’s also equivalent to: It’s also equivalent to: ((aabb) mod ) mod m m = 0= 0..

Page 81: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Spiral Visualization of modSpiral Visualization of mod

≡ ≡ 33(mod 5)(mod 5)

≡ ≡ 22(mod 5)(mod 5)

≡ ≡ 11(mod 5)(mod 5)

≡ ≡ 00(mod 5)(mod 5)

≡ ≡ 44(mod 5)(mod 5) 0

123

4

5

6

78

9

10

11

1213

14

15

16

1718

19

20

21

22

E.g., modulo-5 arithmeticE.g., modulo-5 arithmetic

Page 82: 資訊科學數學 8 : Proof Strategy, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen) chichen6@mail.tcu.edu.tw

Useful Congruence Useful Congruence TheoremsTheorems

Theorem:Theorem: Let Let aa, , bbZZ, , mmZZ++. Then:. Then:aabb (mod (mod mm)) kkZZ aa==bb++kmkm..

Theorem:Theorem: Let Let aa, , bb, , cc, , ddZZ, , mmZZ++. Then if . Then if aabb (mod (mod mm) and ) and ccdd (mod (mod mm)), then:, then:

. a+c. a+c b+db+d (mod (mod mm), and), and

. . ac ac bdbd (mod (mod mm))