SlideShare a Scribd company logo
Automata and complexity Theory
Chapter 1
Introduction
Definitions
• Symbol – An atomic unit, such as a digit, character,
lower-case letter, etc. Sometimes a word. [Formal
language does not deal with the “meaning” of the
symbols.]
• Alphabet – A finite set of symbols, usually denoted by
ÎŁ.
ÎŁ = {0, 1} ÎŁ = {0, a, 4} ÎŁ = {a, b, c, d}
• String – A finite length sequence of symbols,
Alphabets and strings
• A common way to talk about words, number, pairs of words,
etc. is by representing them as strings
• To define strings, we start with an alphabet
• Examples
An alphabet is a finite set of symbols.
S1 = {a, b, c, d, …, z}: the set of letters in English
S2 = {0, 1, …, 9}: the set of (base 10) digits
S3 = {a, b, …, z, #}: the set of letters plus the
special symbol #
S4 = {(, )}: the set of open and closed brackets
Strings
• The empty string will be denoted by e (epsilon)
• Examples
A string over alphabet S is a finite sequence
of symbols in S.
abfbz is a string over S1 = {a, b, c, d, …, z}
9021 is a string over S2 = {0, 1, …, 9}
ab#bc is a string over S3 = {a, b, …, z, #}
))()(() is a string over S4 = {(, )}
Let: u=ε w = 0110 y = 0aa x = aabcaa z = 111
concatenation: wz = 0110111
length: |w| = 4 |x| = 6 but |u| = 0
reversal: yR = aa0
Some special sets of strings
• Σ* All strings of symbols from Σ
• Σ+ Σ* - {ε}
Example: ÎŁ = {0, 1}
• Σ* = {ε, 0, 1, 00, 01, 10, 11, 000, 001,…}
• Σ+ = {0, 1, 00, 01, 10, 11, 000, 001,…}
Strings
What is Formal Language ?
i.e. any subset L of ÎŁ*
• Classes of formal languages (e.g., regular, context-free,
context-sensitive, recursive, recursively enumerable).
• Formal languages are related to programming
languages and natural languages
A (formal) language is a set of strings over an alphabet.
Formal Language Examples:
ÎŁ = {0, 1}
L = {x | x is in ÎŁ* and x contains an even number of
0’s}
Σ = {0, 1, 2,…, 9, .}
L = {x | x is in ÎŁ* and x forms a finite length real
number}
= {0, 1.5, 9.326,…}
Σ = {a, b, c,…, z, A, B,…, Z}
L = {x | x is in ÎŁ* and x is a CPP reserved word}
Formal Language Examples:
Σ = {CPP reserved words} U { (, ), ., :, ;,…} U {Legal
CPP identifiers}
L = {x | x is in ÎŁ* and x is a syntactically correct CPP
program}
ÎŁ = {English words}
L = {x | x ÎŁ* and x is a syntactically correct English
sentence}
What is automata theory ?
• Automata theory is the study of abstract computational
devices
• Abstract devices are (simplified) models of real
computations
• Computations happen everywhere: On your laptop, on your
cell phone, in nature, …
• Why do we need abstract models?
A simple “computer”
BATTERY
input: switch
output: light bulb
actions: flip switch
states: on, off
A simple “computer”
BATTERY off on
start
f
f
input: switch
output: light bulb
actions: f for “flip switch”
states: on, off
bulb is on if and only if there
was an odd number of flips
Another “computer”
BATTERY
off off
start
1
inputs: switches 1 and 2
actions: 1 for “flip switch 1”
actions: 2 for “flip switch 2”
states: on, off
bulb is on if and only if both
switches were flipped an odd
number of times
1
2
1
off on
1
1
2 2 2 2
Another Example
• A state diagram for a simple Game Enemy model
Wander - player is with in sight - Attack
Attack - player is out of sight - Wander
Attack - player is attacking - Evade
Evade - player is idle - Attack
Different kinds of automata
• This was only some examples of a computational device,
and there are others
• We will look at different devices, and look at the following
questions:
– What can a given type of device compute, and what are its
limitations?
– Is one type of device more powerful than another?
Some devices we will see
finite automata Devices with a finite amount of memory.
Used to model “small” computers.
push-down automata Devices with infinite memory that can be
accessed in a restricted way.
Used to model parsers, etc.
Turing Machines Devices with infinite memory.
Used to model any computer.
Preliminaries of automata theory
• How do we formalize the question
• First, we need a formal way of describing the problems that
we are interested in solving
Can device A solve problem B?
Problems
• Examples of problems we will consider
– Given a word s, does it contain the subword “fool”?
– Given a number n, is it divisible by 7?
– Given a pair of words s and t, are they the same?
– Given an expression with brackets, e.g. (()()), does every left
bracket match with a subsequent right bracket?
• All of these have “yes/no” answers.
• There are other types of problems, that ask “Find this” or
“How many of that” but we won’t look at those.
Reading Assignment
• Mathematical Preliminaries
– sets,
– relations,
– functions,
– sequences,
– graphs,
– trees.

More Related Content

PPT
Lec 01-Introduction Lec 01-IntroductionLec 01-Introduction
PPT
1. Introduction to __Automata Theory.ppt
PPTX
Chapter One - Introduction to automata and complexity theory
PPTX
Lecture 1 of automata theory where .pptx
PDF
Introduction to Automata Theory (Preliminaries) Lecture
PDF
Mod1.pdf
PPTX
LESSON 1 AUTOMATA LESSON 1 AUTOMATA.pptx
PPTX
1. Introduction to machine learning and AI
Lec 01-Introduction Lec 01-IntroductionLec 01-Introduction
1. Introduction to __Automata Theory.ppt
Chapter One - Introduction to automata and complexity theory
Lecture 1 of automata theory where .pptx
Introduction to Automata Theory (Preliminaries) Lecture
Mod1.pdf
LESSON 1 AUTOMATA LESSON 1 AUTOMATA.pptx
1. Introduction to machine learning and AI

Similar to 01.ppt (20)

PPTX
1. Introduction automata throry and intoduction
PPT
Basics of Theory of Computation, Finite Automata with Deterministic and Non D...
PPT
Finite Automata Theory, Computational Theory Basics
PPT
67a999b1e2665.pptcffttftr5ftffgvvgsfrrrggv
PDF
TOC in 8 hours.pdfvdvbnnhgfsxcvbmnvxsdfvb
PDF
FLAT Notes
PDF
Theory of Computation Lecture Notes
PPTX
Introduction to Theory of computations:-
PDF
Introduction
PPTX
Theory of automata and formal language
PPTX
BCS503 TOC Module 1 PPT.pptx VTU academic Year 2024-25 ODD SEM
PPTX
TOC-Module1-DFA,NFA ,DFA to NFA conversion.pptx
PPT
Overview_of_a_computational_model_-_Languages_1.ppt
PPT
Introduction to the computing theory in automata
PDF
Theory of computation
PPTX
Computational Theory Lecture 1 Theory of Automata.pptx
PPTX
Computational Theory Lecture 1 Theory of Automata.pptx
PPT
1 introduction
PPT
Lecture 1,2
1. Introduction automata throry and intoduction
Basics of Theory of Computation, Finite Automata with Deterministic and Non D...
Finite Automata Theory, Computational Theory Basics
67a999b1e2665.pptcffttftr5ftffgvvgsfrrrggv
TOC in 8 hours.pdfvdvbnnhgfsxcvbmnvxsdfvb
FLAT Notes
Theory of Computation Lecture Notes
Introduction to Theory of computations:-
Introduction
Theory of automata and formal language
BCS503 TOC Module 1 PPT.pptx VTU academic Year 2024-25 ODD SEM
TOC-Module1-DFA,NFA ,DFA to NFA conversion.pptx
Overview_of_a_computational_model_-_Languages_1.ppt
Introduction to the computing theory in automata
Theory of computation
Computational Theory Lecture 1 Theory of Automata.pptx
Computational Theory Lecture 1 Theory of Automata.pptx
1 introduction
Lecture 1,2
Ad

Recently uploaded (20)

PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
advance database management system book.pdf
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
Hazard Identification & Risk Assessment .pdf
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PPTX
Computer Architecture Input Output Memory.pptx
PDF
1_English_Language_Set_2.pdf probationary
PDF
Trump Administration's workforce development strategy
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PPTX
History, Philosophy and sociology of education (1).pptx
 
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
My India Quiz Book_20210205121199924.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Introduction to pro and eukaryotes and differences.pptx
advance database management system book.pdf
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Hazard Identification & Risk Assessment .pdf
Paper A Mock Exam 9_ Attempt review.pdf.
Computer Architecture Input Output Memory.pptx
1_English_Language_Set_2.pdf probationary
Trump Administration's workforce development strategy
Chinmaya Tiranga quiz Grand Finale.pdf
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
History, Philosophy and sociology of education (1).pptx
 
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
My India Quiz Book_20210205121199924.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Ad

01.ppt

  • 3. Definitions • Symbol – An atomic unit, such as a digit, character, lower-case letter, etc. Sometimes a word. [Formal language does not deal with the “meaning” of the symbols.] • Alphabet – A finite set of symbols, usually denoted by ÎŁ. ÎŁ = {0, 1} ÎŁ = {0, a, 4} ÎŁ = {a, b, c, d} • String – A finite length sequence of symbols,
  • 4. Alphabets and strings • A common way to talk about words, number, pairs of words, etc. is by representing them as strings • To define strings, we start with an alphabet • Examples An alphabet is a finite set of symbols. S1 = {a, b, c, d, …, z}: the set of letters in English S2 = {0, 1, …, 9}: the set of (base 10) digits S3 = {a, b, …, z, #}: the set of letters plus the special symbol # S4 = {(, )}: the set of open and closed brackets
  • 5. Strings • The empty string will be denoted by e (epsilon) • Examples A string over alphabet S is a finite sequence of symbols in S. abfbz is a string over S1 = {a, b, c, d, …, z} 9021 is a string over S2 = {0, 1, …, 9} ab#bc is a string over S3 = {a, b, …, z, #} ))()(() is a string over S4 = {(, )}
  • 6. Let: u=ε w = 0110 y = 0aa x = aabcaa z = 111 concatenation: wz = 0110111 length: |w| = 4 |x| = 6 but |u| = 0 reversal: yR = aa0 Some special sets of strings • ÎŁ* All strings of symbols from ÎŁ • ÎŁ+ ÎŁ* - {ε} Example: ÎŁ = {0, 1} • ÎŁ* = {ε, 0, 1, 00, 01, 10, 11, 000, 001,…} • ÎŁ+ = {0, 1, 00, 01, 10, 11, 000, 001,…} Strings
  • 7. What is Formal Language ? i.e. any subset L of ÎŁ* • Classes of formal languages (e.g., regular, context-free, context-sensitive, recursive, recursively enumerable). • Formal languages are related to programming languages and natural languages A (formal) language is a set of strings over an alphabet.
  • 8. Formal Language Examples: ÎŁ = {0, 1} L = {x | x is in ÎŁ* and x contains an even number of 0’s} ÎŁ = {0, 1, 2,…, 9, .} L = {x | x is in ÎŁ* and x forms a finite length real number} = {0, 1.5, 9.326,…} ÎŁ = {a, b, c,…, z, A, B,…, Z} L = {x | x is in ÎŁ* and x is a CPP reserved word}
  • 9. Formal Language Examples: ÎŁ = {CPP reserved words} U { (, ), ., :, ;,…} U {Legal CPP identifiers} L = {x | x is in ÎŁ* and x is a syntactically correct CPP program} ÎŁ = {English words} L = {x | x ÎŁ* and x is a syntactically correct English sentence}
  • 10. What is automata theory ? • Automata theory is the study of abstract computational devices • Abstract devices are (simplified) models of real computations • Computations happen everywhere: On your laptop, on your cell phone, in nature, … • Why do we need abstract models?
  • 11. A simple “computer” BATTERY input: switch output: light bulb actions: flip switch states: on, off
  • 12. A simple “computer” BATTERY off on start f f input: switch output: light bulb actions: f for “flip switch” states: on, off bulb is on if and only if there was an odd number of flips
  • 13. Another “computer” BATTERY off off start 1 inputs: switches 1 and 2 actions: 1 for “flip switch 1” actions: 2 for “flip switch 2” states: on, off bulb is on if and only if both switches were flipped an odd number of times 1 2 1 off on 1 1 2 2 2 2
  • 14. Another Example • A state diagram for a simple Game Enemy model Wander - player is with in sight - Attack Attack - player is out of sight - Wander Attack - player is attacking - Evade Evade - player is idle - Attack
  • 15. Different kinds of automata • This was only some examples of a computational device, and there are others • We will look at different devices, and look at the following questions: – What can a given type of device compute, and what are its limitations? – Is one type of device more powerful than another?
  • 16. Some devices we will see finite automata Devices with a finite amount of memory. Used to model “small” computers. push-down automata Devices with infinite memory that can be accessed in a restricted way. Used to model parsers, etc. Turing Machines Devices with infinite memory. Used to model any computer.
  • 17. Preliminaries of automata theory • How do we formalize the question • First, we need a formal way of describing the problems that we are interested in solving Can device A solve problem B?
  • 18. Problems • Examples of problems we will consider – Given a word s, does it contain the subword “fool”? – Given a number n, is it divisible by 7? – Given a pair of words s and t, are they the same? – Given an expression with brackets, e.g. (()()), does every left bracket match with a subsequent right bracket? • All of these have “yes/no” answers. • There are other types of problems, that ask “Find this” or “How many of that” but we won’t look at those.
  • 19. Reading Assignment • Mathematical Preliminaries – sets, – relations, – functions, – sequences, – graphs, – trees.