Вы находитесь на странице: 1из 2

September 20, 2004 Mid Sem Instructor: D.

Goswami

Indian Institute ofTechnology Guwahati


Computer Science &; Engineering l:j'-.,l,l.o \~~
CS 301 Formal Languages and Automata

No queries.
Answers of all parts of a quest.ion must appear together.

No of Questions: 11 Maximum Marks: 60 Maximum Time: 120 Min.


1LL-,
p<'" 17
,,- .
,Yl12Marks I Decide if the following statements are TRUE or FALSE. To receive ~-"7
any cr'edit you. must provide a brief justification or a counter-example.
~f L is non-regular, then LR is also non-regular.
(0 Let L1 be a regular language and L2 be a non-regular language such that
L1 n L2 = cpoThen L = L1 U L2 is necessarily non-regular. ;{'"f>w'- \S8?
f (~ If L ~ 0*, then L is regular.
x~here
W
exists no CFG to generate the empty language cpo
In a CNF grammar, the sentencial form aBcDe must have a derivation
~
~ sequence of length exactly 9. ,-0'
~L-97
ef) The procedure to eliminate useless symbols from a CFG is: First elimin.ate I' c:
f all variables thai do not appeUT'in -a sGntcntia.! fonl1 derived from the start ( \ri ~.,"I,
fPo;:,t. I 0(..Q~ r
symbol, a.nd then eliminate those va.riables tha.t do not derive a terminal
-- - _>i~ - - -=-
~
-- -." .. -. -- ,. ._"'~= ~ ...

~)
,;1'. 14Marks I Construct a regular expression for each of the following languages. I:)
({- S( >!: .

'--
(a) The set of all binary strings having either 000 or III as a substring. ~ tr
D\~
>I'
(b) The set of all binary strings having 'both 000 m: 111 as substrings. ~
W I'
~
3v{:8i\1arks Here is a transition table for a DFA. Give the regular expressions
I
"*" t: '
tv )(.tv
RW ,R~~) and R~~). (Simplify the expressions as much as possible.)
° 1 c/O ".

r5
E ~
q,
Bt
i

II
q2

q, I q,
q1
>itCT
h-

,jIt~
tv
><.:.'-
e,-
00
,
W

.:;>P 0...A. (i
0-.' 4;vv/~et N = ({qo,q1,q2}, {a, b,c}, 6,qo,{q2}) where r5is given by the following table: Q '\
",-" ~,
'O-~ " (l...;''l-
a b ICE 0&-
- ~.,) ~/j
qo {qo} cp 1; {qd ~-,) ~
~ ~pt;
,.,..(Q.() q1 cp {q1} cp {q2} ~ \) ~
.,., q2 <P <p { q2 } cp ,r-'

~.
'0 (. - 016 ,,",,0 l\l"""
~Marks What. is the £-closure of {qo} ?
, -,
I

r
<:) , "".
~
C:;)' --:>
#--
~4.-(~ f J..U..
~ ====-=-===
l1."~
.~
~J' ~2
~,
~ ~ ~~~
L I UL.'\.. ~ ~ ~,Ir- \ 2.- ~ (i.-t()'-0 - , \.-\()'\..-'!.- , ~)...\

1.- \
("\) j... <' L..-)
0 \..-"V
September 20, 2004 (5301 Formal Lnaguages and Automata Mid Sem

~2Marks I Give a regular expression 'r such that L(r) = L(N)


(cJ44Marks I Construct a DF A equivalent to N

5r14Marks Either prove or disprove - the language


I L = {onl'non In::; 12 ::; rn}
is regular.

j(,15Marks I Let L be the set of strings of the form Oilj such that the greatest
common divisor of i and j is 1. Show tlwt L is not regular.

.J(ll.~Iar~~J Cse :tdyhill-Nerode theorem to prove that the language of palindromes


over {O,l} is non-regular.

8. 14~'Iarks I Consider the lan~uage L = E {a, l} *Iw does not contain


{LV substring
OOl}. Determine t.he equivalence classes of =L and justif:v your answer.

~hn'ksl Consider the CFG: S ~ OAI1BIE, A ---+1SIO.1A, B ---+OSI1BB


v6ive a leftmost derivation for the string 0011.
~ve a rightmost derivation for the string, 001011.
.J1raw a parse tree for the string 1001.

~~ Find a grammar in CNF generuting L(G) - {r:} for the grammar G:


S ---+aSlaSbjE.
'.

- - .. ~{.;)-~};]l<lnd a grammar that generates each of the followinglanguagesover


{a, D}.
--('a) L =
- - ---
{(/H"-:'W'r ~ 1}
11
- - --- - .

(h) L = {w I length of w is odd}

(,0r "6/"" .
,'
'1,'"

""'s

So"?
t.. >\0 \ ()-..Qo
.

Вам также может понравиться