Sample Problems in Discrete Mathematics

Similar documents
Full and Complete Binary Trees

Mathematical Induction. Lecture 10-11

3. Mathematical Induction

Math 55: Discrete Mathematics

Midterm Practice Problems

V. Adamchik 1. Graph Theory. Victor Adamchik. Fall of 2005

GRAPH THEORY LECTURE 4: TREES

Graph Theory Problems and Solutions

Lecture 1: Course overview, circuits, and formulas

Connectivity and cuts

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

Lecture 17 : Equivalence and Order Relations DRAFT

Handout #Ch7 San Skulrattanakulchai Gustavus Adolphus College Dec 6, Chapter 7: Digraphs

136 CHAPTER 4. INDUCTION, GRAPHS AND TREES

Mathematical Induction

Lecture 16 : Relations and Functions DRAFT

Examination paper for MA0301 Elementær diskret matematikk

Analysis of Algorithms, I

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

6.3 Conditional Probability and Independence

The Goldberg Rao Algorithm for the Maximum Flow Problem

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Handout #1: Mathematical Reasoning

Math 4310 Handout - Quotient Vector Spaces

Product irregularity strength of certain graphs

Data Structures Fibonacci Heaps, Amortized Analysis

Tree-representation of set families and applications to combinatorial decompositions

Recursive Algorithms. Recursion. Motivating Example Factorial Recall the factorial function. { 1 if n = 1 n! = n (n 1)! if n > 1

An inequality for the group chromatic number of a graph

CMPSCI611: Approximating MAX-CUT Lecture 20

P. Jeyanthi and N. Angel Benseera

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

Row Echelon Form and Reduced Row Echelon Form

Math 319 Problem Set #3 Solution 21 February 2002

Sample Induction Proofs

A 2-factor in which each cycle has long length in claw-free graphs

Solutions for Practice problems on proofs

Math 55: Discrete Mathematics

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

Cartesian Products and Relations

Why? A central concept in Computer Science. Algorithms are ubiquitous.

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

Bicolored Shortest Paths in Graphs with Applications to Network Overlay Design

An inequality for the group chromatic number of a graph

Large induced subgraphs with all degrees odd

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

Graphs without proper subgraphs of minimum degree 3 and short cycles

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

Problem Set 7 Solutions

INDISTINGUISHABILITY OF ABSOLUTELY CONTINUOUS AND SINGULAR DISTRIBUTIONS

CS473 - Algorithms I

Math 181 Handout 16. Rich Schwartz. March 9, 2010

Exponential time algorithms for graph coloring

3 Some Integer Functions

Discrete Mathematics Problems

Mathematics for Algorithm and System Analysis

SCORE SETS IN ORIENTED GRAPHS

A NOTE ON OFF-DIAGONAL SMALL ON-LINE RAMSEY NUMBERS FOR PATHS

On the k-path cover problem for cacti

3.1 Solving Systems Using Tables and Graphs

Generating models of a matched formula with a polynomial delay

Introduction. Appendix D Mathematical Induction D1

Euclidean Minimum Spanning Trees Based on Well Separated Pair Decompositions Chaojun Li. Advised by: Dave Mount. May 22, 2014

Ph.D. Thesis. Judit Nagy-György. Supervisor: Péter Hajnal Associate Professor

From Last Time: Remove (Delete) Operation

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,

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Converting a Number from Decimal to Binary

Binary Search Trees CMPSC 122


Network File Storage with Graceful Performance Degradation

Every tree contains a large induced subgraph with all degrees odd

Chapter 7: Termination Detection

The chromatic spectrum of mixed hypergraphs

Lecture 7: NP-Complete Problems

Dedekind s forgotten axiom and why we should teach it (and why we shouldn t teach mathematical induction in our calculus classes)

Total colorings of planar graphs with small maximum degree

1 Definitions. Supplementary Material for: Digraphs. Concept graphs

Mathematics Review for MS Finance Students

The following themes form the major topics of this chapter: The terms and concepts related to trees (Section 5.2).

Stupid Divisibility Tricks

Approximation Algorithms

Basic Proof Techniques

1 Introduction. Dr. T. Srinivas Department of Mathematics Kakatiya University Warangal , AP, INDIA

Reading 13 : Finite State Automata and Regular Expressions

Network Flow I. Lecture Overview The Network Flow Problem

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) Total 92.

Determine If An Equation Represents a Function

Mathematical Induction. Mary Barnes Sue Gordon

Core Maths C1. Revision Notes

5.1 Bipartite Matching

Degree Hypergroupoids Associated with Hypergraphs

Solutions to Homework 6 Mathematics 503 Foundations of Mathematics Spring 2014

Continued Fractions and the Euclidean Algorithm

CSC 373: Algorithm Design and Analysis Lecture 16

Just the Factors, Ma am

Student Outcomes. Lesson Notes. Classwork. Discussion (10 minutes)

Zachary Monaco Georgia College Olympic Coloring: Go For The Gold

Network (Tree) Topology Inference Based on Prüfer Sequence

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Transcription:

Sample Problems in Discrete Mathematics This handout lists some sample problems that you should be able to solve as a pre-requisite to Computer Algorithms Try to solve all of them You should also read Chapters 2 and 3 of the textbook, and look at the Exercises at the end of these chapters If you are unfamiliar with some of these topics, or cannot solve many of these problems, then you should take a Discrete Math course before taking Computer Algorithms 1 Using Mathematical Induction The task: Given property P = P (n), prove that it holds for all integers n 0 Base Case: show that P (0) is correct; Induction assume that for some fixed, but arbitrary integer n 0, hypothesis: P holds for all integers 0, 1,, n Induction step: prove that the induction hypothesis, P (n), implies that P is true of n + 1: P (n) = P (n + 1) Conclusion: using the principle of Mathematical Induction conclude that P (n) is true for arbitrary n 0 Variants of induction: (although they are really all the same thing) Strong Induction: The induction step is instead: P (0) P (1) P (n) = P (n + 1) Structural Induction: We are given a set S with a well-ordering on the elements of this set For example, the set S could be all the nodes in a tree, and the ordering is that v w if v is below w in the tree The Base Case is now to show P (w) for all w S which have no element preceding it (ie, such that there is no v w) The Inductive Step is now to show that for any w S, we have that (P (v) for all v w) = P (w) Problem 1 Prove that for all n > 10 n 2 < n2 n 1

Proof: Define property P (n) by Then, Base case: for n = 11, P (n) : k n (k > 10; n > 10), k 2 < k2 k 11 2 < 1 11 = 9 < 110 = 55 6 = 9 + 1 6 Notice that the base of the induction proof start with n = 11, rather than with n = 0 Such a shift happens often, and it does not change the principle, since this is nothing more than the matter of notations One can define a property Q(m) by Q(m) = P (n 11), and consider Q for m 0 Induction step Suppose, given n 11, P holds true for all integers up n Then The last inequality is P (n + 1) P (n) = n 2 < n2 n = (n + 1) 2 1 < (n+1)2 (n+1) 2n 1+1 = (n + 1) 2 < (n+1)2 (n+1) 2n 1+1 + 1 = (n + 1) 2 < (n+1)2 (n+1) 2n + 1 = (n + 1) 2 < (n+1)2 (n+1) (since n > 10) Problem 2 For every integer n 1, n i > 2n n/3 Proof: We prove it by induction on n Base For n = 1, the left part is 1 and the right part is 2/3: 1 > 2/3 Inductive step Suppose the statement is correct for some n 1; we prove that it is correct for n + 1 Thus, Given: n n+1 i > 2n n/3; Prove: i > 2(n + 1) n + 1/3 n+1 n i = ( i) + n + 1 (1) Using the given inequality, we evaluate the right part of (1) n ( i) + n + 1 2n n/3 + n + 1 (2) The following sequence of equivalent inequalities completes the proof: 2n n/3 + n + 1 2(n + 1) n + 1/3 (3) 2n n + 3 n + 1 2(n + 1) n + 1 (4) 2n n (2n 1) n + 1 (5) 4n 2 n (2n 1) 2 (n + 1) (6) 4n 3 (4n 2 4n + 1)(n + 1) = 4n 3 3n + 1 (7) 0 3n + 1 (8) The last inequality holds true for any n > 0 2

Problem 3 For every integer n 0, n i 2 = i=0 n(n + 1)(2n + 1) 6 Prove Problem 4 Prove that every integer greater than 1 is a product of prime numbers Proof: We will use strong induction Base Case: 2 is a product of prime numbers, since 2 itself is a prime Inductive Step: Let n be an arbitrary integer greater than 1 The Inductive Hypothesis is that for all integers k such that 1 < k < n, we have that k can be written as a product of primes Then, either n is a prime itself (in which case it is a product of prime numbers), or n can be written as n = n 1 n 2 with both n 1 and n 2 being integers greater than 1 and less than n Thus, the Inductive Hypothesis applies to both n 1 and n 2, and so each can be written as a product of prime numbers Thus, n can be written as a product of prime numbers as well Problem 5 What is wrong with the following classic proof that all horses have the same color? Let P (n) be the proposition that for any set of n horses, all horses in this set have the same color Base Case: P (1) is clearly true Inductive Step: The Inductive Hypothesis is that P (n) holds; we will show that this implies P (n + 1) Let A be an arbitrary set of n + 1 horses Consider the first n horses in A, and the last n horses in A Both of these are sets of n horses, and so the inductive hypothesis holds for them, telling us that both the first n and the last n horses of A have the same color Since the set of the first n and the last n horses overlap, then all n + 1 horses of A must have the same color, thus proving P (n + 1) Problem 6 Prove by induction that where F i denotes the i th Fibonacci number 2 Order of Functions F 1 + F 3 + + F 2n 1 = F 2n, See Chapter 2 of the textbook, and the exercises therein Problem 7 Compare the following pairs of functions in terms of order of growth In each case, determine if f(n) = O(g(n)), f(n) = Ω(g(n)), f(n) = Θ(g(n)) Prove your answers f(n) g(n) (1) (lg n) a n b (here a, b > 0) (2) 2 n log 2 n 10n! (3) n (log2 n) 5 (4) n 2 log 2 n (nlog 2 n) 4 (5) log 2 n log 2 (66n) (6) 1000(log 2 n) 0999 (log 2 n) 1001 (7) n 2 n(log 2 n) 15 3

3 Graph Theory See also Chapter 3 of the textbook and the exercises therein Problem 8 Here is an example of Structural Induction in trees Consider a rooted tree T = (V, E), where nodes are labeled with positive integers: each node v V is labeled with an integer a v Assume that T obeys the heap property, ie, if w is a child of v, then a w < a v Prove that the root node r has the largest label of all nodes in the tree Proof: Let T v be the subtree of T rooted at v We will prove the proposition P (v) which states that v has the largest label in T v Base Case: If v is a leaf, then T v consists of a single node v, and so P (v) is trivially true Inductive Step: Assume that P (w) is true for all children w of v By the heap property, a w < a v, and by the inductive hypothesis, a w is the largest label in T w Therefore, a v is the largest label in T v, as desired We have now shown that P (v) holds for all nodes v V Therefore, P (r) holds, and so r has the largest label of all nodes in the tree Problem 9 By analyzing the algorithm for Breadth-First-Search (BFS), show that in the case of a connected, undirected graph G, its every edge is either a tree edge (belongs to the BFS tree), or a cross edge (connects two vertices, neither is a descendant of the other in the BFS tree) Problem 10 Find an example of a directed graph and a DFS-forest such that vertex v is not a descendant of u, but graph G has a path from u to v and dis[u] < dis[v] (here dis[u] is the distance from the root) Problem 11 Describe an algorithm (in words, not a code), which for a given connected undirected graph G, directs its edges in such a way that the following two conditions are satisfied: 1 the resulting directed graph contains a rooted tree all of whose edges are directed away from the root; 2 every edge not in the tree above forms a directed cycle with some edges of the tree What is the complexity of your algorithm? Explain Problem Show how to tell if graph is bipartite (in linear time) 4 Additional Problems in Discrete Math and Logic Problem 13 How many eight digit numbers are there that contain a 5 and a 6? Explain Problem 14 How many nine digit numbers are there that contain exactly two 5 s? Problem 15 What are the coefficients of the terms 1 x, 1 x 2 in the expansion of (x + 1 x )n, where (n > 2)? Explain Problem 16 Prove that for every n 1 and every m 1, the number of functions from {1, 2,, n} to {1, 2,, m} is m n Problem 17 Prove the following identities 4

Idempotency A A = A; A A = A Commutativity A B = B A; A B = B A Associativity (A B) C = A (B C) (A B) C = A (B C) Distributivity (A B) C = (A C) (B C) (A B) C = (A C) (B C) DeMorgan s Laws U (B C) = (U B) (U C) U (B C) = (U B) (U C) Problem 18 (Converse) Consider the following two statements: 100 percent of convicted felons consumed bread during their childhood and People who consume bread as a child are likely to become felons Does the first statement logically imply the second? Problem 19 (Contrapositive) Consider the following two statements: 100 percent of convicted felons consumed bread during their childhood and People who do not consume bread as a child do not become felons Does the first statement logically imply the second? 5