CSCI 1302 - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

CSCI 1302

Description:

A finite automaton is a 5-tuple (Q, S, d, q0, F), where: Q is a finite set called states ... Non-deterministic Finite Automata (NFAs) ... – PowerPoint PPT presentation

Number of Views:57
Avg rating:3.0/5.0
Slides: 21
Provided by: jonpr
Category:
Tags: csci | automaton

less

Transcript and Presenter's Notes

Title: CSCI 1302


1
CSCI 1302
  • Deterministic Finite-state Automata
  • Turing Machines

2
Finite-state Automata
  • Deterministic Nondeterministic
  • Useful for defining simple machine
  • No memory (storage)
  • Defined as algorithm input, and returns T/F

3
What is Automata?
  • Good for designing computation models with
    extremely limited memory
  • Regular expressions
  • Determinisitic Finite state machines (DFAs)
  • Non-deterministic finite state machines (NFAs)

4
Traditional Desperate Example
Good
Bad
Single
Dating
Bad
Good
Bad
Good
Good/bad
Engaged
Married
5
Formal Definition
  • A finite automaton is a 5-tuple
  • (Q, S, d, q0, F), where
  • Q is a finite set called states
  • S is a finite set called the alphabet
  • d Q x S -gt the transition function
  • q0 is a member of Q and is the start state
  • F is a subset of Q and is the set of accept states

6
Our Example
  • Q single, dating, engaged, married
  • S good, bad
  • d is described
  • Single is the start state
  • F married

7
Another ExampleMachine M
1
0
1
q2
q1
0
L(M) w w ends in a 1
8
Yet Another ExampleMachine M
0
1
1
0
q2
q3
q1
0,1
L(M) w w contains at least one 1 and
an even number of 0s follow the last 1
9
Another ExampleMachine M
1
0
1
q2
q1
0
L(M) w w is empty, or ends in a 0
10
Another ExampleMachine M
0
1
s
0
1
q1
q3
0
0
1
q2
q4
0
1
L(M) w w begins and ends with the same
number
11
Fun at your next party
  • L(M) w w contains the substring 10 and ends
    in a 1
  • L(M) w w does not contain three 0s
  • L(M) w w starts with a 1 and ends with a 0
  • L(M) w every other character is a 1 in w
  • L(M) w w has an even number of 0s or even
    number of 1s
  • L(M) w w contains the same number of 0s and
    1s

12
Non-deterministic Finite Automata (NFAs)
  • Can explore all paths simultaneously by
    multiple transitions for a single input
  • An oracle always picks the correct path
  • Can also have e transitions (arbitrary)

13
Example
  • L(M) w w has an even number of 0s or even
    number of 1s

0
1
s
e
e
q1
q3
0
1
1
0
q2
q4
1
0
14
Pushdown Automata (PDAs)
  • More powerful than DFAs
  • Similar to DFAs, but have a stack
  • Can use the top of the stack to decide transition
  • Can manipulate the stack
  • For example
  • L(M) w w contains the same number of 0s and
    1s
  • Why is a stack necessary for this?

15
Example L(M) 0n1n n gt 0
1A/e
0 Z/AZ
0 A/AA
F
q
p
e
eZ/Z
0 Z/AZ (to humans if you see a zero and a Z is
on the stack, replace it with AZ
Note stack has a Z on it by default
16
Computational History
  • Study limits of computational processes
  • What can computers accomplish
  • What is not doable by computers
  • 1930s
  • Turing Machine defined by Alan M. Turing in 1936

17
Turing Machine Defined
  • Control unit
  • Read/Write head
  • Infinitely-long tape
  • Finite states (start, halt, others)
  • Deterministic transition function

18
Turing Machine Visualized



1
0
0
1
0

19
The Church-Turing Thesis
  • Turing Computable
  • Input value on tape (binary)
  • Execute program
  • Read output value from tape
  • Computational power of Turing machine limit of
    computational power of any algorithmic system
  • i.e. If you cant do it with a Turing machine,
    you cant do it computationally

20
FIN
Write a Comment
User Comments (0)
About PowerShow.com