SlideShare a Scribd company logo
1 of 4
Shivalik College of Engineering
Question Bank
Subject: Theory of
Automata & Formal
Languages
Course Code: TCS-403
Branch: CSE Semester: IV
Unit - I
1. Define the following with suitable examples.
(a) Alphabet
(b) Language
(c) Kleene’s closure
(d) Positive closure
2. (i) Draw a block diagram to define automata. Also explain deterministic and non-deterministic
automata. What are the limitations & Applications of Finite Automata?
(ii) What do you know about compliment and reverse of a language? Explain both of these by
giving suitable examples.
3. (i) What is a generalized transition graph? Explain with a suitable example. Also explain Chomsky
heirarchy by taking suitable examples.
(ii) Define grammar and its types in theory of computation. Briefly explain Chomsky hierarchy.
4. Design a DFA over {0, 1} for the following:-
(i) that accepts the set of all strings such that the 3rd
symbol from the right end is 1.
(ii) that accepts the set of string not containing 011 as a sub string.
(iii) That accepts the set of string not ending with double letter.
5. Make a DFA that accepts the following languages over the alphabet Є = {0,1}
(a) No. of 1’s is even
(b) No. of 1 is odd
(c) No. of 1’s as well as 0’s is even
(d) No. of 1’s as well as 0’s is odd
6. Make a DFA for the following languages over the alphabet Є = {0,1}
(a) All strings of length atmost 5
(b) All strings with exactly two 1’s
(c) All strings containing atleast two 0’s
(d) All strings containing atmost two 0’s
(e) All strings starting with 1 and length of string is divisible by 3
7. (i)Design a DFA for a set of strings over the alphabet {0, 1} such that the number of 0s is divisible
by 5 and number of 1s is divisible by 3.
(ii)Design a DFA for the language containing strings over the alphabet {0, 1} in which leftmost
symbol differs from the rightmost symbol.
(iii)Design a DFA for set of all strings over {a, b} ending in
(a) eitherab or ba.
(b) Either aa or bb.
(c) Neither aa or bb.
Unit – II
1. What do you understand by “Finite automata with output function “? What is the output function
for Mealy and Moore machine? Also define these 2 machines.
2. Differentiate between
(i) Moore machine and Mealy machine by taking a suitable example.
Shivalik College of Engineering
Question Bank
Subject: Theory of
Automata & Formal
Languages
Course Code: TCS-403
Branch: CSE Semester: IV
(ii) DFA & NFA
3. Construct a Mealy Machine for the following and then convert them into equivalent Moore
machines
(a) which can output EVEN, ODD accordingly as the total number of 1s encountered is even or
odd. The input symbols are 0 & 1.
(b) that gives an output 1 if the input string ends in bab.
4. Construct a Moore Machine for the following and then convert them into equivalent Mealy
machines.
(a) that gives an output 1 if the input string ends in bab.
(b) that accepts strings ending in “00” and “11”.
5. Design NFA to recognize the following sets of string : abc, abd, and aacd. Assume the alphabet is
{a,b,c,d}.
6. Define regular expression. Also give regular expression generating the following Languages over ∑ =
{0,1}
(i) L1= {w|w contains atleast three 1’s}
(ii) L2= {w|w has length at least 3 and its third symbol is 0}
(iii) L3= {w|w doesn’t contain the substring
(iv) L4= {w|every odd position of w is a 1}
(iv) L5= {w|w contains atleast two 0’s and at most one 1’s}
7. Consider the following Transition Table of an NFA. Convert it into its equivalent DFA.
(i) δ 0 1
->p p, r p
q r, s q
r* p, q r
s* q, r ф
(ii)
8. Determine the total number of States in the Minimalistic DFA for the given DFA.
Unit – III
1. Give the Formal definitions for the following: -
Shivalik College of Engineering
Question Bank
Subject: Theory of
Automata & Formal
Languages
Course Code: TCS-403
Branch: CSE Semester: IV
Context Free Grammar, Context Free Language, Context Sensitive Grammar, Chomsky Normal
Form, Greibach Normal Form
2. Simplify the given grammar
(a) S->0A0|1B1|BB, A->C, B->S|A, C->S|ε
(b) S->aAa, A->Sb|bCC, C->abb, E->aC
(c) S→aAa , A→bBB, B→ab , C→aB
(d) S→AB, A→a, B→C|b, C→D, D→E, E→a
3. Consider the Grammar : S→aB|bA, A→aS|bAA|a, B→bS|aBB|b
For the string “aaabbabbba” find
(a) Leftmost derivation
(b) Rightmost derivation
(c) Parse Tree
4. Find the Context Free Grammars for the following languages:
(a) L = { an
bn
: n <= m+3, n, m>=0)}
(b) L = {w belongs to (a+b)*
: na(w)!= nb(w)}
(c) L = {a*b*}
5. What do you understand by Ambiguous Grammar? Prove that -
(a) G is ambiguous, if G is the grammar S → S b s |a
(b) G is ambiguous, if G is the grammar S → a S b| SS |λ
(c) G is ambiguous, if G is the grammar S → AB | aaB, A → a | Aa, B → b
(d) G is ambiguous, if G is the grammar S→a|abSb|aAb, A→bS|aAAb
(e) G is ambiguous, if G is the grammar S→aB|ab, A→aAB, B→ABb|b
6. Obtain the equivalent CNF for the given Grammar.
(a) S → ABa, A → aab, B → AC
(b) S→AA|0 , A→SS|1
(c) S→ASA|Ba, A→B|S, B→c
(d) S→1A|0B, A→1AA|0S|0, B→0BB|1s|1
(e) S→a|abSb|aAb, A→bS|aAAb
Unit – IV
1. (a)Define Pushdown Automation (PDA). Draw the model of PDA and explain its working. Is there any
difference between FA and PDA, explain it.
(b)What do you understand by Auxiliary PDA? Explain with the help of a neat diagram. Also explain 2-PDA.
2. Show that the language L = {0n
1n
: n>=1} U{0n
12n
: n>=1} is a Context Free Language that is not
accepted by any Deterministic PDA.
3. Construct a CFG generating each of the following language and hence a PDA accepting each of them by
empty store
(i) {a
n
b
n
such that n>=1} ᴜ { a
m
b
2m
such that m>=1}
(ii) { a
n
b
m
a
n
such that m,n>=1}ᴜ {a
n
c
n
such that n ≥ 1}
(iii) {x such that na(x)>=nb(x)}
4. Construct nondeterministic push down automata that accepts the following languages on ∑ = {a, b}.
(i) L= { a
n
b
2n
: n≥1 }
(ii) L= {W: na(w) = nb(w+1) }
(iii) L= { a
n
b
m
c
p
: p=m+n, m,n,p≥1}
Shivalik College of Engineering
Question Bank
Subject: Theory of
Automata & Formal
Languages
Course Code: TCS-403
Branch: CSE Semester: IV
(iv) L= { a
n
b
m
c
p
: p>m+n, m,n,p≥1}
(v) L= { a
n
b
m
c
p
: p<m+n, m,n,p≥1}
(vi) L= { a
n
b
m
c
m
d
n
: m,n,≥1} L = {w : na(w) = nb(w+1)}
(vii) L = {w : na(w) <= nb(w)}
5. Construct a PDA corresponding to the following grammar:
(a) S→ aAA, A → aS|bS|a
(b) S→ aSbb|aab
(c) S→aSb|A, A→bSa|S|ᴜ
Unit – V
1. (a)Design a TM which accepts all strings of the form an
bn
for n>=1 and rejects all other strings?
(b)Design a TM to check whether a string over {a b} contains equal no of a’s and b’s?
(c)Design a TM to increment a binary number by 1?
(d)Design a Turing Machine that accepts the language L over an alphabet {a, b}* that consists of
all strings with an even number of a’s and even number of b’s.
2. Explain the following
(i) Universal Turing machine
(ii) Church’s Hypothesis
(iii) Recursive function theory
(iv) Recursive and Recursively Enumerable language
(v) Properties of RL & REL.
(vi) Unsolvable Decision Problems
(vii) Post Correspondence Problem
(viii) Halting problem of Turing Machine.
3. Prove the following.
(i) If L is a recursive language over Σ show that L’ (L’ defined as Σ – L ) is also recursive
(ii) If L and L’ (compliment of L) are both recursively enumerable. Show that L and L’ are recursive.
(iii) The Union of two Recursively Enumerable languages is Recursively Enumerable and union of two
Recursive languages is Recursive.
4. Define Turing Machine and Universal Turing Machine using suitable diagrams. Explain the language
acceptability by turing machine in short. What are the steps to construct a type-0 grammar generating the
set accepted by a given Turing Machine.
5. Give the complete hierarchy of Grammar with their recognizers as well as the form of production rules?

More Related Content

What's hot

Theory of computing
Theory of computingTheory of computing
Theory of computing
Ranjan Kumar
 
Introduction to the theory of computation
Introduction to the theory of computationIntroduction to the theory of computation
Introduction to the theory of computation
prasadmvreddy
 

What's hot (20)

Cs6503 theory of computation november december 2015 be cse anna university q...
Cs6503 theory of computation november december 2015  be cse anna university q...Cs6503 theory of computation november december 2015  be cse anna university q...
Cs6503 theory of computation november december 2015 be cse anna university q...
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 
Theory of computing
Theory of computingTheory of computing
Theory of computing
 
Theory of computing
Theory of computingTheory of computing
Theory of computing
 
Theory of Computation Grammar Concepts and Problems
Theory of Computation Grammar Concepts and ProblemsTheory of Computation Grammar Concepts and Problems
Theory of Computation Grammar Concepts and Problems
 
Automata
AutomataAutomata
Automata
 
Cs6503 theory of computation november december 2016
Cs6503 theory of computation november december 2016Cs6503 theory of computation november december 2016
Cs6503 theory of computation november december 2016
 
Introduction to the theory of computation
Introduction to the theory of computationIntroduction to the theory of computation
Introduction to the theory of computation
 
Analysis and design of algorithms part 3
Analysis and design of algorithms part 3Analysis and design of algorithms part 3
Analysis and design of algorithms part 3
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Minimizing DFA
Minimizing DFAMinimizing DFA
Minimizing DFA
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture Notes
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
 
3.1 intro toautomatatheory h1
3.1 intro toautomatatheory  h13.1 intro toautomatatheory  h1
3.1 intro toautomatatheory h1
 
Types of Language in Theory of Computation
Types of Language in Theory of ComputationTypes of Language in Theory of Computation
Types of Language in Theory of Computation
 
Flat unit 3
Flat unit 3Flat unit 3
Flat unit 3
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
 
Cs 73
Cs 73Cs 73
Cs 73
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammar
 

Viewers also liked

Can Crusher Project
Can Crusher ProjectCan Crusher Project
Can Crusher Project
Ali Taheri
 

Viewers also liked (20)

Automata Theory
Automata TheoryAutomata Theory
Automata Theory
 
Cs6503 theory of computation index page
Cs6503 theory of computation index pageCs6503 theory of computation index page
Cs6503 theory of computation index page
 
All possible questions - KINEMATICS OF MACHINERY / UNIT – I
All possible questions - KINEMATICS OF MACHINERY / UNIT – IAll possible questions - KINEMATICS OF MACHINERY / UNIT – I
All possible questions - KINEMATICS OF MACHINERY / UNIT – I
 
Crank Sliding Link Cylinder Mechanism
Crank Sliding Link Cylinder MechanismCrank Sliding Link Cylinder Mechanism
Crank Sliding Link Cylinder Mechanism
 
Can Crusher Project
Can Crusher ProjectCan Crusher Project
Can Crusher Project
 
DNB Pediatrics Theory Question Bank 2000-2007
DNB Pediatrics Theory Question Bank 2000-2007DNB Pediatrics Theory Question Bank 2000-2007
DNB Pediatrics Theory Question Bank 2000-2007
 
DNB Pediatrics Theory Question Bank 2007-2010
DNB Pediatrics Theory Question Bank 2007-2010DNB Pediatrics Theory Question Bank 2007-2010
DNB Pediatrics Theory Question Bank 2007-2010
 
Slider Crank Mechanism for Four bar linkage
Slider Crank Mechanism for Four bar linkageSlider Crank Mechanism for Four bar linkage
Slider Crank Mechanism for Four bar linkage
 
Cs6702 graph theory and applications question bank
Cs6702 graph theory and applications question bankCs6702 graph theory and applications question bank
Cs6702 graph theory and applications question bank
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
 
Slider crank
Slider crankSlider crank
Slider crank
 
Dynamics of Machines: Question bank unitwise from vtu old question papers
Dynamics of Machines: Question bank unitwise from vtu old question papersDynamics of Machines: Question bank unitwise from vtu old question papers
Dynamics of Machines: Question bank unitwise from vtu old question papers
 
THEORY OF MACHINES I QUESTION BANK
THEORY OF MACHINES I QUESTION BANK THEORY OF MACHINES I QUESTION BANK
THEORY OF MACHINES I QUESTION BANK
 
Four Bar Mechanism
Four Bar MechanismFour Bar Mechanism
Four Bar Mechanism
 
Notes 2D-Transformation Unit 2 Computer graphics
Notes 2D-Transformation Unit 2 Computer graphicsNotes 2D-Transformation Unit 2 Computer graphics
Notes 2D-Transformation Unit 2 Computer graphics
 
FOUR BAR CHAIN AND INVERSIONS
FOUR BAR CHAIN AND INVERSIONSFOUR BAR CHAIN AND INVERSIONS
FOUR BAR CHAIN AND INVERSIONS
 
Inversion of Mechanisms: Theory of Machines With Videos
Inversion of Mechanisms: Theory of Machines With VideosInversion of Mechanisms: Theory of Machines With Videos
Inversion of Mechanisms: Theory of Machines With Videos
 
Theory of machines by rs. khurmi_ solution manual _ chapter 11
Theory of machines by rs. khurmi_ solution manual _ chapter 11Theory of machines by rs. khurmi_ solution manual _ chapter 11
Theory of machines by rs. khurmi_ solution manual _ chapter 11
 
Speed Governers
Speed GovernersSpeed Governers
Speed Governers
 
Can Crusher Device - Theory of Machines Mini-Project
Can Crusher Device - Theory of Machines Mini-ProjectCan Crusher Device - Theory of Machines Mini-Project
Can Crusher Device - Theory of Machines Mini-Project
 

Similar to Question bank toafl

Expected Questions TC
Expected Questions TCExpected Questions TC
Expected Questions TC
SANTOSH RATH
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tc
SANTOSH RATH
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tc
SANTOSH RATH
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tc
SANTOSH RATH
 
9 a05407 formal_languages_automata_theor_yfr_2029
9 a05407 formal_languages_automata_theor_yfr_20299 a05407 formal_languages_automata_theor_yfr_2029
9 a05407 formal_languages_automata_theor_yfr_2029
Rajesh Yaramadi
 
Csr2011 june17 15_15_kaminski
Csr2011 june17 15_15_kaminskiCsr2011 june17 15_15_kaminski
Csr2011 june17 15_15_kaminski
CSR2011
 

Similar to Question bank toafl (20)

Problem set2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set2 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurProblem set2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Problem set1 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set1 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurProblem set1 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set1 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Expected Questions TC
Expected Questions TCExpected Questions TC
Expected Questions TC
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tc
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tc
 
Expected questions tc
Expected questions tcExpected questions tc
Expected questions tc
 
TOC question bank.pdf
TOC question bank.pdfTOC question bank.pdf
TOC question bank.pdf
 
V cse cs6503 model qb1 1
V  cse cs6503  model qb1 1V  cse cs6503  model qb1 1
V cse cs6503 model qb1 1
 
Model toc
Model tocModel toc
Model toc
 
Automata And Compiler Design
Automata And Compiler DesignAutomata And Compiler Design
Automata And Compiler Design
 
Compiler worksheet
Compiler worksheetCompiler worksheet
Compiler worksheet
 
PART A.doc
PART A.docPART A.doc
PART A.doc
 
TOC_Solutions-Adi.pdf
TOC_Solutions-Adi.pdfTOC_Solutions-Adi.pdf
TOC_Solutions-Adi.pdf
 
TOC Solutions-Adi.pdf
TOC Solutions-Adi.pdfTOC Solutions-Adi.pdf
TOC Solutions-Adi.pdf
 
TOC_Solutions-Adi.pdf
TOC_Solutions-Adi.pdfTOC_Solutions-Adi.pdf
TOC_Solutions-Adi.pdf
 
9 a05407 formal_languages_automata_theor_yfr_2029
9 a05407 formal_languages_automata_theor_yfr_20299 a05407 formal_languages_automata_theor_yfr_2029
9 a05407 formal_languages_automata_theor_yfr_2029
 
Assigment cd1
Assigment cd1Assigment cd1
Assigment cd1
 
Assigment1
Assigment1Assigment1
Assigment1
 
Csr2011 june17 15_15_kaminski
Csr2011 june17 15_15_kaminskiCsr2011 june17 15_15_kaminski
Csr2011 june17 15_15_kaminski
 
Unit-1-part-1.pptx
Unit-1-part-1.pptxUnit-1-part-1.pptx
Unit-1-part-1.pptx
 

More from Shivalik college of engineering

More from Shivalik college of engineering (20)

Front pages of practical file
Front pages of practical fileFront pages of practical file
Front pages of practical file
 
Algorithms Question bank
Algorithms Question bankAlgorithms Question bank
Algorithms Question bank
 
Video streaming
Video streamingVideo streaming
Video streaming
 
Infosystestpattern
InfosystestpatternInfosystestpattern
Infosystestpattern
 
Mydbms
MydbmsMydbms
Mydbms
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Net overview
Net overviewNet overview
Net overview
 
java vs C#
java vs C#java vs C#
java vs C#
 
stack presentation
stack presentationstack presentation
stack presentation
 
sear
searsear
sear
 
Dbms lab file format front page
Dbms lab file format front pageDbms lab file format front page
Dbms lab file format front page
 
computer architecture.
computer architecture.computer architecture.
computer architecture.
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
SQA presenatation made by krishna ballabh gupta
SQA presenatation made by krishna ballabh guptaSQA presenatation made by krishna ballabh gupta
SQA presenatation made by krishna ballabh gupta
 
Webapplication ppt prepared by krishna ballabh gupta
Webapplication ppt prepared by krishna ballabh guptaWebapplication ppt prepared by krishna ballabh gupta
Webapplication ppt prepared by krishna ballabh gupta
 
Cloud computing prepare by krishna ballabh gupta
Cloud computing prepare by krishna ballabh guptaCloud computing prepare by krishna ballabh gupta
Cloud computing prepare by krishna ballabh gupta
 
Cloud computing kb gupta
Cloud computing kb guptaCloud computing kb gupta
Cloud computing kb gupta
 
comparing windows and linux ppt
comparing windows and linux pptcomparing windows and linux ppt
comparing windows and linux ppt
 
Gsm an introduction....
Gsm an introduction....Gsm an introduction....
Gsm an introduction....
 
Gsm an introduction....
Gsm an introduction....Gsm an introduction....
Gsm an introduction....
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Question bank toafl

  • 1. Shivalik College of Engineering Question Bank Subject: Theory of Automata & Formal Languages Course Code: TCS-403 Branch: CSE Semester: IV Unit - I 1. Define the following with suitable examples. (a) Alphabet (b) Language (c) Kleene’s closure (d) Positive closure 2. (i) Draw a block diagram to define automata. Also explain deterministic and non-deterministic automata. What are the limitations & Applications of Finite Automata? (ii) What do you know about compliment and reverse of a language? Explain both of these by giving suitable examples. 3. (i) What is a generalized transition graph? Explain with a suitable example. Also explain Chomsky heirarchy by taking suitable examples. (ii) Define grammar and its types in theory of computation. Briefly explain Chomsky hierarchy. 4. Design a DFA over {0, 1} for the following:- (i) that accepts the set of all strings such that the 3rd symbol from the right end is 1. (ii) that accepts the set of string not containing 011 as a sub string. (iii) That accepts the set of string not ending with double letter. 5. Make a DFA that accepts the following languages over the alphabet Є = {0,1} (a) No. of 1’s is even (b) No. of 1 is odd (c) No. of 1’s as well as 0’s is even (d) No. of 1’s as well as 0’s is odd 6. Make a DFA for the following languages over the alphabet Є = {0,1} (a) All strings of length atmost 5 (b) All strings with exactly two 1’s (c) All strings containing atleast two 0’s (d) All strings containing atmost two 0’s (e) All strings starting with 1 and length of string is divisible by 3 7. (i)Design a DFA for a set of strings over the alphabet {0, 1} such that the number of 0s is divisible by 5 and number of 1s is divisible by 3. (ii)Design a DFA for the language containing strings over the alphabet {0, 1} in which leftmost symbol differs from the rightmost symbol. (iii)Design a DFA for set of all strings over {a, b} ending in (a) eitherab or ba. (b) Either aa or bb. (c) Neither aa or bb. Unit – II 1. What do you understand by “Finite automata with output function “? What is the output function for Mealy and Moore machine? Also define these 2 machines. 2. Differentiate between (i) Moore machine and Mealy machine by taking a suitable example.
  • 2. Shivalik College of Engineering Question Bank Subject: Theory of Automata & Formal Languages Course Code: TCS-403 Branch: CSE Semester: IV (ii) DFA & NFA 3. Construct a Mealy Machine for the following and then convert them into equivalent Moore machines (a) which can output EVEN, ODD accordingly as the total number of 1s encountered is even or odd. The input symbols are 0 & 1. (b) that gives an output 1 if the input string ends in bab. 4. Construct a Moore Machine for the following and then convert them into equivalent Mealy machines. (a) that gives an output 1 if the input string ends in bab. (b) that accepts strings ending in “00” and “11”. 5. Design NFA to recognize the following sets of string : abc, abd, and aacd. Assume the alphabet is {a,b,c,d}. 6. Define regular expression. Also give regular expression generating the following Languages over ∑ = {0,1} (i) L1= {w|w contains atleast three 1’s} (ii) L2= {w|w has length at least 3 and its third symbol is 0} (iii) L3= {w|w doesn’t contain the substring (iv) L4= {w|every odd position of w is a 1} (iv) L5= {w|w contains atleast two 0’s and at most one 1’s} 7. Consider the following Transition Table of an NFA. Convert it into its equivalent DFA. (i) δ 0 1 ->p p, r p q r, s q r* p, q r s* q, r ф (ii) 8. Determine the total number of States in the Minimalistic DFA for the given DFA. Unit – III 1. Give the Formal definitions for the following: -
  • 3. Shivalik College of Engineering Question Bank Subject: Theory of Automata & Formal Languages Course Code: TCS-403 Branch: CSE Semester: IV Context Free Grammar, Context Free Language, Context Sensitive Grammar, Chomsky Normal Form, Greibach Normal Form 2. Simplify the given grammar (a) S->0A0|1B1|BB, A->C, B->S|A, C->S|ε (b) S->aAa, A->Sb|bCC, C->abb, E->aC (c) S→aAa , A→bBB, B→ab , C→aB (d) S→AB, A→a, B→C|b, C→D, D→E, E→a 3. Consider the Grammar : S→aB|bA, A→aS|bAA|a, B→bS|aBB|b For the string “aaabbabbba” find (a) Leftmost derivation (b) Rightmost derivation (c) Parse Tree 4. Find the Context Free Grammars for the following languages: (a) L = { an bn : n <= m+3, n, m>=0)} (b) L = {w belongs to (a+b)* : na(w)!= nb(w)} (c) L = {a*b*} 5. What do you understand by Ambiguous Grammar? Prove that - (a) G is ambiguous, if G is the grammar S → S b s |a (b) G is ambiguous, if G is the grammar S → a S b| SS |λ (c) G is ambiguous, if G is the grammar S → AB | aaB, A → a | Aa, B → b (d) G is ambiguous, if G is the grammar S→a|abSb|aAb, A→bS|aAAb (e) G is ambiguous, if G is the grammar S→aB|ab, A→aAB, B→ABb|b 6. Obtain the equivalent CNF for the given Grammar. (a) S → ABa, A → aab, B → AC (b) S→AA|0 , A→SS|1 (c) S→ASA|Ba, A→B|S, B→c (d) S→1A|0B, A→1AA|0S|0, B→0BB|1s|1 (e) S→a|abSb|aAb, A→bS|aAAb Unit – IV 1. (a)Define Pushdown Automation (PDA). Draw the model of PDA and explain its working. Is there any difference between FA and PDA, explain it. (b)What do you understand by Auxiliary PDA? Explain with the help of a neat diagram. Also explain 2-PDA. 2. Show that the language L = {0n 1n : n>=1} U{0n 12n : n>=1} is a Context Free Language that is not accepted by any Deterministic PDA. 3. Construct a CFG generating each of the following language and hence a PDA accepting each of them by empty store (i) {a n b n such that n>=1} ᴜ { a m b 2m such that m>=1} (ii) { a n b m a n such that m,n>=1}ᴜ {a n c n such that n ≥ 1} (iii) {x such that na(x)>=nb(x)} 4. Construct nondeterministic push down automata that accepts the following languages on ∑ = {a, b}. (i) L= { a n b 2n : n≥1 } (ii) L= {W: na(w) = nb(w+1) } (iii) L= { a n b m c p : p=m+n, m,n,p≥1}
  • 4. Shivalik College of Engineering Question Bank Subject: Theory of Automata & Formal Languages Course Code: TCS-403 Branch: CSE Semester: IV (iv) L= { a n b m c p : p>m+n, m,n,p≥1} (v) L= { a n b m c p : p<m+n, m,n,p≥1} (vi) L= { a n b m c m d n : m,n,≥1} L = {w : na(w) = nb(w+1)} (vii) L = {w : na(w) <= nb(w)} 5. Construct a PDA corresponding to the following grammar: (a) S→ aAA, A → aS|bS|a (b) S→ aSbb|aab (c) S→aSb|A, A→bSa|S|ᴜ Unit – V 1. (a)Design a TM which accepts all strings of the form an bn for n>=1 and rejects all other strings? (b)Design a TM to check whether a string over {a b} contains equal no of a’s and b’s? (c)Design a TM to increment a binary number by 1? (d)Design a Turing Machine that accepts the language L over an alphabet {a, b}* that consists of all strings with an even number of a’s and even number of b’s. 2. Explain the following (i) Universal Turing machine (ii) Church’s Hypothesis (iii) Recursive function theory (iv) Recursive and Recursively Enumerable language (v) Properties of RL & REL. (vi) Unsolvable Decision Problems (vii) Post Correspondence Problem (viii) Halting problem of Turing Machine. 3. Prove the following. (i) If L is a recursive language over Σ show that L’ (L’ defined as Σ – L ) is also recursive (ii) If L and L’ (compliment of L) are both recursively enumerable. Show that L and L’ are recursive. (iii) The Union of two Recursively Enumerable languages is Recursively Enumerable and union of two Recursive languages is Recursive. 4. Define Turing Machine and Universal Turing Machine using suitable diagrams. Explain the language acceptability by turing machine in short. What are the steps to construct a type-0 grammar generating the set accepted by a given Turing Machine. 5. Give the complete hierarchy of Grammar with their recognizers as well as the form of production rules?