C241 Homework Assignment 7

Similar documents
C241 Homework Assignment 8

Discrete Mathematics. Spring 2017

Discrete Math, Spring Solutions to Problems V

Review of Power Series

C241 Homework Assignment 9

COT 2104 Homework Assignment 1 (Answers)

. As the binomial coefficients are integers we have that. 2 n(n 1).

1.1 Inductive Reasoning filled in.notebook August 20, 2015

Proofs. Joe Patten August 10, 2018

What can you prove by induction?

Math Circle: Recursion and Induction

Use mathematical induction in Exercises 3 17 to prove summation formulae. Be sure to identify where you use the inductive hypothesis.

COM S 330 Lecture Notes Week of Feb 9 13

Problem Set 5 Solutions

10.6 Alternating Series, Absolute and Conditional Convergence

Ch 4.2 Divisibility Properties

Exercises. Template for Proofs by Mathematical Induction

CSE20: Discrete Mathematics

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and

Mathematical Induction

Homework 4, 5, 6 Solutions. > 0, and so a n 0 = n + 1 n = ( n+1 n)( n+1+ n) 1 if n is odd 1/n if n is even diverges.

Mathematical Induction Assignments

The infinite series is written using sigma notation as: lim u k. lim. better yet, we can say if the

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

Contribution of Problems

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31

MATH10040: Numbers and Functions Homework 1: Solutions

Mathematical Induction

Chapter 5: The Integers

Series. Definition. a 1 + a 2 + a 3 + is called an infinite series or just series. Denoted by. n=1

Math 242: Principles of Analysis Fall 2016 Homework 1 Part B solutions

Fall 2017 Test II review problems

M381 Number Theory 2004 Page 1

CHAPTER 3. Number Theory

MATH FINAL EXAM REVIEW HINTS

MATHEMATICS IN EVERYDAY LIFE 8

Homework 3, solutions

Mathematical Induction

CS1800: Mathematical Induction. Professor Kevin Gold

Infinite Continued Fractions

CSE 1400 Applied Discrete Mathematics Proofs

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers.

not to be republished NCERT REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results

Number Theory and Graph Theory

1 Overview and revision

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

Power Series. Part 1. J. Gonzalez-Zugasti, University of Massachusetts - Lowell

SECTION 9.2: ARITHMETIC SEQUENCES and PARTIAL SUMS

Climbing an Infinite Ladder

8.1 Sequences. Example: A sequence is a function f(n) whose domain is a subset of the integers. Notation: *Note: n = 0 vs. n = 1.

Preparing for the CS 173 (A) Fall 2018 Midterm 1

MATH 117 LECTURE NOTES

Homework 5 Solutions

NOTES ON SIMPLE NUMBER THEORY

Solutions for Homework Assignment 2

3 The language of proof

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

Divisibility = 16, = 9, = 2, = 5. (Negative!)

Input Decidable Language -- Program Halts on all Input Encoding of Input -- Natural Numbers Encoded in Binary or Decimal, Not Unary

Problem 1: Suppose A, B, C and D are finite sets such that A B = C D and C = D. Prove or disprove: A = B.

Midterm Preparation Problems

Math 210 Exam 2 - Practice Problems. 1. For each of the following, determine whether the statement is True or False.

Note that r = 0 gives the simple principle of induction. Also it can be shown that the principle of strong induction follows from simple induction.

Mathematical Induction

Lesson 12.7: Sequences and Series

Algebra. Formal fallacies (recap). Example of base rate fallacy: Monty Hall Problem.

Carmen s Core Concepts (Math 135)

2. THE EUCLIDEAN ALGORITHM More ring essentials

CSC 344 Algorithms and Complexity. Proof by Mathematical Induction

Announcements. Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Existence Proofs. Non-constructive

Introduction to Abstract Mathematics

Chapter 5: Sequences, Mathematic Induction, and Recursion

Chapter 2. Mathematical Reasoning. 2.1 Mathematical Models

CHAPTER III THE PROOF OF INEQUALITIES

, 500, 250, 125, , 2, 4, 7, 11, 16, , 3, 9, 27, , 3, 2, 7, , 2 2, 4, 4 2, 8

EECS 1028 M: Discrete Mathematics for Engineers

MATH 301 INTRO TO ANALYSIS FALL 2016

MATHEMATICAL INDUCTION

Notes on arithmetic. 1. Representation in base B

Objectives. Materials

ASSIGNMENT 1 SOLUTIONS

Writing proofs for MATH 61CM, 61DM Week 1: basic logic, proof by contradiction, proof by induction

(e) Commutativity: a b = b a. (f) Distributivity of times over plus: a (b + c) = a b + a c and (b + c) a = b a + c a.

CSCE 222 Discrete Structures for Computing. Dr. Hyunyoung Lee

Solution Set 2. Problem 1. [a] + [b] = [a + b] = [b + a] = [b] + [a] ([a] + [b]) + [c] = [a + b] + [c] = [a + b + c] = [a] + [b + c] = [a] + ([b + c])

1.2 The Well-Ordering Principle

Sequences. 1. Number sequences. 2. Arithmetic sequences. Consider the illustrated pattern of circles:

Midterm 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:

Homework 5 Solutions

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

CMSC250 Homework 9 Due: Wednesday, December 3, Question: Total Points: Score:

1 + lim. n n+1. f(x) = x + 1, x 1. and we check that f is increasing, instead. Using the quotient rule, we easily find that. 1 (x + 1) 1 x (x + 1) 2 =

Lecture 7 Feb 4, 14. Sections 1.7 and 1.8 Some problems from Sec 1.8

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

Heaps Induction. Heaps. Heaps. Tirgul 6

Chapter 5. Number Theory. 5.1 Base b representations

Announcements. CS243: Discrete Structures. Sequences, Summations, and Cardinality of Infinite Sets. More on Midterm. Midterm.

Transcription:

C24 Homework Assignment 7. Prove that for all whole numbers n, n i 2 = n(n + (2n + The proof is by induction on k with hypothesis H(k i 2 = k(k + (2k + base case: To prove H(, i 2 = = = 2 3 = ( + (2 + induction step: Assume H(k. Now, ( k+ i 2 = i 2 + (k + 2 (expand k(k + (2k + = + (k + 2 (IH k(k + (2k + (k + 2 = + (multiply by = / k(k + (2k + + (k + 2 = (add fractions = (k + ( k(2k + + (k + (factor (k + = (k + (2k2 + 7k + (combine like terms (k + (k + 2(2k + 3 = (factor 2k 2 + 7k + (k + ((k + + (2(k + + = (arithmetic This completes the induction case and the proof of the problem.

2. Prove that for all n N, n i(i! = (n +! The proof is by induction on k with hypothesis H(k i(i! = (k +! Recall that base case: n! = { if n = 0 2 n otherwise i(i! = (! = = 2 = 2! = (2 +! induction step: Assume H[k] k i(i! = (k +!. Now, ( k+ i(i! = i(i! + (k + (k +! (expand = ((k +! + (k + (k +! (induction hypothesis = ((k +! + (k + (k +! (rearrange sums = ( + k + (k +! distribute (k +! = (k + 2(k +! (simplify = (k + 2! (meaning of! = ((k + +! (as desired This proves H[k + ] and completes the induction.

3. Prove that for all whole numbers n, evenly divides n 3 n. The proof is by induction on k N with hypothesis H[n] evenly devides n 3 n Base Case (H[]. 3 = 3 = 0, which is evenly divisible by. Induction (H[k] H[k + ]. Assume that k 3 k is evenly divisible by. Now, (k + 3 (k + = (k 3 + 3k 2 + 3k + (k + Expanding (k + 3 = (k 3 + 3k 2 + 2k Combining like terms = k(k 2 + 3k + 2 Distributing k = k(k + (k + 2 Factoring k 2 + 3k + 2 By Proposition A (below this number is divisible by 3. And since at least one of k, k +, or k + 2 is an even number, it is also divisible by 2. That is, k(k + (k + 2 = 2 3 q, for some q, and is therefore divisible by. Proposition A. For all n N, n(n + (n + 2 is divisible by 3. Proof: by induction on n with hypothesis, H[k] k(k+(k+2 = 3p for some p. Base Case: 0 2 = 0 = 3 0. Induction Case: Assume k(k + (k + 2 = 3p for some p. (k + (k + 2(k + 3 = k(k + (k + 2 + 3(k + (k + 2 (distributing over k + 3 IH = 3p + 3(k + (k + 2 (Induction Hypothesis = 3 [p + (k + (k + 2] (distributing the 3 Comment: It is reasonable to say that this proposition is obvious and need not be proven.

4. Prove that for all whole numbers n > 4, 2 n > n 2. The proof is by induction on k with hypothesis H[k] 2 k > k 2. base case: To prove H[5], 2 5 = 32 > 25 = 5 2 induction step: Assume 2 k > k 2. Now, 2 k+ = 2 2 k > 2 k 2 (induction hypothesis, used twice = k 2 + k 2 > k 2 + 2k + (k > 4? k 2 > 2k + = (k + 2 The induction is finished once it is established that for any natural number n > 4, n 2 > 2n +. This fact is proved in the lemma below. lemma For all n > 3, n 2 > 2n +. proof: The proof is by induction on k with hypothesis H[k] k > 3, k 2 > 2k +. base case: 3 2 = 9 > 7 = 3 3 + induction step: Assume k 2 > 2k +, k > 3. Then (k + 2 = k 2 + 2k + > (2k + + 2k + (induction hypothesis > (2k + + + (k > = (2k + 2 + (arithmetic = 2(k + + (arithmetic This completes the induction and the proof of the lemma. The proof of the lemma completes the proof of the problem.

5. Use induction to prove that the sum of the first n odd numbers is equal to n 2. n That is, show: For all n Nat, n > 0, (2i = n 2. Base Case. (2i = 2 = = 2 Induction. Assume that (2i = k 2. k+ (2i = 2(k + + (2i (expanding by one term H = 2(k + + k 2 (I.H. = k 2 + 2k + (simplifying = (k + 2 (factoring

. Consider the program P : begin {A, B > 0} q := 0; r := A; l: while r B do begin q := q + ; r := r B end; end {A = qb + r r < B} Use Theorem 5.Loop Invariantstheorem.5. and invariant assertion I A = qb + r to prove that this program computes the quotient and remainder of A and B. According to Theorem 5.Loop Invariantstheorem.5., it we can show that assertion I is true when P first reaches l and that executing the loop body leaves I true, then when P ends, I will be true and the test r B will be false. Thus, there are three things to prove: Note: Blue comments need not be included because they are implied by the use of Theorem 5.Loop Invariantstheorem.5.. Initialization (Base Case: {A, B > 0} q := 0 ; r := A {A = qb + r} Since we have just assigned 0 to q and A to r we have qb + r = 0 B + A = A. 2. Invariance (Induction Case: {A = qb + r r B} q := q + ; r := r B {A = qb + r} The loop body computes new values for program variables q = q + and r = r B (valid because r B. So we have q B + r = (q + B + (r B (substituting for r and q = qb + B + r B = qb + r (simplifying IH = A (assumption as desired. 3. Termination: It remains to show that I (r < b implies the postcondition, {(A = qb + r (r < B}. But in this case the two formulas are identical, so the implication is tautologically valid.

Supplemental Problem. (Unit Square Puzzle Solve the Problem below assuming the following two facts. Then see if you can prove Theorems A and B. A. Theorem. The harmonic sum, + 2 + 3 + + n + diverges. That is, ( n lim = n k k= B. Theorem. The geometric sum + 2 + 9 + + + n + converges 2 and is less than 2. That is, ( n lim n k 2 2 k=0 Suppose you have all the squares of size n n for n W. Since the area of the unit square ( is, Theorem B suggests that it should be possible to fit all the smaller squares inside it without overlapping. On the other hand, Theorem B suggests that this might not be possible because, if you place all these squares next to each other, the resulting linear arrangement is infinitely long. 2 2 3 3 4 4 n n Problem. Determine whether and how all the n n squares, n >, can be placed inside the unit square. If this problem has a solution, you should present a construction showing how to do it, and prove any arithmetic facts needed to justify the correctness of your construction. There is room to spare. Start by placing the 2 2 square in the upper-left corner. Now placing the 3 3 square next to it. Now place the 4 4, 5 5,...,, and 7 7 squares just below the first row. Because we are dealing with infinitely many squares, your construction may not be an algorithm because it does not terminate. Even so, you must establish that each step of the procedure is well determined and possible.

/32 /32 Just below row k add all the squares with sides of 2 k through 2 k+. /2 /3 /4 /5 / /7 /8 /9 /0 / /2 /3 /4 /5 / /32 There are two things to prove in order to verify this solution. Both proofs are easy inductions. A. There is room vertically for all the rows because for all n W, ( n n 2 i = 2n thus, lim n 2 i B. There is room for horizontally for each row because for all n W, 2 n+ i=2 n i <