SlideShare a Scribd company logo
Finite Automata
●

What are machines?
–

●

What are constituents of a machine?
–

●

Automation of various steps.
Each step takes an input and produces an output.

Machine can be defined as
–

Set of states which take input in specified format and
produce desired output.
Finite Automata
●

●

●

Finite Automata (FA) is a language recognizing
machine.
Accepts all words of the language for which it is
built.
Rejects all other words.
Finite Automata
●

Five tuple machine defined as M = (Q, ∑, ∂, Q0, F)
–

Q: Set of states such as Q0, Q1, Q2, Q3..... Qn.

–

∑: Alphabet of the language for which the machine is built such
as {a, b} or {0, 1}.

–

∂: Transition function or Next Move function. It maps Q X ∑ ->
Q.

–

∂ (Qi, a) = Qj where
– 'Qi' -> current state
– 'a' -> current input symbol
– 'Qj' -> next state
Q0 -> start state.

–

F -> collection of final states.

●
Finite Automata
●

Example of a Switch to “switch on” a fan.
–

Q = {OFF, ON}

–

∑ = {push}

–

∂ has two rules
●
●

∂ (OFF, push) = ON.
∂ (ON, push) = OFF.

–

Q0 = {OFF}

–

F = {ON}
Finite Automata
●

FA is a collection of 3 things:
–

A finite set of states, one of them is the start state
and some (maybe) none as the final states.

–

An alphabet ∑, which consists of all possible input
letters.

–

A finite set of transition rules which direct from each
state and for each particular input letter which state
to go next.
Finite Automata
We discuss an example here. Following are two
representations of an FA:
●
●

Transition Table
Transition Graph
Transition Table
a

b

-x

y

z

y

x

z

+z

z

z

Transition Graph
Finite Automata
Depiction of initial and final states for an FA can be defined in several ways:
●

Use a '-' symbol for initial state and a '+' symbol for final state.

●

Use a '->' symbol for initial state and double encircle the final state.

●

Write 'start' for the initial state and 'final' for the final state.
Finite Automata
FA has
●

3 states labelled x, y and z

●

∑ = {a,b}

●

●

State x is designated as the
start state.
State z is designated as the
final state.
Finite Automata
The transition table as well as the transition diagrams clearly define the ∂ function.
It is a depiction of the following rules:
Rule 1: If we are in state x and we encounter an input 'a' then we go to state y.
Rule 2: If we are in state x and we encounter an input 'b' then we go to state z.
Rule 3: If we are in state y and we encounter an input 'a' then we go to state x.
Rule 4: If we are in state y and we encounter an input 'b' then we go to state z.
Rule 5: If we are in state z and we encounter an input 'a' then we remain in state z.
Rule 6: If we are in state z and we encounter an input 'b' then we remain in state z.

Transition Graph

Transition Table
a

b

-x

y

z

y

x

z

+z

z

z
Finite Automata
●

To understand the language
dry run the input
–

“aaa”

–

“abba”
Finite Automata
●

●

●

If after complete string traversal, we do not reach the “final state”,
the string is then REJECTED by the FA.
If after complete string traversal, we reach the “final state”, the string
is then ACCEPTED by the FA.
Thus, FA is a language recognizer, which accepts all the
words in the language for which it is defined and rejects all the
other strings.
Finite Automata
●

What language does this FA represents?

Regular Expression for the language of
the FA: (a + b)* b (a + b)*
Finite Automata
●

A finite automata is
–
–

●

“Deterministic” in nature.
Finite

Note: By convention we say that the null word (λ) starts as
well as ends in the initial state.
Finite Automata
●

Analyse the FA given below

Regular Expression for the language of the
FA: (a + b) (a + b)*
Finite Automata
●

What is the language of the FA given below?

Regular Expression for the language of the
FA: (a + b)*
Finite Automata
●

What is the language accepted by the FA which has no final
state?

Such FA's accept “no language”.
Finite Automata
●

An interesting example. Identify the language.

This FA also accepts “no language”.
Finite Automata
●

What is the language of the FA given below?

This FA accepts all words of even length over the alphabet ∑
= {a,b}.
Finite Automata
●

Draw an FA which accepts all the words in the language a (a
+ b)* where ∑ = {a,b}.

First draw a diagram which accepts the minimum
length word which is 'a'.
Finite Automata
●

●

●

Now complete all the other transitions.
For words starting from 'b', we
introduce a new state y, which is a
“trap state” .
Trap State
–

On reaching trap state, we can never
go back to the other states of the FA
and accept the word.

–

Reaching a trap state means we
“reject” the word.

–

We have only one trap state for the
whole FA.

–

We need to complete the transitions
of the trap state too.
Finite Automata
●

●

●

●

Draw an FA which accepts all the words
that have a double 'a' or a double 'b' in
them where ∑ = {a,b}.
Two minimum length words 'aa' and
'bb'.
First draw an FA which accepts these
two words.
All the states signify something:
–

State 1: Neither an 'a' nor a 'b' has
occurred.

–

State 2: One 'a' has occurred.

–

State 3: One 'b' has occurred.

–

State 4: Either two a's or two b's have
occurred in continuation.
Finite Automata
●

Now complete the remaining transitions.
Finite Automata
●

Examine the following FA and find out the language
represented by it.

FA accepts all the words which have their third letter as
'b'. The regular expression is (a+b) (a+b) (b) (a+b)*.
Finite Automata
●

Construct an FA that accepts only the word 'baa' where ∑ =
{a,b}.

First draw the word 'baa'.
Now complete the FA.
Finite Automata

Note that there is only one “trap state” for the whole FA.
Finite Automata
●

Draw an FA which accepts only the word λ where ∑ =
{a,b}.

Now complete the transitions.
Finite Automata
●

FA which accepts only the word λ where ∑ = {a,b}.
Finite Automata
●

Draw an FA for all the words which end in 'a' where ∑ =
{a,b}.

Draw the minimum word i.e. 'a'.
Finite Automata
●

Complete the transitions.
Finite Automata
●

●

Draw an FA for all the words which have a double 'a' in
them where ∑ = {a,b}.

Significance of each state:
–

State 1: Zero a's are encountered consecutively.

–

State 2: One 'a' is encountered consecutively.

–

State 3: Double 'a' has been encountered.
Finite Automata
●

Now complete all the transitions.
Finite Automata
●

Draw an FA for all the words with different first and last
letters where ∑ = {a,b}.
Finite Automata
●

Now complete all the transitions.

More Related Content

PPTX
Introduction TO Finite Automata
PPTX
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
PPT
Finite automata
PPTX
NFA Non Deterministic Finite Automata by Mudasir khushik
PPTX
1.3.2 non deterministic finite automaton
PPT
Nondeterministic Finite Automata
PPTX
Finite automata-for-lexical-analysis
PPSX
FINITE STATE MACHINE AND CHOMSKY HIERARCHY
Introduction TO Finite Automata
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite automata
NFA Non Deterministic Finite Automata by Mudasir khushik
1.3.2 non deterministic finite automaton
Nondeterministic Finite Automata
Finite automata-for-lexical-analysis
FINITE STATE MACHINE AND CHOMSKY HIERARCHY

What's hot (20)

PPT
Finite automata
PPTX
Finite Automata in compiler design
PDF
Introduction to the theory of computation
PPT
Finite automata(For college Seminars)
PPT
Nondeterministic Finite Automat
PPT
Introduction to fa and dfa
PDF
Lecture: Automata
PPT
Finite automata examples
PPT
Nfa vs dfa
PPTX
Theory of computing presentation
PDF
Formal Languages and Automata Theory unit 5
PDF
Deterministic Finite Automata (DFA)
PDF
Finite Automata
PDF
Finite automata
PDF
Ch2 finite automaton
PDF
Fafl notes [2010] (sjbit)
PPT
Dfa basics
PDF
Finite automata
PPTX
CONTEXT FREE GRAMMAR
PPTX
1.3.1 deterministic finite automaton
Finite automata
Finite Automata in compiler design
Introduction to the theory of computation
Finite automata(For college Seminars)
Nondeterministic Finite Automat
Introduction to fa and dfa
Lecture: Automata
Finite automata examples
Nfa vs dfa
Theory of computing presentation
Formal Languages and Automata Theory unit 5
Deterministic Finite Automata (DFA)
Finite Automata
Finite automata
Ch2 finite automaton
Fafl notes [2010] (sjbit)
Dfa basics
Finite automata
CONTEXT FREE GRAMMAR
1.3.1 deterministic finite automaton
Ad

Viewers also liked (15)

PPTX
Decidability of Finiteness of a Context Free Grammer
PPTX
Pumping Lemma
PPT
Pumping lemma
PDF
Decidability
PDF
State space search
PPTX
Components Of C Language
PPTX
Deciability (automata presentation)
PPTX
Theory of computation Lec3 dfa
PPTX
Components of Language
PDF
Lecture: Context-Free Grammars
PDF
The Complement System
ODP
Akka Finite State Machine
PPT
Cldch8
PPT
02. chapter 3 lexical analysis
PPTX
Components of language
Decidability of Finiteness of a Context Free Grammer
Pumping Lemma
Pumping lemma
Decidability
State space search
Components Of C Language
Deciability (automata presentation)
Theory of computation Lec3 dfa
Components of Language
Lecture: Context-Free Grammars
The Complement System
Akka Finite State Machine
Cldch8
02. chapter 3 lexical analysis
Components of language
Ad

Similar to Final fa part1 (20)

PPTX
Automata introduction to FA_ Anurag Kumar.pptx
PPTX
Chapter-twoChapter-three automata and complexity theory .pptx
PDF
5. NFA & DFA.pdf
PPTX
language , grammar and automata
PPT
FInite Automata
PPTX
introduction-190804060837.pptx
PDF
flat unit1
PPTX
Decision properties of reular languages
PPTX
CS 5th.pptx
PDF
deterministicfiniteautomatondfa-181008145215 (1).pdf
PPTX
FSA.pptx natural language prsgdsgocessing
PPT
a simple idealized machine used to recognize patterns within input taken from...
PPTX
TOC Introduction
PDF
Theory of computation and automata
PDF
Theory of computation and automata
PPTX
Lec1.pptx
PPTX
Decision properties of reular languages
PPTX
TCS MUBAI UNIVERSITY ATHARVA COLLEGE OF ENGINEERING.pptx
PPTX
symbolic_automata or Advanced Programming Practice.pptx
PPT
To lec 03
Automata introduction to FA_ Anurag Kumar.pptx
Chapter-twoChapter-three automata and complexity theory .pptx
5. NFA & DFA.pdf
language , grammar and automata
FInite Automata
introduction-190804060837.pptx
flat unit1
Decision properties of reular languages
CS 5th.pptx
deterministicfiniteautomatondfa-181008145215 (1).pdf
FSA.pptx natural language prsgdsgocessing
a simple idealized machine used to recognize patterns within input taken from...
TOC Introduction
Theory of computation and automata
Theory of computation and automata
Lec1.pptx
Decision properties of reular languages
TCS MUBAI UNIVERSITY ATHARVA COLLEGE OF ENGINEERING.pptx
symbolic_automata or Advanced Programming Practice.pptx
To lec 03

Recently uploaded (20)

PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Approach and Philosophy of On baking technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
A Presentation on Artificial Intelligence
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Assigned Numbers - 2025 - Bluetooth® Document
Review of recent advances in non-invasive hemoglobin estimation
Diabetes mellitus diagnosis method based random forest with bat algorithm
Chapter 3 Spatial Domain Image Processing.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
cuic standard and advanced reporting.pdf
A comparative analysis of optical character recognition models for extracting...
20250228 LYD VKU AI Blended-Learning.pptx
Approach and Philosophy of On baking technology
MIND Revenue Release Quarter 2 2025 Press Release
Programs and apps: productivity, graphics, security and other tools
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Advanced methodologies resolving dimensionality complications for autism neur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Unlocking AI with Model Context Protocol (MCP)
A Presentation on Artificial Intelligence
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Final fa part1

  • 1. Finite Automata ● What are machines? – ● What are constituents of a machine? – ● Automation of various steps. Each step takes an input and produces an output. Machine can be defined as – Set of states which take input in specified format and produce desired output.
  • 2. Finite Automata ● ● ● Finite Automata (FA) is a language recognizing machine. Accepts all words of the language for which it is built. Rejects all other words.
  • 3. Finite Automata ● Five tuple machine defined as M = (Q, ∑, ∂, Q0, F) – Q: Set of states such as Q0, Q1, Q2, Q3..... Qn. – ∑: Alphabet of the language for which the machine is built such as {a, b} or {0, 1}. – ∂: Transition function or Next Move function. It maps Q X ∑ -> Q. – ∂ (Qi, a) = Qj where – 'Qi' -> current state – 'a' -> current input symbol – 'Qj' -> next state Q0 -> start state. – F -> collection of final states. ●
  • 4. Finite Automata ● Example of a Switch to “switch on” a fan. – Q = {OFF, ON} – ∑ = {push} – ∂ has two rules ● ● ∂ (OFF, push) = ON. ∂ (ON, push) = OFF. – Q0 = {OFF} – F = {ON}
  • 5. Finite Automata ● FA is a collection of 3 things: – A finite set of states, one of them is the start state and some (maybe) none as the final states. – An alphabet ∑, which consists of all possible input letters. – A finite set of transition rules which direct from each state and for each particular input letter which state to go next.
  • 6. Finite Automata We discuss an example here. Following are two representations of an FA: ● ● Transition Table Transition Graph Transition Table a b -x y z y x z +z z z Transition Graph
  • 7. Finite Automata Depiction of initial and final states for an FA can be defined in several ways: ● Use a '-' symbol for initial state and a '+' symbol for final state. ● Use a '->' symbol for initial state and double encircle the final state. ● Write 'start' for the initial state and 'final' for the final state.
  • 8. Finite Automata FA has ● 3 states labelled x, y and z ● ∑ = {a,b} ● ● State x is designated as the start state. State z is designated as the final state.
  • 9. Finite Automata The transition table as well as the transition diagrams clearly define the ∂ function. It is a depiction of the following rules: Rule 1: If we are in state x and we encounter an input 'a' then we go to state y. Rule 2: If we are in state x and we encounter an input 'b' then we go to state z. Rule 3: If we are in state y and we encounter an input 'a' then we go to state x. Rule 4: If we are in state y and we encounter an input 'b' then we go to state z. Rule 5: If we are in state z and we encounter an input 'a' then we remain in state z. Rule 6: If we are in state z and we encounter an input 'b' then we remain in state z. Transition Graph Transition Table a b -x y z y x z +z z z
  • 10. Finite Automata ● To understand the language dry run the input – “aaa” – “abba”
  • 11. Finite Automata ● ● ● If after complete string traversal, we do not reach the “final state”, the string is then REJECTED by the FA. If after complete string traversal, we reach the “final state”, the string is then ACCEPTED by the FA. Thus, FA is a language recognizer, which accepts all the words in the language for which it is defined and rejects all the other strings.
  • 12. Finite Automata ● What language does this FA represents? Regular Expression for the language of the FA: (a + b)* b (a + b)*
  • 13. Finite Automata ● A finite automata is – – ● “Deterministic” in nature. Finite Note: By convention we say that the null word (λ) starts as well as ends in the initial state.
  • 14. Finite Automata ● Analyse the FA given below Regular Expression for the language of the FA: (a + b) (a + b)*
  • 15. Finite Automata ● What is the language of the FA given below? Regular Expression for the language of the FA: (a + b)*
  • 16. Finite Automata ● What is the language accepted by the FA which has no final state? Such FA's accept “no language”.
  • 17. Finite Automata ● An interesting example. Identify the language. This FA also accepts “no language”.
  • 18. Finite Automata ● What is the language of the FA given below? This FA accepts all words of even length over the alphabet ∑ = {a,b}.
  • 19. Finite Automata ● Draw an FA which accepts all the words in the language a (a + b)* where ∑ = {a,b}. First draw a diagram which accepts the minimum length word which is 'a'.
  • 20. Finite Automata ● ● ● Now complete all the other transitions. For words starting from 'b', we introduce a new state y, which is a “trap state” . Trap State – On reaching trap state, we can never go back to the other states of the FA and accept the word. – Reaching a trap state means we “reject” the word. – We have only one trap state for the whole FA. – We need to complete the transitions of the trap state too.
  • 21. Finite Automata ● ● ● ● Draw an FA which accepts all the words that have a double 'a' or a double 'b' in them where ∑ = {a,b}. Two minimum length words 'aa' and 'bb'. First draw an FA which accepts these two words. All the states signify something: – State 1: Neither an 'a' nor a 'b' has occurred. – State 2: One 'a' has occurred. – State 3: One 'b' has occurred. – State 4: Either two a's or two b's have occurred in continuation.
  • 22. Finite Automata ● Now complete the remaining transitions.
  • 23. Finite Automata ● Examine the following FA and find out the language represented by it. FA accepts all the words which have their third letter as 'b'. The regular expression is (a+b) (a+b) (b) (a+b)*.
  • 24. Finite Automata ● Construct an FA that accepts only the word 'baa' where ∑ = {a,b}. First draw the word 'baa'. Now complete the FA.
  • 25. Finite Automata Note that there is only one “trap state” for the whole FA.
  • 26. Finite Automata ● Draw an FA which accepts only the word λ where ∑ = {a,b}. Now complete the transitions.
  • 27. Finite Automata ● FA which accepts only the word λ where ∑ = {a,b}.
  • 28. Finite Automata ● Draw an FA for all the words which end in 'a' where ∑ = {a,b}. Draw the minimum word i.e. 'a'.
  • 30. Finite Automata ● ● Draw an FA for all the words which have a double 'a' in them where ∑ = {a,b}. Significance of each state: – State 1: Zero a's are encountered consecutively. – State 2: One 'a' is encountered consecutively. – State 3: Double 'a' has been encountered.
  • 31. Finite Automata ● Now complete all the transitions.
  • 32. Finite Automata ● Draw an FA for all the words with different first and last letters where ∑ = {a,b}.
  • 33. Finite Automata ● Now complete all the transitions.