SlideShare une entreprise Scribd logo
1  sur  13
Two-way DeterministicFinite Automata (2DFA) Presented By: HafsaNaseem
DFA Input is processed once from left to right. After an input has been read, the DFA decides whether the input is accepted or rejected. 2DFA ,[object Object]
As in the case of DFA, the 2DFA decides whether a given input is accepted or rejected.,[object Object]
What is 2DFA? The concept of 2DFA was originated by Rabin and Scott in 1997  2DFA is a generalized version of the DFA which can revisit characters already processed.
How 2DFA works? Two-way Finite Automata have a read head, which can move left or right over the input string.  Consists of the symbols of the input string as occupying cells of a finite tape, one symbol per cell.  The input string is enclosed in left and right endmarkers ⊣ and ⊢, which are not elements of the input alphabet Σ. The read head may not move outside of the endmarkers.
Structure of 2DFA
Formal Definition of 2DFA
Function δ takes a state and a symbol as arguments and returns a new state and a direction to move the head.  If δ(p, b) = (q, d), then whenever the machine is in state p and scanning a tape cell containing symbol b, it moves its head one cell in the direction d and enters state q.
Example: 2DFAs can be seen as read-only Turing machines with no work tape, only a read-only input tape Turing machine Move back and forth in the working tape while reading and/or writing. Has no limit to the amount of memory that it can use. As input becomes more complicated, it may use more memory to compute.
Informal description of a 2DFA accepting the set  A = {x ∈ {a, b}∗ | #a(x) is a multiple of 3 and #b(x) is even}.  counting the number of a’s mod 3 and ignoring the b’s.  counting the number of b’s mod 2 and ignoring the a’s.
How does DFA compare to 2DFA? The equivalent DFA for a 2DFA may have exponentially more states. 2DFA can solve any problems that are solvable by DFA. Next, are there problems that can be solved by 2DFA but cannot be solved by DFA It turns out that 2DFA can be significantly simpler in design for solving the same problem than DFA.
Why not 2DFA? Yes! 2DFA are realistic. Consumes less memory and time than DFA. Problems that can be solved by DFA can be solved by 2DFA Easy to implement/ much more powerful than DFA.
Thank You

Contenu connexe

Tendances

8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back tracking
Tech_MX
 
Context free grammars
Context free grammarsContext free grammars
Context free grammars
Ronak Thakkar
 

Tendances (20)

LINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptxLINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptx
 
Intro automata theory
Intro automata theory Intro automata theory
Intro automata theory
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
 
Lecture: Automata
Lecture: AutomataLecture: Automata
Lecture: Automata
 
Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFA
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back tracking
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
NFA to DFA
NFA to DFANFA to DFA
NFA to DFA
 
And or graph
And or graphAnd or graph
And or graph
 
NFA & DFA
NFA & DFANFA & DFA
NFA & DFA
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
sum of subset problem using Backtracking
sum of subset problem using Backtrackingsum of subset problem using Backtracking
sum of subset problem using Backtracking
 
Finite Automata in compiler design
Finite Automata in compiler designFinite Automata in compiler design
Finite Automata in compiler design
 
Ambiguous & Unambiguous Grammar
Ambiguous & Unambiguous GrammarAmbiguous & Unambiguous Grammar
Ambiguous & Unambiguous Grammar
 
Context free grammars
Context free grammarsContext free grammars
Context free grammars
 
Language for specifying lexical Analyzer
Language for specifying lexical AnalyzerLanguage for specifying lexical Analyzer
Language for specifying lexical Analyzer
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler designPeephole optimization techniques in compiler design
Peephole optimization techniques in compiler design
 

En vedette

Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raj Gupta
 
Chapter 2 2 1 1
Chapter 2 2 1 1Chapter 2 2 1 1
Chapter 2 2 1 1
bolovv
 
Chapter Two(1)
Chapter Two(1)Chapter Two(1)
Chapter Two(1)
bolovv
 

En vedette (20)

Deterministic Finite Automata
Deterministic Finite AutomataDeterministic Finite Automata
Deterministic Finite Automata
 
Introduction to fa and dfa
Introduction to fa  and dfaIntroduction to fa  and dfa
Introduction to fa and dfa
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
 
Deterministic Finite Automata
Deterministic Finite AutomataDeterministic Finite Automata
Deterministic Finite Automata
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
REGULAR EXPRESSION TO N.F.A
REGULAR EXPRESSION TO N.F.AREGULAR EXPRESSION TO N.F.A
REGULAR EXPRESSION TO N.F.A
 
PUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINEPUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINE
 
Hima1
Hima1Hima1
Hima1
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
 
Nfa to-dfa
Nfa to-dfaNfa to-dfa
Nfa to-dfa
 
Chapter 2 2 1 1
Chapter 2 2 1 1Chapter 2 2 1 1
Chapter 2 2 1 1
 
Ch3
Ch3Ch3
Ch3
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFA
 
Chapter Two(1)
Chapter Two(1)Chapter Two(1)
Chapter Two(1)
 
Finaal application on regular expression
Finaal application on regular expressionFinaal application on regular expression
Finaal application on regular expression
 
Finite automata
Finite automataFinite automata
Finite automata
 
Dfa 2 ppt
Dfa 2 pptDfa 2 ppt
Dfa 2 ppt
 
Automata 3
Automata 3Automata 3
Automata 3
 
Automata 1
Automata 1Automata 1
Automata 1
 
Automata 2
Automata 2Automata 2
Automata 2
 

Dernier

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Dernier (20)

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

Two-way Deterministic Finite Automata

  • 1. Two-way DeterministicFinite Automata (2DFA) Presented By: HafsaNaseem
  • 2.
  • 3.
  • 4. What is 2DFA? The concept of 2DFA was originated by Rabin and Scott in 1997 2DFA is a generalized version of the DFA which can revisit characters already processed.
  • 5. How 2DFA works? Two-way Finite Automata have a read head, which can move left or right over the input string. Consists of the symbols of the input string as occupying cells of a finite tape, one symbol per cell. The input string is enclosed in left and right endmarkers ⊣ and ⊢, which are not elements of the input alphabet Σ. The read head may not move outside of the endmarkers.
  • 8. Function δ takes a state and a symbol as arguments and returns a new state and a direction to move the head. If δ(p, b) = (q, d), then whenever the machine is in state p and scanning a tape cell containing symbol b, it moves its head one cell in the direction d and enters state q.
  • 9. Example: 2DFAs can be seen as read-only Turing machines with no work tape, only a read-only input tape Turing machine Move back and forth in the working tape while reading and/or writing. Has no limit to the amount of memory that it can use. As input becomes more complicated, it may use more memory to compute.
  • 10. Informal description of a 2DFA accepting the set A = {x ∈ {a, b}∗ | #a(x) is a multiple of 3 and #b(x) is even}. counting the number of a’s mod 3 and ignoring the b’s. counting the number of b’s mod 2 and ignoring the a’s.
  • 11. How does DFA compare to 2DFA? The equivalent DFA for a 2DFA may have exponentially more states. 2DFA can solve any problems that are solvable by DFA. Next, are there problems that can be solved by 2DFA but cannot be solved by DFA It turns out that 2DFA can be significantly simpler in design for solving the same problem than DFA.
  • 12. Why not 2DFA? Yes! 2DFA are realistic. Consumes less memory and time than DFA. Problems that can be solved by DFA can be solved by 2DFA Easy to implement/ much more powerful than DFA.