CPSC 121: Models of Computation. Module 9: Proof Techniques (part 2) Mathematical Induction
|
|
- Shanna Johnson
- 5 years ago
- Views:
Transcription
1 CPSC 121: Models of Computation Module 9: Proof Techniques (part 2) Mathematical Induction
2 Module 9: Announcements Midterm #2: th Monday November 14, 2016 at 17:00 Modules 5 (from multiple quantifiers onwards) to 8 plus labs 4, 5, 6 and 7. Same locations as for midterm #1. You can bring one 8.5 x 11in (21.59 x 27.94cm) two sided sheet of paper. No textbook, calculator or other electronic equipment is allowed. 2
3 Module 9: Announcements Assignment #4 is due Thursday November 10th at 11:00. Pre-class quiz #10 is tentatively due on Monday November 21st at 19:00. Textbook sections: Epp, 4th edition: 6.1, 7.1 Epp, 3rd edition: 5.1, 6.1 Rosen, 6th edition: 2.1, 2.3 up to the top of page 136. Rosen, 7th edition: 2.1, 2.3 down to the bottom of page
4 Module 9: Mathematical Induction By the start of class, you should be able to Convert sequences to and from explicit formulas that describe the sequence. Convert sums to and from summation/σ notation. Convert products to and from product/π notation. Manipulate formulas in summation/product notation by adjusting their bounds, merging or splitting summations/products, and factoring out values. 4
5 Module 9: Mathematical Induction Pre-class quiz #9 Very well done. Being comfortable with summations is important not only for CPSC 121, but for following courses too! As usual, we will revisit the open-ended question shortly. 5
6 Module 9: Mathematical Induction If you haven t already done so, read the rest of the chapters on mathematical induction (Epp4, 5.2 to 5.4, etc). After this reading, you will be able to: Given a theorem to prove stated in terms of its induction variable (i.e., usually, in terms of n), write out the skeleton of an inductive proof including: the base case(s) that need to be proven, the induction hypothesis, and the inductive step that needs to be proven. 6
7 Module 9: Mathematical Induction By the end of this module, you should be able to: Establish properties of self-referential structures using inductive proofs that naturally build on those self-references. Critique formal inductive proofs to determine whether they are valid and where the error(s) lie if they are invalid. Prove properties of the non-negative integers (or a subset) with appropriate self-referential structure using weak or strong induction as needed. 7
8 Module 9: Mathematical Induction?? 1. How can we? convince ourselves that an algorithm? does what it's supposed to do?? 2. How do we determine whether or not one algorithm is better than? another one????useful tool Mathematical induction is a very? when proving the correctness or efficiency of an algorithm.?? We will see several examples of this.???? CPSC 121: the BIG questions: 8
9 Module 9: Mathematical Induction Module Summary Example: single-elimination tournaments. Defining and validating mathematical induction. More examples where we can use induction. A slightly different type of induction. 9
10 Module 9.1: Single-elimination tournaments Problem: single-elimination tournament Teams play one another in pairs The winner of each pair advances to the next round Los Angeles Vancouver Toronto St. Louis Los Angeles Toronto Los Angeles Montréal Pittsburgh New York Isl. Montréal Buffalo Round 2 Montréal New York Isl. Montréal Round 3 Round 4 10
11 Module 9.1: Single-elimination tournaments Question: if we have n rounds of playoffs, how many teams can participate? a) n b) 2n c) n2 d) 2n e) None of the above. 11
12 Module 9.1: Single-elimination tournaments How can we prove this result formally? We will use a technique called mathematical induction. We will convince ourselves that it is a valid proof technique. Many theorems involve summations, so it is important to be comfortable manipulating them. Hence the reading for pre-class quiz #9. 13
13 Module 9.1: Single-elimination tournaments First we look at the following question instead: If t teams can participate in a playoff with n rounds, how many teams can participate in a playoff with n+1 rounds? a) t+1 b) 2t c) t2 d) 2t e) None of the above. 14
14 Module 9.1: Single-elimination tournaments Proof (with holes): Consider an unspecified playoff with n rounds. Assume that We can think of a playoff with n+1 rounds as follows: Two playoffs with n rounds proceed in parallel. The two winners then Since each playoff with n rounds has 16
15 Module 9.1: Single-elimination tournaments How do we use this to prove what we want? Recall Universal Modus Ponens: P(a) x D, P(x) Q(x) Q(a) If we define P(t, n): Up to t teams can participate in a playoff with n rounds then we have proved t Z+ n Z+, P(t, n) P(2t, n+1) 17
16 Module 9.1: Single-elimination tournaments So We know that only 2 teams can play with 1 round. This is P(2, 1). Given P(2, 1) t Z+ n Z+, P(t, n) P(2t, n+1) We can deduce: P(4, 2) 18
17 Module 9.1: Single-elimination tournaments Given P(4, 2) t Z+ n Z+, P(t, n) P(2t, n+1) We can deduce: P(8, 3) Given P(8, 3) t Z+ n Z+, P(t, n) P(2t, n+1) We can deduce: P(16, 4) 19
18 Module 9.1: Single-elimination tournaments Given P(16, 4) t Z+ n Z+, P(t, n) P(2t, n+1) We can deduce: P(32, 5) Etc... Therefore we can show that n Z+, P(2n, n) 20
19 Module 9.1: Single-elimination tournaments Another way to think about this: Given an unspecified positive integer n. To prove P(2n+1, n+1): First we prove P(2n, n). Then we use the fact that t Z+ n Z+, P(t, n) P(2t, n+1) Hence induction is more or less the same as recursion! A fun example involving induction: 21
20 Module 9: Mathematical Induction Module Summary Example: single-elimination tournaments. Defining and validating mathematical induction. More examples where we can use induction. A slightly different type of induction. 22
21 Module 9.2: Defining and validating M.I. Define Q(n) by: Q(n): P(2n,n) In the previous example, we proved Q(1) n Z+, Q(n) Q(n+1) and deduced that n Z+, Q(n) Why is this a valid proof technique? 23
22 Module 9.2: Defining and validating M.I. Theorem: Q(1) ^ ( n Z+, Q(n) Q(n+1)) n Z+, Q(n) Proof: We use a proof by contradiction. Suppose that the premises hold, but that n Z+, Q(n) is false. There is at least one value of n for which Q(n) does not hold. Let y be the smallest such value. Clearly y > 1, so y 1 Z +. 24
23 Module 9.2: Defining and validating M.I. Proof (continued): Because y is the smallest value for which Q(n) is false, and y 1 Z+, Q(y - 1) is true. But then the 2nd premise implies that Q(y) is true, a contradiction (since we assumed Q(y) was false). Therefore the conclusion must be true, that is n Z+, Q(n) holds. 25
24 Module 9.2: Defining and validating M.I. So a proof by mathematical induction has One (or more) base case(s): Q(1) Usually very straightforward to prove. An induction step: n Z+, Q(n) Q(n+1) We can use any proof technique we know for it. Usually a direct proof will work well. 26
25 Module 9: Mathematical Induction Module Summary Example: single-elimination tournaments. Defining and validating mathematical induction. More examples where we can use induction. A slightly different type of induction. 27
26 Module 9.3: More induction examples Example 1: recall the exercises from our first class: Make group of 5 students. Then order each group from in order of day of birth by swapping pairs of adjacent students. We claimed the maximum number of swaps for n students is n(n-1)/2. 28
27 Module 9.3: More induction examples How many swaps do we need? Suppose we place students from left to right. The students already placed are ordered by day of birth. We swap each new student with his/her neighbour until he/she is at the right place. The ith student may be swapped with all previous i-1 students. n 1 So the total number of swaps is Hence we need to prove that n 1 i=0 i= i=0 i n(n 1) 2 29
28 Module 9.3: More induction examples Which fact(s) do we need to prove? 0 a) i=0 i=0 ( )( )( ) n n( n 1) (n+ 1) n + i= b) n ℤ i= 2 2 i=0 i= 0 n 1 n n( n 1) ( n+1) n + c) n ℤ +, i= n ℤ, i = 2 2 i= 0 i =0 ( n 1 d) Both (a) and (b) ) e) Both (a) and (c) 30
29 Module 9.3: More induction examples Proof: Base case: n = 1 0 Clearly, with only 1 student, no swap is needed: i =0 i=0 which is equal to 1 (1-1)/2 Induction step: Pick an unspecified n 1. Assume that when we have n students, we need at most n(n-1)/2 swaps. Equivalently we assume that n 1 n(n 1) i= 2 i=0 This is called the Induction Hypothesis. 32
30 Module 9.3: More induction examples Proof (continued) Induction step (continued) For n+1 students, we need at most swaps. n ( ) n 1 i= i + n i=0 i =0 By the induction hypothesis, this is equal to n(n 1) ( n+ 1) n + n= 2 2 swaps, as required for the induction step. Hence by the principle of M.I., the theorem holds. QED 33
31 Module 9.3: More induction examples Example 2: geometric series We will prove that for every value of a 0, 1: t t+ 1 a 1 i a = a 1 i=0 These summations occur frequently when we need to determine the running time of divide-and-conquer algorithms. 34
32 Module 9.3: More induction examples Proof: Base case: t = 0 1 a 1 0 =1 In this case the summation is a = 1, and a 1 Induction step: Pick an unspecified t 0. Assume that Now Hence by the principle of M.I., the theorem holds. QED 35
33 Module 9.3: More induction examples Example 3: prove that n 4, 2n < n! Rules for inequalities: Start from one side (say the left side) Work step by step towards the other. When dealing with <, you are allowed to make the expression larger, but never smaller. Example: if I am smaller than you, then I am still smaller than you when you stand on a bench. 36
34 Module 9.3: More induction examples Proof: by induction on n. Base case: n = Induction step: we want to prove that n, if 2n-1 < (n-1)! then 2n < n! Consider an unspecified n. Induction hypothesis: assume that 2n-1 < (n-1)! Then 2n = 2(2n-1) < 2(n-1)! < n(n-1)! = n! this is where we approximate the induction hypothesis is used here Hence by the principle of M.I., n 4, 2n < n! 37
35 Module 9.3: More induction examples Example 4: prove that for every n 1, n i2 n i=1 Note (this doesn t help with the proof; it s simply an interesting mathematical fact): 1 π2 i2 = 6 i=1 38
36 Module 9.3: More induction examples Example 5: consider the following DFA:
37 Module 9.3: More induction examples This DFA accepts the empty string, and which other strings? a) Strings whose length is divisible by 5. b) Unsigned binary integers that are prime numbers. c) Strings where every 1 is followed by 01. d) Unsigned binary integers that are divisible by 5. e) None of the above. 40
38 Module 9.3: More induction examples What should we prove (ignoring empty strings)? a) The DFA is in state 0 if and only if it has seen one of the strings 1010, 1111 or b) The DFA is in state 0 if and only if s is divisible by 5. c) The DFA is in state 0 if and only if s is terminated by the string 101. d) The DFA is in state 0 if and only if s contains the substring 101 followed by zero or more 0's. e) None of the above. 42
39 Module 9.3: More induction examples Theorem: The DFA ends up in state r after reading a string s if and only if q Z, s = 5q+r. Proof: by induction on the length n of s. Base case: n = 1 This can be verified easily by looking at the DFA. Induction step: consider an unspecified n > 1. Induction hypothesis: the theorem holds for strings with n 1 characters. Consider an unspecified string s with n bits. 44
40 Module 9.3: More induction examples Proof (continued): Suppose that s = bn-1bn-2...b2b1b0. After reading the bits bn-1bn-2...b2b1, the DFA is in state r. By the induction hypothesis, the binary integer bn-1bn-2...b2b1 = 5q + r for some integer q. Now, s = 2 (bn-1bn-2...b2b1) + b0 = 2(5q+r) + b0 = 10q + 2r + b0 and so s = 5 (2q) + (2r + b0). So the DFA should have the following transitions: r b0 2r+b0 r b0 2r+b
41 Module 9.3: More induction examples Proof (continued): It does, and hence after reading all n bits of s, the DFA ends up in state r if and only if q Z, s = 5q+r. Hence by the principle of mathematical induction, the DFA ends up in state r after reading a string s if and only if q Z, s = 5q+r. QED Corollary: the DFA is in state 0 if and only if s is divisible by 5. 46
42 Module 9.3: More induction examples Mathematical induction is how we analyze recursive algorithms: Example: (define (sum n) (if (= n 0) 0 (+ n (sum (- n 1))))) n ( ) n 1 i =n+ i i=0 i =0 The type of induction we discussed so far works when the recursive call is with (- n 1) 47
43 Module 9: Mathematical Induction Module Summary Example: single-elimination tournaments. Defining and validating mathematical induction. More examples where we can use induction. A slightly different type of induction. 48
44 Module 9.4: A slightly different type of induction How do we handle more general recursions? A recursive function/method has One or more base cases When it can compute the answer directly An induction step It computes recursively the solutions to one or more smaller sub-problems, and combines them to obtain its answer. Our induction proofs mimic this structure. It is similar to the templates you used in CPSC
45 Module 9.4: A slightly different type of induction We use a slightly different induction hypothesis. Instead of proving that x Z+, Q(x) Q(x+1) We prove that x Z+, (Q(1) ^ Q(2) ^... ^ Q(x)) Q(x+1) We can also show that this type of induction is a valid proof technique. The proof is the same proof by contradiction that we looked at earlier. 50
46 Module 9.4: A slightly different type of induction CPSC 110 review: A binary tree is a data structure that is defined recursively: it is either Empty, or A node with some data, and two children that are themselves trees
47 Module 9.4: A slightly different type of induction Example 6: consider the following function: (define (tree-size t) (if (null? t) 0 (+ 1 (tree-size (left-child t)) (tree-size (right-child t))))) How can we prove that it correctly computes the number of (non-null) nodes of the tree? 52
48 Module 9.4: A slightly different type of induction We prove this using mathematical induction on the size of the tree. Base case: t is null In this case t contains exactly 0 nodes. Induction step: Assume the algorithm works for trees that are smaller than t. Because the left sub-tree of t is smaller than t, the 1st recursive calls correctly returns the size of the left subtree of t. 53
49 Module 9.4: A slightly different type of induction Proof (continued) Induction step (continued) Similarly the right sub-tree of t is smaller than t, and so the 2nd recursive call correctly returns the size of the right sub-tree of t. But we return 1 + the sum of the values returned by the recursive calls. This is exactly the size of t (1 for the root, and the sum of the sizes of the two sub-trees). Hence by the principle of M.I., our algorithm computes correctly the size of every tree. QED 54
50 Module 9.4: A slightly different type of induction Example 7: every positive integer n greater than 1 can be written as a product of primes. What base case(s) is/are the most appropriate? a) n = 1 b) n = 2 c) n = 2, 3 or 5. d) n is prime. e) None of the above. 55
51 Module 9.4: A slightly different type of induction Proof: we prove the result by induction on n. Base case: n We can write n = n and n is a product of primes (with only 1 prime). Induction step: n Suppose that every value from 2 to n 1 is a product of primes. Since n We can write n = 57
52 Module 9.4: A slightly different type of induction Proof (continued) Since 2 a < n, Since 2 b < n, Then Hence by the principle of M.I., every positive integer larger than 1 can be written as a product of primes. QED 58
53 Module 9.4: A slightly different type of induction Example 8: we can find the ith smallest element in an unsorted list as follows: Pick a random element x of the list. Divide the list into three sublists: list-smaller: elements smaller than x list-equal: elements equal to x list-larger: elements larger than x Then search list-smaller if i length of list-smaller list-larger if i > length of list smaller + length of list-equal otherwise return x 59
54 Module 9.4: A slightly different type of induction Example 8: continued This algorithm is called randomized-quick-select. Racket code will be posted on the course web site. A student shows the expected number of steps S(n) of the algorithm on a list with n elements is: S(1) = 4c S(2) = 12c S(3) = 20c S(n) 2cn + S( 3n/4 ) when n 4 60
55 Module 9.4: A slightly different type of induction Example 8: continued Prove that for every n 1, S(n) 8cn. 61
56 Module 9.4: A slightly different type of induction Example 9: binary search Suppose we have something like a list, but whose ith element and length can be found in a single step. This structure is called a vector in Racket. It is similar to an ArrayList in Java. We assume that we have such a vector, sorted in increasing order. Examples: ( Anh, Charles, Dora, Gregor, Wei ). We want to find the position of a given element (for instance, Dora ). 62
57 Module 9.4: A slightly different type of induction The following algorithm (formerly known as B) works: (define (binary-search avector first-pos last-pos x) (if (> first-pos last-pos) false (if (= first-pos last-pos) (if (= (vector-ref avector first-pos) x) first-pos false) (local ((define mid-pos (quotient (+ first-pos last-pos) 2))) (if (= x (vector-ref avector mid-pos)) mid-pos (if (< x (vector-ref avector mid-pos)) (binary-search avector first-pos (- mid-pos 1) x) (binary-search avector (+ mid-pos 1) last-pos x))))))) 63
58 Module 9.4: A slightly different type of induction Prove that binary search makes at most log2 (size+1) comparisons if size 1. The proof is once again by induction on size. Base case: size = The algorithm uses comparison, which is Induction step: Consider an unspecified size Assume that. 64
59 Module 9.4: A slightly different type of induction Prove that binary search makes at most log2 (size+1) comparisons if size 1. The proof is once again by induction on size. Base case: size = 1 The algorithm uses 1 comparison, which is log2 2 Induction step: Consider an unspecified size > 1. Assume that for every integer k such that 1 k size 1, binary search makes at most log2 (k+1) comparisons for a vector with k elements. 65
60 Module 9.4: A slightly different type of induction We first make 1 comparison with the middle element. If it is the element we want, we make 0 more comparisons. Otherwise If size is odd, then we recurse on (size-1)/2 elements. size-1/2 size-1/2 If size is even, then we recurse on at most size/2 elements size/ size/2 In either case, the recursion is on at most (size 1)/ 2 elements 66
61 Module 9.4: A slightly different type of induction So the number of comparisons is at most 1 + number of comparisons for (size 1)/ 2 elements 1 + log2 ( (size 1)/ 2 + 1) by the ind. hypothesis. 1 + log2 ( (size 1)/ ) 1 + log2 ( (size + 1)/ 2 ) log2 (2 * (size + 1)/ 2 ) If size is odd, this is log2 (size + 1) If size is even, this is log2 (size + 2). Note, however, that log2 x and log2 (x + 1) are only different if x is a power of 2, which can t happen when x is odd. So log2 (size + 2) = log2 (size + 1) when size is even. 67
62 Module 9.4: A slightly different type of induction This completes the induction step and the proof of the theorem. 68
Module 9: Mathematical Induction
Module 9: Mathematical Induction Module 9: Announcements There is a chance that this Friday s class may be cancelled. Assignment #4 is due Thursday March 16 th at 4pm. Midterm #2 Monday March 20 th, 2017
More informationCPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements
CPSC 121: Models of Computation Pre-class quiz #7 is due Wednesday October 16th at 17:00. Assigned reading for the quiz: Epp, 4th edition: 4.1, 4.6, Theorem 4.4.1 Epp, 3rd edition: 3.1, 3.6, Theorem 3.4.1.
More informationCPSC 121: Models of Computation
CPSC 121: Models of Computation Unit 6 Rewriting Predicate Logic Statements Based on slides by Patrice Belleville and Steve Wolfman Coming Up Pre-class quiz #7 is due Wednesday October 25th at 9:00 pm.
More informationProof Techniques (Review of Math 271)
Chapter 2 Proof Techniques (Review of Math 271) 2.1 Overview This chapter reviews proof techniques that were probably introduced in Math 271 and that may also have been used in a different way in Phil
More informationDepartment of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)
Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007) Problem 1: Specify two different predicates P (x) and
More informationLecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018
CS17 Integrated Introduction to Computer Science Klein Contents Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018 1 Tree definitions 1 2 Analysis of mergesort using a binary tree 1 3 Analysis of
More informationDivide and Conquer. CSE21 Winter 2017, Day 9 (B00), Day 6 (A00) January 30,
Divide and Conquer CSE21 Winter 2017, Day 9 (B00), Day 6 (A00) January 30, 2017 http://vlsicad.ucsd.edu/courses/cse21-w17 Merging sorted lists: WHAT Given two sorted lists a 1 a 2 a 3 a k b 1 b 2 b 3 b
More informationDiscrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1
CS 70 Discrete Mathematics and Probability Theory Fall 013 Vazirani Note 1 Induction Induction is a basic, powerful and widely used proof technique. It is one of the most common techniques for analyzing
More informationCPSC 121: Models of Computation
CPSC 121: Models of Computation Unit 4 Propositional Logic Proofs Based on slides by Patrice Belleville and Steve Wolfman Coming Up Pre-class quiz #5 is due Wednesday October 4th at 21:00 Assigned reading
More informationChapter 2. Mathematical Reasoning. 2.1 Mathematical Models
Contents Mathematical Reasoning 3.1 Mathematical Models........................... 3. Mathematical Proof............................ 4..1 Structure of Proofs........................ 4.. Direct Method..........................
More informationCPSC 121 Sample Final Examination December 2013
CPSC 121 Sample Final Examination December 201 [6] 1. Short answers [] a. What is wrong with the following circuit? You can not connect the outputs of two or more gates together directly; what will happen
More informationSEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION
CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION Copyright Cengage Learning. All rights reserved. SECTION 5.4 Strong Mathematical Induction and the Well-Ordering Principle for the Integers Copyright
More informationInduction and recursion. Chapter 5
Induction and recursion Chapter 5 Chapter Summary Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms Mathematical Induction Section 5.1
More informationProblem One: Order Relations i. What three properties does a binary relation have to have to be a partial order?
CS103 Handout 16 Fall 2011 November 4, 2011 Extra Practice Problems Many of you have expressed interest in additional practice problems to review the material from the first four weeks of CS103. This handout
More informationLogic, Sets, and Proofs
Logic, Sets, and Proofs David A. Cox and Catherine C. McGeoch Amherst College 1 Logic Logical Operators. A logical statement is a mathematical statement that can be assigned a value either true or false.
More informationChapter Summary. Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms
1 Chapter Summary Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms 2 Section 5.1 3 Section Summary Mathematical Induction Examples of
More informationFor all For every For each For any There exists at least one There exists There is Some
Section 1.3 Predicates and Quantifiers Assume universe of discourse is all the people who are participating in this course. Also let us assume that we know each person in the course. Consider the following
More informationCS1800: Mathematical Induction. Professor Kevin Gold
CS1800: Mathematical Induction Professor Kevin Gold Induction: Used to Prove Patterns Just Keep Going For an algorithm, we may want to prove that it just keeps working, no matter how big the input size
More informationInduction and Recursion
. All rights reserved. Authorized only for instructor use in the classroom. No reproduction or further distribution permitted without the prior written consent of McGraw-Hill Education. Induction and Recursion
More informationNotes on induction proofs and recursive definitions
Notes on induction proofs and recursive definitions James Aspnes December 13, 2010 1 Simple induction Most of the proof techniques we ve talked about so far are only really useful for proving a property
More informationCSC236H Lecture 2. Ilir Dema. September 19, 2018
CSC236H Lecture 2 Ilir Dema September 19, 2018 Simple Induction Useful to prove statements depending on natural numbers Define a predicate P(n) Prove the base case P(b) Prove that for all n b, P(n) P(n
More informationWe want to show P (n) is true for all integers
Generalized Induction Proof: Let P (n) be the proposition 1 + 2 + 2 2 + + 2 n = 2 n+1 1. We want to show P (n) is true for all integers n 0. Generalized Induction Example: Use generalized induction to
More informationMathematical Induction. Rosen Chapter 4.1,4.2 (6 th edition) Rosen Ch. 5.1, 5.2 (7 th edition)
Mathematical Induction Rosen Chapter 4.1,4.2 (6 th edition) Rosen Ch. 5.1, 5.2 (7 th edition) Motivation Suppose we want to prove that for every value of n: 1 + 2 + + n = n(n + 1)/2. Let P(n) be the predicate
More informationCS 2110: INDUCTION DISCUSSION TOPICS
CS 110: INDUCTION DISCUSSION TOPICS The following ideas are suggestions for how to handle your discussion classes. You can do as much or as little of this as you want. You can either present at the board,
More informationCSC 344 Algorithms and Complexity. Proof by Mathematical Induction
CSC 344 Algorithms and Complexity Lecture #1 Review of Mathematical Induction Proof by Mathematical Induction Many results in mathematics are claimed true for every positive integer. Any of these results
More informationCSE 20 DISCRETE MATH SPRING
CSE 20 DISCRETE MATH SPRING 2016 http://cseweb.ucsd.edu/classes/sp16/cse20-ac/ Today's learning goals Describe computer representation of sets with bitstrings Define and compute the cardinality of finite
More informationCSI Mathematical Induction. Many statements assert that a property of the form P(n) is true for all integers n.
CSI 2101- Mathematical Induction Many statements assert that a property of the form P(n) is true for all integers n. Examples: For every positive integer n: n! n n Every set with n elements, has 2 n Subsets.
More informationCSE 2001: Introduction to Theory of Computation Fall Suprakash Datta
CSE 2001: Introduction to Theory of Computation Fall 2013 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.eecs.yorku.ca/course/2001 9/10/2013
More informationDiscrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 3
EECS 70 Discrete Mathematics and Probability Theory Spring 014 Anant Sahai Note 3 Induction Induction is an extremely powerful tool in mathematics. It is a way of proving propositions that hold for all
More informationAnnouncements. Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Existence Proofs. Non-constructive
Announcements Homework 2 Due Homework 3 Posted Due next Monday Quiz 2 on Wednesday Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Exam 1 in two weeks Monday, February 19
More informationCS 220: Discrete Structures and their Applications. Mathematical Induction in zybooks
CS 220: Discrete Structures and their Applications Mathematical Induction 6.4 6.6 in zybooks Why induction? Prove algorithm correctness (CS320 is full of it) The inductive proof will sometimes point out
More informationMath 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011
Math 31 Lesson Plan Day 2: Sets; Binary Operations Elizabeth Gillaspy September 23, 2011 Supplies needed: 30 worksheets. Scratch paper? Sign in sheet Goals for myself: Tell them what you re going to tell
More informationSMT 2013 Power Round Solutions February 2, 2013
Introduction This Power Round is an exploration of numerical semigroups, mathematical structures which appear very naturally out of answers to simple questions. For example, suppose McDonald s sells Chicken
More informationLanguages, regular languages, finite automata
Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,
More informationLearning Goals: In-Class. Using Logical Equivalences. Outline. Worked Problem: Even Squares
CPSC 121: Models of Computation 2013W2 Proof Techniques (Part B) Steve Wolfman, based on notes by Patrice Belleville and others snick snack Learning Goals: In-Class By the end of this unit, you should
More informationPreparing for the CS 173 (A) Fall 2018 Midterm 1
Preparing for the CS 173 (A) Fall 2018 Midterm 1 1 Basic information Midterm 1 is scheduled from 7:15-8:30 PM. We recommend you arrive early so that you can start exactly at 7:15. Exams will be collected
More informationLecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel
Lecture Notes on DISCRETE MATHEMATICS Eusebius Doedel c Eusebius J. Doedel, 009 Contents Logic. Introduction............................................................................... Basic logical
More informationBinomial Coefficient Identities/Complements
Binomial Coefficient Identities/Complements CSE21 Fall 2017, Day 4 Oct 6, 2017 https://sites.google.com/a/eng.ucsd.edu/cse21-fall-2017-miles-jones/ permutation P(n,r) = n(n-1) (n-2) (n-r+1) = Terminology
More informationData Structures and Algorithms
Data Structures and Algorithms Spring 2017-2018 Outline Announcements 1 Announcements 2 3 Recap Mergesort Of Note Labs start in Week02 in CS305b Do you have linux account? Lab times: Fri. 15.00, 16.00
More informationLecture Overview. 2 Weak Induction
COMPSCI 30: Discrete Mathematics for Computer Science February 18, 019 Lecturer: Debmalya Panigrahi Lecture 11 Scribe: Kevin Sun 1 Overview In this lecture, we study mathematical induction, which we often
More informationLECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel
LECTURE NOTES on DISCRETE MATHEMATICS Eusebius Doedel 1 LOGIC Introduction. First we introduce some basic concepts needed in our discussion of logic. These will be covered in more detail later. A set is
More informationHomework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4
Do the following exercises from the text: Chapter (Section 3):, 1, 17(a)-(b), 3 Prove that 1 3 + 3 + + n 3 n (n + 1) for all n N Proof The proof is by induction on n For n N, let S(n) be the statement
More informationAdvanced Counting Techniques. Chapter 8
Advanced Counting Techniques Chapter 8 Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence Relations Nonhomogeneous Recurrence Relations Divide-and-Conquer
More informationCSC236 Week 3. Larry Zhang
CSC236 Week 3 Larry Zhang 1 Announcements Problem Set 1 due this Friday Make sure to read Submission Instructions on the course web page. Search for Teammates on Piazza Educational memes: http://www.cs.toronto.edu/~ylzhang/csc236/memes.html
More informationAnalysis of Algorithms I: Asymptotic Notation, Induction, and MergeSort
Analysis of Algorithms I: Asymptotic Notation, Induction, and MergeSort Xi Chen Columbia University We continue with two more asymptotic notation: o( ) and ω( ). Let f (n) and g(n) are functions that map
More informationALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers
ALGEBRA CHRISTIAN REMLING 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers by Z = {..., 2, 1, 0, 1,...}. Given a, b Z, we write a b if b = ac for some
More informationLecture Notes 1 Basic Concepts of Mathematics MATH 352
Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Ivan Avramidi New Mexico Institute of Mining and Technology Socorro, NM 87801 June 3, 2004 Author: Ivan Avramidi; File: absmath.tex; Date: June 11,
More information5 + 9(10) + 3(100) + 0(1000) + 2(10000) =
Chapter 5 Analyzing Algorithms So far we have been proving statements about databases, mathematics and arithmetic, or sequences of numbers. Though these types of statements are common in computer science,
More informationMathematical Induction
Mathematical Induction Let s motivate our discussion by considering an example first. What happens when we add the first n positive odd integers? The table below shows what results for the first few values
More informationCOE428 Notes Week 4 (Week of Jan 30, 2017)
COE428 Lecture Notes: Week 4 1 of 9 COE428 Notes Week 4 (Week of Jan 30, 2017) Table of Contents Announcements...2 Answers to last week's questions...2 Review...3 Big-O, Big-Omega and Big-Theta analysis
More informationAt the start of the term, we saw the following formula for computing the sum of the first n integers:
Chapter 11 Induction This chapter covers mathematical induction. 11.1 Introduction to induction At the start of the term, we saw the following formula for computing the sum of the first n integers: Claim
More informationPS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010
University of Virginia - cs3102: Theory of Computation Spring 2010 PS2 - Comments Average: 77.4 (full credit for each question is 100 points) Distribution (of 54 submissions): 90, 12; 80 89, 11; 70-79,
More informationCS 173: Induction. Madhusudan Parthasarathy University of Illinois at Urbana-Champaign. February 7, 2016
CS 173: Induction Madhusudan Parthasarathy University of Illinois at Urbana-Champaign 1 Induction February 7, 016 This chapter covers mathematical induction, and is an alternative resource to the one in
More informationCS 151. Red Black Trees & Structural Induction. Thursday, November 1, 12
CS 151 Red Black Trees & Structural Induction 1 Announcements Majors fair tonight 4:30-6:30pm in the Root Room in Carnegie. Come and find out about the CS major, or some other major. Winter Term in CS
More informationLecture 7 Feb 4, 14. Sections 1.7 and 1.8 Some problems from Sec 1.8
Lecture 7 Feb 4, 14 Sections 1.7 and 1.8 Some problems from Sec 1.8 Section Summary Proof by Cases Existence Proofs Constructive Nonconstructive Disproof by Counterexample Nonexistence Proofs Uniqueness
More informationThe maximum-subarray problem. Given an array of integers, find a contiguous subarray with the maximum sum. Very naïve algorithm:
The maximum-subarray problem Given an array of integers, find a contiguous subarray with the maximum sum. Very naïve algorithm: Brute force algorithm: At best, θ(n 2 ) time complexity 129 Can we do divide
More informationAn analogy from Calculus: limits
COMP 250 Fall 2018 35 - big O Nov. 30, 2018 We have seen several algorithms in the course, and we have loosely characterized their runtimes in terms of the size n of the input. We say that the algorithm
More informationThe Process of Mathematical Proof
1 The Process of Mathematical Proof Introduction. Mathematical proofs use the rules of logical deduction that grew out of the work of Aristotle around 350 BC. In previous courses, there was probably an
More informationdata structures and algorithms lecture 2
data structures and algorithms 2018 09 06 lecture 2 recall: insertion sort Algorithm insertionsort(a, n): for j := 2 to n do key := A[j] i := j 1 while i 1 and A[i] > key do A[i + 1] := A[i] i := i 1 A[i
More informationCSE101: Design and Analysis of Algorithms. Ragesh Jaiswal, CSE, UCSD
Greedy s Greedy s Shortest path Claim 2: Let S be a subset of vertices containing s such that we know the shortest path length l(s, u) from s to any vertex in u S. Let e = (u, v) be an edge such that 1
More informationThe Real Number System
MATH 337 The Real Number System Sets of Numbers Dr. Neal, WKU A set S is a well-defined collection of objects, with well-defined meaning that there is a specific description from which we can tell precisely
More informationPRIMES Math Problem Set
PRIMES Math Problem Set PRIMES 017 Due December 1, 01 Dear PRIMES applicant: This is the PRIMES 017 Math Problem Set. Please send us your solutions as part of your PRIMES application by December 1, 01.
More informationMathematical Induction
Mathematical Induction MAT30 Discrete Mathematics Fall 018 MAT30 (Discrete Math) Mathematical Induction Fall 018 1 / 19 Outline 1 Mathematical Induction Strong Mathematical Induction MAT30 (Discrete Math)
More informationn(n + 1). 2 . If n = 3, then 1+2+3=6= 3(3+1) . If n = 2, then = 3 = 2(2+1)
Chapter 4 Induction In this chapter, we introduce mathematical induction, which is a proof technique that is useful for proving statements of the form (8n N)P(n), or more generally (8n Z)(n a =) P(n)),
More informationComplete Induction and the Well- Ordering Principle
Complete Induction and the Well- Ordering Principle Complete Induction as a Rule of Inference In mathematical proofs, complete induction (PCI) is a rule of inference of the form P (a) P (a + 1) P (b) k
More information(1) Which of the following are propositions? If it is a proposition, determine its truth value: A propositional function, but not a proposition.
Math 231 Exam Practice Problem Solutions WARNING: This is not a sample test. Problems on the exams may or may not be similar to these problems. These problems are just intended to focus your study of the
More informationk-protected VERTICES IN BINARY SEARCH TREES
k-protected VERTICES IN BINARY SEARCH TREES MIKLÓS BÓNA Abstract. We show that for every k, the probability that a randomly selected vertex of a random binary search tree on n nodes is at distance k from
More informationCS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions
CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions PRINT Your Name: Answer: Oski Bear SIGN Your Name: PRINT Your Student ID: CIRCLE your exam room: Dwinelle
More informationCOM S 330 Lecture Notes Week of Feb 9 13
Monday, February 9. Rosen.4 Sequences Reading: Rosen.4. LLM 4.. Ducks 8., 8., Def: A sequence is a function from a (usually infinite) subset of the integers (usually N = {0,,, 3,... } or Z + = {,, 3, 4,...
More informationRMT 2013 Power Round Solutions February 2, 2013
RMT 013 Power Round Solutions February, 013 1. (a) (i) {0, 5, 7, 10, 11, 1, 14} {n N 0 : n 15}. (ii) Yes, 5, 7, 11, 16 can be generated by a set of fewer than 4 elements. Specifically, it is generated
More informationStrong Induction (Second Principle) Example: There are two piles of cards, players take turn: each turn: one player removes any number of cards from
Strong Induction (Second Principle) Example: There are two piles of cards, players take turn: each turn: one player removes any number of cards from 1 pile (any of the two). The player who removes the
More information2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.
2 Arithmetic This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. (See [Houston, Chapters 27 & 28]) 2.1 Greatest common divisors Definition 2.16. If a, b are integers, we say
More informationChapter 1 The Real Numbers
Chapter 1 The Real Numbers In a beginning course in calculus, the emphasis is on introducing the techniques of the subject;i.e., differentiation and integration and their applications. An advanced calculus
More information0.Axioms for the Integers 1
0.Axioms for the Integers 1 Number theory is the study of the arithmetical properties of the integers. You have been doing arithmetic with integers since you were a young child, but these mathematical
More informationChapter 2 Section 2.1: Proofs Proof Techniques. CS 130 Discrete Structures
Chapter 2 Section 2.1: Proofs Proof Techniques CS 130 Discrete Structures Some Terminologies Axioms: Statements that are always true. Example: Given two distinct points, there is exactly one line that
More informationStandard forms for writing numbers
Standard forms for writing numbers In order to relate the abstract mathematical descriptions of familiar number systems to the everyday descriptions of numbers by decimal expansions and similar means,
More informationOutline. We will cover (over the next few weeks) Induction Strong Induction Constructive Induction Structural Induction
Outline We will cover (over the next few weeks) Induction Strong Induction Constructive Induction Structural Induction Induction P(1) ( n 2)[P(n 1) P(n)] ( n 1)[P(n)] Why Does This Work? I P(1) ( n 2)[P(n
More informationCS1802 Week 11: Algorithms, Sums, Series, Induction
CS180 Discrete Structures Recitation Fall 017 Nov 11 - November 17, 017 CS180 Week 11: Algorithms, Sums, Series, Induction 1 Markov chain i. Boston has days which are either sunny or rainy and can be modeled
More informationAnnouncements. Exam 1 Review
Announcements Quiz today Exam Monday! You are allowed one 8.5 x 11 in cheat sheet of handwritten notes for the exam (front and back of 8.5 x 11 in paper) Handwritten means you must write them by hand,
More informationDiscrete Mathematics: Midterm Test with Answers. Professor Callahan, section (A or B): Name: NetID: 30 multiple choice, 3 points each:
Discrete Mathematics: Midterm Test with Answers Professor Callahan, section (A or B): Name: NetID: 30 multiple choice, 3 points each: 1. If f is defined recursively by: f (0) = -2, f (1) = 1, and for n
More informationCSE 2001: Introduction to Theory of Computation Fall Suprakash Datta
CSE 2001: Introduction to Theory of Computation Fall 2012 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cs.yorku.ca/course/2001 9/6/2012 CSE
More information(2) Generalize De Morgan s laws for n sets and prove the laws by induction. 1
ARS DIGITA UNIVERSITY MONTH 2: DISCRETE MATHEMATICS PROFESSOR SHAI SIMONSON PROBLEM SET 2 SOLUTIONS SET, FUNCTIONS, BIG-O, RATES OF GROWTH (1) Prove by formal logic: (a) The complement of the union of
More informationData Structures and Algorithms
Data Structures and Algorithms Spring 2017-2018 Outline 1 Sorting Algorithms (contd.) Outline Sorting Algorithms (contd.) 1 Sorting Algorithms (contd.) Analysis of Quicksort Time to sort array of length
More informationClimbing an Infinite Ladder
Section 5.1 Section Summary Mathematical Induction Examples of Proof by Mathematical Induction Mistaken Proofs by Mathematical Induction Guidelines for Proofs by Mathematical Induction Climbing an Infinite
More informationCITS2211 Discrete Structures Proofs
CITS2211 Discrete Structures Proofs Unit coordinator: Rachel Cardell-Oliver August 13, 2017 Highlights 1 Arguments vs Proofs. 2 Proof strategies 3 Famous proofs Reading Chapter 1: What is a proof? Mathematics
More informationShow Your Work! Point values are in square brackets. There are 35 points possible. Some facts about sets are on the last page.
Formal Methods Name: Key Midterm 2, Spring, 2007 Show Your Work! Point values are in square brackets. There are 35 points possible. Some facts about sets are on the last page.. Determine whether each of
More informationIn this initial chapter, you will be introduced to, or more than likely be reminded of, a
1 Sets In this initial chapter, you will be introduced to, or more than likely be reminded of, a fundamental idea that occurs throughout mathematics: sets. Indeed, a set is an object from which every mathematical
More informationDivide and Conquer Algorithms. CSE 101: Design and Analysis of Algorithms Lecture 14
Divide and Conquer Algorithms CSE 101: Design and Analysis of Algorithms Lecture 14 CSE 101: Design and analysis of algorithms Divide and conquer algorithms Reading: Sections 2.3 and 2.4 Homework 6 will
More informationRecursion: Introduction and Correctness
Recursion: Introduction and Correctness CSE21 Winter 2017, Day 7 (B00), Day 4-5 (A00) January 25, 2017 http://vlsicad.ucsd.edu/courses/cse21-w17 Today s Plan From last time: intersecting sorted lists and
More informationMidterm 1. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:
CS70 Discrete Mathematics and Probability Theory, Fall 2018 Midterm 1 8:00-10:00pm, 24 September Your First Name: SIGN Your Name: Your Last Name: Your Exam Room: Name of Person Sitting on Your Left: Name
More informationWriting proofs for MATH 51H Section 2: Set theory, proofs of existential statements, proofs of uniqueness statements, proof by cases
Writing proofs for MATH 51H Section 2: Set theory, proofs of existential statements, proofs of uniqueness statements, proof by cases September 22, 2018 Recall from last week that the purpose of a proof
More informationare the q-versions of n, n! and . The falling factorial is (x) k = x(x 1)(x 2)... (x k + 1).
Lecture A jacques@ucsd.edu Notation: N, R, Z, F, C naturals, reals, integers, a field, complex numbers. p(n), S n,, b(n), s n, partition numbers, Stirling of the second ind, Bell numbers, Stirling of the
More informationMATH 55 - HOMEWORK 6 SOLUTIONS. 1. Section = 1 = (n + 1) 3 = 2. + (n + 1) 3. + (n + 1) 3 = n2 (n + 1) 2.
MATH 55 - HOMEWORK 6 SOLUTIONS Exercise Section 5 Proof (a) P () is the statement ( ) 3 (b) P () is true since ( ) 3 (c) The inductive hypothesis is P (n): ( ) n(n + ) 3 + 3 + + n 3 (d) Assuming the inductive
More information1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : 5 points
Introduction to Discrete Mathematics 3450:208 Test 1 1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : The inverse of E : The
More informationBasic Proof Examples
Basic Proof Examples Lisa Oberbroeckling Loyola University Maryland Fall 2015 Note. In this document, we use the symbol as the negation symbol. Thus p means not p. There are four basic proof techniques
More informationWith Question/Answer Animations
Chapter 5 With Question/Answer Animations Copyright McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education. Chapter Summary
More informationWe are going to discuss what it means for a sequence to converge in three stages: First, we define what it means for a sequence to converge to zero
Chapter Limits of Sequences Calculus Student: lim s n = 0 means the s n are getting closer and closer to zero but never gets there. Instructor: ARGHHHHH! Exercise. Think of a better response for the instructor.
More information1 Sequences and Summation
1 Sequences and Summation A sequence is a function whose domain is either all the integers between two given integers or all the integers greater than or equal to a given integer. For example, a m, a m+1,...,
More informationQuiz 3 Reminder and Midterm Results
Quiz 3 Reminder and Midterm Results Reminder: Quiz 3 will be in the first 15 minutes of Monday s class. You can use any resources you have during the quiz. It covers all four sections of Unit 3. It has
More information1 Functions, relations, and infinite cardinality
Discrete Structures Prelim 2 sample questions s CS2800 Questions selected for fall 2017 1 Functions, relations, and infinite cardinality 1. True/false. For each of the following statements, indicate whether
More information