0% found this document useful (0 votes)
17 views33 pages

Theory of Computation: 2022-2023 Güz Zeynep Altan

Uploaded by

yash2005ganorkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views33 pages

Theory of Computation: 2022-2023 Güz Zeynep Altan

Uploaded by

yash2005ganorkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Theory of Computation

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

An automaton with a finite number of states is called a Finite Automaton


(FA) or Finite State Machine (FSM)
Automata Theory
How a vending machine works?

Vending machine room seen in


Hokkaido, Japan 2004

How to design a vending machine?


→ Use a finite automaton!
Automata Theory
An example: Assumptions (for simplicity)
Only 5-L and 10-L are used.
Only drinks all of 20 L are sold.

Requiring “memory” called “states” for the


10
design.
5 15
5

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

generator acceptor transducer


Automata Theory Model Type I:
Generator
“natural language” grammar
(generating “sentences” spoken by people)

reception robot
(speaking organized words and sentences)

context-free gramma Reception robot


--- Expo 2005
(generating strings of symbols)
Automata Theory Model Type II:
Acceptor
digital lock
(accepting digits)

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.

Sequential machines have numerous applications in:


asynchronous circuits /digital circuit design
coding theory,
concurrent systems
software and hardware verification
hardware testing
protocol design
Example of Automata: Vending Machines
A vending machine is an automated machine that dispenses numerous
items such as cold drinks, snacks, beverages, alcohol etc. to sales
automatically, after a buyer inserts currency or credit into the machine.

Vending machine is works on finite state automate to control the


functions process.
Example of Automata: Traffic Lights
The optimization of traffic light controllers in a city is a systematic
representation of handling the instructions of traffic rules.

Its process depends on a set of instruction works in a loop with


switching among instruction to control traffic.
Examples of 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.

Regular Expression Matching: It is a technique to checking the two or more


regular expression are similar to each other or not. The finite state machine is
useful to checking out that the expressions are acceptable or not by a machine
or not.
Example of Automata: Speech Recognition
Speech recognition via machine is the technology
enhancement that is capable to identify words and phrases in
spoken language and convert them to a machine-readable
format
Receiving words and phrases from real world and then
converting it into machine readable language automatically is
effectively solved by using finite state machine.
Summary: Applications of Theory of Computation
– Text analysis – Digital system design – Language design
• text search • computer design • programming
• text editing • special digital system language design
design • document
– Compiler design description
– Protocol modeling and
• lexical analysis verification language design
– e.g., HTML, XML, …
• parser generation – Expert system design
• picture language
– Cryptography … design
– e.g., SVG, VHML, …
• special language
design
Fields Related to Scope of Theory of
Computation
Fields Related theory
Compiling theory Formal languages
Switching circuit theory Automata theory
Algorithm analysis Computational complexity
Natural language processing Formal languages
Syntactic pattern recognition Formal languages
Programming languages Formal languages
Artificial intelligence Formal languages and automata theory
Neural networks Automata theory
Finite
0 1 Automata
1 0,1
1
1 2 3
0 0 1
1 0,1
1
1 2 3
0

Input: finite string


Output: Accept or Reject
States: 1 2 3 States: 1 2 3
1 Computation process: Begin at start state,
Transitions: Transitions:
read input symbols, follow corresponding transitions,
Accept if end with accept state, Reject if not.
Start state: : 1 Start state:
Examples: 01101 → Accept
Accept states: 3 Accept
00101 states:
→ Reject

1 accepts exactly those strings in where


= { | contains substring 11}.
Definition FA
A finite automaton is a 5-tuple ( , Σ, , 0, )
finite set of states 0
1 1
• Σ finite set of alphabet symbols 1
0,1
1 2 3
• transition function : ×Σ → 0

• 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

$ " = { | contains substring 11} =


Therefore is regular
Let 1 = has equal numbers of 0s and 1s}
1 is not regular
Regular Expressions
Let ,0 be languages:

Union: ∪0={ | ∈ or ∈0}


Concatenation: ∘0={56 | 5∈ and 6∈0} = 0
Star: ∗={51… 58 | each 5 ∈ for 8≥0}
Note: ε∈ ∗ always

Example Let ={good, bad} and 0={boy, girl}.


∪0= {good, bad, boy, girl}
∘0= 0= {goodboy, goodgirl, badboy, badgirl}
∗= {ε, good, bad, goodgood, goodbad, badgood,
badbad, goodgoodgood, goodgoodbad, … }
Finite Automata equivalent to Regular Expressions
• RegRegular expressions
Built from Σ, members Σ, ∅, ε [Atomic]
By using ∪, ∘, ∗ [Composite]

Examples:

0∪1 ∗ = Σ ∗ gives all strings over Σ

Σ ∗ 1 gives all strings that end with 1

Σ ∗ 11Σ ∗ = all strings that contain 11 = $ " ular expressions


- Built from Σ, members Σ, ∅, ε [Atomic]
- Σ ∗ = all strings that contain 11 = $ "
Closure Properties for Regular Languages
Theorem: If ", 2 are regular languages, so is " ∪ 2 (closure under ∪)
Proof: Let " = ( " , Σ, " , " , " ) recognize "
; = ( ; , Σ, ; , ; , ; ) rrecognize ;
Construct = ( , Σ, , 0, ) recognizing " ∪ ;
should accept input if either " or ; accept . should accept
input if either " or ; accept .
Components of <: "

= 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 " ;

" ;

should accept input


if = 56 where
" accepts 5 and ; accepts 6.

5 y

Doesn’t work: Where to split ?


Computability Theory / Recursion Theory

 An effective procedure that can be carried out by following specific


rules.
We might ask whether there is some effective procedure, some
algorithm
given a sentence about the integers will decide whether that sentence is
true or false.
The set of even integers is decidable
How do you Determine Decidable?
A language is called Decidable or Recursive if there is a Turing
machine which accepts and halts on every input string w.
Every decidable language is Turing-Acceptable.
A decision problem P is decidable if the language L of all yes
instances to P is decidable.

The relationships among classes of languages


The difference Between
Decidable and Recognizable
A language is said to be Decidable if there is a machine that will
accept strings in the language
and
reject strings not in the language

A language is called Turing Recognizable if some Turing Machine


recognizes it.
A Language is called Turing Decidable if some Turing Machine decides
it.
Language Hierarchy
Turing-recognizability means that there is a program that can
confirm that a string w is in a language
 co-Turing-recognizability means that there is a program that can
confirm that a string w is not in the language.
Problems Studied in Theory of Computation
“What are the fundamental capabilities and limitations of
computers?”
– What can a computer do at all? ---
studied in the domain of Computability!
– What can a computer do efficiently? --- studied in the domain
of Computational complexity!
Introduction to Computability
Is there a flight between Detroit and New York for less that $100?
Such a question is a decision problem
 we want a decision on whether the answer is yes or no.
We can generalize the question above into a predicate that takes an
input value:
Is there a flight between Detroit and x for less than $100?
 Given any particular destination x, the answer to this question is still either yes or no.
We can further generalize this predicate to work with multiple input
values:
Is there a flight between x and y for less than z?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy