HW1. Due: September 13, 2018

Similar documents
Computability Theory

1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time:

W4231: Analysis of Algorithms

NP-Complete Reductions 2

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

Midterm 2 Solutions. CS70 Discrete Mathematics and Probability Theory, Spring 2009

Homework 4 Solutions

1 Algorithm and Proof for Minimum Vertex Coloring

1. Chapter 1, # 1: Prove that for all sets A, B, C, the formula

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices

Lecture 5: Graphs. Graphs! Euler Definitions: model. Fact! Euler Again!! Planar graphs. Euler Again!!!!

2SAT Andreas Klappenecker

NP-Completeness. Algorithms

MC 302 GRAPH THEORY 10/1/13 Solutions to HW #2 50 points + 6 XC points

An Introduction to Graph Theory

CPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60

CS70 - Lecture 6. Graphs: Coloring; Special Graphs. 1. Review of L5 2. Planar Five Color Theorem 3. Special Graphs:

Some Hardness Proofs

A graph is a mathematical structure for representing relationships.

Computer Science 280 Fall 2002 Homework 10 Solutions

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

8 NP-complete problem Hard problems: demo

HW Graph Theory SOLUTIONS (hbovik) - Q

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT

1 Definition of Reduction

NP-complete Reductions

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

K 4 C 5. Figure 4.5: Some well known family of graphs

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

CMPSCI611: The SUBSET-SUM Problem Lecture 18

Assignment 4 Solutions of graph problems

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7

CS446: Machine Learning Fall Problem Set 4. Handed Out: October 17, 2013 Due: October 31 th, w T x i w

GRAPH THEORY: AN INTRODUCTION

Notebook Assignments

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]

Reductions and Satisfiability

NP-Completeness of 3SAT, 1-IN-3SAT and MAX 2SAT

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements.

Diagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets?

CS40-S13: Functional Completeness

Number Theory and Graph Theory

Angles of Polygons. Essential Question What is the sum of the measures of the interior angles of a polygon?

Finding a winning strategy in variations of Kayles

Mathematics Masters Examination

Homework 1 CS 1050 A Due:

Discrete Mathematics Introduction

Chapter 8. NP-complete problems

CSE 20 DISCRETE MATH. Fall

9.1 Cook-Levin Theorem

Technische Universität München Zentrum Mathematik

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

CS February 17

Standard Boolean Forms

Ma/CS 6b Class 26: Art Galleries and Politicians

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W.

Problem Set 1. Solution. CS4234: Optimization Algorithms. Solution Sketches

Math 485, Graph Theory: Homework #3

Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1

Section 1.4 Proving Conjectures: Deductive Reasoning

CS261: Problem Set #1

Senior Math Circles November 25, 2009 Graph Theory II

Graph Theory: Introduction

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

Technische Universität München Zentrum Mathematik

Material from Recitation 1

Pebble Sets in Convex Polygons

Recursively Enumerable Languages, Turing Machines, and Decidability

CSE 20 DISCRETE MATH. Winter

Week 8: The fundamentals of graph theory; Planar Graphs 25 and 27 October, 2017

Final Exam May 8, 2018

CSC 501 Semantics of Programming Languages

CME 305: Discrete Mathematics and Algorithms Instructor: Reza Zadeh HW#3 Due at the beginning of class Thursday 02/26/15

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings

Bipartite Roots of Graphs

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting

NP and computational intractability. Kleinberg and Tardos, chapter 8

MC302 GRAPH THEORY SOLUTIONS TO HOMEWORK #1 9/19/13 68 points + 6 extra credit points

Instructor: Paul Zeitz, University of San Francisco

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM

Solutions for the Exam 6 January 2014

An Eternal Domination Problem in Grids

Definition: A graph G = (V, E) is called a tree if G is connected and acyclic. The following theorem captures many important facts about trees.

BOOLEAN ALGEBRA AND CIRCUITS

P Is Not Equal to NP. ScholarlyCommons. University of Pennsylvania. Jon Freeman University of Pennsylvania. October 1989

CHAPTER 2. Graphs. 1. Introduction to Graphs and Graph Isomorphism

Partitions and Packings of Complete Geometric Graphs with Plane Spanning Double Stars and Paths

Graph Theory Questions from Past Papers

COMS 1003 Fall Introduction to Computer Programming in C. Bits, Boolean Logic & Discrete Math. September 13 th

Extra Practice Problems 2

Math236 Discrete Maths with Applications

Logic: The Big Picture. Axiomatizing Arithmetic. Tautologies and Valid Arguments. Graphs and Trees

Angles Formed by Intersecting Lines

Module 11. Directed Graphs. Contents

Discrete structures - CS Fall 2017 Questions for chapter 2.1 and 2.2

2. Draw a non-isosceles triangle. Now make a template of this triangle out of cardstock or cardboard.

Lecture 2: NP-Completeness

CS264: Homework #4. Due by midnight on Wednesday, October 22, 2014

Notes for Recitation 8

11.4 Bipartite Multigraphs

Transcription:

CSCI 1010 Theory of Computation HW1 Due: September 13, 2018 Attach a fully filled-in cover sheet to the front of your printed homework. Your name should not appear anywhere; the cover sheet and each individual page of the homework should include your Banner ID only. While collaboration is encouraged in this class, please remember not to take away notes from any labs or collaboration sessions. Please monitor Piazza, as we will post clarifications of questions there. Hand in your solutions by 10:20am to the CSCI 1010 bin on the second floor of the CIT. Late homeworks are not accepted. Problem 1 This problem uses the logical symbols representing AND, representing OR, and representing NOT. Conjunctive Normal Form (CNF) is a particular way of writing Boolean formulas that will be used in this course. We define it constructively: 1. A literal is a variable or its complement. x i and x i are examples of literals. 2. A clause is any disjunction (that is, OR) of any number of literals. A literal by itself is also a clause. 3. A formula is in conjunctive normal form if it is the conjunction (that is, AND) of any number of clauses. As an example, the formula (x 1 x 3 ) ( x 1 x 2 ) x 2 is in CNF. Using the above definition, convert the following formulas into equivalent formulas in conjunctive normal form. We say that two formulas are equivalent if they evaluate to the same truth value for each assignment of the variables (i.e., no matter how the variables are assigned true or false, the two formulas either both evaluate to true or both evaluate to false). a. (x 1 x 2 ) ( x 1 x 3 x 4 ) x 2

b. (x 1 (x 2 x 3 )) x 2 c. (x 1 x 2 ) x 3 d. (x 1 x 2 ) (x 2 x 3 ) (For parts (c) and (d), recall that denotes exclusive-or, where x 1 x 2 = (x 1 x 2 ) (x 1 x 2 ); denotes implies, where x 1 x 2 = x 1 x 2 ; and denotes if-and-only-if, where x 1 x 2 = (x 1 x 2 ) (x 2 x 1 ).) Problem 2 Oh no! The ClueFinders have wound up in trouble. The numbers 1 through n, which are attached to fire traps, will be arbitrarily arranged along a circle around them. In order to escape, the ClueFinders must find 4 numbers that appear consecutively along the circle that have a sum greater than or equal to 2n+2. Prove that, no matter how the numbers are arranged along the circle, the ClueFinders will be able to escape. Problem 3 You are playing a variant of the well-known game Snake, and start to notice a pattern in the snake s coloring. A snake contains squares arranged in a straight line (unlike regular Snake, the snake does not bend), and each square is colored either dark purple or light blue. In addition, the first square (the head) must be dark purple, and the last square must be light blue. The figure below shows an example of a snake. Prove that, in any snake, there are an odd number of places where consecutive squares are colored differently. For example, in the figure, there are three pairs of consecutive squares where one square is colored dark purple and the other is colored light blue. (Hint: it might help to think of the snake as a graph where the squares are vertices and consecutive squares are joined by an edge.) 2

The following questions are lab problems. Lab Problem 1 A CS1010 student hops onto their MySpace page and decides to do some graph analysis of their friend connections. They decide to represent people as vertices and friend connections as edges. So, MySpace is represented as a simple graph G = (V,E). First, some terminology: A simple graph is an undirected graph with no self-loops (an edge from a vertex to itself) or multiple edges (more than one edge between the same pair of vertices). A clique is a subset of vertices S V such that u,v S, (u,v) E (if u v). That is, every pair of vertices in S is connected by an edge in E. A vertex cover is a subset of vertices S V such that for any edge (u,v) E, u S or v S. Anindependent setisasubsetofverticess V suchthat u,v S, (u,v) / E. The complement of a simple graph G is the simple graph G = (V,E) on the same vertices such that, for every pair of (distinct) vertices u,v, we have (u,v) E if and only if (u,v) / E. Consider a graph G = (V,E). a. Show that a subset of vertices is an independent set in G if and only if it is a clique in G. b. Show that a subset of vertices S V is an independent set if and only if V \S is a vertex cover. Recall that \ denotes set difference, so V \S is the set of vertices not in S. Lab Problem 2 1. When it was first discovered that there are computational problems that cannot be solved by computers, it was a very surprising result. 3

In this problem, we will do a high-level argument of a related result. Gödel showed that there exist true mathematical statements that cannot be proven. Instead of using mathematical statements, we will simply use English sentences. This is the sentence we are trying to prove: There exists a true sentence for which there is no proof. We will argue this by contradiction. 1 That is, we will assume the following statement, then obtain a contradiction: Assumption: All true sentences have proofs. You may assume that any statement for which there exists a proof is true. (Hint: Examine the sentence S = No proof exists for this sentence. Show that given our assumption, if S is true or false, we obtain a contradiction.) 2. In class we looked at the Halting Problem, the problem of determining whether a program P will terminate on an input X. We wanted to know whether a program Jeeves (a mathematical butler) that solves the Halting Problem exists: Jeeves: Input: a program P, an input X Output: Yes if P terminates on X, No if P runs forever We concluded that Jeeves cannot exist, meaning that no program can solve the halting problem. We will now look at another problem that cannot be solved by computers: the problem of deciding the truth value of a sentence. We want to know whether a program TruthSolver exists: TruthSolver: Input: a sentence S Output: True if S is true, False if S is false 1 We are being informal here, because we have not given a mathematical formalization of the statement we are trying to prove. 4

Argue that TruthSolver cannot exist, by first showing that if we had a TruthSolver, we could use it to build a Jeeves. Then argue that since Jeeves cannot exist, TruthSolver cannot exist. (Hint: Jeeves will use TruthSolver as a subroutine. What kind of statement should it give as input?) Lab Problem 3 GLaDOS has just offered you a two-dimensional cake. While the cake is a lie, the claim that GLaDOS makes is true: if the cake is cut n times (each cut is a straight line), then each resulting slice of cake can be frosted with a different color than its adjacent slices (two slices are adjacent if they meet at an edge; they are not adjacent if they only touch at a corner). Here s the catch you only have two colors of frosting. Prove that you can frost the cake in this way, regardless of where the cuts are made. Here is an example of a valid frosting: 5