Midterm Practice Problems



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

Discrete Mathematics Problems

Lecture 16 : Relations and Functions DRAFT

Analysis of Algorithms, I

Graph Theory Problems and Solutions

Mathematical Induction

Simple Graphs Degrees, Isomorphism, Paths

Lecture 17 : Equivalence and Order Relations DRAFT

The positive minimum degree game on sparse graphs

CMPSCI611: Approximating MAX-CUT Lecture 20

Graphs without proper subgraphs of minimum degree 3 and short cycles

INCIDENCE-BETWEENNESS GEOMETRY

Introduction to Graph Theory

6.852: Distributed Algorithms Fall, Class 2

Class One: Degree Sequences

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

Sum of Degrees of Vertices Theorem

Social Media Mining. Graph Essentials

Graph Theory Lecture 3: Sum of Degrees Formulas, Planar Graphs, and Euler s Theorem Spring 2014 Morgan Schreffler Office: POT 902

System Interconnect Architectures. Goals and Analysis. Network Properties and Routing. Terminology - 2. Terminology - 1

Labeling outerplanar graphs with maximum degree three

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

Computing exponents modulo a number: Repeated squaring

COMBINATORIAL PROPERTIES OF THE HIGMAN-SIMS GRAPH. 1. Introduction

136 CHAPTER 4. INDUCTION, GRAPHS AND TREES

Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs

ON DEGREES IN THE HASSE DIAGRAM OF THE STRONG BRUHAT ORDER

Every tree contains a large induced subgraph with all degrees odd

Math 319 Problem Set #3 Solution 21 February 2002

The Clar Structure of Fullerenes

CS311H. Prof: Peter Stone. Department of Computer Science The University of Texas at Austin

Connectivity and cuts

Just the Factors, Ma am

3. Eulerian and Hamiltonian Graphs

Lecture 1: Course overview, circuits, and formulas

Lecture 22: November 10

Reading 13 : Finite State Automata and Regular Expressions

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

Every Positive Integer is the Sum of Four Squares! (and other exciting problems)

3. Mathematical Induction

GRAPH THEORY LECTURE 4: TREES

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Zachary Monaco Georgia College Olympic Coloring: Go For The Gold

So let us begin our quest to find the holy grail of real analysis.

Mathematics for Algorithm and System Analysis

Solutions to Homework 10

SPERNER S LEMMA AND BROUWER S FIXED POINT THEOREM

The Open University s repository of research publications and other research outputs

Math 55: Discrete Mathematics

Examination paper for MA0301 Elementær diskret matematikk

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

6.080/6.089 GITCS Feb 12, Lecture 3

Degree Hypergroupoids Associated with Hypergraphs

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

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

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

BOOLEAN ALGEBRA & LOGIC GATES

Chapter 6: Graph Theory

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

Arrangements And Duality

UPPER BOUNDS ON THE L(2, 1)-LABELING NUMBER OF GRAPHS WITH MAXIMUM DEGREE

CSC2420 Fall 2012: Algorithm Design, Analysis and Theory

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

Networks and Paths. The study of networks in mathematics began in the middle 1700 s with a famous puzzle called the Seven Bridges of Konigsburg.


ON INDUCED SUBGRAPHS WITH ALL DEGREES ODD. 1. Introduction

Markov random fields and Gibbs measures

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

88 CHAPTER 2. VECTOR FUNCTIONS. . First, we need to compute T (s). a By definition, r (s) T (s) = 1 a sin s a. sin s a, cos s a

Odd induced subgraphs in graphs of maximum degree three

Euler Paths and Euler Circuits

Cycles in a Graph Whose Lengths Differ by One or Two

Angles that are between parallel lines, but on opposite sides of a transversal.

8 Divisibility and prime numbers

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

6.3 Conditional Probability and Independence

Problem Set 7 Solutions

8 Primes and Modular Arithmetic

Incenter Circumcenter

Full and Complete Binary Trees

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

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

each college c i C has a capacity q i - the maximum number of students it will admit

On three zero-sum Ramsey-type problems

LAMC Beginners Circle: Parity of a Permutation Problems from Handout by Oleg Gleizer Solutions by James Newton

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

Performance of networks containing both MaxNet and SumNet links

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

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

(Refer Slide Time: 01.26)

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

k, then n = p2α 1 1 pα k

On the crossing number of K m,n

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

Scalar Valued Functions of Several Variables; the Gradient Vector

Transcription:

6.042/8.062J Mathematics for Computer Science October 2, 200 Tom Leighton, Marten van Dijk, and Brooke Cowan Midterm Practice Problems Problem. [0 points] In problem set you showed that the nand operator by itself can be used to write equivalent expressions for all other Boolean logical operators. We call such an operator universal. Another universal operator is nor, defined such that P norq (P Q). Show how to express P Q in terms of: nor, P, Q, and grouping parentheses. Solution. ( P ) nor ( Q) = (P nor P ) nor (Q nor Q). Problem 2. [5 points] We define the sequence of numbers if 0 n 3, a n = a n + a n 2 + a n 3 + a n 4 if n 4. Prove that a n (mod 3) for all n 0. Solution. Proof by strong induction. Let P (n) be the predicate that a n (mod 3). Base case: For 0 n 3, a n = and is therefore (mod 3). Inductive step: For n 4, assume P (k) for 0 k n in order to prove P (n + ). In particular, since each of a n 4, a n 3, a n 2 and a n is (mod 3), their sum must be 4 (mod 3). Therefore, a n (mod 3) and P (n + ) holds. Problem 3. [20 points] The Slipped Disc Puzzle consists of a track holding 9 circular tiles. In the middle is a disc that can slide left and right and rotate 80 to change the positions of exactly four tiles. As shown below, there are three ways to manipulate the puzzle: Shift Right: The center disc is moved one unit to the right (if there is space) Rotate Disc: The four tiles in the center disc are reversed Shift Left: The center disc is moved one unit to the left (if there is space)

2 shift right 2 3 4 5 6 7 8 9 rotate disc 2 3 4 5 6 7 8 9 2 6 5 4 3 7 8 9 shift left 2 3 4 5 6 7 8 9 Prove that if the puzzle starts in an initial state with all but tiles and 2 in their natural order, then it is impossible to reach a goal state where all the tiles are in their natural order. The initial and goal states are shown below: Initial State Goal State 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 Write your proof on the next page... Solution. Order the tiles from left to right in the puzzle. Define an inversion to be a pair of tiles that is out of their natural order (e.g. 4 appearing to the left of 3). Lemma. Starting from the initial state there is an odd number of inversions after any number of transitions. Proof. The proof is by induction. Let P (n) be the proposition that starting from the initial state there is an odd number of inversions after n transitions. Base case: After 0 transitions, there is one inversion, so P (0) holds. Inductive step: Assume P (n) is true. Say we have a configuration that is reachable after n + transitions.. Case : The last transition was a shift left or shift right In this case, the left-to-right order of the discs does not change and thus the number of inversions remains the same as in

3 2. The last transition was a rotate disc. In this case, six pairs of disks switch order. If there were x inversions among these pairs after n transitions, there will be 6 x inversions after the reversal. If x is odd, 6 x is odd, so after n + transitions the number of inversions is odd. Conclusion: Since all reachable states have an odd number of inversions and the goal state has an even number of inversions (specifically 0), the goal state cannot be reached.

4 Problem 4. [0 points] Find the multiplicative inverse of 7 modulo 72 in the range {0,,..., 7}. Solution. Since 7 and 72 = 2 3 3 2 are relatively prime, an inverse exists and can be found by either Euler s theorem or the Pulverizer. Solution : Euler s Theorem φ(72) = φ(2 3 3 2 ) = φ(2 3 ) φ(3 2 ) (since 2 3 and 3 2 are rel. prime) = (2 3 2 2 )(3 2 3 ) (since 2 and 3 are prime) = 4 6 = 24 Therefore, 7 φ(72) = 7 23 is an inverse of 7. To find the inverse in the range {0,,..., 7} we take the remainder using the method of repeated squaring: 7 = 7 7 2 = 289 (since 289 = 4 72 + ) 7 4 2 = 7 8... etc. Therefore the inverse of 7 in the range {0,,..., 7} is given by, Solution 2: The Pulverizer 7 23 = 7 6 7 4 7 2 7 7 = 7 x y rem xy = x q y 72 7 4 = 72 4 7 7 4 = 7 4 4 = 7 4 (72 4 7) = 7 7 4 72 4 0 Since 7 2 4 72 =, 7 2 (mod 72) and so 7 is self inverse.

5 Problem 5. [5 points] Consider a graph representing the main campus buildings at MIT. 7 0 8 5 3 4 6 2 (a) [3 pts] Is this graph bipartite? Provide a brief argument for your answer. Solution. No, there is an odd-length cycle (b) [4 pts] Does this graph have an Euler circuit? Provide a brief argument for your answer. Solution. This graph does not have an Euler circuit because there are vertices with odd degree

6 Problem 5 continued... Now suppose each building has separate mail collection and drop-off boxes and each collection box has a single package destined for a unique drop-off box (i.e. a permutation). We can model this as a permutation routing problem by treating the buildings as switches, attaching an input and output terminal to each of the nine buildings, and treating the existing edges as bidirectional as in the graph below: (c) [4 pts] Give the diameter of this graph: Solution. The diameter is 8, the length of a shortest path between the terminals for buildings and 2. (d) [4 pts] What is the max congestion of this graph? That is, in the worst case permutation, how many packages would need to pass through a single building? Provide a brief argument for your answer. Solution. The maximum congestion is 9. Consider a permutation where all the packages on the left side are destined for drop-offs on the right side and vice versa with the building 0 package destined for building 0. In this case, all 9 packages must pass through building 0, giving a congestion of 9, which is the maximum for a graph with nine input-output pairs.

7 Problem 6. [0 points] A tournament graph G = (V, E) is a directed graph such that there is either an edge from u to v or an edge from v to u for every distinct pair of nodes u and v. (The nodes represent players and an edge u v indicates that player u beats player v.) Consider the beats relation implied by a tournament graph. Indicate whether or not each of the following relational properties hold for all tournament graphs and briefly explain your reasoning. You may assume that a player never plays herself.. transitive Solution. The beats relation is not transitive because there could exist a cycle of length 3 where x beats y, y beats z and z beats x. By the definition of a tournament, x cannot then beat y in such a situation. 2. symmetric Solution. The beats relation is not symmetric by the definition of a tournament: if x beats y then y does not beat x. 3. antisymmetric Solution. The beats relation is antisymmetric since for any distinct players x and y, if x beats y then y does not beat x. 4. reflexive Solution. The beats relation is not reflexive since a tournament graph has no self-loops. Problem 7. [20 points] An outerplanar graph is an undirected graph for which the vertices can be placed on a circle in such a way that no edges (drawn as straight lines) cross each other. For example, the complete graph on 4 vertices, K 4, is not outerplanar but any proper subgraph of K 4 with strictly fewer edges is outerplanar. Some examples are provided below: Prove that any outerplanar graph is 3-colorable. A fact you may use without proof is that any outerplanar graph has a vertex of degree at most 2.

8 Solution. Proof. Proof by induction on the number of nodes n with the induction hypothesis P (n) = every outerplanar graph with n vertices is 3-colorable. Base case: For n = the single node graph with no edges is trivially outerplanar and 3-colorable. Inductive step: Assume P (n) holds and let G n+ be an outerplanar graph with n+ vertices. There must exist a vertex v in G n+ with degree at most 2. Removing v and all its incident edges leaves a subgraph G n with n vertices. Since G n+ could be drawn with its vertices on a circle and its edges drawn as straight lines without intersections, any subgraph can also be drawn in such a way and so G n is also an outerplanar graph. P (n) implies G n is 3-colorable. Therefore we can color all the vertices in G n+ other than v using only 3 colors and since deg(v) 2 we may color it a color different than the vertices adjacent to it using only 3 colors. Therefore, G n+ is 3-colorable and P (n + ) holds. Problem 8. [0 points] Give upper and lower bounds for the following expression which differ by at most. n i 3 Solution. To find upper and lower bounds, we use the integral method: i= n n i + dx 3 3 x i= n = x 2 2 3 = = 2 n 2 2 2n 2 n n i 3 n + 3 x dx 3 i= = n x 2 n 3 2 = n 3 2 n = 2 2 + n 3 2n 2 Problem 9. [5 points] Circle every symbol on the left that could correctly appear in the box to its right. For each of the six parts you may need to circle any number of symbols.

9 (a) O Ω Θ o ω 6n 2 2 + 7n 0 = O, Ω, Θ n (b) O Ω Θ o ω 6 n = Ω, ω n 6 (c) O Ω Θ o ω n! = O, o (n n ) (d) O Ω Θ o ω n j= j = O, Ω, Θ, (ln n) (e) O Ω Θ o ω ln(n 3 ) = O, Ω, Θ (ln n)

MIT OpenCourseWare http://ocw.mit.edu 6.042J / 8.062J Mathematics for Computer Science Fall 200 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.