# Discrete Mathematics (2009 Spring) Induction and Recursion (Chapter 4, 3 hours)

Save this PDF as:

Size: px
Start display at page:

Download "Discrete Mathematics (2009 Spring) Induction and Recursion (Chapter 4, 3 hours)"

## Transcription

1 Discrete Mathematics (2009 Spring) Induction and Recursion (Chapter 4, 3 hours) Chih-Wei Yi Dept. of Computer Science National Chiao Tung University April 17, 2009

2 4.1 Mathematical Induction 4.1 Mathematical Induction

3 4.1 Mathematical Induction 4.1 Mathematical Induction A powerful, rigorous technique for proving that a predicate P (n) is true for every natural number n, no matter how large. Essentially a domino e ect principle. Based on a predicate-logic inference rule: BasisStep : P (0) InductiveStep : 8n 0, (P (n)! P (n + 1)) Conclusion : ) 8n 0, P (n) The First Principle of Mathematical Induction.

4 4.1 Mathematical Induction Outline of an Inductive Proof Example Want to prove 8n P (n)... 1 Base case (or basis step): Prove P (0). 2 Inductive step: Prove 8n 0 P (n)! P (n + 1). E.g. use a direct proof: Let n 2 N, assume P (n). (inductive hypothesis) Under this assumption, prove P (n + 1). 3 Inductive inference rule then gives 8n P (n). Prove that the sum of the rst n odd positive integers is n 2. That is, prove: 8n 1 : n i=1 (2i 1) = n 2 {z } P (n)

5 4.1 Mathematical Induction Proof. Base Case: Let n = 1. The sum of the rst 1 odd positive integer is 1 which equals 1 2. Inductive Step: Prove 8n 1 : P (n)! P (n + 1). Let n 1, assume P (n), and prove P (n + 1). n+1 (2i 1) = i=1! n (2i 1) + (2 (n + 1) 1) i=1 = n 2 + 2n + 1 = (n + 1) 2 So, according to the inductive inference rule, the property is proved.

6 4.1 Mathematical Induction Generalizing Induction Can also be used to prove 8n c P (n) for a given constant c 2 Z, where maybe c 6= 0. In this circumstance, the base case is to prove P (c) rather than P (0), and the inductive step is to prove 8n c (P (n)! P (n + 1)). Induction can also be used to prove 8n c P (a n ) for an arbitrary series fa n g. Can reduce these to the form already shown.

7 4.1 Mathematical Induction Example Prove that 8n > 0, n < 2 n. Solution Let P (n) = (n < 2 n ). 1 Base case: P (1) = 1 < 2 1 = (1 < 2) = T. 2 Inductive step: For n > 0, prove P (n)! P (n + 1). Assuming n < 2 n, prove n + 1 < 2 n+1. Note n + 1 < 2 n + 1 (by inductive hypothesis) < 2 n + 2 n (because 1 < 2 = n 1 = 2 n ) = 2 n+1 3 So n + 1 < 2 n+1, and we re done.

8 4.1 Mathematical Induction Harmonic Numbers Theorem The harmnoic numbers H j for j = 1, 2, 3, are H j = j. Then, H 2 n 1 + n 2. Proof. BASIS STEP INDUCTIVE STEP CONCLUSION

9 4.1 Mathematical Induction De Morgan s Law Theorem If A 1, A 2,, A n are subsets of a universal set U and n 2, then we have n\ n[ n[ n\ A j = A j and A j = A j. Proof. j=1 BASIS STEP INDUCTIVE STEP CONCLUSION j=1 j=1 j=1

10 4.1 Mathematical Induction The Inclusion-Exclusion Principle Theorem If A 1, A 2,, A n are nite sets and n 1, we have n[ A i = ja i j ja i \ A j j + i=1 i=1 1i <jn. Proof. BASIS STEP INDUCTIVE STEP CONCLUSION 1i <j<kn ja i \ A j \ A k j

11 4.2 Strong Induction and Well-Ordering 4.2 Strong Induction and Well-Ordering

12 4.2 Strong Induction and Well-Ordering 4.2: Strong Induction Second Principle of Induction Characterized by another inference rule: P (0) 8n 0 : P is true in all previous cases z } { (80 k n P (k))! P (n + 1) ) 8n 0 : P (n) Di erence with the 1st principle is that the inductive step uses the fact that P (k) is true for all smaller k < n + 1, not just for k = n.

13 4.2 Strong Induction and Well-Ordering Example of Second Principle Example Show that every n > 1 can be written as a product p 1 p 2... p s of some series of s prime numbers. Solution Let P (n) = n has that property. 1 Base case: For n = 2, let s = 1, p 1 = 2. 2 Inductive step: Let n 2. Assume 82 k n: P (k). Consider n + 1. If prime, let s = 1, p 1 = n + 1. Else n + 1 = ab, where 1 < a n and 1 < b n. Then a = p 1 p 2... p t and b = q 1 q 2... q u. Then n + 1 = p 1 p 2... p t q 1 q 2... q u, a product of s = t + u primes. 3 So, P (n) is true for all n > 1.

14 4.2 Strong Induction and Well-Ordering Another 2nd Principle Example Example Prove that every amount of postage of 12 cents or more can be formed using just 4-cent and 5-cent stamps. Solution Let P (n) = n can be formed using 4-cent and 5-cent stamps." 1 Base case: 12 = 3 (4), 13 = 2 (4) + 1 (5), 14 = 1 (4) + 2 (5), 15 = 3 (5), so 812 n 15, P (n). 2 Inductive step: Let n 15. Assume 812 k n P(k). Note n + 1 = (n 3) + 4 and 12 n 3 n. Since P (n 3), add a 4-cent stamp to get postage for n So, P (n) is true for all n 12.

15 4.2 Strong Induction and Well-Ordering Examples 1 Consider a game in which two players take turns removing any positive number of matches they want from one of two piles of matches. The player who removes the last match wins the game. Show that if the two piles contain the same number of matches initially, the second player can always guarantee a win. 2 A simple polygon with n sides, where n is an integer with n 3, can be triangulated into n 2 triangles. Lemma (For the 2nd example) Every simple polygon has an interior diagonal.

16 4.2 Strong Induction and Well-Ordering Validity of Induction Proof that 8k 0 P (k) is a valid consequent: Given any k 0, 8n 0 (P (n)! P (n + 1)) (antecedent 2) trivially implies 8n 0 (n < k)! (P (n)! P (n + 1)), or (P (0)! P (1)) ^ (P (1)! P (2)) ^... ^ (P (k 1)! P (k)). Repeatedly applying the hypothetical syllogism rule to adjacent implications k 1 times then gives P (0)! P (k). P (0) (antecedent #1) and modus ponens give P (k). Thus 8k 0 P (k).

17 4.3 Recursive De nitions and Structural Induction 4.3 Recursive De nitions and Structural Induction

18 4.3 Recursive De nitions and Structural Induction Recursive De nitions In induction, we prove all members of an in nite set have some property P by proving the truth for larger members in terms of that of smaller members. In recursive de nitions, we similarly de ne a function, a predicate or a set over an in nite number of elements by de ning the function or predicate value or set-membership of larger elements in terms of that of smaller ones.

19 4.3 Recursive De nitions and Structural Induction Recursion Recursion is a general term for the practice of de ning an object in terms of itself (or of part of itself). An inductive proof establishes the truth of P (n + 1) recursively in terms of P (n). There are also recursive algorithms, de nitions, functions, sequences, and sets.

20 4.3 Recursive De nitions and Structural Induction Recursively De ned Functions Simplest case: One way to de ne a function f : N! S (for any set S) or series a n = f (n) is to: De ne f (0). For n > 0, de ne f (n) in terms of f (0),...,f (n 1). E.g.: De ne the series a n : 2 n recursively: Let a 0 : 1. For n > 0, let a n : 2a n 1.

21 4.3 Recursive De nitions and Structural Induction Another Example Suppose we de ne f (n) for all n 2 N recursively by: Let f (0) = 3. For all n 2 N, let f (n + 1) = 2f (n) + 3 What are the values of the following? f (1) = 9, f (2) = 21, f (3) = 45, f (4) = 93

22 4.3 Recursive De nitions and Structural Induction Recursive de nition of Factorial Give an inductive de nition of the factorial function F (n) : n! : n. Base case: F (0) : 1 Recursive part: F (n) : n F (n 1). F (1) = 1 F (2) = 2 F (3) = 6

23 4.3 Recursive De nitions and Structural Induction The Fibonacci Series The Fibonacci series f n0 is a famous series de ned by f 0 : 0, f 1 : 1, f n2 : f n 1 + f n

24 4.3 Recursive De nitions and Structural Induction Inductive Proof about Fib. Series Theorem For all n 2 N, f n < 2 n. Proof. Prove the theorem by induction. Base cases: f 0 = 0 < 2 0 = 1 f 1 = 1 < 2 1 = 2 the base cases of recursive def n Inductive step: Use the 2nd principle of induction (strong induction). Assume 8k < n, f k < 2 k. Then f n = f n 1 + f n 2 < 2 n n 2 < 2 n n 1 = 2 n. So, f n < 2 n is proved.

25 4.3 Recursive De nitions and Structural Induction Exercise Problem Let f n denote the Fibonacci numbers. Show that whenever n 3, f n > α n 2, where α = (1+p 5) 2. Problem (Lamé s Theorem) Let a and b be positive integers with a b. Then the number of divisions used by the Euclidean algorithm to nd gcd (a, b) is less than or equal to ve times the number of decimal digits in b.

26 4.3 Recursive De nitions and Structural Induction Recursively De ned Sets Example An in nite set S may be de ned recursively, by giving: A small nite set of base elements of S. A rule for constructing new elements of S from previously-established elements. Implicitly, S has no other elements but these. Let 3 2 S, and let x + y 2 S if x, y 2 S What is S?

27 4.3 Recursive De nitions and Structural Induction The Set of All Strings Given an alphabet, the set of all strings over can be recursively de ned as ε 2 Σ (ε :, the empty string) (λ 2 Σ ) ^ (x 2 Σ)! λx 2 Σ Problem Prove that this de nition is equivalent to our old one = [ n. n2n

28 4.3 Recursive De nitions and Structural Induction Tree Structures Rooted Trees The set of rooted trees, where a rooted tree consists of a set of vertices containing a distinguished vertex called the root, and edges connecting these vertices, can be de ned recursively by these steps: BASIS STEP: A single vertex r is a rooted tree. RECURSIVE STEP: Suppose that T 1, T 2,..., T n are disjoint rooted trees with roots r 1, r 2,..., r n respectively. Then the graph formed by starting with a root r, which is not in any of the rooted trees T 1, T 2,..., T n, and adding an edge from r to each of the vertices r 1, r 2,..., r n is also a rooted tree.

29 4.3 Recursive De nitions and Structural Induction Examples of Rooted Trees

30 4.3 Recursive De nitions and Structural Induction Tree Structures Binary Trees The set of extended binary trees can be de ned recursively by these steps: BASIS STEP: A empty set is an extended binary tree. RECURSIVE STEP: If T 1 and T 2 are disjoint extended binary trees, there is an extended binary tree, denoted by T 1 T 2, containing of a root r together with edges connecting the root to each of the roots of the left subtree T 1 and the right subtree T 2 when these trees are nonempty.

31 4.3 Recursive De nitions and Structural Induction Example of Extended Binary Trees

32 4.4 Recursive Algorithms 4.4 Recursive Algorithms

33 4.4 Recursive Algorithms 4.4 Recursive Algorithms Recursive de nitions can be used to describe algorithms as well as functions and sets. Example (A procedure to compute a n ) procedure power (a 6= 0 : real, n 2 N) if n = 0 then return 1 else return a power (a, n 1)

34 4.4 Recursive Algorithms E ciency of Recursive Algorithms The time complexity of a recursive algorithm may depend critically on the number of recursive calls it makes. E.g., modular exponentiation to a power n can take log (n) time if done right, but linear time if done slightly di erently. Compute b n mod m, where m 2, n 0, and 1 b < m.

35 4.4 Recursive Algorithms Modular Exponentiation Alg. #1 Use the fact that b n = b b n 1 and that x y mod m = x (y mod m) mod m. (Prove!!!) Example (Returns b n mod m by using b n = b b n 1.) procedure mpower (b 1, n 0, m > b 2 N) if n = 0 then return 1 else return (b mpower (b, n 1, m)) mod m Note this algorithm takes Θ (n) steps!

36 4.4 Recursive Algorithms Modular Exponentiation Alg. #2 Use the fact that b 2k = b k2 = (b k ) 2. Example (Returns b n mod m by using b 2k = (b k ) 2.) procedure mpower (b, n, m) if n = 0 then return 1 else if 2 j n then return mpower (b, n/2, m) 2 mod m else return (mpower (b, n 1, m) b) mod m What is its time complexity?

37 4.4 Recursive Algorithms Modular Exponentiation Alg. #2 Use the fact that b 2k = b k2 = (b k ) 2. Example (Returns b n mod m by using b 2k = (b k ) 2.) procedure mpower (b, n, m) if n = 0 then return 1 else if 2 j n then return mpower (b, n/2, m) 2 mod m else return (mpower (b, n 1, m) b) mod m What is its time complexity? Θ (log n) steps

38 4.4 Recursive Algorithms A Slight Variation Example procedure mpower(b, n, m) if n = 0 then return 1 else if 2jn then mpower (b, n/2, m) return mpower (b, n/2, m) else return (mpower (b, n mod m 1, m) b) mod m Nearly identical but takes Θ (n) time instead! The number of recursive calls made is critical.

39 4.4 Recursive Algorithms Recursive Euclid s Algorithm Example (Recursive Euclid s Algorithm) procedure gcd (a, b 2 N) if a = 0 then return b else return gcd (b mod a, a) Note recursive algorithms are often simpler to code than iterative ones... However, they can consume more stack space, if your compiler is not smart enough.

40 4.4 Recursive Algorithms Merge Sort Example (Merge Sort) procedure sort (L = `1,..., `n) if n > 1 then m = bn/2c // this is rough 1 2 -way point L = merge (sort (`1,..., `m), sort(`m+1,..., `n)) return L The merge takes Θ (n) steps, and merge-sort takes Θ (n log n).

41 4.4 Recursive Algorithms Example (Merge routine) procedure merge (A, B : sorted lists) L = empty list i = 0; j = 0; k = 0; while i < jaj _ j < jbj // jaj is length of A if i == jaj then L k = B j ; j = j + 1 else if j == jbj then L k = A i ; i = i + 1 else if A i < B j then L k = A i ; i = i + 1 else L k = B j ; j = j + 1 k = k + 1 return L

42 4.4 Recursive Algorithms Ackermann s Function Problem Find the value A (1, 0), A (0, 1), A (1, 1),and A (2, 2) according to the following recursive de nition 8 2n if m = 0 >< 0 if m 1 and n = 0 A (m, n) =. 2 if m 1 and n = 1 >: A (m 1, A (m, n 1)) if m 1 and n 2

### Mathematical Induction. Lecture 10-11

Mathematical Induction Lecture 10-11 Menu Mathematical Induction Strong Induction Recursive Definitions Structural Induction Climbing an Infinite Ladder Suppose we have an infinite ladder: 1. We can reach

### Mathematical induction. Niloufar Shafiei

Mathematical induction Niloufar Shafiei Mathematical induction Mathematical induction is an extremely important proof technique. Mathematical induction can be used to prove results about complexity of

### Induction. Margaret M. Fleck. 10 October These notes cover mathematical induction and recursive definition

Induction Margaret M. Fleck 10 October 011 These notes cover mathematical induction and recursive definition 1 Introduction to induction At the start of the term, we saw the following formula for computing

### Full and Complete Binary Trees

Full and Complete Binary Trees Binary Tree Theorems 1 Here are two important types of binary trees. Note that the definitions, while similar, are logically independent. Definition: a binary tree T is full

### Math 55: Discrete Mathematics

Math 55: Discrete Mathematics UC Berkeley, Fall 2011 Homework # 5, due Wednesday, February 22 5.1.4 Let P (n) be the statement that 1 3 + 2 3 + + n 3 = (n(n + 1)/2) 2 for the positive integer n. a) What

### 3. Mathematical Induction

3. MATHEMATICAL INDUCTION 83 3. Mathematical Induction 3.1. First Principle of Mathematical Induction. Let P (n) be a predicate with domain of discourse (over) the natural numbers N = {0, 1,,...}. If (1)

### Discrete Mathematics

Discrete Mathematics Chih-Wei Yi Dept. of Computer Science National Chiao Tung University March 16, 2009 2.1 Sets 2.1 Sets 2.1 Sets Basic Notations for Sets For sets, we ll use variables S, T, U,. We can

### CS 103X: Discrete Structures Homework Assignment 3 Solutions

CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering

### Many algorithms, particularly divide and conquer algorithms, have time complexities which are naturally

Recurrence Relations Many algorithms, particularly divide and conquer algorithms, have time complexities which are naturally modeled by recurrence relations. A recurrence relation is an equation which

### Section IV.1: Recursive Algorithms and Recursion Trees

Section IV.1: Recursive Algorithms and Recursion Trees Definition IV.1.1: A recursive algorithm is an algorithm that solves a problem by (1) reducing it to an instance of the same problem with smaller

### 1.1 Logical Form and Logical Equivalence 1

Contents Chapter I The Logic of Compound Statements 1.1 Logical Form and Logical Equivalence 1 Identifying logical form; Statements; Logical connectives: not, and, and or; Translation to and from symbolic

### CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

CHAPTER 5 Number Theory 1. Integers and Division 1.1. Divisibility. Definition 1.1.1. Given two integers a and b we say a divides b if there is an integer c such that b = ac. If a divides b, we write a

### Homework 5 Solutions

Homework 5 Solutions 4.2: 2: a. 321 = 256 + 64 + 1 = (01000001) 2 b. 1023 = 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = (1111111111) 2. Note that this is 1 less than the next power of 2, 1024, which

### Mathematical Induction. Mary Barnes Sue Gordon

Mathematics Learning Centre Mathematical Induction Mary Barnes Sue Gordon c 1987 University of Sydney Contents 1 Mathematical Induction 1 1.1 Why do we need proof by induction?.... 1 1. What is proof by

### Mathematical Induction

Mathematical Induction (Handout March 8, 01) The Principle of Mathematical Induction provides a means to prove infinitely many statements all at once The principle is logical rather than strictly mathematical,

### Connectivity and cuts

Math 104, Graph Theory February 19, 2013 Measure of connectivity How connected are each of these graphs? > increasing connectivity > I G 1 is a tree, so it is a connected graph w/minimum # of edges. Every

### Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

7 Catalan Numbers Thomas A. Dowling, Department of Mathematics, Ohio State Uni- Author: versity. Prerequisites: The prerequisites for this chapter are recursive definitions, basic counting principles,

### 8 Divisibility and prime numbers

8 Divisibility and prime numbers 8.1 Divisibility In this short section we extend the concept of a multiple from the natural numbers to the integers. We also summarize several other terms that express

### Measuring Rationality with the Minimum Cost of Revealed Preference Violations. Mark Dean and Daniel Martin. Online Appendices - Not for Publication

Measuring Rationality with the Minimum Cost of Revealed Preference Violations Mark Dean and Daniel Martin Online Appendices - Not for Publication 1 1 Algorithm for Solving the MASP In this online appendix

### Graphs without proper subgraphs of minimum degree 3 and short cycles

Graphs without proper subgraphs of minimum degree 3 and short cycles Lothar Narins, Alexey Pokrovskiy, Tibor Szabó Department of Mathematics, Freie Universität, Berlin, Germany. August 22, 2014 Abstract

### Notes: Chapter 2 Section 2.2: Proof by Induction

Notes: Chapter 2 Section 2.2: Proof by Induction Basic Induction. To prove: n, a W, n a, S n. (1) Prove the base case - S a. (2) Let k a and prove that S k S k+1 Example 1. n N, n i = n(n+1) 2. Example

### def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

Section 1.5 Methods of Proof 1.5.1 1.5 METHODS OF PROOF Some forms of argument ( valid ) never lead from correct statements to an incorrect. Some other forms of argument ( fallacies ) can lead from true

### Elementary Number Theory We begin with a bit of elementary number theory, which is concerned

CONSTRUCTION OF THE FINITE FIELDS Z p S. R. DOTY Elementary Number Theory We begin with a bit of elementary number theory, which is concerned solely with questions about the set of integers Z = {0, ±1,

### Discrete Mathematics Problems

Discrete Mathematics Problems William F. Klostermeyer School of Computing University of North Florida Jacksonville, FL 32224 E-mail: wkloster@unf.edu Contents 0 Preface 3 1 Logic 5 1.1 Basics...............................

### Regular Languages and Finite Automata

Regular Languages and Finite Automata 1 Introduction Hing Leung Department of Computer Science New Mexico State University Sep 16, 2010 In 1943, McCulloch and Pitts [4] published a pioneering work on a

### Section 6-2 Mathematical Induction

6- Mathematical Induction 457 In calculus, it can be shown that e x k0 x k k! x x x3!! 3!... xn n! where the larger n is, the better the approximation. Problems 6 and 6 refer to this series. Note that

### WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

First Name: Family Name: Student Number: Class/Tutorial: WOLLONGONG COLLEGE AUSTRALIA A College of the University of Wollongong Diploma in Information Technology Final Examination Spring Session 2008 WUCT121

### Solutions for Practice problems on proofs

Solutions for Practice problems on proofs Definition: (even) An integer n Z is even if and only if n = 2m for some number m Z. Definition: (odd) An integer n Z is odd if and only if n = 2m + 1 for some

### The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

The Prime Numbers Before starting our study of primes, we record the following important lemma. Recall that integers a, b are said to be relatively prime if gcd(a, b) = 1. Lemma (Euclid s Lemma). If gcd(a,

### CS 441 Discrete Mathematics for CS Lecture 5. Predicate logic. CS 441 Discrete mathematics for CS. Negation of quantifiers

CS 441 Discrete Mathematics for CS Lecture 5 Predicate logic Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Negation of quantifiers English statement: Nothing is perfect. Translation: x Perfect(x)

### CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

CHAPTER 3 Methods of Proofs 1. Logical Arguments and Formal Proofs 1.1. Basic Terminology. An axiom is a statement that is given to be true. A rule of inference is a logical rule that is used to deduce

### The Binomial Distribution

The Binomial Distribution James H. Steiger November 10, 00 1 Topics for this Module 1. The Binomial Process. The Binomial Random Variable. The Binomial Distribution (a) Computing the Binomial pdf (b) Computing

### 136 CHAPTER 4. INDUCTION, GRAPHS AND TREES

136 TER 4. INDUCTION, GRHS ND TREES 4.3 Graphs In this chapter we introduce a fundamental structural idea of discrete mathematics, that of a graph. Many situations in the applications of discrete mathematics

### Homework Exam 1, Geometric Algorithms, 2016

Homework Exam 1, Geometric Algorithms, 2016 1. (3 points) Let P be a convex polyhedron in 3-dimensional space. The boundary of P is represented as a DCEL, storing the incidence relationships between the

### Appendix F: Mathematical Induction

Appendix F: Mathematical Induction Introduction In this appendix, you will study a form of mathematical proof called mathematical induction. To see the logical need for mathematical induction, take another

### MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

MATHEMATICAL INDUCTION MIGUEL A LERMA (Last updated: February 8, 003) Mathematical Induction This is a powerful method to prove properties of positive integers Principle of Mathematical Induction Let P

### Induction Problems. Tom Davis November 7, 2005

Induction Problems Tom Davis tomrdavis@earthlin.net http://www.geometer.org/mathcircles November 7, 2005 All of the following problems should be proved by mathematical induction. The problems are not necessarily

### I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

I GROUPS: BASIC DEFINITIONS AND EXAMPLES Definition 1: An operation on a set G is a function : G G G Definition 2: A group is a set G which is equipped with an operation and a special element e G, called

### The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge, cheapest first, we had to determine whether its two endpoints

### Elements of probability theory

2 Elements of probability theory Probability theory provides mathematical models for random phenomena, that is, phenomena which under repeated observations yield di erent outcomes that cannot be predicted

### CONTRIBUTIONS TO ZERO SUM PROBLEMS

CONTRIBUTIONS TO ZERO SUM PROBLEMS S. D. ADHIKARI, Y. G. CHEN, J. B. FRIEDLANDER, S. V. KONYAGIN AND F. PAPPALARDI Abstract. A prototype of zero sum theorems, the well known theorem of Erdős, Ginzburg

### The Foundations: Logic and Proofs. Chapter 1, Part III: Proofs

The Foundations: Logic and Proofs Chapter 1, Part III: Proofs Rules of Inference Section 1.6 Section Summary Valid Arguments Inference Rules for Propositional Logic Using Rules of Inference to Build Arguments

### SECTION 10-2 Mathematical Induction

73 0 Sequences and Series 6. Approximate e 0. using the first five terms of the series. Compare this approximation with your calculator evaluation of e 0.. 6. Approximate e 0.5 using the first five terms

### Homework until Test #2

MATH31: Number Theory Homework until Test # Philipp BRAUN Section 3.1 page 43, 1. It has been conjectured that there are infinitely many primes of the form n. Exhibit five such primes. Solution. Five such

### Examination paper for MA0301 Elementær diskret matematikk

Department of Mathematical Sciences Examination paper for MA0301 Elementær diskret matematikk Academic contact during examination: Iris Marjan Smit a, Sverre Olaf Smalø b Phone: a 9285 0781, b 7359 1750

### SHARP BOUNDS FOR THE SUM OF THE SQUARES OF THE DEGREES OF A GRAPH

31 Kragujevac J. Math. 25 (2003) 31 49. SHARP BOUNDS FOR THE SUM OF THE SQUARES OF THE DEGREES OF A GRAPH Kinkar Ch. Das Department of Mathematics, Indian Institute of Technology, Kharagpur 721302, W.B.,

### APPLICATIONS OF THE ORDER FUNCTION

APPLICATIONS OF THE ORDER FUNCTION LECTURE NOTES: MATH 432, CSUSM, SPRING 2009. PROF. WAYNE AITKEN In this lecture we will explore several applications of order functions including formulas for GCDs and

### Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof. Harper Langston New York University

Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof Harper Langston New York University Proof and Counterexample Discovery and proof Even and odd numbers number n from Z is called

### MODULAR ARITHMETIC. a smallest member. It is equivalent to the Principle of Mathematical Induction.

MODULAR ARITHMETIC 1 Working With Integers The usual arithmetic operations of addition, subtraction and multiplication can be performed on integers, and the result is always another integer Division, on

### INCIDENCE-BETWEENNESS GEOMETRY

INCIDENCE-BETWEENNESS GEOMETRY MATH 410, CSUSM. SPRING 2008. PROFESSOR AITKEN This document covers the geometry that can be developed with just the axioms related to incidence and betweenness. The full

### Reading 13 : Finite State Automata and Regular Expressions

CS/Math 24: Introduction to Discrete Mathematics Fall 25 Reading 3 : Finite State Automata and Regular Expressions Instructors: Beck Hasti, Gautam Prakriya In this reading we study a mathematical model

### 1 Introduction to Counting

1 Introduction to Counting 1.1 Introduction In this chapter you will learn the fundamentals of enumerative combinatorics, the branch of mathematics concerned with counting. While enumeration problems can

### Math 55: Discrete Mathematics

Math 55: Discrete Mathematics UC Berkeley, Spring 2012 Homework # 9, due Wednesday, April 11 8.1.5 How many ways are there to pay a bill of 17 pesos using a currency with coins of values of 1 peso, 2 pesos,

### Factoring Algorithms

Factoring Algorithms The p 1 Method and Quadratic Sieve November 17, 2008 () Factoring Algorithms November 17, 2008 1 / 12 Fermat s factoring method Fermat made the observation that if n has two factors

### Automata and Formal Languages

Automata and Formal Languages Winter 2009-2010 Yacov Hel-Or 1 What this course is all about This course is about mathematical models of computation We ll study different machine models (finite automata,

### GREATEST COMMON DIVISOR

DEFINITION: GREATEST COMMON DIVISOR The greatest common divisor (gcd) of a and b, denoted by (a, b), is the largest common divisor of integers a and b. THEOREM: If a and b are nonzero integers, then their

### 2.3 Scheduling jobs on identical parallel machines

2.3 Scheduling jobs on identical parallel machines There are jobs to be processed, and there are identical machines (running in parallel) to which each job may be assigned Each job = 1,,, must be processed

### Divisor graphs have arbitrary order and size

Divisor graphs have arbitrary order and size arxiv:math/0606483v1 [math.co] 20 Jun 2006 Le Anh Vinh School of Mathematics University of New South Wales Sydney 2052 Australia Abstract A divisor graph G

### Answer: (a) Since we cannot repeat men on the committee, and the order we select them in does not matter, ( )

1. (Chapter 1 supplementary, problem 7): There are 12 men at a dance. (a) In how many ways can eight of them be selected to form a cleanup crew? (b) How many ways are there to pair off eight women at the

### Data Structures Fibonacci Heaps, Amortized Analysis

Chapter 4 Data Structures Fibonacci Heaps, Amortized Analysis Algorithm Theory WS 2012/13 Fabian Kuhn Fibonacci Heaps Lacy merge variant of binomial heaps: Do not merge trees as long as possible Structure:

### Lecture 1: Course overview, circuits, and formulas

Lecture 1: Course overview, circuits, and formulas Topics in Complexity Theory and Pseudorandomness (Spring 2013) Rutgers University Swastik Kopparty Scribes: John Kim, Ben Lund 1 Course Information Swastik

### IMO Training 2010 Russian-style Problems Alexander Remorov

Solutions: Combinatorial Geometry 1. No. Call a lattice point even if the sum of its coordinates is even, and call it odd otherwise. Call one of the legs first, and other one second. Then every time a

### GRAPH THEORY LECTURE 4: TREES

GRAPH THEORY LECTURE 4: TREES Abstract. 3.1 presents some standard characterizations and properties of trees. 3.2 presents several different types of trees. 3.7 develops a counting method based on a bijection

### MA651 Topology. Lecture 6. Separation Axioms.

MA651 Topology. Lecture 6. Separation Axioms. This text is based on the following books: Fundamental concepts of topology by Peter O Neil Elements of Mathematics: General Topology by Nicolas Bourbaki Counterexamples

### SYSTEMS OF PYTHAGOREAN TRIPLES. Acknowledgements. I would like to thank Professor Laura Schueller for advising and guiding me

SYSTEMS OF PYTHAGOREAN TRIPLES CHRISTOPHER TOBIN-CAMPBELL Abstract. This paper explores systems of Pythagorean triples. It describes the generating formulas for primitive Pythagorean triples, determines

### Graph Theory Problems and Solutions

raph Theory Problems and Solutions Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles November, 005 Problems. Prove that the sum of the degrees of the vertices of any finite graph is

### CMPS 102 Solutions to Homework 1

CMPS 0 Solutions to Homework Lindsay Brown, lbrown@soe.ucsc.edu September 9, 005 Problem..- p. 3 For inputs of size n insertion sort runs in 8n steps, while merge sort runs in 64n lg n steps. For which

### 6.3 Conditional Probability and Independence

222 CHAPTER 6. PROBABILITY 6.3 Conditional Probability and Independence Conditional Probability Two cubical dice each have a triangle painted on one side, a circle painted on two sides and a square painted

### 8 Primes and Modular Arithmetic

8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.

### Intro. to the Divide-and-Conquer Strategy via Merge Sort CMPSC 465 CLRS Sections 2.3, Intro. to and various parts of Chapter 4

Intro. to the Divide-and-Conquer Strategy via Merge Sort CMPSC 465 CLRS Sections 2.3, Intro. to and various parts of Chapter 4 I. Algorithm Design and Divide-and-Conquer There are various strategies we

### Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

MTHSC 412 Section 2.4 Prime Factors and Greatest Common Divisor Greatest Common Divisor Definition Suppose that a, b Z. Then we say that d Z is a greatest common divisor (gcd) of a and b if the following

### Exponential time algorithms for graph coloring

Exponential time algorithms for graph coloring Uriel Feige Lecture notes, March 14, 2011 1 Introduction Let [n] denote the set {1,..., k}. A k-labeling of vertices of a graph G(V, E) is a function V [k].

### Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

### 9 Modular Exponentiation and Cryptography

9 Modular Exponentiation and Cryptography 9.1 Modular Exponentiation Modular arithmetic is used in cryptography. In particular, modular exponentiation is the cornerstone of what is called the RSA system.

### CS 598CSC: Combinatorial Optimization Lecture date: 2/4/2010

CS 598CSC: Combinatorial Optimization Lecture date: /4/010 Instructor: Chandra Chekuri Scribe: David Morrison Gomory-Hu Trees (The work in this section closely follows [3]) Let G = (V, E) be an undirected

### WRITING PROOFS. Christopher Heil Georgia Institute of Technology

WRITING PROOFS Christopher Heil Georgia Institute of Technology A theorem is just a statement of fact A proof of the theorem is a logical explanation of why the theorem is true Many theorems have this

### Solutions to In-Class Problems Week 4, Mon.

Massachusetts Institute of Technology 6.042J/18.062J, Fall 05: Mathematics for Computer Science September 26 Prof. Albert R. Meyer and Prof. Ronitt Rubinfeld revised September 26, 2005, 1050 minutes Solutions

### Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras

Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture No. # 31 Recursive Sets, Recursively Innumerable Sets, Encoding

### Nim Games. There are initially n stones on the table.

Nim Games 1 One Pile Nim Games Consider the following two-person game. There are initially n stones on the table. During a move a player can remove either one, two, or three stones. If a player cannot

### 13 Infinite Sets. 13.1 Injections, Surjections, and Bijections. mcs-ftl 2010/9/8 0:40 page 379 #385

mcs-ftl 2010/9/8 0:40 page 379 #385 13 Infinite Sets So you might be wondering how much is there to say about an infinite set other than, well, it has an infinite number of elements. Of course, an infinite

### Introduction to Diophantine Equations

Introduction to Diophantine Equations Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles September, 2006 Abstract In this article we will only touch on a few tiny parts of the field

### Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement

### = 2 + 1 2 2 = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

Instructions. Answer each of the questions on your own paper, and be sure to show your work so that partial credit can be adequately assessed. Credit will not be given for answers (even correct ones) without

### MITES Physics III Summer Introduction 1. 3 Π = Product 2. 4 Proofs by Induction 3. 5 Problems 5

MITES Physics III Summer 010 Sums Products and Proofs Contents 1 Introduction 1 Sum 1 3 Π Product 4 Proofs by Induction 3 5 Problems 5 1 Introduction These notes will introduce two topics: A notation which

### Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Chapter 3 Cartesian Products and Relations The material in this chapter is the first real encounter with abstraction. Relations are very general thing they are a special type of subset. After introducing

### PART I. THE REAL NUMBERS

PART I. THE REAL NUMBERS This material assumes that you are already familiar with the real number system and the representation of the real numbers as points on the real line. I.1. THE NATURAL NUMBERS

### (IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

3130CIT: Theory of Computation Turing machines and undecidability (IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. An undecidable problem

### Converting a Number from Decimal to Binary

Converting a Number from Decimal to Binary Convert nonnegative integer in decimal format (base 10) into equivalent binary number (base 2) Rightmost bit of x Remainder of x after division by two Recursive

### Class One: Degree Sequences

Class One: Degree Sequences For our purposes a graph is a just a bunch of points, called vertices, together with lines or curves, called edges, joining certain pairs of vertices. Three small examples of

### Near Optimal Solutions

Near Optimal Solutions Many important optimization problems are lacking efficient solutions. NP-Complete problems unlikely to have polynomial time solutions. Good heuristics important for such problems.

### Binary Search Trees. Data in each node. Larger than the data in its left child Smaller than the data in its right child

Binary Search Trees Data in each node Larger than the data in its left child Smaller than the data in its right child FIGURE 11-6 Arbitrary binary tree FIGURE 11-7 Binary search tree Data Structures Using

### Lecture 17 : Equivalence and Order Relations DRAFT

CS/Math 240: Introduction to Discrete Mathematics 3/31/2011 Lecture 17 : Equivalence and Order Relations Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Last lecture we introduced the notion

### POLYNOMIAL RINGS AND UNIQUE FACTORIZATION DOMAINS

POLYNOMIAL RINGS AND UNIQUE FACTORIZATION DOMAINS RUSS WOODROOFE 1. Unique Factorization Domains Throughout the following, we think of R as sitting inside R[x] as the constant polynomials (of degree 0).

### The Tower of Hanoi. Recursion Solution. Recursive Function. Time Complexity. Recursive Thinking. Why Recursion? n! = n* (n-1)!

The Tower of Hanoi Recursion Solution recursion recursion recursion Recursive Thinking: ignore everything but the bottom disk. 1 2 Recursive Function Time Complexity Hanoi (n, src, dest, temp): If (n >

### 6.254 : Game Theory with Engineering Applications Lecture 5: Existence of a Nash Equilibrium

6.254 : Game Theory with Engineering Applications Lecture 5: Existence of a Nash Equilibrium Asu Ozdaglar MIT February 18, 2010 1 Introduction Outline Pricing-Congestion Game Example Existence of a Mixed

### Lecture 3: Finding integer solutions to systems of linear equations

Lecture 3: Finding integer solutions to systems of linear equations Algorithmic Number Theory (Fall 2014) Rutgers University Swastik Kopparty Scribe: Abhishek Bhrushundi 1 Overview The goal of this lecture

### Lecture 13 - Basic Number Theory.

Lecture 13 - Basic Number Theory. Boaz Barak March 22, 2010 Divisibility and primes Unless mentioned otherwise throughout this lecture all numbers are non-negative integers. We say that A divides B, denoted

### 36 CHAPTER 1. LIMITS AND CONTINUITY. Figure 1.17: At which points is f not continuous?

36 CHAPTER 1. LIMITS AND CONTINUITY 1.3 Continuity Before Calculus became clearly de ned, continuity meant that one could draw the graph of a function without having to lift the pen and pencil. While this