SlideShare a Scribd company logo
1 of 11
Formalization
Machines and States
D.K.S.Hasaranga & A.G.A.L.Dhanushka
Finite State Machine
• Symbol
 Ex: a, b, c, 0, 1, 2, 3, ….
• Alphabet – Collection of symbols (Ɛ)
 Ex: {a,b}, {0,1,2}
• String – Sequence of symbols
 Ex: a, b, 0, 1, aa, bb, ab, 01, ….
Finite State Machine …
• Language – Set of Strings
 Ex: Ɛ = {0,1}
L1 = set of all strings of length 2
= {00, 01, 10, 11}
L2 = Set of all strings of length 3
= {000, 001, 010, 011, 100, 101, 110, 111}
L3 = Set of all strings that begin with “0”
= {0, 00, 01, 000, 001, ……}
Finite
Infinite
Finite State Machine …
Finite Automata
F A without output F A with output
DFA NFA Moore
Machine
Mealy
Machine
Ɛ - NFA
DFA (Deterministic Finite Automata)
 It is the simplest model of the computation
 It has a very limited memory
Every DFA can define using 5 tuples. They are,
 Q = Set of states
 Ɛ = Inputs
 q0 = Start state or initial state
 F = Set of final states
 ƍ = Transition function from Q x Ɛ Q
DFA (Deterministic Finite Automata) …
• Q = {A, B, C, D}
• Ɛ = {0, 1}
• q0 = A
• F = {D}
A B
C D
1
1
1
1
00 0 0
A C B
B D A
C A D
D B C
0 1
NFA (Non-Deterministic Finite Automata)
Every NFA can define using 5 tuples. They are,
 Q = Set of states - {A, B}
 Ɛ = Inputs - {0, 1}
 q0 = Start state or initial state - A
 F = Set of final states - B
 ƍ = Transition function from Q x Ɛ ?
A B0
0, 1
• The machine can move to any combination of the states in the machine (the exact
state to which the machine moves cannot be determined).
• Hence, it is called Non-deterministic Automaton.
• As it has finite number of states, the machine is called Non-deterministic Finite
Machine or Non-deterministic Finite Automaton.
L = {Set of all strings ends with 0}
NFA (Non-Deterministic Finite Automata)
A B0
0, 1
ƍ = Transition function from Q x Ɛ 2Q
Little Exercise
A x 0 A , B , A B
A x 1 A
B x 0 ø
B x 1 ø
Possibilities = A,B,AB, ø
= 4
= 22
Mealy Machine
Every Mealy Machine can define using 6 tuples. They are,
 Q = Finite set of state
 Ɛ = Finite non-empty set of Input Alphabets
 Δ = The set of Output Alphabets
 ƍ = Transition function from Q x Ɛ Q
 λ = Output function : Ɛ x Q Δ
 q0 = Initial state / Start state
A Mealy Machine is an FSM whose output depends on the present state as well as the
present input.
a/0
a/1
b/0
b/0
b/1
A
B
a/0
C
L = {Set of all strings ends with aa or bb}
Moore Machine
Every Moore Machine can define using 6 tuples. They are,
 Q = Finite set of state
 Ɛ = Finite non-empty set of Input Alphabets
 Δ = The set of Output Alphabets
 ƍ = Transition function from Q x Ɛ Q
 λ = Output function : Q Δ
 q0 = Initial state / Start state
Moore machine is a finite state machine in which the next state is decided by the current
state and current input symbol. The output symbol at a given time depends only on the
present state of the machine.
Moore Machine …
A/b B/b
1
01
Example
C/a
0
Construct a moore machine that prints ‘a’ whenever the sequence ‘01’ is encountered
in any input binary
Ɛ = {0,1}
Δ = {a,b}
Input String 0 1 0 1
A B C B C
b b a b a
0 1

More Related Content

What's hot

Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Sylvain Hallé
 
Computer notes - Sorting
Computer notes  - SortingComputer notes  - Sorting
Computer notes - Sortingecomputernotes
 
When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)Sylvain Hallé
 
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)Sylvain Hallé
 
Sorting and Searching - Data Structure - Notes
Sorting and Searching - Data Structure - NotesSorting and Searching - Data Structure - Notes
Sorting and Searching - Data Structure - NotesOmprakash Chauhan
 
Vi editor commands
Vi editor commandsVi editor commands
Vi editor commandsFemi Adeyemi
 
4 Type conversion functions
4 Type conversion functions4 Type conversion functions
4 Type conversion functionsDocent Education
 
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 3Srimatre K
 
Parametricity - #cljsyd - May, 2015
Parametricity - #cljsyd - May, 2015Parametricity - #cljsyd - May, 2015
Parametricity - #cljsyd - May, 2015Leonardo Borges
 
5 1 domain and range
5 1 domain and range5 1 domain and range
5 1 domain and rangehisema01
 
Infix to-postfix examples
Infix to-postfix examplesInfix to-postfix examples
Infix to-postfix examplesmua99
 

What's hot (20)

Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings
 
QUEUES
QUEUESQUEUES
QUEUES
 
Computer notes - Sorting
Computer notes  - SortingComputer notes  - Sorting
Computer notes - Sorting
 
When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)
 
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
 
Sorting and Searching - Data Structure - Notes
Sorting and Searching - Data Structure - NotesSorting and Searching - Data Structure - Notes
Sorting and Searching - Data Structure - Notes
 
2015.3.12 the root of lisp
2015.3.12 the root of lisp2015.3.12 the root of lisp
2015.3.12 the root of lisp
 
Vi editor commands
Vi editor commandsVi editor commands
Vi editor commands
 
Team 6
Team 6Team 6
Team 6
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
4 Type conversion functions
4 Type conversion functions4 Type conversion functions
4 Type conversion functions
 
Ss matlab solved
Ss matlab solvedSs matlab solved
Ss matlab solved
 
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
 
Parametricity - #cljsyd - May, 2015
Parametricity - #cljsyd - May, 2015Parametricity - #cljsyd - May, 2015
Parametricity - #cljsyd - May, 2015
 
Queue
QueueQueue
Queue
 
Matlab
MatlabMatlab
Matlab
 
FSharp Talk
FSharp TalkFSharp Talk
FSharp Talk
 
5 1 domain and range
5 1 domain and range5 1 domain and range
5 1 domain and range
 
Infix to-postfix examples
Infix to-postfix examplesInfix to-postfix examples
Infix to-postfix examples
 
Welcome vibrant-technology-navimumbai
Welcome vibrant-technology-navimumbaiWelcome vibrant-technology-navimumbai
Welcome vibrant-technology-navimumbai
 

Similar to Formalization Machines and Sastes

Automata theory introduction
Automata theory introductionAutomata theory introduction
Automata theory introductionNAMRATA 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).pdfFariyaTasneem1
 
Theory of automata
Theory of automataTheory of automata
Theory of automataArslan905905
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Mohammad Ilyas Malik
 
deterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdfdeterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdfAmayJaiswal4
 
Automata based programming
Automata based programmingAutomata based programming
Automata based programmingVisnuDharsini
 
Mealy and moore machine
Mealy and moore machineMealy and moore machine
Mealy and moore machineEhatsham Riaz
 
finiteautomata-160104102657.pptx
finiteautomata-160104102657.pptxfiniteautomata-160104102657.pptx
finiteautomata-160104102657.pptxStudyvAbhi
 
Finite State Machines with Output
Finite State Machines with OutputFinite State Machines with Output
Finite State Machines with OutputMustafa Saeed
 
Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1Srimatre K
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! EdholeEdhole.com
 
Free Ebooks Download ! Edhole
Free Ebooks Download ! EdholeFree Ebooks Download ! Edhole
Free Ebooks Download ! EdholeEdhole.com
 

Similar to Formalization Machines and Sastes (20)

CS 5th.pptx
CS 5th.pptxCS 5th.pptx
CS 5th.pptx
 
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
 
Theory of automata
Theory of automataTheory of automata
Theory of automata
 
5. NFA & DFA.pdf
5. NFA & DFA.pdf5. NFA & DFA.pdf
5. NFA & DFA.pdf
 
Ch2 finite automaton
Ch2 finite automatonCh2 finite automaton
Ch2 finite automaton
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
 
deterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdfdeterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdf
 
Automaton
AutomatonAutomaton
Automaton
 
TOC Introduction
TOC Introduction TOC Introduction
TOC Introduction
 
Automata based programming
Automata based programmingAutomata based programming
Automata based programming
 
Mealy and moore machine
Mealy and moore machineMealy and moore machine
Mealy and moore machine
 
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
 
finiteautomata-160104102657.pptx
finiteautomata-160104102657.pptxfiniteautomata-160104102657.pptx
finiteautomata-160104102657.pptx
 
Finite State Machines with Output
Finite State Machines with OutputFinite State Machines with Output
Finite State Machines with Output
 
Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
 
Finite automata
Finite automataFinite automata
Finite automata
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
 
Free Ebooks Download ! Edhole
Free Ebooks Download ! EdholeFree Ebooks Download ! Edhole
Free Ebooks Download ! Edhole
 

More from Lahiru Danushka

Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygonsLiang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygonsLahiru Danushka
 
Virtual Machines - Virtual Box
Virtual Machines  - Virtual BoxVirtual Machines  - Virtual Box
Virtual Machines - Virtual BoxLahiru Danushka
 
Human Computer Interaction (HCI)
Human Computer Interaction (HCI)Human Computer Interaction (HCI)
Human Computer Interaction (HCI)Lahiru Danushka
 
Dining Philosopher Problem and Solution
Dining Philosopher Problem and SolutionDining Philosopher Problem and Solution
Dining Philosopher Problem and SolutionLahiru Danushka
 
Election in Wireless Environment
Election in Wireless EnvironmentElection in Wireless Environment
Election in Wireless EnvironmentLahiru Danushka
 
Shuffle exchange networks
Shuffle exchange networksShuffle exchange networks
Shuffle exchange networksLahiru Danushka
 

More from Lahiru Danushka (7)

Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygonsLiang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
 
Virtual Machines - Virtual Box
Virtual Machines  - Virtual BoxVirtual Machines  - Virtual Box
Virtual Machines - Virtual Box
 
Human Computer Interaction (HCI)
Human Computer Interaction (HCI)Human Computer Interaction (HCI)
Human Computer Interaction (HCI)
 
Dining Philosopher Problem and Solution
Dining Philosopher Problem and SolutionDining Philosopher Problem and Solution
Dining Philosopher Problem and Solution
 
My Sql Work Bench
My Sql Work BenchMy Sql Work Bench
My Sql Work Bench
 
Election in Wireless Environment
Election in Wireless EnvironmentElection in Wireless Environment
Election in Wireless Environment
 
Shuffle exchange networks
Shuffle exchange networksShuffle exchange networks
Shuffle exchange networks
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Formalization Machines and Sastes

  • 2. Finite State Machine • Symbol  Ex: a, b, c, 0, 1, 2, 3, …. • Alphabet – Collection of symbols (Ɛ)  Ex: {a,b}, {0,1,2} • String – Sequence of symbols  Ex: a, b, 0, 1, aa, bb, ab, 01, ….
  • 3. Finite State Machine … • Language – Set of Strings  Ex: Ɛ = {0,1} L1 = set of all strings of length 2 = {00, 01, 10, 11} L2 = Set of all strings of length 3 = {000, 001, 010, 011, 100, 101, 110, 111} L3 = Set of all strings that begin with “0” = {0, 00, 01, 000, 001, ……} Finite Infinite
  • 4. Finite State Machine … Finite Automata F A without output F A with output DFA NFA Moore Machine Mealy Machine Ɛ - NFA
  • 5. DFA (Deterministic Finite Automata)  It is the simplest model of the computation  It has a very limited memory Every DFA can define using 5 tuples. They are,  Q = Set of states  Ɛ = Inputs  q0 = Start state or initial state  F = Set of final states  ƍ = Transition function from Q x Ɛ Q
  • 6. DFA (Deterministic Finite Automata) … • Q = {A, B, C, D} • Ɛ = {0, 1} • q0 = A • F = {D} A B C D 1 1 1 1 00 0 0 A C B B D A C A D D B C 0 1
  • 7. NFA (Non-Deterministic Finite Automata) Every NFA can define using 5 tuples. They are,  Q = Set of states - {A, B}  Ɛ = Inputs - {0, 1}  q0 = Start state or initial state - A  F = Set of final states - B  ƍ = Transition function from Q x Ɛ ? A B0 0, 1 • The machine can move to any combination of the states in the machine (the exact state to which the machine moves cannot be determined). • Hence, it is called Non-deterministic Automaton. • As it has finite number of states, the machine is called Non-deterministic Finite Machine or Non-deterministic Finite Automaton. L = {Set of all strings ends with 0}
  • 8. NFA (Non-Deterministic Finite Automata) A B0 0, 1 ƍ = Transition function from Q x Ɛ 2Q Little Exercise A x 0 A , B , A B A x 1 A B x 0 ø B x 1 ø Possibilities = A,B,AB, ø = 4 = 22
  • 9. Mealy Machine Every Mealy Machine can define using 6 tuples. They are,  Q = Finite set of state  Ɛ = Finite non-empty set of Input Alphabets  Δ = The set of Output Alphabets  ƍ = Transition function from Q x Ɛ Q  λ = Output function : Ɛ x Q Δ  q0 = Initial state / Start state A Mealy Machine is an FSM whose output depends on the present state as well as the present input. a/0 a/1 b/0 b/0 b/1 A B a/0 C L = {Set of all strings ends with aa or bb}
  • 10. Moore Machine Every Moore Machine can define using 6 tuples. They are,  Q = Finite set of state  Ɛ = Finite non-empty set of Input Alphabets  Δ = The set of Output Alphabets  ƍ = Transition function from Q x Ɛ Q  λ = Output function : Q Δ  q0 = Initial state / Start state Moore machine is a finite state machine in which the next state is decided by the current state and current input symbol. The output symbol at a given time depends only on the present state of the machine.
  • 11. Moore Machine … A/b B/b 1 01 Example C/a 0 Construct a moore machine that prints ‘a’ whenever the sequence ‘01’ is encountered in any input binary Ɛ = {0,1} Δ = {a,b} Input String 0 1 0 1 A B C B C b b a b a 0 1