Toc Sample Question
Toc Sample Question
USN BCS503
Note: 1. Answer any FIVEfull questions, choosing ONE fullquestion from each module
2. M: Marks, L: Bloom's level, C: Course outcomes.
Module - MLC
Q.1 Define the following with example 3 L1 CO1
i) Language ii) String ii) Power of an alphabet.
b. Define DFA. Draw a DFA to accepts. 10 L3 CO1
1) The set of all strings that contain a substring aba.
ii) To accept the stings of a's and b's that contain not more than there b's.
iii) L= {wefa. b} :No 2 consecutive characters are same in w}.
Convert the following NFA to DFA. 7 L2 CO1
PP, q} {p}
{r} {r}
{s}
S {s} {s}
OR
Q.2 2. Define the following with example : 3 L1 CO1
i) Alphabet
ii) Reversal of string
iii) Concatenation of Languages.
b Design a DFA for the Language : L3 Coi
L= {w E {0, 1}*:w is a string divisible by 5}.
Define NFA. Obtain an[ NFA which accepts strings consisting of 0 or 10 L2 CO1
more a's , followed by 0 or more b's followed by 0 or more C's. Also
convert it to DFA.
Module -2
Q.3 a Define Regular expression. Write the regular expression for the following 10| L2 CO2
languages :
i) Strings of a's and b's starting with a and ending with b.
ii) Set of strings that consists of alternating 0's and I's.
ii) L = fa bm , (n + m) is even}.
iv) L= (w:/w/mod 3 =0, where we{a, b}*}.
1of 3
BCSS03
GE
GF G
HG D
OR
Q.4 a. Construct [ - NFAfor the following Regular express ion: L1 C02
i) (0+ 1)0 1(1 +0) ü) 1(0 + 1) 0 ii) (0 +)011
b. Obtain the Regular expression that denotes the language accepted by6 L3 CO2
Fig. 4(b).
Fig. Q4(b)
o
State the Pumping Lemma for the Regular Languages. And also prove that L1 CO2
the following languages are note regular.
i) L= {0" 1"n s m} ii) L= {0" 1" 2"|n, m> 1}.
Module -3
Q.5 a. Design CFG for the following languages : 10 L3 CO3
i) L= fa"b,n> }
ii) L={a'b ,j=j+k, i>0, k>0}
iii) L= {w//w/ mod 3 > 0 where w e(a) *}
iv) L= {a" b" / m n}
v) Palinderomes over 0 and 1.
2 of3
BH
CO2
BCS 03
BCSS03
3of 3
HE
HCS503
ModelQuestion Paper-1with effect from 2022-23 (CBCS Scheme)
Note: o1. Answer any FIVE full questions, choosing at least ONE question from cach MODULE.
02. Draw transition diagrams wherever nccessary.
*Bloom's COs
Module -1 Taxonomy Marks
Level
L3 CO1
Q01, Obtain a DFA to accept strings of a's and b's having odd number
of a's and even number of b's.
L3 COI
b Draw a DFAto accept decimal strings divisible by 3. COI 9
L2
Dgfine the following terms with example:
Aiplhabet i) Power of Alphabet ii) Languages
OR
Obtain an (- NFAwhich accepts strings consisting of zero or morc a's L3 CO1
Q.02
followed by zero or more b's followed by zero or morc c's. M
L2 CoI 6
BDefine Deterministic Finite Automata. Explain the two preferred
notations for describing the Transition Function with an example. CO1
ctObtain aDFA for the following NFA using lazy evaluation method. L3
Module-2
). 03 a)| List applications of RE. What are the notations used in UNIX Operation L2 C02
system? List few Regular expressions with its UNIX notations.
b Obtain an E-NFA forthe Regular Expression (a+b)* bb (a+b)" L3 CO2 9
L3 CO2
Find the minimized DFA of the following.
B A
B
OR
).04a/ Define Pumping Lemma. Prove that below 1anguage is not a regular L2 CO2 5
ii)Accept strings of a's and b's containing not more than 3 a's.
1Find Regular language acccptcd by the following FA by L3 CO2
eliminating states?
Page 01 of 02
(4)
Module-3 L3 CO3
Techniques for reducing
grammar? Explain the
Q. 05 What is ambiguous suitable examples. CO3
ambiguity in the gramnur with
L3
ambiguous by taking the string aab.
b Show that the following grammar is CO3
S’ aS aSbSc L3
for the following Languagcs.
Design the Context Free Grammar threg a's
strings with no more than
i) To accept the set of all
when - (a, b}. number ofa's and b's
ii) To accept the set of' strings with any
with at lcast one a.
OR L3 CO3
corresponding PDA
). 06 For the below Grammar obtain the B’ bA |b, C’a
S’ aABC, A’ aB|a, L3 CO3
Page 02 of 02
sCSS03
L=fa'b' n > . Draw the transition diagram and show the moves made
by TM or the string: "aaaabbbb.
COS
Design a Turing Machine to accept strings formed on {0,1* and
ending wvith 000. Write transition diagram and sequence of IDs for
W= 101000
"Bloom's Taxonomy Level: Indicate as LI, L2, L3, L4, ete. It is also desirable to indicate the COs and
POs to be
attained by every bit of questions.
Page 03 of 02
BCSAI3
Model Question Paper with effect from 2024-25 (CBCS Seheme)
USN
1 0,1
42
OR
Q.02 L3 10
A B A
B A
C D
*D D A
E D
F G E
Page 01 ef 62
BCSS03
G G
H G D
OR 10
L2
Q04 a State and prove pumping lemma Theorem not regular
Show that,L= {WW* | WE{a,b) *}} is
L3 10
b Show that regular languages are closed under
1. Union,concatenation and Kleens star
Intersection and Difference
Module-3
10
shown and get the L3
0. 05 a i. Obtain the unambiguous grammar for the grammar
derivation for the expression (a+b)*(a-b).
E’ E+E| E-E
E’ E*E| E/E
E’ (E)|I
I’ ab<c
Consider the following grammar
S’ AbB
A ’aA |¬
B> aB | bB |¬ "aaabab
Give LMD and RMD and Parse tree for the string
L3 10
{WCW*|We(a+b)*}
b a) Design a PDAfor accepting a palindrome L(M) =
where W* is reverse of W and show ID for the string aab"
OR
L2 10
0.06 a Construct CFG for the following languages
i) L={0n1m | n>-0,m>=0}
ii) L= {ww* | WE {a,b) *}}
of"101"}
iii) L= { ww¬ {0,1 }* with atleast one occurance
number of a's and b's }
iv)L= {strings of a's and b's with equal strings 0's and 1's haing a
V) Obtain a grammar to generate a language of
substring 000 L3 10
b|Define with example
Grammar
Derivation
iii. Leftmost and Rightmost derivation
IV. Ambiguous grammar
V. Parse tree
Module-4
L3 10
). 07 a S ’al aA|B
A ’ aBB&
B ’ Aa | b
Convert the above grammar to CNF L3 10
b S’ Sa Sbl aA|B
A ’Abl aBB|ab
B’ Balbb
Eliminate left recursion.
Page 01 of 02
BCS401
OR
L3 10
Q 08 a
A BC
B CAa
B AB| b
Convert the above grammar to GNF L3 10
b Show that CFLis not closed under union, Concatenation, star and
omplimentation
Module-5
Explain The Church-Turing machine with ncat a d1agram L2 10
0. 09 a
i. Expain Multiple TM witha ncat diagram
bDetinc Turing Machine (TM). Design a TM lor language L-{O" 1|n>=0} L3 10
Showthat the string 001| is accepted
OR
Q 10a Definc Turing Machinc (TM) Design a TM for language L-{1" 2" 3" n>=l} L4 12
Show that the string 1222333 is accepted
bDemonstrate the model ofLincar bound automata(LBA) with ncat dagram L3 08
Page 02 of 02
Model Question Paper-1 with effect BCSS03
USN from 2022-23 (CBCS Scheme)
’ A
B A
C B
*D A
D
F G E
H GD
G
OR
Q.04 Define Pumping Lemma. Prove that below language is not a regular L2 C02
Language. L={a b|i>jL
Develop Regular expressions for the following Languages on E=a, b) L3 CO2 6
i)Accept strings ofa's and b's whose fifth symbol from the right end is
ii) Accept strings of a's and b's containing not morethan 3 a's.
Find Regular language accepted by the following FA by L3 CO2 9
eliminating states?
Page 01 of 02
BCSS03
42)
Module-3
a What is ambiguous grammar? Explain the Techniques for reducing L3 CO3
Q. 05
ambiguity in the grammar with suitable examples.
L3 CO3 6
Show that the following grammar is ambiguous by taking the string aab.
S ’ aS | aSbS ¬ 9
L3 CO3
C Design the Context Free Grammar for the following Languages.
i) To accept the set of all strings with no more than three a's
when E= {a, b}.
ii) To accept the set of strings with any number of a's and b's
with at least one a.
OR
L3 CO3
Q. 06 For the below Grammar obtain the corresponding PDA
S’ aABC, A ’> aB |a, B’ bA |b, C’a
L3 CO3 6
b Let G be the Grammar
S’ aB | bA
A ’alaS | bAA
B ’b|bS | aBB
For the string aabbabab, find
i)Derivation Tree i) Leftmost Derivation ii) Rightmost Derivation L3 CO3
Define CFG. Design CFG for the following Languages:
i) Consisting of set of allnon-palindromes over L={a,b}
ii) L={0°1**! |n0}
ii)L = {wew : wefa,b}*, w is the reverse of w}
Module-4
L2 CO4 6
Q.07 a Define the following with suitable examples:
() Inherently ambiguous Language (ii) Chomsky Normal Forms
(iil)Greibach Normal Form 6
b Remove all the ¬-productions and Unit productions from the L3 CO4
grammar:
S’ aAlaBB A ’ aAA ¬ B’ bB | bbC C ’B
Define GNF. Convert the following grammar into GNF. L3 CO4 8
Page 02 of 02
BCS503
L={ab | n 2l}. Draw the transition diagram and show the moves made
by TM for the string: "aaaabbbb".
Design a Turing Machine to accept strings formed on {0,1}* and L3 COS
ending with 000. Write transition diagram and sequence of IDs for
w= 101000
*Bloom's Taxonomy Level: Indicate as LI, L2,L3, L4, etc. It is also desirable to indicate the cOs and POs to be
attained by every bit of questions.
Page 03 of 02
KryCeptis
CIE-Test 1
Date: 1610/224
Tiae:9J0-11:10
Sobjeet Theery of Camputati Mas Marksc S4
Sabject Cde: BCNa
faractionAer ans fult quosiens, selectig ONE questlon from eack part
Q.Na Question Marks RITCD
1 4
Give defintion far Determinitic Finite Autoata (LDEA) with an example
Educkian
and Cive definition foe Non teminiwic Fnte Autostuats(NEA) witth an cxatngle
&Construct the NFAlor
LLc tb)*srng that starte with aand ends with b)
RL(wE (ab|w"a or bb}
COE
Prefsionale
ry
String
OR
List aut te diffeences bet wcen DEA anæ NFA
Canserut the NFA Tor the language L. IwE b) waba ox jweveriland
COI
Technlogy also urite exteaded transitions for both accopting and roecting string
Coevet the folawing NEALO DEA using subiet costruction method. 2xS10
inferavks
Bidng OR
.r)
Via :
Cvete engNIADN
CO1
0-6-0-0
Cav he lollowutge-Aa DPA
lac ting
Key
CO
Educatin
end
Frmieans
bry Revised Boom's Taxanomy: L1 Rernember, 2.Understand, 3.Apply, L4 Analye, L5-Evaluata, LS-Crete
QUIZ-I vtun
ENSTRUCTION- Each question carries ae mark
Techsalg Lbbbabablab )
101K10-101
Isfartion 3
is denoted uang
The laiguage is the identity for COncateation of languages
7ANFA ast inale tranuition to more tan one state on reading a input charcter. Stale TR¯E OH
Visle : FALSE