Automata and Languages Computability Theory Complexity Theory

Theory of Computation Chapter 0: Introduction 1 What is this course about?   This course is about the fundamental capabilities and limitations ...
Author: Jasper Wood
1 downloads 0 Views 560KB Size
Theory of Computation Chapter 0: Introduction

1

What is this course about? 



This course is about the fundamental capabilities and limitations of computers/computation This course covers 3 areas, which make up the theory of computation: Automata and Languages  Computability Theory  Complexity Theory 

2

Automata and Languages 

Introduces models of computation We will study finite automata and context free grammars  Each model determines what can be expressed, as we will see in Part I of this course  Will allow us to become familiar with simple models before we move on to more complex models like a Turing machine  Given a model, we can examine computability and complexity 

3

Computability Theory 

A major mathematical discovery in 1930s 

Certain problems cannot be solved by computers 



That is, they have no algorithmic solution

We can ask what a model can and can’t do As it turns out, a simple model of a computer, A Turing machine, can do everything that a computer can do  So we can use a Turing machine to determine what a computer can and can’t do (i.e., compute) 

4

Complexity Theory  

How hard is a problem? You already should know a lot about this 

You should know how to determine the time complexity of most simple algorithms 



You should know the Big O notation. We can say that a problem is O(n2) and that is harder than an O(n) problem

We take one step forward and study NP-completeness 

A first course in theory of computation generally stops there and hence we will not cover Chapters 8, 9, or 10 of the text

5

About this Course 

Theory of Computation traditionally considered challenging 



I expect (and hope) that you will find this to be true!

A very different kind of course 

In many ways, a pure theory course 



Proofs are an integral part of the course, although I and the text both rely on informal proofs 



But very grounded (the models of computation are not abstract at all)

But the reasoning must still be clear

The only way to learn this material is by doing problems   

You should expect to spend 33-7 hours per week on homework You should expect to read parts of the text 22-4 times You should not give up if you are completely stumped by a problem after 5 minutes 6

Mathematical Preliminaries A review with some new material

7

Mathematical Preliminaries 

We will now very quickly review discrete math  

You should know most of this from 1100/1400 Reading Chapter 0 of the text should help you review 



Mathematical Notation    

 



Ask me for help if you have trouble with some of this Sets Sequences and Tuples Functions and Relations Graphs Strings and Languages (not covered previously) Boolean Logic

Proofs and Types of Proofs 

You may not have covered natural induction 8

Sets 

A set is a group of objects, order doesn’t matter The objects are called elements or members  Examples: 





{1, 3, 5}, {1, 3, 5, …}, or {x|xZ and x mod 2 ≠ 0}

You should know these operators/concepts Subset (A  B or A  B)  Cardinality: Number elements in set (|A| or n(A))  Intersection () and Union (), Complement 





What do we need to know to determine complement of set A?

Venn Diagrams: can be used to visualize sets 9

Sets II 

Power Set: All possible subsets of a set If A = {0, 1} then what is P(A)?  In general, what is the cardinality of P(B)? 

10

Sequences and Tuples 

A sequence is a list of objects, order matters 



Example: (1, 3, 5) or (5, 3, 1)

In this course we will use term tuple instead 

(1, 3, 5) is a 3-tuple and a k-tuple has k elements

11

Sequences and Tuples II 

Cartesian product (x) is an operation on sets but yields a set of tuples 

Example: if A = {1, 2} and B = {x, y, z} 





If we have k sets A1, A2, …, Ak, we can take the Cartesian product A1 x A2 … x Ak which is the set of all k-tuples (a1, a2, …, ak) where ai Ai We can take Cartesian product of a set with itself 



A x B = {(1,x), (1,y), (1,z), (2,x), (2,y), (2,z)}

Ak represents A x A x A … x A where there are k A’s.

The set Z2 represents Z x Z all pairs of integers, which can be written as {(a,b)|aZ and bZ} 12

Functions and Relations 

A function maps an input to a (single) output 



f(a) = b, f maps a to b

The set of possible inputs is the domain and the set of possible outputs is the range   

f: D  R Example 1: for the abs function, if D = Z, what is R? Example 2: sum function 



Can say Z x Z  Z

Functions can be described using tables 

Example: Describe f(x) = 2x for D={1,2,3,4}

13

Relations 

A predicate is a function with range {True, False} 



A (k-ary) relation is a predicate whose domain is a set of k-tuples A x A x A … x A   



Example: even(4) = True

If k =2 then binary relation (e.g., =,