CS2205 Theory of Computation

Similar documents
Finite Mathematical Structures A

CSE548, AMS542: Analysis of Algorithms, Fall 2016 Date: Sep 25. Homework #1. ( Due: Oct 10 ) Figure 1: The laser game.

CS103 Handout 25 Spring 2017 May 5, 2017 Problem Set 5

Problem Set 4 Due: Wednesday, November 12th, 2014

: Principles of Automated Reasoning and Decision Making Midterm

Spring 06 Assignment 2: Constraint Satisfaction Problems

Checkpoint Questions Due Monday, October 7 at 2:15 PM Remaining Questions Due Friday, October 11 at 2:15 PM

RMT 2015 Power Round Solutions February 14, 2015

CS 473G: Combinatorial Algorithms, Fall 2005 Homework 0. I understand the Homework Instructions and FAQ.

Counting and Probability

On form and function in board games

Notes for Recitation 3

Section Marks Agents / 8. Search / 10. Games / 13. Logic / 15. Total / 46

NANYANG TECHNOLOGICAL UNIVERSITY SEMESTER II EXAMINATION MH1301 DISCRETE MATHEMATICS. Time Allowed: 2 hours

COMPSCI 372 S2 C Computer Graphics

Spring 06 Assignment 2: Constraint Satisfaction Problems

KenKen Strategies. Solution: To answer this, build the 6 6 table of values of the form ab 2 with a {1, 2, 3, 4, 5, 6}

The Problem. Tom Davis December 19, 2016

Table of Contents. Table of Contents 1

arxiv: v1 [cs.cc] 21 Jun 2017

CIS 2033 Lecture 6, Spring 2017

An Optimal Algorithm for a Strategy Game

of the hypothesis, but it would not lead to a proof. P 1

KenKen Strategies 17+

MAS336 Computational Problem Solving. Problem 3: Eight Queens

CS188: Artificial Intelligence, Fall 2011 Written 2: Games and MDP s

Lahore University of Management Sciences. EE 340 Devices and Electronics. Fall Dr. Tehseen Zahra Raza. Instructor

PROBLEMS & INVESTIGATIONS. Introducing Add to 15 & 15-Tac-Toe

FFT analysis in practice

Learning to Play like an Othello Master CS 229 Project Report. Shir Aharon, Amanda Chang, Kent Koyanagi

Overview. Equipment. Setup. A Single Turn. Drawing a Domino

Chapter 4 Number Theory

Sampling distributions and the Central Limit Theorem

CSC C85 Embedded Systems Project # 1 Robot Localization

1 Introduction. 2 An Easy Start. KenKen. Charlotte Teachers Institute, 2015

Technical framework of Operating System using Turing Machines

In 1974, Erno Rubik created the Rubik s Cube. It is the most popular puzzle

Stanford University CS261: Optimization Handout 9 Luca Trevisan February 1, 2011

1. The empty set is a proper subset of every set. Not true because the empty set is not a proper subset of itself! is the power set of A.

Conway s Soldiers. Jasper Taylor

Tiling Problems. This document supersedes the earlier notes posted about the tiling problem. 1 An Undecidable Problem about Tilings of the Plane

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague 7 November, CS1800 Discrete Structures Midterm Version C

HIROIMONO is N P-complete

On Variants of Nim and Chomp

Lecture 20 November 13, 2014

Graphs of Tilings. Patrick Callahan, University of California Office of the President, Oakland, CA

ECON 282 Final Practice Problems

Strategic Bargaining. This is page 1 Printer: Opaq

Finite Mathematical Structures A

Practice Midterm Exam 5

Such a description is the basis for a probability model. Here is the basic vocabulary we use.

DVA325 Formal Languages, Automata and Models of Computation (FABER)

Sokoban: Reversed Solving

Unit 12: Artificial Intelligence CS 101, Fall 2018

CS269I: Incentives in Computer Science Lecture #20: Fair Division

A Grid of Liars. Ryan Morrill University of Alberta

Today s Topics. Sometimes when counting a set, we count the same item more than once

Upper Primary Division Round 2. Time: 120 minutes

COMM901 Source Coding and Compression Winter Semester 2013/2014. Midterm Exam

Modeling, Analysis and Optimization of Networks. Alberto Ceselli

English Version. Instructions: Team Contest

Introduction to Filters

COLLEGE OF THE DESERT

MATH 135 Algebra, Solutions to Assignment 7

CPS331 Lecture: Heuristic Search last revised 6/18/09

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF ELECTRICAL AND ELECTRONICS ENGINEERING DEPARTMENT OF ECE COURSE PLAN

Vision & Goals Worksheet

ENGR170 Assignment Problem Solving with Recursion Dr Michael M. Marefat

Sets. Definition A set is an unordered collection of objects called elements or members of the set.

Tutorial: Creating maze games

IMOK Maclaurin Paper 2014

CS 32 Puzzles, Games & Algorithms Fall 2013

Computer Science and Software Engineering University of Wisconsin - Platteville. 4. Game Play. CS 3030 Lecture Notes Yan Shi UW-Platteville

final examination on May 31 Topics from the latter part of the course (covered in homework assignments 4-7) include:

Lahore SSE L-301 TBA. Office TBA TBA. Hours. Credit. Duration. Core Elective COURSE DESCRIPTION. laying.

Name: Exam 1. September 14, 2017

Taffy Tangle. cpsc 231 assignment #5. Due Dates

ABOUT THE GAME COMPONENTS

Game Theory and Economics Prof. Dr. Debarshi Das Humanities and Social Sciences Indian Institute of Technology, Guwahati

Cardinality revisited

UNIVERSITY of PENNSYLVANIA CIS 391/521: Fundamentals of AI Midterm 1, Spring 2010

Office: Room 517 (Bechtel) Office Hours: MWF 10 : :00 and by appointment (send ) Extension: 3538

ACHS Math Team Lecture: Introduction to Set Theory Peter S. Simon

Econ 302: Microeconomics II - Strategic Behavior. Problem Set #5 June13, 2016

MAT 409 Semester Exam: 80 points

MITOCW watch?v=6fyk-3vt4fe

POKER (AN INTRODUCTION TO COUNTING)

SALES AND MARKETING Department MATHEMATICS. Combinatorics and probabilities. Tutorials and exercises

On Variations of Nim and Chomp

Discrete Structures for Computer Science

and problem sheet 7

Lecture 20: Combinatorial Search (1997) Steven Skiena. skiena

Name: Hoped-for Major:

CoCreate 2008 Curriculum Guide

Wireless Communications Principles and Practice 2 nd Edition Prentice-Hall. By Theodore S. Rappaport

The topic for the third and final major portion of the course is Probability. We will aim to make sense of statements such as the following:

8.F The Possibility of Mistakes: Trembling Hand Perfection

CPCS 222 Discrete Structures I Counting

Error Correction with Hamming Codes

Syllabus Course description

Transcription:

CS2205 Theory of Computation Derek Bridge A firm foundation in the theory of a subject is the hallmark of a professional and an excellent defence against technological obsolesence. Page 1 of 12

1.1. Page 2 of 12 Lecturer: Credit weighting: Content: Prerequisites: Lectures: Tutorials: Private study: Handouts: Course web site: Dr. Derek Bridge Room 304, Science Building d.bridge@cs.ucc.ie 10 credit optional module Correctness, Complexity and Computability The ability to program; the ability to reason carefully 2 1hr per week 2 1hr per week (pen-and-paper exercises) 2hrs per week (pen-and-paper exercises) Lecture notes and exercise sheets will be handed out in lectures and tutorials www.cs.ucc.ie/ dgb/courses/toc.html

Written exam: Continuous assessment: How to fail: How to pass: 3hr written exam; worth 160 marks 2 class tests; worth 40 marks Skip lectures & tutorials; avoid private study; cram at Easter; expect the exam to be a memory test Attend lectures & tutorials; practice the skills immediately; expect a problem-solving exam Page 3 of 12

1.2. Page 4 of 12 This module begins with some background material and then proceeds to look at the following three topics. Correctness: How can we be sure that an algorithm or program solves a problem? How can we be sure that it terminates and produces the correct output for all of its legal inputs? Complexity: How do we measure and compare the complexity of algorithms? By complexity we mean the time and memory space the algorithms consume. What is the inherent complexity of a problem? In other words, what are the minimum resources required to solve that problem. In yet other words, what resources are required by the best possible algorithm? There are problems for which the best possible algorithms require so much time (or space) that those algorithms cannot be executed by any computers of reasonable size in any reasonable amount of time and never will be. Computability: Are there precisely-defined problems for which no algorithm is possible? Given a problem, how can one tell whether or not an algorithm is possible? We will ask and, where possible, answer these questions about problems, algorithms and programs relative to a particular model of computation. In other words, we will make some assumptions about the capabilities of the computer. We will find in the latter part of the course that these assumptions are not so important. The answers come out the same for an incredibly wide range of different assumptions.

1.3. We will illustrate some of these ideas right now, with a simple example of a set of problems that we could try to solve by computer. The problems we will look at are called. One input is a finite set of 1cm 1cm square tiles, with coloured edges: Page 5 of 12 You may assume you have an unlimited supply of each type of tile. Another input is a rectangular grid, divided into 1cm 1cm cells. You are asked: Without rotating the tiles, can you tile the grid so that every cell in the grid contains exactly one of the given kinds of tile and the colours on all adjacent tile edges are the same? Suppose the inputs are these tile types and this grid:

Then, the answer is YES. (In fact, with this set of tile types, we can tile any size rectangular grid.) But suppose the inputs are these tile types and this grid: Page 6 of 12 Then, the answer is NO. When we design the algorithm, we don t know what tile types there are. And we don t know the dimensions of the grid. These are inputs. Our algorithm has to be general enough to handle all legal inputs. All that is required is a YES or NO answer. We are not asking the algorithm to come up with an actual configuration of tiles. 1.3.1. Dimensions Known When Writing the Algorithm Suppose, contrary to what was said previously, that, at the time we are designing the algorithm, we do know the dimensions of the grid. E.g. maybe we are told that all grids will be 5 5. Then, it turns out that we can design an algorithm whose input is a finite set of tile types and whose output is YES exactly when the grid is tilable and NO otherwise.

Furthermore, this algorithm will be reasonably efficient. Page 7 of 12 (In fact, it is sufficient to know only one of the dimensions of the grid when we are designing the algorithm. E.g. maybe we know that the grid will be 5 wide, but we don t know how high it will be. In this case, we can still write a reasonably efficient algorithm.) 1.3.2. Dimensions Not Known When Writing the Algorithm Suppose we do not know the dimensions when we are designing the algorithm. Then, it is still the case that we can design an algorithm whose input is a finite set of tile types and the dimensions of the grid, and whose output is YES exactly when the grid is tilable and NO otherwise. But the best algorithm that has been found so far is unreasonably inefficient when given even quite small grids and small sets of tile types. Consider an algorithm that assigns a tile to each cell in the grid in turn; when the grid is full, it checks the legality. Num. of cells Num. of tile types 2 3 4 16 81 9 512 19683 16 65536 43046721 25 33554432 a 22-digit number 36 an 11-digit number a 28-digit number 49 a 15-digit number a 34-digit number Tile Assignments

(The number of microseconds since the Big Bang has 24 digits.) Question: is there a way of avoiding some of these tile assignments? Page 8 of 12 1.3.3. Dimensions Known to be the Integer Grid Suppose, at the time we are designing the algorithm, we know that we must tile the integer grid. In other words, the input is still the set of tile types, and we want the algorithm to decide whether, using these tiles, we could tile the infinite grid. No algorithm can be written to solve this problem. Even with unlimited time and memory, and irrespective of how clever you are, provably no algorithm can be written to solve this problem. There may be algorithms that can solve special cases, but there is no algorithm that will work for all legal inputs. 1.3.4. Dimensions Known to be the Integer Grid and a Question About Infinite Recurrence If the integer grid can be tiled by a particular set of tiles, then it follows that at least one of the tile types must be used infinitely often. Now consider a slight variant of the problem that we have been looking at, in which we additionally ask about the recurrence of a designated tile. The problem is augmented: We want a YES if there is a tiling of the integer grid which contains an infinite recurrence of the first tile type in the set of tile types. To clarify: we know that at least one of the tile types would have to recur infinitely often, so we want to know whether some particular tile type (the first tile type, say) is among those that do actually recur infinitely often.

No algorithm can be written to solve this problem. But this problem is provably, in some sense, even less solvable than the previous one! This might seem counter-intuitive. The previous problem couldn t be solved. Neither can this one. But this one is, in some sense, even worse! In fact, there is an infinite hierarchy of levels of unsolvability! You might be relieved to hear that we re not going to get bogged down in this kind of stuff in this module. Page 9 of 12

1.4. A Classification of Problems This lecture has given you an overview of four classes of problem. highly unsolvable problems e.g. recurrence in unbounded tiling unsolvable problems e.g. unbounded tiling intractable problems e.g. bounded tiling (probably) tractable problems e.g. fixed dimension tiling Page 10 of 12 The set of solvable problems is an infinitesimally small subset of the set of all problems, and the tractable problems are a minute subset of the solvable problems. The next diagram is suggestive of these facts.

all problems tractable problems solvable problems Page 11 of 12 Acknowledgements This module draws heavily on Harel s excellent book [Har92]. The discussion of tiling problems, along with several of the diagrams, are based on material in Chapter 8 of that book. The Venn diagram is based on one in Chapter 3 of [GL82]. Clip Art (of head with bomb) licensed from the Clip Art Gallery on DiscoverySchool.com.

References [GL82] L. Goldschlager and A. Lister. Computer Science: A Modern Introduction. Prentice-Hall, 1982. [Har92] D. Harel. Algorithmics: The Spirit of Computing. Addison-Wesley, 2nd edition, 1992. Page 12 of 12