Docsity

Introduction to Computability, Logic, and Complexity in Computation, Study notes of Algorithms and Programming

Toggle sidebar
bg1
CMPSCI601: Introduction Lecture 1
What is the subject matter of this course?
Computability: What can be computed in principle?
Logic: How can we express statements and proofs?
Complexity: What can be computed in practice?
Problem Mathematical
Concrete
Model
The mathematical method is to form abstractions that
capture some important aspects of a real-world phenomenon,
then operate on those abstractions using formal defini-
tion,proof, and mathematical problem-solving.
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Introduction to Computability, Logic, and Complexity in Computation and more Study notes Algorithms and Programming in PDF only on Docsity!

CMPSCI601: Introduction Lecture 1

What is the subject matter of this course?

Computability : What can be computed in principle? Logic : How can we express statements and proofs? Complexity : What can be computed in practice?

Problem

Mathematical

Concrete

Model

The mathematical method is to form abstractions that capture some important aspects of a real-world phenomenon, then operate on those abstractions using formal defini- tion , proof , and mathematical problem-solving.

Our real-world target is digital computation. Our first ab- straction is say that we have an input , a collection of bits, and want an output , often a single bit. The key questions are then:

How is the input organized? What computational operations are allowed? Do we have internal memory, and how much?

An answer to these questions gives us a formal model of computation.

CMSPSCI 601: Course Requirements Lecture 1

Texts: available at Jeffery Amherst College Store

[BE:] Jon Barwise and John Etchemendy, Language, Proof, and Logic (required, new copy needed for homework) [P]: Christos Papadimitriou, Computational Complex- ity (recommended) [S]: Michael Sipser, Introduction to the Theory of Computation (useful, lower-level reference)

Prerequisites: Mathematical maturity: reason abstractly, understand and write proofs, use big-O notation. CMP- SCI 250 needed; CMPSCI 311, 401 helpful. Today’s material is a good overview of the sort of stuff we will do, next lecture we start right in on formal language theory.

Graded Work: Eight problem sets (35% of grade) Midterm (30% of grade), in-class Monday 29 March 2004 Final (35% of grade)

Cooperation: Students should talk to each other and help each other; but write up solutions on your own, in your own words. Sharing or copying a solution could result in a grade of F for the course, even on the first offense. If a significant part of one of your solutions is due to someone else, or something you’ve read then you must acknowledge your source! When the grader then looks at the source, it should be clear from your writeup that you’ve understood anything you’ve taken from it. A good heuristic is not to have the source in front of you when you write up.

Electronic Grading: Most of the homework problems from [BE] will be graded electronically. Your inter- action with the software provided will result in a file that you send in, and each student must send in a sep- arate file from a separate interaction with the software (they check).

Syllabus will be up soon on the course web site:

http://www.cs.umass.edu/˜barring/cs

There is a pointer there to the Spring 2003 web site, and the syllabus there will be close to what we do here.

Rough guide:

Formal Languages and Computability (9 lectures) Propositional and First-Order Logic (6 lectures) Complexity Theory (12 lectures)

CMPSCI601: Models of Computation Lecture 1

How is the input organized? What computational operations are allowed? Do we have internal memory, and how much?

An answer to these questions gives us a formal model of computation.

Some Formal Models of Computation:

Boolean: Formal Language Theory: (starting next lecture) First-Order Logic: Recursive Function Theory: Abstract RAM: (as in an algorithms course)

Boolean Logic:

Chapters 1-8 of [BE] deal with propositional or boolean logic. The main topics are:

Syntax and semantics for boolean expressions Rules for proving that an expression is a tautology or that one expression follows logically from another A formal proof system encapsulating these rules and implemented as interactive software, included with the book

The basics of boolean logic should be review, but formal proof may not be. You will be expected to learn the proof system from the book and software, and there will be exercises on it in HW#2. At that point we will consider two important properties of the system:

Soundness: everything provable is true Completeness: everything true is provable

Here “everything” refers only to statements that can be made within the system.

First-Order Logic:

We can think of a sequence of boolean variables    

as a single object

, a function from the set    

to   . Thus for any number  in the range,

  is the

boolean variable we used to call .

is also called a unary relation , a property that each number in the range either has or doesn’t have. We can

also have binary , ternary , or  -ary relations.

For example, in a directed graph where the vertices are

named     we have a binary relation  , where

the boolean     is iff there is an edge from  to .

Recursive Function Theory:

Bits can be used to represent numbers (by which I gener- ally mean non-negative integers in binary. General com- putations may be coded as functions from numbers (or tuples of numbers) to numbers.

Kleene’s recursive function theory defines a set of partial recursive functions by induction. There are base func- tions and rules for creating new functions from old ones.

It turns out that “partial recursive” corresponds to “algo- rithmically computable”. (This is a theorem, not a defi- nition.)

Primitive Recursion and Bloop

An important subset of the partial recursive functions is the primitive recursive functions. We will define these in terms of a simple programming language called Bloop. (My Bloop is based on the language of the same name in Hofstadter’s G¨odel, Escher, Bach but has a different syntax.

Variables represent numbers (non-negative integers). They are declared and initialized to 0 when they first appear.

Statements of Bloop consist of:

assignment statements x = ... the increment operator ++ function declarations and calls (call-by-value, no re- cursion) bounded loops for (x) B, where x is a variable and B is a block of code in which x is not modified. This code executes B exactly x times.

Enriching Bloop:

Use arithmetic expressions like variables Simulate if-then, if (x) B means:

y = one(); for (x) { for (y) B; y = 0;}

This executes B once if x is positive and otherwise does nothing.

A function is primitive recursive iff it can be implemented by a Bloop program.

Relations Among The Models:

Let’s look at a single problem. Given  input bits, we

want to know whether exactly two of them are ones. This question can be posed in each of our models:

Boolean: There are various ways to build an SLP or circuit, which we’ll explore on HW#1. Finite-State Machine: Sweep the input string left- to-right, remembering whether we’ve seen zero, one, two, or more than two ones. First-Order Logic: 



Numerical Input: Is the input the sum of two dis- tinct powers of two? On HW#1 you’ll write a Bloop program to decide this. Abstract RAM: The problem probably defaults to one of the others once we decide on our data repre- sentation.