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

What's hot

FINITE STATE MACHINE AND CHOMSKY HIERARCHY
FINITE STATE MACHINE AND CHOMSKY HIERARCHYFINITE STATE MACHINE AND CHOMSKY HIERARCHY
FINITE STATE MACHINE AND CHOMSKY HIERARCHY
nishimanglani
 
Finite automata
Finite automataFinite automata
Finite automata
Bipul Roy Bpl
 
Finite Automata in compiler design
Finite Automata in compiler designFinite Automata in compiler design
Finite Automata in compiler design
Riazul Islam
 
Introduction to the theory of computation
Introduction to the theory of computationIntroduction to the theory of computation
Introduction to the theory of computation
prasadmvreddy
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
Naman Joshi
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite Automat
Adel Al-Ofairi
 
Introduction to fa and dfa
Introduction to fa  and dfaIntroduction to fa  and dfa
Introduction to fa and dfa
deepinderbedi
 
Lecture: Automata
Lecture: AutomataLecture: Automata
Lecture: Automata
Marina Santini
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
Nfa vs dfa
Nfa vs dfaNfa vs dfa
Nfa vs dfa
raosir123
 
Theory of computing presentation
Theory of computing presentationTheory of computing presentation
Theory of computing presentation
Md. Touhidur Rahman
 
Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5
Srimatre K
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
Animesh Chaturvedi
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
A. S. M. Shafi
 
Finite automata
Finite automataFinite automata
Finite automata
Dr. Abhineet Anand
 
Ch2 finite automaton
Ch2 finite automatonCh2 finite automaton
Ch2 finite automaton
meresie tesfay
 
Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)
Siddharaj Junnarkar
 
Dfa basics
Dfa basicsDfa basics
Dfa basics
ankitamakin
 
Finite automata
Finite automataFinite automata
Finite automata
Pusp Sunar
 
CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR
Zahid Parvez
 

What's hot (20)

FINITE STATE MACHINE AND CHOMSKY HIERARCHY
FINITE STATE MACHINE AND CHOMSKY HIERARCHYFINITE STATE MACHINE AND CHOMSKY HIERARCHY
FINITE STATE MACHINE AND CHOMSKY HIERARCHY
 
Finite automata
Finite automataFinite automata
Finite automata
 
Finite Automata in compiler design
Finite Automata in compiler designFinite Automata in compiler design
Finite Automata in compiler design
 
Introduction to the theory of computation
Introduction to the theory of computationIntroduction to the theory of computation
Introduction to the theory of computation
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite Automat
 
Introduction to fa and dfa
Introduction to fa  and dfaIntroduction to fa  and dfa
Introduction to fa and dfa
 
Lecture: Automata
Lecture: AutomataLecture: Automata
Lecture: Automata
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
Nfa vs dfa
Nfa vs dfaNfa vs dfa
Nfa vs dfa
 
Theory of computing presentation
Theory of computing presentationTheory of computing presentation
Theory of computing presentation
 
Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Finite automata
Finite automataFinite automata
Finite automata
 
Ch2 finite automaton
Ch2 finite automatonCh2 finite automaton
Ch2 finite automaton
 
Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)
 
Dfa basics
Dfa basicsDfa basics
Dfa basics
 
Finite automata
Finite automataFinite automata
Finite automata
 
CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR
 

Viewers also liked

Decidability of Finiteness of a Context Free Grammer
Decidability of Finiteness of a Context Free GrammerDecidability of Finiteness of a Context Free Grammer
Decidability of Finiteness of a Context Free Grammer
Zeeshan Masood S
 
Pumping Lemma
Pumping LemmaPumping Lemma
Pumping Lemma
eburhan
 
Pumping lemma
Pumping lemmaPumping lemma
Pumping lemma
Gagan Dhawan
 
Decidability
DecidabilityDecidability
Decidability
andrejko
 
State space search
State space search State space search
State space search
Timothy Makgato
 
Components Of C Language
Components Of C LanguageComponents Of C Language
Components Of C Language
Anees Salim
 
Deciability (automata presentation)
Deciability (automata presentation)Deciability (automata presentation)
Deciability (automata presentation)
Sagar Kumar
 
Theory of computation Lec3 dfa
Theory of computation Lec3 dfaTheory of computation Lec3 dfa
Theory of computation Lec3 dfa
Arab Open University and Cairo University
 
Components of Language
Components of LanguageComponents of Language
Components of Language
Michael Caesar Tubal
 
Lecture: Context-Free Grammars
Lecture: Context-Free GrammarsLecture: Context-Free Grammars
Lecture: Context-Free Grammars
Marina Santini
 
The Complement System
The Complement SystemThe Complement System
The Complement System
Ybeb18
 
Akka Finite State Machine
Akka Finite State MachineAkka Finite State Machine
Akka Finite State Machine
Knoldus Inc.
 
Cldch8
Cldch8Cldch8
Cldch8
sealife24
 
02. chapter 3 lexical analysis
02. chapter 3   lexical analysis02. chapter 3   lexical analysis
02. chapter 3 lexical analysis
raosir123
 
Components of language
Components of languageComponents of language
Components of language
mhariandithz
 

Viewers also liked (15)

Decidability of Finiteness of a Context Free Grammer
Decidability of Finiteness of a Context Free GrammerDecidability of Finiteness of a Context Free Grammer
Decidability of Finiteness of a Context Free Grammer
 
Pumping Lemma
Pumping LemmaPumping Lemma
Pumping Lemma
 
Pumping lemma
Pumping lemmaPumping lemma
Pumping lemma
 
Decidability
DecidabilityDecidability
Decidability
 
State space search
State space search State space search
State space search
 
Components Of C Language
Components Of C LanguageComponents Of C Language
Components Of C Language
 
Deciability (automata presentation)
Deciability (automata presentation)Deciability (automata presentation)
Deciability (automata presentation)
 
Theory of computation Lec3 dfa
Theory of computation Lec3 dfaTheory of computation Lec3 dfa
Theory of computation Lec3 dfa
 
Components of Language
Components of LanguageComponents of Language
Components of Language
 
Lecture: Context-Free Grammars
Lecture: Context-Free GrammarsLecture: Context-Free Grammars
Lecture: Context-Free Grammars
 
The Complement System
The Complement SystemThe Complement System
The Complement System
 
Akka Finite State Machine
Akka Finite State MachineAkka Finite State Machine
Akka Finite State Machine
 
Cldch8
Cldch8Cldch8
Cldch8
 
02. chapter 3 lexical analysis
02. chapter 3   lexical analysis02. chapter 3   lexical analysis
02. chapter 3 lexical analysis
 
Components of language
Components of languageComponents of language
Components of language
 

Similar to Final fa part1

5. NFA & DFA.pdf
5. NFA & DFA.pdf5. NFA & DFA.pdf
5. NFA & DFA.pdf
TANZINTANZINA
 
language , grammar and automata
language , grammar and automatalanguage , grammar and automata
language , grammar and automata
ElakkiyaS11
 
FInite Automata
FInite AutomataFInite Automata
FInite Automata
Mobeen Mustafa
 
introduction-190804060837.pptx
introduction-190804060837.pptxintroduction-190804060837.pptx
introduction-190804060837.pptx
shumPanwar
 
flat unit1
flat unit1flat unit1
flat unit1
Janhavi Vishwanath
 
Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languages
SOMNATHMORE2
 
CS 5th.pptx
CS 5th.pptxCS 5th.pptx
CS 5th.pptx
MadniFareed1
 
deterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdfdeterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdf
AmayJaiswal4
 
a simple idealized machine used to recognize patterns within input taken from...
a simple idealized machine used to recognize patterns within input taken from...a simple idealized machine used to recognize patterns within input taken from...
a simple idealized machine used to recognize patterns within input taken from...
NALESVPMEngg
 
TOC Introduction
TOC Introduction TOC Introduction
TOC Introduction
Thapar Institute
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
Prof. Dr. K. Adisesha
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
Prof. Dr. K. Adisesha
 
Lec1.pptx
Lec1.pptxLec1.pptx
Lec1.pptx
ziadk6872
 
Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languages
SOMNATHMORE2
 
To lec 03
To lec 03To lec 03
To lec 03
Hasam Panezai
 
NLP_KASHK:Finite-State Automata
NLP_KASHK:Finite-State AutomataNLP_KASHK:Finite-State Automata
NLP_KASHK:Finite-State Automata
Hemantha Kulathilake
 
Automata theory
Automata theoryAutomata theory
Automata theory
Pardeep Vats
 
Automata theory introduction
Automata theory introductionAutomata theory introduction
Automata theory introduction
NAMRATA BORKAR
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
FariyaTasneem1
 
Formal Languages and Automata Theory unit 3
Formal Languages and Automata Theory unit 3Formal Languages and Automata Theory unit 3
Formal Languages and Automata Theory unit 3
Srimatre K
 

Similar to Final fa part1 (20)

5. NFA & DFA.pdf
5. NFA & DFA.pdf5. NFA & DFA.pdf
5. NFA & DFA.pdf
 
language , grammar and automata
language , grammar and automatalanguage , grammar and automata
language , grammar and automata
 
FInite Automata
FInite AutomataFInite Automata
FInite Automata
 
introduction-190804060837.pptx
introduction-190804060837.pptxintroduction-190804060837.pptx
introduction-190804060837.pptx
 
flat unit1
flat unit1flat unit1
flat unit1
 
Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languages
 
CS 5th.pptx
CS 5th.pptxCS 5th.pptx
CS 5th.pptx
 
deterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdfdeterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdf
 
a simple idealized machine used to recognize patterns within input taken from...
a simple idealized machine used to recognize patterns within input taken from...a simple idealized machine used to recognize patterns within input taken from...
a simple idealized machine used to recognize patterns within input taken from...
 
TOC Introduction
TOC Introduction TOC Introduction
TOC Introduction
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
 
Lec1.pptx
Lec1.pptxLec1.pptx
Lec1.pptx
 
Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languages
 
To lec 03
To lec 03To lec 03
To lec 03
 
NLP_KASHK:Finite-State Automata
NLP_KASHK:Finite-State AutomataNLP_KASHK:Finite-State Automata
NLP_KASHK:Finite-State Automata
 
Automata theory
Automata theoryAutomata theory
Automata theory
 
Automata theory introduction
Automata theory introductionAutomata theory introduction
Automata theory introduction
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
 
Formal Languages and Automata Theory unit 3
Formal Languages and Automata Theory unit 3Formal Languages and Automata Theory unit 3
Formal Languages and Automata Theory unit 3
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 

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.