CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich

advertisement
CMPS 3223
Theory of Computation
Automata, Computability, & Complexity
by Elaine Rich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Slides provided by author
Slides edited for use by MSU Department of
Computer Science – R. Halverson
1
Computation
Chapter 4
2
Our Goals
1. Define a problem as a language
2. Define program/machine which accepts
a string as input & determines if the
string is in the language
3
Three Computational Issues
1. Decision procedures
2. Nondeterminism
3. Functions on functions and programs
4
1. Decision Procedures
 Decision Problem
 Yes or No solution
 Algorithm
 Detailed process/procedure that
accomplishes some task
 Decision Procedure
 An algorithm that provides a Yes or
No solution to a decision problem
5
2. Nondeterminism
Deterministic Program
Given a single input, all executions of the
program compute the same solution
I.E. We can DETERMINE with certainty
what the solution will be.
Nondeterministic Program
 Given a single input, different executions
of the program may produce different
solutions.
6
How is nondeterminism possible?
• You answer this question!!
7
Nondeterminism
This is author’s method of specifying.
We will seldom, if ever, use this.
1. choose (action 1;;
action 2;;
…
action n )
2. choose(x from S: P(x))
8
Nondeterminism Example
Want plane ticket, rental car, train/public transportation for
a trip. Is optimal (cheapest/fastest) absolutely
necessary??
trip-plan(start, finish) =
return (choose(
fly-major-airline-and-rent-car(start, finish);;
fly-regional-airline-and-rent-car(start, finish);;
take-train-and-use-public-transportation
(start, finish);;
drive(start, finish) ))
9
Nondeterminism
Convert first to second. Is a solution possible?
How will you find it? How long will it take?
10
3. Functions on Languages
• Given a language, perform some function
on the language to create a new
language
– Concatenation, Repetition, Union,
Intersection
– Can define many others
• E.G. Chop = all odd strings of a language with
the middle character “chopped” out
11
Homework Chapter 4
None
12
Download