Theory of Computation: 2022-2023 Güz Zeynep Altan
Theory of Computation: 2022-2023 Güz Zeynep Altan
2022-2023 Güz
Zeynep Altan
Types of Theory of Computation
Automata Theory
Formal Language
Computability theory
Complexity theory
Basic terms in Automata Theory
Symbols: These are either individual objects or separate entities. These
can be any letter, alphabet or any picture.
Strings: These are a finite collection of symbols from the alphabet, and are
denoted by w.
Language: A collection of appropriate strings is called a language. A
language can be Finite or Infinite.
Automata Theory
transition diagram
start 0 5 5 10 5
10 10
10 20
Vending Machine Autamaton
The states of Deterministic Finite Automata (DFA) for Vending Machines
include:
Q = {$0.00, $0.25, $0.50, $0.75, $1.00, $1.25, $1.50, $1.75, $2.00} (states)
Σ = {$0.25, $1.00, select} is the alphabet
q0 = $0.00 is the start state
A = ∅ is the set of accept states
Vending Machine
Automata Theory
Three major models of automata
– generator --- with output and without input
– acceptor --- with input and without output
– transducer --- both with input and with output
Yes
trigger
or
signal
No
reception robot
(speaking organized words and sentences)
lexical analyzer
(recognizing computer language keywords)
finite automaton
(accepting valid strings of symbols) Digital lock
Automata Theory Model Type III:
Transducer
Interpreter
(translating natural languages)
Compiler
(translating high-level languages into machine codes)
Turing machine
(transforming strings of symbols)
Example of Automata: Sequential Machine
A sequential machine is a mathematical model of a certain type of
simple computational structure.
Its behavior represents the working process of finite automata.
Video Games: Video games levels represent the states of automata. In which a
sequence of instructions are followed by the players to accomplish the task.
Text Parsing: Text parsing is a technique which is used to derive a text string
using the production rules of a grammar to check the acceptability of a string.
• 0 start state
• set of accept states
= 0 1
1 = ( , Σ, , 1, )
1 1 2
= { 1, 2, 3}
2 1 3
Σ = {0, 1} 1 3
= { 3} 3 3 3
3 3
Finite Automata – Computation
Strings and languages
- A string is a finite sequence of symbols in Σ
- A language is a set of strings (finite or infinite)
- The empty string ε is the string of length 0
Recognizing languages
$( ) = { | accepts }
- The empty language ø is the set with no strings $( ) is the language of
recognizes $( )
Definition: accepts string
Definition
= 1 2 … each Σ A language is regular if some
finite automaton recognizes it.
if there is a sequence of states 0, 1, 2, , … ,
where:
- 0 = 0
- = ( !" , ) for 1 ≤ ≤
-
Regular Languages – Examples
More examples:
0 1
1
0,1
1 Let 0 = has an even number of 1s}
1 2 3
0 0 is regular
Examples:
= 1× 2
={( 1, 2 )| 1∈ 1 and 2∈ 2}
0=( 1, 2)
(( , ),=)=( 1 ( ,=), 2 ( ,=))
A=A1× A2 gives no intersection =
;
?
A=(A1× 2 )∪( 1×A2 )
Closure Properties for Regular Languages
Theorem: If ", ; are regular languages, so is " ; (closure under ∘)
Proof: Let " = ( " , Σ, " , " , " ) recognize "
; = ( ; , Σ, ; , ; , ; ) recognize ;
Construct = ( , Σ, , 0, ) recognizing " ;
" ;
5 y