Midterm Review Session • Wednesday, June 13 from 5‐6pm in ORCH 3074 CPSC 121: Models of Computation – the TAs will stay until 6:30pm if there are still 2018S questions Proof Techniques (Part A) Meghan Allen based on notes by Steve Wolfman, Patrice Belleville and others 1 2 Outline Learning Goals: “Pre‐Class” • Learning Goals, Quiz Notes, and Big Picture Be able for each proof strategy below to: • Problems and Discussion: Generally Faster? – Identify the form of statement the strategy can prove. – Sketch the structure of a proof that uses the strategy. – Breaking Down Big Proofs – Witness Proofs, also known as Proofs of Existence Strategies: constructive/non‐constructive proofs of – Without loss of generality (WLOG), also known as existence ("witness"), disproof by Generalizing from the Generic Particular counterexample, exhaustive proof, generalizing – Antecedent Assumption from the generic particular ("WLOG"), direct – Proving Inequality (and equivalences/equality) proof ("antecedent assumption"), proof by – Breaking Down Big Proofs, Revisited contradiction, and proof by cases. Alternate names are listed for some techniques. • Coming Soon: The Rest 3 4 1
Where We Are in Learning Goals: In‐Class The Big Stories By the end of this unit, you should be able to: Theory Hardware – Devise and attempt multiple different, appropriate How do we model How do we build devices to proof strategies—including all those listed in the computational systems? compute? “pre‐class” learning goals plus use of logical equivalences, rules of inference, universal modus Now : With our powerful Now : We’ve been mostly on ponens/tollens, and predicate logic premises—for modelling language (pred the theoretical side for a given theorem. logic), we can begin to a while, and we’ll – For theorems requiring only simple insights express interesting stay there for a little questions (like whether while longer. Never beyond strategic choices or for which the insight is one algorithm is faster fear, though, we’ll given/hinted, additionally prove the theorem. than another “in general”). return! 5 6 Outline Our “GenerallyFaster” • Learning Goals, Quiz Notes, and Big Picture GenerallyFaster(a1, a2) = i Z + , n Z + , n i Faster(a1, a2, n). • Problems and Discussion: Generally Faster? – Breaking Down Big Proofs – Witness Proofs, also known as Proofs of Existence – Without loss of generality (WLOG), also known as Generalizing from the Generic Particular – Antecedent Assumption – Proving Inequality (and equivalences/equality) – Breaking Down Big Proofs, Revisited time • Coming Soon: The Rest Alg A 8 7 Alg B problem size 2
Our Algorithms Our Algorithms At Particular Sizes (a) Ask each student for the list of their (a) For 10 students: 10 minutes groupmates’ classes, and check for each class For 100 students: 100 minutes whether it is CPSC 121. If the answer is ever For 400 students: 400 minutes yes, include the student in my count. (b) For each student s 1 in the class, ask the (b) For 10 students: ~10*10 seconds student for each other student s 2 in the class For 100 students: ~100*100 seconds whether s 2 is a groupmate. If the answer is For 400 students: ~400*400 seconds ever yes, include s 1 in my count. time time Alg A Alg A 9 10 Alg B Alg B problem size problem size Proving “GenerallyFaster” Proving “GenerallyFaster” Theorem: i Z + , n Z + , n i 60n < n 2 . GenerallyFaster(a1, a2) = i Z + , n Z + , n i Faster(a1, a2, n). Which of these is the best overall description of this Can we prove algA is generally faster than algB? statement? a. It’s a big “AND”. GenerallyFaster(algA, algB) b. It’s a big “OR”. i Z + , n Z + , n i Faster(algA, algB, n). i Z + , n Z + , n i 60n < n 2 . c. It’s a conditional. d. It’s an inequality. time time Alg A Alg A (The last line is what we really mean in this case.) 11 12 Alg B Alg B problem size problem size 3
Proving “GenerallyFaster” Proving “GenerallyFaster” Theorem: i Z + , n Z + , n i 60n < n 2 . Theorem: i Z + , n Z + , n i 60n < n 2 . We can always pick out the “outermost” operator: We can always pick out the “outermost” operator: i Z + , P(i) , where… i Z + , P(i) , where… P(i) = n Z + , n i 60n < n 2 P(i) = n Z + , Q(i,n), Q(i,n) = n i 60n < n 2 time time Alg A Alg A 13 14 Alg B Alg B problem size problem size Proving “GenerallyFaster” Proving “GenerallyFaster” Theorem: i Z + , n Z + , n i 60n < n 2 . Theorem: i Z + , n Z + , n i 60n < n 2 . We can always pick out the “outermost” operator: We can always pick out the “outermost” operator: i Z + , P(i) , where… i Z + , P(i) , where… P(i) = n Z + , Q(i,n), P(i) = n Z + , Q(i,n), Q(i,n) = R(i,n) S(n), Q(i,n) = R(i,n) S(n), R(i,n)= n i, R(i,n)= n i, S(n) = 60n < n 2 S(n) = 60n < n 2 So to get started , we can think about how to prove an existential… time time Alg A Alg A 15 16 Alg B Alg B problem size problem size 4
Proof of Existence or Outline “witness proofs” • Learning Goals, Quiz Notes, and Big Picture Pattern to prove x D, R(x) . • Problems and Discussion: Generally Faster? – Breaking Down Big Proofs Prove R(x) for any one x in D . – Witness Proofs, also known as Pick the one that makes your job easiest! Proofs of Existence – Without loss of generality (WLOG), also known as The x you use for your proof is the “ witness ” to Generalizing from the Generic Particular the existential… it “testifies” that your – Antecedent Assumption existential is true. – Proving Inequality (and equivalences/equality) (We’re proving one of the disjuncts of a big “OR”.) proving – Breaking Down Big Proofs, Revisited • Coming Soon: The Rest 17 18 Witness Proof Example : Proving “GenerallyFaster” A Touch of Brevity Our Strategy So Far Theorem: i Z + , n Z + , n i 60n < n 2 . Theorem : There’s a valid BSL program shorter LEAVE this blank until you know what to pick. than this (45‐character) Java program: Take notes as you learn more about i . We pick i = ??. class A{public static void main(String[]a){}} Then, we prove: n Z + , n i 60n < n 2 . Problem : prove the theorem. time Alg A 19 20 Alg B problem size 5
Proving “GenerallyFaster” Form of Our “TODO Item” Our Strategy So Far Partial Theorem: n Z + , n i 60n < n 2 . Theorem: i Z + , n Z + , n i 60n < n 2 . We pick i = ??. Which of these is the best overall description of this statement? Then, we prove: n Z + , n i 60n < n 2 . a. It’s a big “AND”. b. It’s a big “OR”. That’s the same as: Q(i,n) = n i 60n < n 2 . c. It’s a conditional. n Z + , Q(i,n). d. It’s an inequality. time time Alg A Alg A So, how do we prove a universal? 21 22 Alg B Alg B problem size problem size Generalizing from the Generic Particular / Outline Without Loss of Generality (WLOG) • Learning Goals, Quiz Notes, and Big Picture Pattern to prove x D, R(x) . • Problems and Discussion: Generally Faster? Pick some arbitrary x , but assume nothing – Breaking Down Big Proofs about which x it is except that it’s drawn from – Witness Proofs, also known as D Proofs of Existence – Without loss of generality (WLOG), also known as Then prove R(x) . Generalizing from the Generic Particular That is: pick x “without loss of generality”! – Antecedent Assumption – Proving Inequality (and equivalences/equality) – Breaking Down Big Proofs, Revisited proving • Coming Soon: The Rest 24 23 6
WLOG Example : Why Does This Work? My Machine Speaks BSL Pattern to prove x D, R(x) . Theorem: Any valid BSL program can be Pick some arbitrary x , but assume nothing represented in my computer’s machine about which x it is except that it’s drawn from language. D . Then prove R(x) . Problem : prove the theorem. This is a big “AND”. To prove it, we must prove each “conjunct”. Can we generate each individual proof from this one generic proof? 25 26 WLOG Example : Proving “GenerallyFaster” My Machine Speaks BSL Our Strategy So Far Theorem: i Z + , n Z + , n i 60n < n 2 . Theorem : Any valid BSL program can be represented in my computer’s machine language. Proof : Without loss of generality, consider a valid BSL We pick i = ??. program p . Without loss of generality, let n be an arbitrary positive Since p is valid, DrRacket can interpret it on my computer. integer. However, all commands that my computer runs are expressed in its machine language. Then, we prove: n i 60n < n 2 . Therefore, p can be expressed (as the combination of the compiled DrRacket program and the input program) in my computer’s machine language. QED time Alg A 27 28 Alg B problem size 7
Recommend
More recommend