THE ISLAMIC UNIVERSITY OF GAZA ENGINEERING FACULTY DEPARTMENT OF COMPUTER ENGINEERING DISCRETE MATHMATICS DISCUSSION ECOM Eng. Huda M.

Similar documents
Mathematical Induction Assignments

Discrete Mathematics. Spring 2017

Climbing an Infinite Ladder

INDUCTION AND RECURSION. Lecture 7 - Ch. 4

Mathematical Induction

1 Examples of Weak Induction

Climbing an Infinite Ladder

Induction. Induction. Induction. Induction. Induction. Induction 2/22/2018

Problem Set 5 Solutions

CISC-102 Fall 2017 Week 3. Principle of Mathematical Induction

CSE 311: Foundations of Computing. Lecture 14: Induction

Mathematical Induction. EECS 203: Discrete Mathematics Lecture 11 Spring

Section 4.2: Mathematical Induction 1

Mathematical Induction. Section 5.1

CSC 344 Algorithms and Complexity. Proof by Mathematical Induction

CS173 Lecture B, September 10, 2015

PRINCIPLE OF MATHEMATICAL INDUCTION

CSCE 222 Discrete Structures for Computing. Proof by Induction. Dr. Hyunyoung Lee. !!!!!! Based on slides by Andreas Klappenecker

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.

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4

Mathematical Induction

CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction. Linda Shapiro Spring 2016

Chapter Summary. Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms

CS173 Strong Induction and Functions. Tandy Warnow

Sum of Squares. Defining Functions. Closed-Form Expression for SQ(n)

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City?

Carmen s Core Concepts (Math 135)

Outline. We will cover (over the next few weeks) Induction Strong Induction Constructive Induction Structural Induction

Integer-Valued Polynomials

Exercises. Template for Proofs by Mathematical Induction

CS 220: Discrete Structures and their Applications. Mathematical Induction in zybooks

Mathematical Structures Combinations and Permutations

Mathematical Induction Again

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

Proof by Induction. Andreas Klappenecker

Mathematical Induction

Mathematical Induction Again

n n P} is a bounded subset Proof. Let A be a nonempty subset of Z, bounded above. Define the set

MTH 3318 Solutions to Induction Problems Fall 2009

Induction and recursion. Chapter 5

Induction and Recursion

Definition: A sequence is a function from a subset of the integers (usually either the set

Induction. Announcements. Overview. Defining Functions. Sum of Squares. Closed-form expression for SQ(n) There have been some corrections to A1

Mathematical Induction. Rosen Chapter 4.1,4.2 (6 th edition) Rosen Ch. 5.1, 5.2 (7 th edition)

Legendre s Equation. PHYS Southern Illinois University. October 18, 2016

COMP232 - Mathematics for Computer Science

CSCE 222 Discrete Structures for Computing. Dr. Hyunyoung Lee

CSC236H Lecture 2. Ilir Dema. September 19, 2018

Consider an infinite row of dominoes, labeled by 1, 2, 3,, where each domino is standing up. What should one do to knock over all dominoes?

Fall 2017 Test II review problems

Induction 1 = 1(1+1) = 2(2+1) = 3(3+1) 2

Math.3336: Discrete Mathematics. Mathematical Induction

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1

1 Recursive Algorithms

With Question/Answer Animations

MATHEMATICAL INDUCTION

Fall 2015 Lecture 14: Modular congruences. cse 311: foundations of computing

Exam in Discrete Mathematics

Recurrence Relations

Direct Proof Universal Statements

n(n + 1). 2 . If n = 3, then 1+2+3=6= 3(3+1) . If n = 2, then = 3 = 2(2+1)

STUDY PROBLEMS FOR EXAM I CMSC 203 DISCRETE STRUCTURES. n (n +1)(2n +1), 6. j 2 = 1(1+1)(2 1+1) 6. k (k +1)(2k +1) 6

21 Induction. Tom Lewis. Fall Term Tom Lewis () 21 Induction Fall Term / 14

Mathematical Induction. How does discrete math help us. How does discrete math help (CS160)? How does discrete math help (CS161)?

Name CMSC203 Fall2008 Exam 2 Solution Key Show All Work!!! Page (16 points) Circle T if the corresponding statement is True or F if it is False.

Math 2233 Homework Set 7

Mathematical Induction. Defining Functions. Overview. Notation for recursive functions. Base case Sn(0) = 0 S(n) = S(n 1) + n for n > 0

MODEL ANSWERS TO THE THIRD HOMEWORK. 1. We prove this result by mathematical induction. Let P (n) be the statement that

Discrete Math in Computer Science Solutions to Practice Problems for Midterm 2

CSE 20 DISCRETE MATH SPRING

Discrete Mathematics & Mathematical Reasoning Induction

Math 3000 Section 003 Intro to Abstract Math Homework 6

Advanced Analysis of Algorithms - Midterm (Solutions)

Discrete Structures - CM0246 Mathematical Induction

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

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 3

M381 Number Theory 2004 Page 1

3.3 Accumulation Sequences

CS 360, Winter Morphology of Proof: An introduction to rigorous proof techniques

PRINCIPLE OF MATHEMATICAL INDUCTION

1 Direct Proofs Technique Outlines Example Implication Proofs Technique Outlines Examples...

Midterm Exam Solution


Discrete Mathematics & Mathematical Reasoning Induction

Another Proof By Contradiction: 2 is Irrational

Mathematical Fundamentals

Discrete Mathematics for CS Spring 2008 David Wagner Note 4

Doubly Indexed Infinite Series

Analysis I (Math 121) First Midterm Correction

Algorithm Analysis Recurrence Relation. Chung-Ang University, Jaesung Lee

Discrete Mathematics. Spring 2017

COL106: Data Structures and Algorithms (IIT Delhi, Semester-II )

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

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

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

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

MAS114: Solutions to Exercises

Combinational Digital Design. Laboratory Manual. Experiment #6. Simplification using Karnaugh Map

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.

Transcription:

THE ISLAMIC UNIVERSITY OF GAZA ENGINEERING FACULTY DEPARTMENT OF COMPUTER ENGINEERING DISCRETE MATHMATICS DISCUSSION ECOM 2011 Eng. Huda M. Dawoud December, 2015

Section 1: Mathematical Induction 3. Let P(n) be the statement that 1 2 + 2 2 + +n 2 = n(n + 1)(2n + 1)/ for the positive integer n. a) What is the statement P(1)? b) Show that P(1) is true, completing the basis step of the proof. c) What is the inductive hypothesis? d) What do you need to prove in the inductive step?

e) Complete the inductive step, identifying where you use the inductive hypothesis. f) Explain why these steps show that this formula is true whenever n is a positive integer. a) P(1) is the statement: 1 2 = 1 2 3/. b) 1 2 = 1 1 2 3/ = / = 1 both sides equal 1, so the statement P(1) is true. c) The inductive hypothesis is the statement that 1 2 + 2 2 +... + k 2 = k(k + 1)(2k + 1). d) For the inductive step, we want to show for each k 1 that P(k) implies P(k + 1). In other words, we want to show that assuming the inductive hypothesis P(k): 1 2 + 2 2 +... + k 2 = can show P(k+1): 1 2 + 2 2 +... + k 2 + (k + 1) 2 = k(k + 1)(2k + 1), we (k + 1)(k + 2)(2(k + 1) + 1). e) If we add (k + 1) 2 to both sides in the inductive step: 1 2 + 2 2 +... + k 2 k(k + 1)(2k + 1) = 1 2 + 2 2 +... + k 2 + (k + 1) 2 k(k + 1)(2k + 1) = + (k + 1) 2 Remember we want to show P(k+1) in part d: 1 2 + 2 2 + + k 2 + (k + 1) 2 = = k(k + 1)(2k + 1)+(k+1)2 (k + 1)[k(2k + 1)+(k+1)] = (k + 1)[2k2 +7k+]

= = (k + 1)(k + 2)+(2k+3)] (k + 1)(k + 2)+(2(k+1)+1)] f) In part b we have completed the basis step and In part e we have completed the inductive step, so by the principle of mathematical induction, the statement is true for every positive integer n. 5. Prove that 1 2 + 3 2 + 5 2 + +(2n + 1) 2 = (n + 1)(2n + 1)(2n + 3)/3 whenever n is a nonnegative integer. Basis Step: P (0): (2 0 +1) 2 = (0+1) (2 0+1)(2 0+3)/3 1 = 1 P(0) is true Inductive Step: Inductive hypothesis: assume that P(k) is true for an arbitrary fixed integer k 0 1 2 + 3 2 + 5 2 + +(2k + 1) 2 = (k + 1)(2k + 1)(2k + 3)/3 We want to prove P(k+1): 1 2 + 3 2 + 5 2 + +(2k + 1) 2 +(2(k+1) + 1) 2 = ((k+1) + 1)(2(k+1) + 1)(2(k+1) + 3)/3 1 2 + 3 2 + 5 2 + +(2k + 1) 2 +(2k + 3) 2 = (k + 2)(2k + 3)(2k + 5)/3 Starting from the assumption of P(k) and adding (2k + 3) 2 to both sides 1 2 + 3 2 + 5 2 + +(2k + 1) 2 + (2k + 3) 2 = (k + 1)(2k + 1)(2k + 3)/3 +(2k + 3) 2 = (k + 1)(2k + 1)(2k + 3)+ 3(2k + 3) 2 /3

= (2k+3)[(k + 1)(2k + 1)+3(2k + 3)] /3 = (2k+3)[2k 2 + 9k + 10] /3 = (2k+3)(k + 2)(2k + 5)/3 By mathematical induction, P(n) is true for all integers n with n 0 21. Prove that 2 n > n 2 if n is an integer greater than 4. Basis Step: 2 5 > 5 2 32 > 25 Inductive Step: Inductive hypothesis: assume that P(k) is true for an arbitrary fixed integer k 5 2 k > k 2 We want to prove P(k+1) 2 k+1 > (k+1) 2 2 2 k > (k+1) 2 From the right hand side (k+1) 2 = k 2 + 2k + 1 < k 2 + 2k + k < k 2 + 3k < k 2 + 3k (since k >3) < k 2 + k 2 < k 2 + k 2 < 2 k 2 (and from the Inductive hypothesis) 2 k 2 < 2 2 k

Section 3: Recursive Definitions and Structural Induction. Determine whether each of these proposed definitions is a valid recursive definition of a function f from the set of nonnegative integers to the set of integers. If f is well defined, find a formula for f (n) when n is a nonnegative integer and prove that your formula is valid. a) f (0) = 1, f (n) = f (n 1) for n 1 c) f (0) = 0, f (1) = 1, f (n) = 2f (n + 1) for n 2 a) This is valid recursive definition, since we are provided with the value at n = 0 and each subsequent value is determined by the previous one. f (n) = f (n 1) f (n) = { -1, 1, -1, } for n 1 So we can write it as f (n) = (-1) n for n 1 To prove that it is a valid formula by induction, that f (n) = f (n 1) = (- 1) n for n 1 Basis Step: f (1) = f (0) = (-1) 1 -(1) = -1 Inductive Step inductive hypothesis: f (k) = f (k) = (-1) k for k 1 We want to prove f (k+1) = f (k+1-1) = (-1) k+1 from the inductive hypothesis. f (k+1) = f (k) = (-1) k+1 = (-1) k (-1) 1 = -(-1) k f (k) = (-1) k

c) This is invalid. We are told that f(2) is defined in terms of f(3), but f(3) has not been defined. 8. Give a recursive definition of the sequence {an}, n = 1, 2, 3,... if a) an = 4n 2. b) an = 1 + ( 1) n a) We can write the first 5 elements and then try to notice a recursive definition a1 = 4(1) -2 = 2 a2 = 4(2) -2 = = 2 + 4 a3 = 4(3) -2 = 10 = + 4 a4 = 4(4) -2 = 14= 10 + 4 a5 = 4(5) -2 = 18= 14 + 4 As we notice, an element is equal the an-1 + 4 b) a1 = 1 + (-1) 1 = 0 a2 = 1 + (-1) 2 = 2 a3 = 1 + (-1) 3 = 0 a4 = 1 + (-1) 4 = 2 a5 = 1 + (-1) 5 = 0 As we notice, a1 and a2 repeats so if we take them as basis we can write that an = an-2

Section 4: Recursive Algorithms 7. Give a recursive algorithm for computing nx whenever n is a positive integer and x is an integer, using just addition. As we know we can represent the multiplication process nx as a n repeated summation of x. procedure product(n: positive integer; x: integer) if n = 1 then return x else return product(n - 1, x) + x To understand how the previous procedure works, look at the following tracing: P1 Let s call the procedure to calculate 4 5 product(4,5) if 4 = 1 then return 5 else return product(3, 5) + 5 P2 P4 retruns 5 to P3 P3 returns 5 + 5 to P2 P2 returns 5 + 5 + 5 to P1 P1 returns 5 + 5 + 5 + 5 if 3 = 1 then return 5 else return product(2, 5) + 5 P3 P1 calls P2 and wait for it to return the result P2 calls P3 and wait for it to return the result P3 calls P4 and wait for it to return the result if 2 = 1 then return 5 else return product(2, 5) + 5 P4 if 1 = 1 then return 5 else return product(0, 5) + 5 Now P1 after waiting the results will return 5 + 5 + 5 + 5 Now you know how recursive algorithms works :D, Try to solve some other problems on it by yourself.