Imp Que

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 199

11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 45

  Login

GATE CSE 2005 | Question: 45

 9,980 views


asked
in Theory of Computation
Sep 22, 2014
edited
May 5, 2021
by soujanyareddy13

Consider three decision problems , and . It is known that is decidable and is


undecidable. Which one of the following is TRUE?
47

A.  is decidable if is reducible to


B. is undecidable if is reducible to
C. is undecidable if is reducible to
D. is decidable if is reducible to 's complement

gatecse-2005
theory-of-computation
decidability
normal


Kathleen

 share
2 Comments
Nitesh Singh 2
commented
Jan 22, 2019
A Reducible to B  means every string of A is present in B. so something like this A is subset of B.

 
1

samir757
commented
Jan 7

 Hope this helps

https://gateoverflow.in/1375/gate-cse-2005-question-45 1/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 45

  Login

 
2

3 Answers


A. If  is reducible to , then  is at least as hard as . So, no guarantee if  is decidable.
56 B. If  is reducible to , then  cannot be harder than . But  being undecidable, this can't

say  is undecidable.

https://gateoverflow.in/1375/gate-cse-2005-question-45 2/5

11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 45


C. If  is reducible to , then  is at least as hard as . Since,  is undecidable, this means
 is also undecidable -hence the answer. Login
Best
answer D. Complement of an undecidable problem is undecidable. Now, reducing to an undecidable
problem can't prove  is decidable. 

http://gatecse.in/wiki/Some_Reduction_Inferences


answered
Nov 13, 2014
edited
Feb 6, 2018
by kenzou


Arjun

4 Comments
Show 9 previous comments

Nitesh Singh 2
commented
Jan 22, 2019
Shaik Masthan just a simple correction-  ( P2 ) is undecidable =====> ( P2 ) '  is also undecidable.

 
1

Shaik Masthan
commented
Jan 22, 2019
It's  a typo !


Thanks, i will update it.

 
0

val_pro20
commented
Feb 2, 2021
@Arjun Sir 

for option D 

A language L is undecidable
if (1) L is not recursively enumerable or (2) L is recursively enumerable but not
.http://www.cs.columbia.edu/~aho/cs3261/Lectures/L18-Undecidable_Problems.html

 
0


If there is any undecidable problem and if we are able to convert it into some other problem then that
problem will also be undecidable.

5
If it is already known that a problem is decidable & if we convert some other problem to decidable

problem then that problem will also be decidable.

A <m (B) means A cannot be harder than B.

So option C is right.

https://gateoverflow.in/1375/gate-cse-2005-question-45 3/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 45

 
A Reducible to B  means every string of A is present in B. so something like this A is a subset of B.
Login


answered
Jan 22, 2019
edited
Jan 23, 2020
by Nitesh Singh 2


Nitesh Singh 2


answer is C

–2

answered
Dec 30, 2017


swapnil1997

Answer: C

← Previous Next →

← Previous in category Next in category →

Related questions

https://gateoverflow.in/1375/gate-cse-2005-question-45 4/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 45


17
GATE CSE 2005 | Question: 58

Consider the following two problems on undirected graphs: : Given  ,


Login


#1

asked
Sep 22, 2014

GATE CSE 2005 | Question: 55

30  Consider the languages: and



#2

asked
Sep 22, 2014

GATE CSE 2005 | Question: 53

43  Consider the machine : The language recognized by is:



#3

asked
Sep 22, 2014

GATE CSE 2005 | Question: 83b

28  Consider the following expression grammar. The semantic rules for expression

#4

asked
Nov 27, 2016

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1375/gate-cse-2005-question-45 5/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 53

  Login

GATE CSE 2005 | Question: 53

 9,390 views


asked
in Theory of Computation
Sep 22, 2014
edited
May 9, 2021
by gatecse

Consider the machine :

43

The language recognized by is:

A.

B.

C.

D.

gatecse-2005
theory-of-computation
finite-automata
normal


Kathleen

 share
4 Comments
Show 2 previous comments

Arjun
commented
Dec 3, 2014
@Vikrant: b is the answer assuming start start state is also accepting rt? I guess it was a printing

mistake.

 
13

https://gateoverflow.in/1376/gate-cse-2005-question-53 1/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 53

 sripo
commented
Oct 9, 2018
It should be aa not just a  
Login

 
0

Shubham Aggarwal
commented
Dec 1, 2018
Key point-> For the string which is like contain there is no Dead state only final state will be there.

so C is wrong.

 
2

6 Answers


A is Wrong, since is accepted. ( a is followed by more than 's)

63
C is Wrong, since contains as substring, but is still not accepted.

 D is Wrong, since

Best Hence, correct answer is B.


does not contain as substring, but is still not accepted.

answer


answered
Jan 2, 2015
edited
Jun 15, 2018
by Milicevic3306


saurabhrk

4 Comments
Show 7 previous comments

HitechGa
commented
Jan 31, 2021
Yes for this question actually, none of the options are correct, but going with the closest, B can be

chosen, but it is necessarily not right,,,

 
0

sujaygoswami
commented
Aug 23, 2021
Why would ‘bb’ be accepted as per as option B. It clearly states that a followed by atleast 2 b’s so abb,

abbb,abbbb….. and so on will be accepted by the machine.

 
1

Arpit Patel
commented
Jan 11
@sujaygoswami

Every is the key here. If ‘a’ occurs then it is followed by atleast 2 b’s. b* should also be accepted but it
does not.

 
0

https://gateoverflow.in/1376/gate-cse-2005-question-53 2/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 53

  Login



Most of us might be having confused between option (B) and (D).

12
Lets look at option (D) :


{w∈{a,b}∗ | w does not contain ‘aa’ as a substring}

which means that any Language L that does not contain 'aa' should be accepted.

now let's take L = {a} and parse it to the initial state... As we see clearly, 'a' is not accepted by the given
machine M.

Therefore option (B) is correct


answered
Jul 21, 2017


Bencher Last


None of the options are correct. Let me give counter-examples:-

A) w = 'abbb'. M would accept but L won't.

2
B) w = 'b'. M won't accept but L would. This example is also applicable to option A and C.

C) w = 'aabb'. M won't accept but L would.

D) Same as option B.

Please don't say that 'a' has to be there in w. Then {a,b}* won't have any significance. Because the
language produced by {a,b}* = {empty, a, b, aa, bb, aba, baa, ..............}.


answered
Jan 19, 2018


pradipbasak

1 comment
Pranavpurkar
commented
6 days ago
seems correct!

 
0


Check option one bye one

0
A) string abbb also accepted so A fails

C) string aabb containg substring abb but not accepted hence c fails

https://gateoverflow.in/1376/gate-cse-2005-question-53 3/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 53

 D) string abba  does not contain aa but string not accepted hence D fails

 Login

B) says every a followed by atlest 2 b's i.e

String abb or babb or abbabb, bbabb such all strings accepted by given machine M So option B true


answered
Sep 30, 2019


mesh90

1 comment
JAINchiNMay
commented
Sep 26, 2020
why b* is not in the final automata

 
0

1
2
next »

Answer: B

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2005 | Question: 63

32  The following diagram represents a finite state machine which takes as input a

#1

asked
Sep 22, 2014

GATE CSE 2005 | Question: 58

17  Consider the following two problems on undirected graphs: : Given ,



#2

asked
Sep 22, 2014

GATE CSE 2005 | Question: 55

30  Consider the languages: and



#3

asked
Sep 22, 2014

GATE CSE 2005 | Question: 45

https://gateoverflow.in/1376/gate-cse-2005-question-53 4/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 53


 
47#4 Consider three decision problems and It is known that is decidable

asked
Sep 22, 2014 Login

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1376/gate-cse-2005-question-53 5/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 54

  Login

GATE CSE 2005 | Question: 54


asked
in Theory of Computation
Sep 22, 2014 3,140 views 

Let and denote the classes of languages accepted by non-deterministic finite automata and
non-deterministic push-down automata, respectively. Let and denote the classes of languages
22
accepted by deterministic finite automata and deterministic push-down automata respectively. Which

one of the following is TRUE?

A.

B.

C.

D.

gatecse-2005
theory-of-computation
easy
non-determinism


Kathleen

 share

2 Answers


Correct Option: D

26
NFA and DFA both have equivalent power.(every nfa can be converted into equivalent DFA)  but NPDA


can accept more languages than DPDA.


answered
Dec 26, 2014
Best
answer edited
May 6, 2021
by soujanyareddy13


shree

https://gateoverflow.in/1377/gate-cse-2005-question-54 1/2

11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 54

 
 2
Ans: D

Login
Expressive power of DFA and NFA are same but not true in case of DPDA and NPDA


answered
Nov 15, 2017


rishu_darkshadow

Answer: D

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 1994 | Question: 1.16


17  Which of the following conversions is not possible (algorithmically)? Regular

#1

asked
Oct 4, 2014

GATE CSE 2011 | Question: 8

26  Which of the following pairs have DIFFERENT expressive power? Deterministic



#2

asked
Sep 29, 2014

GATE CSE 1998 | Question: 1.11


18  Regarding the power of recognition of languages, which of the following

#3

asked
Sep 26, 2014

GATE CSE 2009 | Question: 16, ISRO2017-12

40  Which one of the following is FALSE? There is a unique minimal DFA for every

#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1377/gate-cse-2005-question-54 2/2
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 55

  Login

GATE CSE 2005 | Question: 55


asked
in Theory of Computation
Sep 22, 2014 6,347 views 

Consider the languages:

30  and

Which one of the following statements is FALSE?

A. is a context-free language

B. is a context-free language

C. are context-free languages

D. is a context sensitive language

gatecse-2005
theory-of-computation
identify-class-language
normal


Kathleen

 share

6 Answers


is CFL   [ put 's in stack , and pop with each ]]

37 is CFL   [put 's in stack and pop with each ]



C) is True.

B) is True. CFL is closed under Union    [     where is grammar for and for ]
Best
answer CFL is not closed under Intersection, so intersection of two CFLs may or may not be CFL. Lets
examine:

which is Context sensitive but not context free [can't match 's, 's and 's
with one stack]

So, A) is False.

https://gateoverflow.in/1378/gate-cse-2005-question-55 1/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 55

 
D) is True.
Login


answered
Mar 6, 2015
edited
Jun 15, 2018
by Milicevic3306


Praveen Saini

4 Comments
Show 14 previous comments

ankit3009
commented
Nov 18, 2021
CFL intersection CFL  =  CFL which is also a CSL as CFL is subset of CSL. That’s why, option D is True.

 
0

raja11sep
commented
Jan 11


CFL intersection CFL  =  CFL

@ankit3009  bro..CFL is not closed under complementation so this statement is not correct.

You can say every CFL is CSL so  CFL intersection CFL = CSL intersection CSL = CSL

As CSL’s are closed under complementation.

 
3

ankit3009
commented
Jan 11
Oh sorry! I missed it. Very poor mistake. Thanks for correcting @raja11sep :)

 
3


A. CFL's are not closed under intersection.

5 
answered
Sep 23, 2014


Gate Keeda

1 comment
Pritam Dutta
commented
Dec 15, 2017
This is not the reason. CFL's are not always closed under intersection,so it may be or may not be. So we

can say in general : "CFL's are not closed under intersection". But given 2 particular CFLs you have to
check it. For example if it were L1 = L2 = (0+1)^* . Then see both are RL & consequently CFL,also L1
intersection L2 = (0+1)^* which is CFL too. So you cant make the argument that since CFL's are not
closed under intersection, then intersection of every 2 CFLs will result in non CFL.

 
4

https://gateoverflow.in/1378/gate-cse-2005-question-55 2/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 55

  Login


Wrong answer

3

Clearly A is false, I have solved this by taking example.

L1 union L2 is regular, so it is also CFL, CSL, RE etc.

L1 intersection L2 is CSL


answered
Oct 19, 2020


ijnuhb

3 Comments

https://gateoverflow.in/1378/gate-cse-2005-question-55 3/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 55

 Ayan Kumar Pahari


commented
Oct 20, 2020
Nice answer bro!  
Login

 
0

jugnu1337
commented
Apr 23
in your answer L1 U L2 =  a*b*c*  how this is possible, coz in actual language  n,m>0


string length should be  >=3..

doubt**

 
1

gatecse
commented
Oct 11

 
0


Answer Option A]

1
counter example of A= since m and n can be greater than 0 so it is possible case that they can be equal

i.e. m=n in this case we can not  construct pda bcz it is not cfl therefore A is false


answered
Jan 23, 2019


sumedh

1
2
next »

Answer: A

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2005 | Question: 58

17  Consider the following two problems on undirected graphs: : Given ,



#1

asked
Sep 22, 2014
https://gateoverflow.in/1378/gate-cse-2005-question-55 4/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 55


43
GATE CSE 2005 | Question: 53

Consider the machine : The language recognized by is:


 Login


#2

asked
Sep 22, 2014

GATE CSE 2005 | Question: 45

47  Consider three decision problems , and . It is known that is decidable



#3

asked
Sep 22, 2014

GATE CSE 2005 | Question: 77, ISRO2016-55

59  The relation book (title, price) contains the titles and prices of different books.

#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1378/gate-cse-2005-question-55 5/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 56

  Login

GATE CSE 2005 | Question: 56

 4,366 views


asked
in Theory of Computation
Sep 22, 2014
edited
Mar 1, 2018
by kenzou

Let  be a recursive language, and let be a recursively enumerable but not a recursive language.
Which one of the following is TRUE?
25

A. ' is recursive and ' is recursively enumerable


B. ' is recursive and ' is not recursively enumerable
C. ' and ' are recursively enumerable
D. ' is recursively enumerable and ' is recursive

gatecse-2005
theory-of-computation
recursive-and-recursively-enumerable-languages
easy


Kathleen

 share

2 Answers


 being recursive, we have a TM M for  which accepts all words in  and rejects all words in '.
So, this TM also works for ' by changing the accept and reject states. Thus ' is recursive. 

39


being recursively enumerable but not recursive means TM for can accept all words in but
cannot reject all words not in  TM for ' cannot exist (as otherwise TM for  could simulate
the moves of that TM to reject words in ')   ' is not recursively enumerable. So, (B). 
Best
answer


answered
Sep 23, 2014
edited
Mar 1, 2018
by kenzou


Arjun

4 Comments
vaishali jhalani
commented
Dec 15, 2016

https://gateoverflow.in/1379/gate-cse-2005-question-56 1/3
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 56

   
RE are not closed under Complement then how we can definitely say that complement of RE is not REC
enumerable. Login

2

Arjun
commented
Dec 15, 2016
RE set is not closed under complement. So, given a r.e. language we cannot say if its complement is r.e.

or not.

But any regular language is also r.e. and complement of a regular language is regular and hence r.e. too.
Here, for a particular subset of RE set we say complement is closed.

Similarly in the question, we do not have the general RE set but a subset where the languages are not
recursive. For those languages complement is guaranteed not to be r.e. -> reason given in answer.

 
9

vaishali jhalani
commented
Dec 15, 2016
So recursively enumerable lang which are recursive like reg... complement is also RE.


But RE which are not recursive complement is non RE.

Is this the conclusion?

 
4

ankit3009
commented
Nov 19, 2021
Yes correct.

 
0


as we know recursive language are closed under complementation hence L1 is recusrive language so
L1' also and it is also  recusrive enumerable language

8
( all options are still open as all satisfy above property )

recursive enumerable language are not closed under complementation so it may be recursive
enumerable language or not 

case 1: if L' is  recursive enumerable language

as we know if L and L' are recursive enumerable languages then L is recursive language but here in
question they mentioned L2 is not recusrive 

hence L2' cant be recursive enumerable language

therfore L2' accept only case 2 which is L2' is not recursive enumerable language

Ans is B 


answered
Sep 3, 2017


Gate Ranker18

https://gateoverflow.in/1379/gate-cse-2005-question-56 2/3
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 56

  Login

Answer: B

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2005 | Question: 63

32  The following diagram represents a finite state machine which takes as input a

#1

asked
Sep 22, 2014

GATE CSE 2005 | Question: 57

32  Consider the languages:



#2

asked
Sep 22, 2014

GATE CSE 2005 | Question: 54

22  Let and denote the classes of languages accepted by non-deterministic



#3

asked
Sep 22, 2014

GATE CSE 2005 | Question: 78

22  Consider a relation scheme on which the following



#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1379/gate-cse-2005-question-56 3/3
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 58

  Login

GATE CSE 2005 | Question: 58

 5,253 views


asked
in Theory of Computation
Sep 22, 2014
recategorized
Jan 15, 2018
by srestha

Consider the following two problems on undirected graphs:

17 : Given , does have an independent set of size |V| - ?


: Given , does have an independent set of size ?

Which one of the following is TRUE?

A. is in P and is NP-complete

B. is NP-complete and is in P

C. Both and are NP-complete

D. Both and are in P

gatecse-2005
theory-of-computation
p-np-npc-nph
normal


Kathleen

 share
3 Comments
Arjun
commented
Jul 24, 2015
That's the same question from me, WHY? Who told it is NPC?

 
1

radha gogia
commented
Jul 24, 2015
Sir ,answ was given NPC on the below link :


 

http://geeksquiz.com/gate-gate-cs-2005-question-58/

 
0

Chhotu
commented
Sep 7, 2017
edited
Oct 31, 2017
by Chhotu

https://gateoverflow.in/1381/gate-cse-2005-question-58 1/4
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 58

 
Additional information.

Login
In following lecture Prof.  L. Sunil Chandran is teaching -  How maximal independent set and minimal
vertex cover are related (Just check near around time 50:00 )?

https://www.youtube.com/watch?v=Gc8emFk-2vc

 
0

1 Answer


Independent Set- a set of vertices in a graph no two of which are adjacent. 

22 Maximal Independent set problem - Given a graph , find the size of the maximal independent set in it.

This problem in NP-hard.

Best
Independent set decision problem - Given a graph
of size . This problem is NP-complete (NP-hard but in NP).
and a number , does have an independent set

answer
Now, in the given problem   corresponds to the Independent set decision problem. But there is a
difference there. We have instead of . And this drastically changes the problem statement. We can
now give a polynomial time deterministic algorithm for . 

Find all vertex sets of size . We get such vertex sets


For each of them check if there is any adjacent vertices. This check can be done in constant
time if we use an Adjacency matrix representation

Thus the whole time complexity reduces to  which is and hence polynomial. is
not polynomial but is . 

Problem is asking for an independent set of size . This is equivalent to asking if has a
vertex cover* of size . Following a similar approach as done for this problem also can be done in
polynomial time. 

So, both and are in .

D choice. 

Vertex cover of a graph is the set of vertices such that each edge of the graph is incident on atleast
one of those vertices.

Independent Set and Vertex cover Reduction: https://www.cs.cmu.edu/~ckingsf/bioinfo-


lectures/npcomplete.pdf


answered
Jul 24, 2015
edited
Nov 3, 2017
by kenzou


Arjun

https://gateoverflow.in/1381/gate-cse-2005-question-58 2/4
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 58

 4 Comments
Show 7 previous comments
 Login

Veenit
commented
Nov 20, 2019
@Arjun sir, How is the β problem different from independent set decision problem? Is k not constant

there?

 
1

ronak.ladhar
commented
Aug 17, 2020
Explaination to the doubt of @shreya roy:


Maximal Independent Set + Minimum Vertex Cover = |V|.

If we are not talking about the Minimum Vertex Cover here then how we can talk about Maximal
Independent Set or Independence Number here.

Actually, there sum if what is equal to |V|, that what actually matters here.

If there would be a vertex cover of size let say 5 we can have independence number of greater than
|V|-5. But here what we are concerned is of finding independent set of size |V|-5.

 
1

Manu Shaurya
commented
Jul 1, 2021
For α, we can also check the Vertex cover for k in constant time using adjacency representation. Just as

β it would take polynomial time to check if vertex cover for k exists or not.

 
0

Answer: D

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2005 | Question: 55

30  Consider the languages: and



#1

asked
Sep 22, 2014

GATE CSE 2005 | Question: 53

43 
https://gateoverflow.in/1381/gate-cse-2005-question-58 3/4
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 58


 
#2
asked
Sep 22, 2014
Login
GATE CSE 2005 | Question: 45

47  Consider three decision problems , and . It is known that is decidable



#3

asked
Sep 22, 2014

GATE CSE 2005 | Question: 83b

28  Consider the following expression grammar. The semantic rules for expression

#4

asked
Nov 27, 2016

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1381/gate-cse-2005-question-58 4/4
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 63

  Login

GATE CSE 2005 | Question: 63

 6,474 views


asked
in Theory of Computation
Sep 22, 2014
edited
Apr 30, 2019
by Pooja Khatri

The following diagram represents a finite state machine which takes as input a binary number from the
least significant bit.
32

   

Which of the following is TRUE?

A. It computes ’s complement of the input number

B. It computes ’s complement of the input number

C. It increments the input number

D. it decrements the input number

gatecse-2005
theory-of-computation
finite-automata
easy


Kathleen

 share
1 comment
Deepak Poonia
commented
Jan 27
edited
Apr 20
by Deepak Poonia
Video Solution :

https://youtu.be/2ozJwqxTEeA

https://gateoverflow.in/1386/gate-cse-2005-question-63 1/4
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 63

 
Mealy and Moore Machines for Option A :
Login
Mealy and Moore Machines for Option C :

Mealy and Moore Machines for Option D :

Explanation of Finite State Machines (Mealy, Moore Machines), with ALL GATE Questions’ solution can
be found in the following playlist :

https://youtube.com/playlist?list=PLIPZ2_p3RNHjd6P9g6XoUm8E33CsUBqDv

 
3

2 Answers


Answer is option B.

31 For any binary no, FSM read input from LSB and remain unchanged till first , and it complement after

that 

Best
      's complement of

      's complement of
's complement of

's complement of
answer
   's complement of

Note : Underline part is unchanged (till first from lsb) then 's changed to 's and 's changed to 's 


answered
Mar 5, 2015
edited
Jun 15, 2018
by Milicevic3306


Praveen Saini

3 Comments
Prateek kumar
commented
Aug 22, 2016
@Praveen sir why to read input from LSB and remain unchanged till first 1 ? not getting the logic


would you explain in details with examples

 
1

Mk Utkarsh
commented
Nov 17, 2017
It's mentioned in the question to read input from LSB and the bits doesn't change until the 1st 1 from

LSB because when you calculate 2's complement for example 

10110 --> 01001 ---> then when you'll add 1 to this number it will carry over till it finds 0 which
automatically makes the same as input 

01001 + 1 = 01010

10 is the same as input and all other bits are inverted

https://gateoverflow.in/1386/gate-cse-2005-question-63 2/4
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 63

 
 

5


Login
Manisha Jaishwal
commented
May 25
2's complement of +ve number is number itself so it's valid for -ve number only ??

 
0


B.

10
the given above is a mealy machine for finding 2's complement.


answered
Sep 23, 2014


Gate Keeda

2 Comments
dhingrak
commented
Dec 25, 2014
Can you please explain how this F.A will work on input 100....


I am getting 001

Starting from L.S.B ....input 0 we will get output as 0, input 0 we will get output 0, input 1 we will get
output as 1

Thus the final string which is generated is 001

But the 2's complement of 100 is 100.......

Please explain....

 
0

Syedarshadali
commented
Oct 13, 2017
If your input is 100(1 being MSB and 0 being LSB) then input for FA is in the order 001(LSB first)

q0 --0--> q0 --0--> q0 --1-->q1

o/p:0             0             1

     LSB                      MSB       

input : 100(1 being MSB and 0 being LSB)

output : 100(1 being MSB and 0 being LSB)

 
0

https://gateoverflow.in/1386/gate-cse-2005-question-63 3/4
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2005 | Question: 63


Answer: B
 Login

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2005 | Question: 57

32  Consider the languages:



#1

asked
Sep 22, 2014

GATE CSE 2005 | Question: 56

25  Let be a recursive language, and let be a recursively enumerable but not a



#2

asked
Sep 22, 2014

GATE CSE 2005 | Question: 54

22  Let and denote the classes of languages accepted by non-deterministic



#3

asked
Sep 22, 2014

GATE CSE 2005 | Question: 53

43  Consider the machine : The language recognized by is:



#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1386/gate-cse-2005-question-63 4/4
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 19

  Login

GATE CSE 2006 | Question: 19

 11,511 views


asked
in Theory of Computation
Sep 17, 2014
edited
Feb 1, 2018
by kenzou

Let

42 ,

 and

.  

Which of these languages are NOT context free? 

A.  only
B.  only
C.  and 
D.  and

gatecse-2006
theory-of-computation
context-free-language
normal


Rucha Shelke

 share
4 Comments
Show 2 previous comments

Warlock lord
commented
Nov 12, 2017
@set2018 for the second one, consider n=0 ... Then it's similar to the third.

 
1

7010905314ravindra
commented
Nov 6, 2018
Sir plz tell me L2 is not CFL

 
0

tusharb
commented
Jul 28
Alternate reasoning for why L2 is not CFL

https://gateoverflow.in/980/gate-cse-2006-question-19 1/5
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 19

 
Let us assume that L2 is CFL => There exists a PDA which recognizes this language => The working of
the PDA will be  will match with each other and we can have m number of 0’s in the end. Login

This PDA will accept any strings of the form . 

Contradiction

This same PDA will also accept 00110000 (if you draw the above PDA), but it should be rejected
because this string does not belong to the language. So this language is not CFl and there does not
exists a PDA for it.

 
0

6 Answers


Answer is (D)

59 is context-free. We count the number of 's and check if the remaining number of 's followed by

0's count to the initial number of 's.

 is not context-free. Here the number of 's and the following 's must be same, which can be
Best checked using a PDA. But after that we must also ensure that the following number of 's must be less
answer than the previous count of 's and 's (otherwise , which violates the condition for acceptance)
and we cannot do these two checks using a single PDA.

is again not context-free as it is nothing but equal number of 's followed by equal number of 's
followed by equal number of 's.


answered
Dec 22, 2014
edited
Oct 24, 2018
by Krithiga2101


Arjun

4 Comments
Show 26 previous comments

raja11sep
commented
Jul 14, 2021
L2 = { a b c | p<=n and p,n>=0 }

 
0

Abhrajyoti00
commented
Oct 18
More than 1 infinite power matching on the same variable with AND is not CFL. Thus L2, L3 are not CFL.

 
0

Pranavpurkar
commented
Oct 26
Abhrajyoti00

https://gateoverflow.in/980/gate-cse-2006-question-19 2/5
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 19

   
can you please provide some source to read this.

0
Login



Take language one by one:

8 1. L1 is CFL Even DCFL since push all 1's , when first 0 come start pop untill stack is empty.Take

language one by one:


2. L3 is Non -CFL Even DCFL since push all 0's , when first 1 come start pop untill stack is empty,
now at this point you forget what is the value of m+n since stack is empty So you need two
stacks . if you took n+m=p then language look like  .
3. L2 is Non-CFL since  push all 0's , when first 1 come start pop untill stack is empty, now at this
point you forget what is the value of m since stack is empty So you need two stacks .


answered
Mar 22, 2018


Prashant.

4 Comments
Show 2 previous comments

KUSHAGRA गुप्ता
commented
Dec 5, 2019
@mesh90

It will accept those strings also which are not part of the language according to that logic. And if you are
satisfied with then when you put n=0 in you will get which is same as . Hence not
CFL.

 
0

raja11sep
commented
Jul 14, 2021
What do you mean by L3 is Non -CFL Even DCFL 

 
0

Pranavpurkar
commented
Nov 17, 2021
DOUBT:can’t we just skip the remaining zeroes in L2 and L3? so in order to get accepted by the PDA?

my reasoning : we cant skip the remaining zeroes because of the unknown’s n and m ..as all the
comparisons between 0 and 1 are based on the n and m .(so as to avoid invalid string getting accepted
by PDA)

is my reasoning correct???

 
1


https://gateoverflow.in/980/gate-cse-2006-question-19 3/5
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 19

 
3 L1 can be accepted by PDA, we need to push all 0’s before 1’s and when 1’s comes in input string we

 need to pop every 0’s from stack for every 1’s and then for every 0’s. If stack and input string is empty
the same time then the string belongs to L1.

Loginat

But for L2 and L3 PDA implementation is not possible. The reason is, in L2 there are two comparison at
a time, first the number of 0’s in beginning should be equal to 1’s and then 0’s after 1’s must be less
than or equal to number of 1’s. Suppose for initial 0’s and 1’s are matched by using stack then after
matching stack will become empty and then we cannot determine the later 0’s are equal to or less than
number of 1’s.

Hence PDA implementation is not possible.

Similarly L3 also has the similar reason.

Option D is right.


answered
Sep 3, 2020


varunrajarathnam

1 comment
Pranavpurkar
commented
Oct 26
Nice explanation!

 
0


L2 and L3 are  like  language  a^nb^nc^n. which is csl . because there is two comparision so we cannot
drow PDA .
2


answered
Mar 22, 2018


abhishekmehta4u

3 Comments
Raj Kumar 7
commented
Mar 22, 2018
What is wrong with my argument? Why is it invalid?

 
0

raja11sep
commented
Jul 14, 2021
Wrong.

L2={ a b c | p<=n and p,n>=0 }

 
0

Pranavpurkar
commented
Oct 26

https://gateoverflow.in/980/gate-cse-2006-question-19 4/5
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 19

 
raja11sep
Login
if this is the case then why isn’t it CFL?

 
0

1
2
next »

Answer: D

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2006 | Question: 34

78  Consider the regular language The minimum number of



#1

asked
Sep 22, 2014

GATE CSE 2006 | Question: 33

51  Let be a regular language, be a deterministic context-free language and



#2

asked
Sep 18, 2014

GATE CSE 2006 | Question: 31

8  Let SHAM be the problem of finding a Hamiltonian cycle in a graph



#3

asked
Sep 18, 2014

GATE CSE 2006 | Question: 30

45  For let denote the decimal value of e.g. Let



#4

asked
Sep 18, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/980/gate-cse-2006-question-19 5/5
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 29

  Login

GATE CSE 2006 | Question: 29

 14,316 views


asked
in Theory of Computation
Sep 18, 2014
edited
Mar 8, 2018
by kenzou

If is a string over   then let denote the number of ’s in and the number of ’s
in . Which one of the following languages is not regular?
69

A.
B.
C.
D.

gatecse-2006
theory-of-computation
normal
regular-language


Rucha Shelke

 share
2 Comments
Nitesh Singh 2
commented
Dec 7, 2018
I will explain only option B because rest are clear. so option B says EVERY prefix of S follow the rule of

|0's - 1's| <=2

people like me who are thinking strings like this 00011 should have accepted but because of "every
prefix" word there is more prefix to this prefix also which is 000 and which will not be accepted since we
will start to analyse prefixes from lower length to higher length and if any one substring is not accepted
we stop and say This string do not follow the rule. So this is regular.

 
11

Yash Karkhur
commented
Feb 1, 2019
Can you please explain why we are considering option b as regular. To know the difference we will have

to count the number of zeros and one's but if we do that , it means it is not regular

 
0

8 Answers

https://gateoverflow.in/992/gate-cse-2006-question-29 1/7

11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 29

 
 A. There are only finite
DFA (including one for
digit primes. Let the largest of them be
and one for
. Now we need states in our
Login
).  We do not need a change of state for any
65
.

Best
B. Here we need just

1.
2.
states to recognise . 

answer
3.
4.
5.

If the difference goes above or below , we go to a dead state. All other states are accepting. This
transition to dead state is possible because of the words "for every prefix of " in and that is what
makes this language regular. 

C. is not regular

All these form distinct equivalent classes under Myhill-Nerode theorem meaning from the strings in
each of these sets, we can append a string which will take the new string to , while the same string
appended to string in any other set would not reach . 

For example, for , we append , for , we append etc. So, in short we need to
maintain the count of and and the count here is not finite. 

D. This is regular. We need a finite automata with states for maintaining the counts of
and and there cannot be more than possibilities for this. With each
input symbol, the transition must be going to one among these. 

Correct Answer:


answered
Feb 3, 2015
edited
May 11, 2019
by Naveen Kumar 3


Arjun

4 Comments
Show 11 previous comments

https://gateoverflow.in/992/gate-cse-2006-question-29 2/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 29

 Prateek K
commented
Jan 28, 2018
@VS   Login 
Thats not the language what ayush mentioned in his question 2 .

Say string s -00011 and its prefix s' 00 

3-2= 1 satisfying the language

 L={s∈ (0+1)* | for every prefix s'of s | n0(s)-n0(s')<=2 }

 
0

jatin khachane 1
commented
Dec 29, 2018
@Ayush Upadhyaya

Please correct if wrong


L={s∈ (0+1)* | for every prefix s' of s | n0(s)-n0(s')<=2 }
will this language be regular?

Yes ...n0(s) <= n0(s') + 2..

For first prefix epsilon we just check n0(s) < = 0 + 2

no(s) <= 2..after that it can be no(s) <= 3  no(s) <= 4.....

hence strings containing atmost 2 zeros..

If it is n0(s') - n0(s) <= 2..then it will be non regular right ???

 
0

Abhineet Singh
commented
Dec 13, 2020
please explain difference between B and C...

 
0


A. is a digit prime. It means no. of are in the range (set) which is


finite. So, will be regular. 

226
For simplicity consider is a digit prime. So set will be DFA will look like

B. Prefix - For a string its prefix is any substring from the beginning of

Example:

https://gateoverflow.in/992/gate-cse-2006-question-29 3/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 29

 
So, here we have to ensure that no where in our string the difference between number of and is
greater than If anywhere the above condition fails, we will enter a dead state as we got a Login
substring (prefix) that violates the condition.

DFA will be like

So, here the difference between number of and crosses  we will be in dead state.

e.g.,

This string will be accepted as nowhere in the difference exceeds .

This string is not accepted.

C. The difference between the number of and should not exceed

Here, once we exceed the limit there is a possibility that we might cover up the difference in further part
of the string.

e.g.,

Here, just by seeing up to the last we cannot move to dead state. So, it needs infinite counting. Hence,
not regular.

D. This language can be stated as the set of strings where number of is divisible by and number
of is divisible by We can make a DFA for this by cross-product method. Hence, regular. 


answered
Oct 24, 2016
edited
Jun 25, 2018
by Krithiga2101


Rajendra Dangwal

4 Comments
Show 12 previous comments

anuragjais
commented
Jan 14, 2019
Is there any method to know the exact number of states in such questions as in option b......

https://gateoverflow.in/992/gate-cse-2006-question-29 4/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 29

  
0

 
Login
shaurya_narayan
commented
Oct 4, 2019
Nice explanation

 
0

ayushsomani
commented
Dec 7, 2019
@shaurya_narayan

How Option B is Regular?

 
0


option C includes 0n1n which is DCFL.

8 Answer C


answered
Jan 24, 2015


Vikrant Singh

4 Comments
Arjun
commented
Jan 24, 2015
"includes" is a wrong word. You can say the problems (problem of accepting those kind of words) are

similar.

 
4

Vikrant Singh
commented
Jan 24, 2015
When I was writing this I know I was wrong, but I am not able to come up with correct phrase. thanks for

correcting.

 
2

Nisha kumari
commented
Feb 3, 2015
Will u explain y second option (b) would b regular and y option (c) is not regular.


finding every prefix of regular language  is not possible so it should not b regular

and in (c) inspite it contain some a^nb^n but are bounded,,so option (c) should b regular

 
0

Arjun
commented
Feb 3, 2015
B is regular and C is not. I have explained in the answer.

 
0

https://gateoverflow.in/992/gate-cse-2006-question-29 5/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 29

  I'll just try to eliminate the confusion why B is RL, but C is not.
 
Login
4
 In B, "every prefix" should be such that n0 − n1 ≤ 2.

How do we check for every prefix? Just remember this fact that regularity is closed under prefixes.

If length of s = 5, length of all its prefixes would be ≤ 5.

We'll only accept the language such that at each step, the given condition is satisfied.

At length = 1, length = 2... so on, if we don't let the given condition violate, eventually our final string
won't have any smaller / "earlier" components (prefixes, loosely) that violate the given condition. So we
actually can do this with FAs.

Now look at C. n0 − n1 ≤ 2 in the string. (NOT THE PREFIX. That's the difference in B and C)

So, if a string starts like 0111111111, we'll let it go in hopes that maybe in the end a bunch of 0's will
come and settle the count. When would the end come, we don't know. Maybe the string is infinite.
Hence, it needs to keep track of the count till infinity, hence can't be done with FA.

Can be done with PDA.

Hence, B is RL, and C is not RL.

Just for the sake of completion, A is finite, and D has a pattern. So, both RL.


answered
Aug 27, 2019


JashanArora

1 comment
Abhineet Singh
commented
Dec 13, 2020
“If length of s = 5, length of all its prefixes would be ≤ 5.” but the length of prefix can be infinite  also,

why havent we considered that, here length of prefix is not mentioned, so it can be anything. so how do
we do infinite comparison?

 
0

1
2
next »

Answer: C

← Previous Next →

← Previous in category Next in category →

https://gateoverflow.in/992/gate-cse-2006-question-29 6/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 29

Related questions
 Login

GATE CSE 2006 | Question: 34

78  Consider the regular language The minimum number of



#1

asked
Sep 22, 2014

GATE CSE 2006 | Question: 33

51  Let be a regular language, be a deterministic context-free language and



#2

asked
Sep 18, 2014

GATE CSE 2006 | Question: 31

8  Let SHAM be the problem of finding a Hamiltonian cycle in a graph



#3

asked
Sep 18, 2014

GATE CSE 2006 | Question: 30

45  For let denote the decimal value of e.g. Let



#4

asked
Sep 18, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/992/gate-cse-2006-question-29 7/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 30

  Login

GATE CSE 2006 | Question: 30

 5,468 views


asked
in Theory of Computation
Sep 18, 2014
edited
Jun 3, 2021
by Lakshman Patel RJIT

For let denote the decimal value of e.g. Let

45

Which one of the following statements is true?

A. is recursively enumerable, but not recursive


B. is recursive, but not context-free
C. is context-free, but not regular
D. is regular

gatecse-2006
theory-of-computation
normal
identify-class-language


Rucha Shelke

 share
4 Comments
Show 7 previous comments

Danish
commented
Feb 5, 2015
Sir i think that similarly we can draw a DFA for mod 7 ... in that DFA all the states Except "mod4" state will

be a final state.

 
3

Adarsh Pandey
commented
Oct 17, 2019
complete banao, tab maane ..;)

 
0

goxul
commented
Dec 22, 2019
For mod-5,we can define a machine as follows:


M = {(0,1,2,3,4), (0,1), (0), , (2)}, where we read the string bit-wise and

https://gateoverflow.in/993/gate-cse-2006-question-30 1/4
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 30

 
.

Login
For mod-7, we can define a similar machine as follows:

M = {(0,1,2,3,4,5,6), (0,1), (0), , (0,1,2,3,5,6)}, where we read the string bit-wise and

Post this, we only need to take the product of this automata and we'll get the desired answer.

Here, we'll have 35 states, out of which 6 will be final ( which is obtained by the product of the respective
final states.)

 
1

2 Answers


is regular

70
Having as final state out of states

 As given in example in posted link [in same DFA , final state will be

Best Similarly,
instead of

is also regular

answer

Having states and all are final state except

is (given problem ) is also regular

As regular languages are closed under intersection. D is correct option.

Reference: https://gateoverflow.in/1695/gate1998_4


answered
Mar 9, 2015
edited
Jun 15, 2018
by Milicevic3306


Praveen Saini

4 Comments
Show 13 previous comments

samarpita
commented
May 28
edited
Oct 19
by samarpita
@Praveen Saini

https://gateoverflow.in/993/gate-cse-2006-question-30 2/4
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 30

 
@Deepak Poonia sir here if instead of and ,given ”or” , then number of final states will be 31 bcz f24, is
also a final state bcz d(s) mod 5=2. Login

We can do this way also 7+30-6 = 31.

 
0

Abhrajyoti00
commented
Oct 19
edited
Oct 19
by Abhrajyoti00
@samarpita It would be

Total states =

Non-final states =

The final states for ‘OR’ :-

 
0

samarpita
commented
Oct 19
@Abhrajyoti00 yes i have corrected..it will be 31.

 
1


D(S) Mod 5 = 2 is Regular.

D(S) Mod 7 != 4 is Regular.

1

Intersection of  above 2 will also be Regular because Regular languages are closed under Intersection
, Therefore Option D is valid.


answered
Nov 3, 2020


vipin.gautam1906

Answer: D

← Previous Next →

← Previous in category Next in category →

Related questions

https://gateoverflow.in/993/gate-cse-2006-question-30 3/4
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 30

 
GATE CSE 2006 | Question: 33

51
Let be a regular language, be a deterministic context-free language and Login

#1

asked
Sep 18, 2014

GATE CSE 2006 | Question: 34

78  Consider the regular language The minimum number of



#2

asked
Sep 22, 2014

GATE CSE 2006 | Question: 31

8  Let SHAM be the problem of finding a Hamiltonian cycle in a graph



#3

asked
Sep 18, 2014

GATE CSE 2006 | Question: 29

69  If is a string over then let denote the number of 's in and



#4

asked
Sep 18, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/993/gate-cse-2006-question-30 4/4
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 31

  Login

GATE CSE 2006 | Question: 31

 3,246 views


asked
in Theory of Computation
Sep 18, 2014
recategorized
Jan 27, 2018
by srestha

Let SHAM  be the problem of finding a Hamiltonian cycle in a graph   with   divisible by
and DHAM   be the problem of determining if a Hamiltonian cycle exists in such graphs. Which one
8
of the following is true? 

A. Both DHAM  and SHAM  are NP-hard 


B. SHAM  is NP-hard, but DHAM  is not 
C. DHAM  is NP-hard, but SHAM  is not 
D. Neither DHAM  nor SHAM  is NP-hard

gatecse-2006
theory-of-computation
p-np-npc-nph
normal


Rucha Shelke

 share
2 Comments
Chhotu
commented
Aug 27, 2017
Just mentioning additional information. 

Dirac's theorem and Ore's theorem are necessary but not sufficient. So 'determining if a Hamiltonian
cycle exists' is also NPH.

 
0

Aakash_
commented
Jan 4, 2019
Chhotu

They are Sufficient Conditions, not necessary.

 
0

2 Answers

https://gateoverflow.in/994/gate-cse-2006-question-31
 1/3
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 31

 
 17
The only difference between SHAM and DHAM, in SHAM |V| is divisible by
constant amount of time.
which can be check in
Login


 S,o the hardness of the two problem will the same. Next, finding hamiltonian cycle comes under NPC
problem and NPC problem is a subset of NPH, so both are NPH.

Best
answer
So, option (A).


answered
Jan 11, 2015
edited
Jun 15, 2018
by Milicevic3306


Vicky Bajoria

4 Comments
Show 3 previous comments

Mahesha999
commented
Jan 9, 2017
really ? changing non decision problem into decision problem ?

 
0

Rakesh K
commented
Jan 10, 2017
@Mahesha999 Your are correct, SHAM is not really a decision problem and is not eligible for NP-hard or

NP-complete.

 
0

Aks9639
commented
Sep 8, 2019
this thread is old but question clarification is important here , 

SHAM3 => defining the soln for HAM-CYCLE, HAM - CYCLE already known NPC, so SHAM3 Clearly a
NPC , no doubt at all,

but DHAM3 is a decision problem , and SHAM3 polynomial verifiable by DHAM3 hence SHAM3 =>
DHAM3

which makes DHAM3 as NPH and since NPC problem is a proper subset of NPH and NP  then
SHAM3 must be NPH , this concludes option A).

 
1


actually  DHAM is well known npc problem. SHAM is optimization problem which is more harder than
decision problem so if decison problem is npc then optimization problem willl also be npc as it is more
1
harder .Now DHAM is poly time reducible to SHAM as with DHAM we can have 3 possible cases :1) no

of vertices is exactly divisible by 3 then it iss direectly reducible to SHAM 2) if no of vertex is 1mod
3just add 2 extraa vertices 3) if no of vertex 2mod3 add 1 extraa vertex thus every instance of DHAM
can be converted to SHAM morever SHAM is verifiable hence np so SHAM is also np complete


answered
May 19, 2018

https://gateoverflow.in/994/gate-cse-2006-question-31 2/3
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 31

 
edited
Dec 1, 2018
by Radha mohan
Login

Radha mohan

Answer: A

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2006 | Question: 16, ISRO-DEC2017-27

21  Let S be an NP-complete problem and Q and R be two other problems not known

#1

asked
Sep 17, 2014

GATE CSE 2006 | Question: 34

78  Consider the regular language The minimum number of



#2

asked
Sep 22, 2014

GATE CSE 2006 | Question: 33

51  Let be a regular language, be a deterministic context-free language and



#3

asked
Sep 18, 2014

GATE CSE 2006 | Question: 30

45  For let denote the decimal value of e.g. Let



#4

asked
Sep 18, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/994/gate-cse-2006-question-31 3/3
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 33

  Login

GATE CSE 2006 | Question: 33


asked
in Theory of Computation
Sep 18, 2014 9,955 views 

Let be a regular language, be a deterministic context-free language and a  recursively


enumerable, but not recursive, language. Which one of the following statements is false?
51

A.  is a deterministic CFL


B.  is recursive
C.  is context free
D.  is recursively enumerable

gatecse-2006
theory-of-computation
normal
identify-class-language


Rucha Shelke

 share
4 Comments
Show 2 previous comments

Lakshman Patel RJIT


commented
Jan 15, 2019
@Mk Utkarsh

https://gateoverflow.in/996/gate-cse-2006-question-33 1/4
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 33

   
How is false

0
Login

Satbir
commented
Jul 26, 2019
edited
Jan 25, 2020
by Lakshman Patel RJIT
is regular ( it is recursive AND it is also recursively enumerable.) i.e.

  is not recursive AND it is recursively enumerable. i.e.

common part of both and

 
6

endurance1
commented
Jan 14, 2021
Apparently this is a paradox, viewing it from set theory point of view seems correct and if viewed by

definitions also it seems correct, set theory is providing wrong answer, why ?

My thought is that both explanations are correct, however the important point is RE but no REC by
saying this we have actually restricted ourself to the outermost track(acc to set diagram), now there is
no way we can move inwards to reach inner RL circle.

So we must expand the properties of RL to matchup with the outer track.

Once we do that both theories align and we have a track which is RECURSIVE ENUMERABLE but not
RECURSIVE, hence the options B becomes false.

Option D however tells the same thing but with correct explanation hence it is correct. Thanks @Satbir
sir

 
0

2 Answers


A. True : DCFL are closed under Intersection with Regular Languages


61 B. False : is recursive hence also decidable, is RE but not Recursive hence it is undecidable.

Intersection of Recursive language and Recursive Enumerable language is Recursive Enumerable

Best
language.
C. True :
Union.
is regular hence also CFL and every DCFL is also CFL and All CFL are closed under

answer D. True : is regular hence also RE; is DCFL hence also RE; RE languages are closed under
Intersection


answered
Jan 19, 2015
edited
Feb 21, 2018
by kenzou


Danish

4 Comments
https://gateoverflow.in/996/gate-cse-2006-question-33 2/4
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 33

 Show 7 previous comments


 Login
sanjaysharmarose
commented
Sep 5, 2020
For option A can we apply this logic ? If not then why?


L1 is RL so it DCFL , L2 is DCFL

Now L1 intersection L2 can be DCFL or non-DCFL because DCFL is not closed under intersection. This
makes option A false.

But we know that DCFL intersection RL is always DCFL which is contradicting above statement.

 
0

smn98
commented
Oct 29, 2020
Counter example for option B:

let be  (regular) and be some recursively enumerable language over (a,b).

Now = , which is recursively enumberable and not recursive.

I am not very sure about the approach, please correct me if I am wrong.

 
0

CheeseCuBES
commented
Feb 8, 2021
for option C,


if L1 is everything, and L2 is a^n b^n

Then L1 U  L2 = everything = regular

But regular languages are context free.

So option C is correct

 
0


L1∩L2 is a deterministic CFL because intersection of any lang. with regular is closed.

5
L3∩L1 is recursive is False because it should be RE {recursive enumerable not recursive}

L1∪L2 is context free is true, because every DCFL is CFL.

L1∩L2∩L3 is recursively enumerable is true.


answered
Nov 12, 2017


Akash Mittal

https://gateoverflow.in/996/gate-cse-2006-question-33 3/4
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2006 | Question: 33

 2 Comments
 Login
JAITLEy41
commented
Nov 12, 2017
can you please explain 4th option ?

 
0

Akash Mittal
commented
Nov 12, 2017
Recursive enumerable is higher set, so, L1∩L2∩L3 whatever lang. may come , we can say it is recursively

enumerable.

 
0

Answer: B

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2006 | Question: 30

45  For let denote the decimal value of e.g. Let


#1

asked
Sep 18, 2014

GATE CSE 2006 | Question: 34

78  Consider the regular language The minimum number of


#2

asked
Sep 22, 2014

GATE CSE 2006 | Question: 31

8  Let SHAM be the problem of finding a Hamiltonian cycle in a graph


#3

asked
Sep 18, 2014

GATE CSE 2006 | Question: 29

69  If is a string over then let denote the number of 's in and


#4

asked
Sep 18, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/996/gate-cse-2006-question-33 4/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2006 | Question: 34

  Login

GATE CSE 2006 | Question: 34

 25,500 views


asked
in Theory of Computation
Sep 22, 2014
edited
Feb 14, 2018
by kenzou

Consider the regular language  The minimum number of  states in any DFA
accepting this languages is:
78

A.
B.
C.
D.

gatecse-2006
theory-of-computation
finite-automata
normal
minimal-state-automata


Rucha Shelke

 share
2 Comments
Mr_22B
commented
Jan 22, 2018
After reading solution, I was like "F*** Awesome Question".

 
12

rawan
commented
Jan 23, 2019
edited
Jan 26, 2019
by rawan
Note: The answer is 9 not because there are 9 states in the DFA. It is 9 because 9 is the the minimum

number of states in any DFA accepting the language. That means, you need to show that this DFA is not
just any DFA, but the minimum DFA, that is, this DFA cannot be minimized further (There are no
unreachable states, and each state is distinguishable from every other state so no two states can be
merged together).

Watch this video if you don't know how to minimize a DFA.

 
2

8 Answers

https://gateoverflow.in/1291/gate-cse-2006-question-34
 1/6
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2006 | Question: 34

 
 90
Given language
Strings , that belongs to the language 

Login



Due to concatenation with if we have three consecutive string lengths in then all higher
Best
answer string lengths will be in

We have strings of length in and so all higher length strings are also in

So, required DFA will be:

So, there are states are final states and states are non-final states ,total number of states are
states .

Hence, option D is true.


answered
Sep 26, 2015
edited
May 4, 2019
by Arjun


Mithlesh Upadhyay

4 Comments
Show 15 previous comments

infodevesh
commented
Nov 21, 2020
Why do you need 3 base case to prove it, cant we just do it like this:


let it be true for any x such that x = 3a +5b

then for x+1, we can write it as : 3a+5b+1

                                                    3a+5b+6-5

https://gateoverflow.in/1291/gate-cse-2006-question-34 2/6
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2006 | Question: 34

   
                                                    3(a+2) + 5(b-1)

                                                    3a’+5b’, thus proved by induction. Login



0

tirth_patel
commented
Apr 1, 2021
@Astha20 we can derive 13 by concatenating 3 1’s with 10 1’s(111 11111 11111)

 
0

jiminpark
commented
Dec 3, 2021
@Omkar Gurav, 17 = 3+3+3+3+5 !

 
0


there will be 9 states. with 1st,4th,6th,7th and 9th state being the final states. with a loop on the ninth
state.

17

 {0,3,5,6,8,9,10,11,12,........} this is the set which will be accepted by the min dfa for this expression.


answered
Oct 28, 2014


Gate Keeda

4 Comments
Show 5 previous comments

Gate Keeda
commented
Dec 24, 2014
I misinterpreted perhaps what he said. Thank you. :)

 
1

David
commented
Nov 1, 2015
Generally we ignore dead/trapped states while counting number of states ..

 
0

Arjun
commented
Nov 6, 2015
not for DFA.

 
5


Minimum number of states in the DFA will be 9, under the assumption that Alphabet consist of only one
symbol {1}, using the fact that all the strings can be generated using the given regular expression
11
except 1, 11, 1111, 1111111 since all of the +ve integers can be expressed as a linear combination of 3

& 5 except 1, 2, 4 & 7.

https://gateoverflow.in/1291/gate-cse-2006-question-34 3/6
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2006 | Question: 34

 
DFA will be as :

Login


answered
Sep 3, 2015


अनुराग पाण्डेय

2 Comments
ANI
commented
Sep 4, 2015
thanks  for your explanation .i had made a mistake.

 
0

अनुराग पाण्डेय
commented
Sep 4, 2015
My pleasure.

 
0


he finite state automata is :

5

Explanation:

It is given that language L = (111 + 11111)*

Strings , that belongs in the language are

L = {null , 111 , 11111, 111111 , 11111111 , 111111111 , 1111111111 , ……. form string length 8 ,
(number of 1’s) , now we can can generate any length of string from length 3 and 5 (i.e. length 8 ,length
9, length 10 , length 11 ,…etc)}

L = {null , 111 , 11111, 111111 , 11111111 , 111111111* }

Strings in length , that belongs in the language

https://gateoverflow.in/1291/gate-cse-2006-question-34 4/6
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2006 | Question: 34

 
L = {0 ,3, 5, 6, 8, 9, 10, 11, …}

So, there are 5 states that are final states and 4 states that are non-final states
Login
Therefore total number of states are 9 states .

hence option D is true.


answered
Sep 15, 2017


Paras Nath

1
2
next »

Answer: D

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2006 | Question: 33

51  Let be a regular language, be a deterministic context-free language and



#1

asked
Sep 18, 2014

GATE CSE 2006 | Question: 31

8  Let SHAM be the problem of finding a Hamiltonian cycle in a graph



#2

asked
Sep 18, 2014

GATE CSE 2006 | Question: 30

45  For let denote the decimal value of e.g. Let



#3

asked
Sep 18, 2014

GATE CSE 2006 | Question: 29

69  If is a string over then let denote the number of 's in and



#4

asked
Sep 18, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us

https://gateoverflow.in/1291/gate-cse-2006-question-34 5/6
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2006 | Question: 34

 
Developed by Chun
Login

https://gateoverflow.in/1291/gate-cse-2006-question-34 6/6
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 6

  Login

GATE CSE 2007 | Question: 6


asked
in Theory of Computation
Sep 22, 2014 4,412 views 

Which of the following problems is undecidable?

24 A. Membership problem for CFGs


B. Ambiguity problem for CFGs


C. Finiteness problem for FSAs
D. Equivalence problem for FSAs

gatecse-2007
theory-of-computation
decidability
normal


Kathleen

 share
2 Comments
Lakshman Patel RJIT
commented
Jan 25, 2020
Membership problem for CFGs, we have well known CYK algorithms.

https://web.cs.ucdavis.edu/~rogaway/classes/120/winter12/CYK.pdf
http://www.cs.nuim.ie/~jpower/Courses/Previous/parsing/node44.html

 
0

Deepak Poonia
commented
Oct 28
Find Video Solution Below:

Video Solution

 
0

2 Answers


Membership problem is decidable as it can be solved by parsers.


35 Finiteness problem is decidable for FSAs (also for CFGs), as we just need to check for a loop in

the DFA.

https://gateoverflow.in/1204/gate-cse-2007-question-6 1/3

11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 6


Equivalence problem for FSAs is decidable as we can take the complement of one FSA
(complement of FSA is another FSA), and do an intersection with the other (FSAs are closed
Login
Best
answer under intersection also), giving a new FSA. If this new FSA accept no string, then the given FSAs
are equivalent, else not equivalent. 
Only ambiguity problem for CFGs are undecidable.

http://gatecse.in/wiki/Grammar:_Decidable_and_Undecidable_Problems

Correct Answer:


answered
Nov 13, 2014
edited
May 10, 2019
by Naveen Kumar 3


Arjun

2 Comments
Veenit
commented
Nov 18, 2019
The equivalence of an FSA needs to be checked both ways,  right?

 
0

Shiva Sagar Rao


commented
Feb 2, 2021
edited
Feb 2, 2021
by Shiva Sagar Rao
Updated link for the link given in answer:


https://gatecse.in/grammar-decidable-and-undecidable-problems/

 
0


equivalence of Regular languages is decidable.

13 1.Membership,

2.Emptiness,

3.Finiteness,

4.Equivalence,

5.Ambiguity,

6.Regularity,

7.Everything,

8.Disjointedness...

All are decidable for Regular languages.

First 3 for CFL.

https://gateoverflow.in/1204/gate-cse-2007-question-6 2/3
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 6

 
Only 1st for CSL and REC.
Login
None for RE.

So option B will be correct one.


answered
Jul 9, 2017


Brij Mohan Gupta

Answer: B

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2007 | Question: 75

26  Consider the following Finite State Automaton: The minimum state automaton

#1

asked
Apr 23, 2016

GATE CSE 2007 | Question: 74

37  Consider the following Finite State Automaton: The language accepted by this

#2

asked
Sep 22, 2014

GATE CSE 2007 | Question: 31

36  Which of the following languages is regular?



#3

asked
Sep 22, 2014

GATE CSE 2007 | Question: 30

24  The language over the alphabet is: not recursive



#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1204/gate-cse-2007-question-6 3/3
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 7

  Login

GATE CSE 2007 | Question: 7

 12,644 views


asked
in Theory of Computation
Sep 22, 2014
retagged
Jul 1, 2017
by Silpa

Which of the following is TRUE?

35 A. Every subset of a regular set is regular


B. Every finite subset of a non-regular set is regular


C. The union of two non-regular sets is not regular
D. Infinite union of finite sets is regular

gatecse-2007
theory-of-computation
easy
regular-language


Kathleen

 share

3 Answers


Correct Option: B

53 Every finite subset of a non-regular set is regular.



Any finite set is always regular. 

being regular any non regular language is a subset of this, and hence (A) is false.
Best
answer If we take a CFL which is not regular, and takes union with its complement (complement of a CFL
which is not regular won't be regular as regular is closed under complement), we get  which is
regular. So, (C) is false. 

Regular set is not closed under infinite union. Example:

Let

Now, if we take infinite union over all , we get

, which is not regular. 

So, (D) is false. 

https://gateoverflow.in/1205/gate-cse-2007-question-7 1/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 7

 
answered
Nov 17, 2014
edited
May 6, 2021
by soujanyareddy13
 Login


Omesh Pandita

4 Comments
Show 11 previous comments

akash_chauhan
commented
Jul 18
how so ?


how union of two non regular languages  given above, is regular !!

 
0

Kabir5454
commented
Jul 18
@akash_chauhan why do you think the union is not regular?

 
0

akash_chauhan
commented
Jul 21


---- 2 days back, I thought of  n as constant in L2.
     and, thereby thinking sol.  for n! = m^n  ( treating “n” as constant )
BUT<>  now, it’s OK 
         → UNION will be regular.

 
0


If a set is finite then it must be regular , as every language which contains finite elements is regular.
Hence, every finite subset of a non-regular set is regular.

6
Every subset of regular set is regular, is false. For example L = { | n ≥ 0} is subset of ∑* and L is

CFL, whereas ∑* is regular. Hence, every subset of regular set need not be regular.

The union of two non-regular sets is not regular, is also a false statement.

For example, consider two CFL’s.

L={ | n ≥ 0} and its complement Lc = { | m ≠ n } U b*a*.

If we take UNION of L and , we will get ∑*, which is regular. Hence the UNION of two non-regular set
may or may not be regular.

The statement, Infinite union of finite sets is regular is also a false statement.


answered
Jul 23, 2019


King Suleiman

https://gateoverflow.in/1205/gate-cse-2007-question-7 2/4

11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 7

 
 3
Some points for Regular Sets:
Login
 A set is always regular if it is finite.
A set is always regular if a DFA/NFA can be drawn for it.

Option A: Every subset of a regular set is regular is False.

For input alphabets a and b, a*b* is regular. A DFA can be drawn for a*b* but a b  for n≥0 which is a
subset of a*b* is not regular as we cannot define a DFA for it.

Option B: Every finite subset of a non-regular set is regular is True.

Each and every set which is finite can have a well-defined DFA for it so whether it is a subset of a
regular set or non-regular set it is always regular.

Option C: The union of two non-regular sets is not regular is False.

For input alphabets a and b, a b  for all n≥0 is non-regular as well as a b  for n≠m is also non-
regular but their union is a*b* which is regular.

Option D: Infinite union of finite sets is regular is False.

For input alphabets a and b sets {ab}, {aabb}, {aaabbb}…….. are regular but their union {ab} U {aabb} U
{aaabbb} U …………………….. gives {a b for n>0} which is not regular.

Courtesy:GeeksForGeeks


answered
Oct 12, 2020


Musa

Answer: B

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2007 | Question: 31

36  Which of the following languages is regular?



#1

asked
Sep 22, 2014

GATE CSE 2007 | Question: 70

27  Match the following: ...


#2
https://gateoverflow.in/1205/gate-cse-2007-question-7 3/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 7


 

asked
Sep 22, 2014

Login
GATE CSE 2007 | Question: 67, ISRO2016-72

53
The address of a class host is to be split into subnets with a - subnet

#3

asked
Sep 22, 2014

GATE CSE 2007 | Question: 50

58  An array of numbers is given, where is an even number. The maximum as well



#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1205/gate-cse-2007-question-7 4/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 29

  Login

GATE CSE 2007 | Question: 29

 8,328 views


asked
in Theory of Computation
Sep 22, 2014
edited
Feb 14, 2018
by kenzou

A minimum state deterministic finite automaton accepting the language

28 number of s and s in   are divisible by and , respectively   has


A. states
B. states
C. states
D. states

gatecse-2007
theory-of-computation
finite-automata
normal
minimal-state-automata


Kathleen

 share
1 comment
Shaik Masthan
commented
May 2, 2020
https://gateoverflow.in/blog/8795/minimal-deterministic-finite-automata

 
2

4 Answers


Answer will be (A) states.

32 We need a separate state for # and # giving total minimum number of


states

 This is a direct consequence of Myhill-Nerode theorem.

Best http://courses.cs.washington.edu/courses/cse322/05wi/handouts/MyhillNerode.pdf
answer


answered
Jan 16, 2015

https://gateoverflow.in/1227/gate-cse-2007-question-29 1/5
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 29

 
edited
Feb 14, 2018
by kenzou
Login

Arjun

4 Comments
Show 11 previous comments

SONU KUMAR 9
commented
Nov 5, 2019
@AHWAN  length of string    and      no. of 'a' & 'b' both are different case .


in case of length of string divisible by 2 and 4 we take L.C.M and we get 4.

IN CASE of no. of 'a' divisible by 2 and no. 'b' divisible by 4  we take multiply and we get 8.

 
2

Harshzf2
commented
Aug 6, 2020
If Anyone came up with the answer 9. That's valid if the question is for divisible by 3 OR divisible by 5

 
0

Pathki Shivamsh
commented
Aug 25, 2020
No,  No.of states remains same even in case of ‘OR’. Only final states will be changed in ‘OR’ case.

Refer this discussion

https://gateoverflow.in/723/gate2001-2-5

 
0


total states will be 15

3

https://gateoverflow.in/1227/gate-cse-2007-question-29 2/5
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 29

  Login


answered
Aug 15, 2021


Harshit2021


Given that number of 0's and 1’s are divisible by 3 and 5, it means that the number of 0’s and 1’s must
be divisible by 15.

2

As the LCM of 3 and 5 is 15, so number of 0’s and 1’s are divisible by 3 and 5 is only possible if of 0’s
and 1’s are divisible by 15. Also modulo 3 will leave a remainder of 0,1,2 (3 states required) and modulo

https://gateoverflow.in/1227/gate-cse-2007-question-29 3/5
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 29

 
5 will leave remainder of 0,1,2,3,4 (5 states required) , so product automata will require (3 × 5=15
states). Login


answered
Jul 23, 2019


King Suleiman


Most of the times the answer the answer for number of states  is cartesian product one dfa going
horizontally and the other one vertically
0


answered
Jul 31, 2021


svas7246

Answer: A

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2007 | Question: 75

26  Consider the following Finite State Automaton: The minimum state automaton

#1

asked
Apr 23, 2016

GATE CSE 2007 | Question: 74

37  Consider the following Finite State Automaton: The language accepted by this

#2

asked
Sep 22, 2014

GATE CSE 2007 | Question: 31

36  Which of the following languages is regular?



#3

asked
Sep 22, 2014

GATE CSE 2007 | Question: 30

24  The language over the alphabet is: not recursive



#4

asked
Sep 22, 2014

https://gateoverflow.in/1227/gate-cse-2007-question-29 4/5
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 29

 
Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Login
Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1227/gate-cse-2007-question-29 5/5
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 30

  Login

GATE CSE 2007 | Question: 30


asked
in Theory of Computation
Sep 22, 2014 6,990 views 

The language over the alphabet is:

24 A. not recursive

B. is recursive and is a deterministic CFL

C. is a regular language

D. is not a deterministic CFL but a CFL

gatecse-2007
theory-of-computation
normal
identify-class-language


Kathleen

 share

4 Answers


has only one comparison that can be done using a DPDA. Hence, its DCFL.

33 Context free languages are a proper subset of Recursive Languages. it is recursive too.


Answer is option B.

Best
answered
Nov 15, 2015
answer edited
Jun 15, 2018
by Milicevic3306


amarVashishth

2 Comments
CSHuB
commented
Jan 31, 2020
We can draw DFA as well?


as the state "2$ will help?

https://gateoverflow.in/1228/gate-cse-2007-question-30 1/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 30

   Isn't it??

0

 Login

Pranavpurkar
commented
4 days ago
CSHuB

not possible.

 
0


L = {0i21i |  i>=0 } is deterministic CFL,

19 Evert DCFL is recursive. As we have membership algorithm for DCFL (Or say CFL in general) , that's why

it is recursive. In fact DCFL is subset of Recursive Languages.

SO answer :-


answered
Nov 14, 2015


Akash Kanase

3 Comments
Raju Kalagoni
commented
Mar 7, 2018
How to find DCFL and CFL ? can you please explain the difference between these two and how to

identify them ?

 
0

meghna
commented
May 11, 2018
Identification of whether DCFL or CFL?

The very basic thing to look out first, is whether  you can generate that language using a PDA or not ?
Relate it with stack and just by using push and pop can you generate it ? If so, its a CFL. Now if the PDA
that you are using, is deterministic at each step, that is you are clear about the next move every single
time, then it's a DCFL, otherwise if there is any non determinism  involved, that is there are some steps
where more than one move is possible, and you are not certain about the action, then its CFL. While
remembering the fact that DCFL is a proper subset of CFL.

Ex:  let L= {anbn}, it is CFL because, with the help of PDA (push down automata), we can recognize it. We
have n a's followed by n b's. we can push all a and corresponding to each b, we can pop a. if they are
equal stack will be empty. if a are more, stack will have a. if stack becomes empty before finishing string,
it means we have more b. It is DCFL as well because, we know we have to push a and pop for b, the
action is deterministic.

On the other hand, {wwR,  where w is a string of a and b} is non deteministic CFL because till half of the
length, we have to push and then we have to pop. but we dont know length. So at each step, we will push

https://gateoverflow.in/1228/gate-cse-2007-question-30 2/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 30

   
the next symbol and pop the previous one to see which one works. so it is non deteminsitic. So a CFL
will be either deterministic or non deterministic.  Login

14

Pranavpurkar
commented
4 days ago
@meghna

Perfectly explained.

 
0


push all 0  then skip 2 then for every 1 pop one 0 .. done by 1 stack without any confusion.. so dcfl.

6
dcfl⊆ cfl ⊆ csl ⊆ rec ⊆re


answered
Nov 15, 2015


Prashant.

3 Comments
Puja Mishra
commented
Jan 1, 2017
transition for skip ??? i am getting little bit confused there ....

 
0

Sandeep Suri
commented
Jan 10, 2018
yes when 2 will come we don't need to perform any operation, therefore, we will bypass (skip) 2 and then

perform a pop operation on seeing 1

 
0

Subbu.
commented
Oct 29, 2021
It should be proper subset..

 
0


The answer is B.

2

answered
Jan 22, 2015


Gate Keeda

Answer: B

https://gateoverflow.in/1228/gate-cse-2007-question-30 3/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 30

 ← Previous
 Next →
Login

← Previous in category Next in category →

Related questions

GATE CSE 2007 | Question: 75

26  Consider the following Finite State Automaton: The minimum state automaton

#1

asked
Apr 23, 2016

GATE CSE 2007 | Question: 74

37  Consider the following Finite State Automaton: The language accepted by this

#2

asked
Sep 22, 2014

GATE CSE 2007 | Question: 31

36  Which of the following languages is regular?



#3

asked
Sep 22, 2014

GATE CSE 2007 | Question: 29

28  A minimum state deterministic finite automaton accepting the language



#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1228/gate-cse-2007-question-30 4/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 31

  Login

GATE CSE 2007 | Question: 31

 11,377 views


asked
in Theory of Computation
Sep 22, 2014
retagged
Jul 1, 2017
by Silpa

Which of the following languages is regular?

36 A.

B.

C.

D.

gatecse-2007
theory-of-computation
normal
regular-language


Kathleen

 share
3 Comments
Ram Swaroop
commented
Aug 13, 2019
How option B CFL please explain

 
0

mohan123
commented
Sep 18, 2019
wxwR  ∣,w∈{0,1}+ ,x∈{0,1}*

@Vikrant Singh 

it is regular ? if yes  how ? 

 
0

endurance1
commented
Nov 9, 2020
DFA for option C,

https://gateoverflow.in/1229/gate-cse-2007-question-31 1/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 31

  Login

Source: Geeksforgeeks

 
2

2 Answers


Correct Option: C

38 A. CFL

B. CFL

Best
C. Regular, language is string starting and ending with the same symbol and having length at least

D. CFL
. e.g. or

answer
http://gatecse.in/wiki/Identify_the_class_of_the_language


answered
Dec 3, 2014
edited
Jun 7, 2021
by Lakshman Patel RJIT


Vikrant Singh

4 Comments
Show 8 previous comments

ayushsomani
commented
Dec 5, 2019
Since, length of x is not restricted, therefore, we just make w as first bit and w as last bit. 

 
0

Shiva Sagar Rao


commented
Feb 2, 2021
edited
Feb 2, 2021
by Shiva Sagar Rao
Updated link for the link given in answer:


https://gatecse.in/identify-the-class-of-a-given-language/

 
0

Abhrajyoti00
commented
Oct 20

https://gateoverflow.in/1229/gate-cse-2007-question-31 2/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 31

 
Regular Expression for Option C)   is →
Login
 

 
0


The regular expression corresponding to option C is:

0 (0+1)+ 0 + 1 (0+1)+ 1

1
Any string which begins and ends with same symbol, can be written in form of “wxwR”

For example consider a string: 10010111, in this string “w=1” , “x= 001011” and wr = 1. Hence any string
which begins and ends with either “0” or with “1” can be written in form of “wxwR” and L={wxwR | x,w ϵ
{0,1}+ } is a regular language.


answered
Jul 23, 2019


King Suleiman

Answer: C

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2007 | Question: 7

35  Which of the following is TRUE? Every subset of a regular set is regular Every finite

#1

asked
Sep 22, 2014

GATE CSE 2007 | Question: 8, ISRO2011-31

31  How many -to- line decoders with an enable input are needed to construct a -

#2

asked
Sep 22, 2014

GATE CSE 2007 | Question: 75

26  Consider the following Finite State Automaton: The minimum state automaton

#3

asked
Apr 23, 2016

GATE CSE 2007 | Question: 74

https://gateoverflow.in/1229/gate-cse-2007-question-31 3/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 31


 
37 Consider the following Finite State Automaton: The language accepted by this
#4 
asked
Sep 22, 2014 Login

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1229/gate-cse-2007-question-31 4/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 74

  Login

GATE CSE 2007 | Question: 74

 10,099 views


asked
in Theory of Computation
Sep 22, 2014
edited
Apr 30, 2019
by Pooja Khatri

Consider the following Finite State Automaton:

37

The language accepted by this automaton is given by the regular expression

A.

B.

C.

D.

gatecse-2007
theory-of-computation
finite-automata
normal


Kathleen

 share
3 Comments
Verma Ashish
commented
Sep 4, 2018
We can reduce given automata to this-

https://gateoverflow.in/1270/gate-cse-2007-question-74 1/6
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 74

  Login

 
9

smsubham
commented
Mar 9, 2020
Approach:


Sometimes there is a tricky question where even this  type of FA accept (a+b)* , but here b not accepted
so that isn't possible.

We can have any number of b then a, q3 is unreachable so forget about it. For q1 and q2 we have
transition for all symbol and it's within these two states so it will accepts everything after this. So
b*a(a+b)*

 
0

raja11sep
commented
Dec 19, 2021
The smallest string the NFA accepting is “a” . Now option elimination.

 

 
0

6 Answers


The answer is C.

42
You can see that both the states, and are final and are accepting .

Best
[Edit]

1. is unreachable state, hence it can be removed.


2. States and are indistinguishable, so, they can be merged. 
answer


answered
Jan 22, 2015
edited
Feb 15, 2018
by kenzou


Gate Keeda

https://gateoverflow.in/1270/gate-cse-2007-question-74 2/6
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 74

 4 Comments
Show 5 previous comments
 Login

Abhrajyoti00
commented
5 days ago
No it is also correct. There are multiple ways to write the same language.

 
1

Pranavpurkar
commented
5 days ago
Abhrajyoti00

yes , btw both are generating the same strings .

 
1

Abhrajyoti00
commented
5 days ago
My earlier eg was catching the first .


Your eg was catching the middle .

Even is also correct (It is catching the last ).

All mean: Atleast 1

 
1


given DFA accept a but option A and D cant so A and D are eliminated 

option B accept epsilon but given DFA cant accept epsilon so B eliminated 

16
Hence Ans is C

q3 i unreachabl state wo we remove it now both q1 and q2 are equivalent so they can combine now we
easily find regular expression for it : b*a(a+b)*


answered
Sep 1, 2017


Gate Ranker18


I will proceed with elimination of options

Option A: wrong because, string "ba" is accepted by given DFA. R.E given here can't generate it.

9
Option B: epsilon can't be accepted by given DFA. Given R.E generates epsilon

Option D: Same reason as option A. As "ba" can't be generated here too. The least it can generate are
aa,baa,bbaa... so on..

Option C is correct. How???

https://gateoverflow.in/1270/gate-cse-2007-question-74 3/6
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 74

 
After reaching q1, the DFA can accept any string generated by the alphabet{a,b}. b* is obvious from the
given figure. to reach q1 we need atleast one a. Hence, b*a(a+b)^* is correct R.E Login


answered
Jul 4, 2017


suman08513

1 comment
Agnel A
commented
Jan 23, 2018
minimal string accepts by A&D are 3a's, 2 a's but from the figure, we can see that string contain one 'a'  is

minimal.

 
1


The answer is C

1 It is very clear from the diagram that q3 is unreachable. Hence it can be removed.

After its removal the diagram looks like

Based on Arden’s Theorem of converting DFA to Regular Expression,

It states that,

Let P and Q be two regular expressions over ∑.

If P does not contain a null string ∈, then,

R = Q + RP has a unique solution i.e. R = QP*

STEPS for constructing REGEX

1. Form equation for each state and add  ∈ in the initial state equation
2. Bring final state in the form of R = Q + RP

In case of having multiple final state,


https://gateoverflow.in/1270/gate-cse-2007-question-74 4/6
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 74

 
1. Write Regex for each final state and add them all to arrive at the final solution
Login
For the above problem,

q0 = q0.b + ∈  → 1 (Epsilon is added as part of step 1)

q1 = q0.a + q1.b + q2.a  -→ 2

q2 = q1.a + q2.b → 3

Now Compare equation 1 with R = Q+RP , (R = q0 ; Q= ∈ ; P = b)

thus q0 = ∈ . b*

q0 = b*  

Substituting q0 value in equation 1, we get

q1 = b*.a + q1.b + q2.a → 4

Since our problem contains two final state add the two state to arrive at the final solution

ADD equation 2 and 4

q1 + q2 = b*.a + q1.b + q2.a + q1.a + q2.b

q1 + q2  = b*.a + q1(a + b) + q2 (a+b)

q1 + q2  = b*.a + (q1 + q2)(a+b) → 5

Compare equation 5 with R = Q+RP , (R = q1 + q2 ; Q= a.b* ; P = (a+b)  )

Thus,

q1+q2 = b*.a(a+b)*   ///// R = Q + RP has a unique solution i.e. R = QP*


answered
Aug 11, 2021


Krithika Kumaran

1
2
next »

Answer: C

← Previous Next →

← Previous in category Next in category →

https://gateoverflow.in/1270/gate-cse-2007-question-74 5/6
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2007 | Question: 74

 Related questions  Login

GATE CSE 2007 | Question: 75

26  Consider the following Finite State Automaton: The minimum state automaton

#1

asked
Apr 23, 2016

GATE CSE 2007 | Question: 29

28  A minimum state deterministic finite automaton accepting the language



#2

asked
Sep 22, 2014

GATE CSE 2007 | Question: 31

36  Which of the following languages is regular?



#3

asked
Sep 22, 2014

GATE CSE 2007 | Question: 30

24  The language over the alphabet is: not recursive



#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1270/gate-cse-2007-question-74 6/6
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2007 | Question: 75

  Login

GATE CSE 2007 | Question: 75

 6,524 views


asked
in Theory of Computation
Apr 23, 2016
edited
Jun 28, 2019
by Pooja Khatri

Consider the following Finite State Automaton:

26

The minimum state automaton equivalent to the above FSA has the following number of states:

A.
B.
C.
D.

normal
gatecse-2007
theory-of-computation
finite-automata
minimal-state-automata


go_editor

 share

3 Answers


Answer will be 2 state.

33

https://gateoverflow.in/43514/gate-cse-2007-question-75 1/4
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2007 | Question: 75

   Login

Best
answer


answered
Apr 23, 2016
edited
Jun 4, 2021
by S k Rawani


ManojK

1 comment
Manu Thakur
commented
Nov 28, 2017
1. q3 is unreachable state, hence it can be removed.


2. States q1 and q2 are indistiguishable, so, they can be merged.

 
20


It is B.

11
The state Q3 is redundant as it is not reachable. And the Regular expression b*a(a+b)* can be made

with two states.

Q1-->b-->Q1

Q1-->a-->Q2

Q2-->a-->Q2

Q2-->b-->Q2.

Clearly there are 2 states.


answered
Apr 29, 2016

https://gateoverflow.in/43514/gate-cse-2007-question-75 2/4
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2007 | Question: 75


Gate Keeda
 Login



Minimum Finite Automata = DFA - (Unreachable States + Equal States)
9                                       = DFA - ( q3 + q2)

Here q2 is equal state with q1 and q3 is unreachable state

So total 2 states left.  

Hence Option B is Ans.


answered
Dec 11, 2016


Rajesh Pradhan

2 Comments
Dulqar
commented
Jan 9, 2017
PLease tell how Q2  and q1 are equal ?

 
0

Yash4444
commented
Jul 15, 2017
Partition the sets in 2 parts final and non final states you will note that all transitions of q1 and q2 is in

same set like that q1 and q2 is equal.

 
6

Answer: B

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2007 | Question: 29

28  A minimum state deterministic finite automaton accepting the language


#1
https://gateoverflow.in/43514/gate-cse-2007-question-75 3/4
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2007 | Question: 75


 

asked
Sep 22, 2014

Login
GATE CSE 2007 | Question: 74

37
Consider the following Finite State Automaton: The language accepted by this
#2

asked
Sep 22, 2014

GATE CSE 2007 | Question: 31

36  Which of the following languages is regular?


#3

asked
Sep 22, 2014

GATE CSE 2007 | Question: 30

24  The language over the alphabet is: not recursive


#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/43514/gate-cse-2007-question-75 4/4
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 9

  Login

GATE CSE 2008 | Question: 9


asked
in Theory of Computation
Sep 11, 2014 6,059 views 

Which of the following is true for the language

25

A. It is not accepted by a Turing Machine


B. It is regular but not context-free
C. It is context-free but not regular
D. It is neither regular nor context-free, but accepted by a Turing machine

gatecse-2008
theory-of-computation
easy
identify-class-language


Kathleen

 share
3 Comments
mrinmoyh
commented
Sep 17, 2019
TM is supposed to be the equivalent of modern computer.


Now in modern computer we can write program to find prime numbers.i.e there is an algorithm to do
this.

so,this is accepted by TM, moreover it's a Recursive language(halting TM).

 
3

Ajitgate21
commented
Oct 17
@mrinmoyh (TM is supposed to be the equivalent of modern computer) This line supper;  but can you

explain why not cfl?

 
0

Abhrajyoti00
commented
Oct 19
@Ajitgate21 To prove is prime we need division operation on infinite powers which is not possible by

PDA. This is why it is not CFL.

 
0

https://gateoverflow.in/407/gate-cse-2008-question-9 1/4
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 9

3 Answers
  Login



We have algorithms to generate prime numbers we can generate sequence of for the given
language, hence strings as defined by the language definition.
33

So, by Church Turing Thesis we can say that there exists a Turing Machine which can accept the given

Best
language.

Answer is option D.
answer


answered
Nov 8, 2015
edited
Jun 15, 2018
by Milicevic3306


amarVashishth

4 Comments
Show 2 previous comments

akash.dinkar12
commented
Sep 4, 2018
mehul vaidya 

https://gateoverflow.in/104949/l-ap%C2%A0%E2%88%A3-p%C2%A0is-a-prime%C2%A0

 
0

mehul vaidya
commented
Sep 4, 2018
@akash.dinkar


there is one statement in link you provided

"NDTM halts on every input and language accepted by NDTM will be CSL "

Do you know any reference for this?

I tried to search on net , i did not find anything useful

 
0

jaswanth431
commented
Aug 9, 2021
yes

 
0


There ar some languages which except by LBA.( Must for Gate Aspirants)

1 See the 4th point which says the given language is CSL.


so it is neither Regular nor CFL, but it is CFL so it is must it is accepted by Turing machine. 

https://gateoverflow.in/407/gate-cse-2008-question-9 2/4
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 9

  Login


answered
Jan 16, 2021


Surya_Dev Chaturvedi


Ans is (D)

0 
answered
Sep 12, 2014


Keith Kr

4 Comments
Show 2 previous comments

rish1602
commented
Nov 2, 2020
why is it not Regular…. as in we can form NFA for it ??

 
0

vaibhavkedia968
commented
Nov 12, 2020
The language given in the question is a well known example of CSL, and it can be proved that it is not RL

or CFL using their respective pumping lemmas.

 
0

Sonu12345
commented
Aug 25
Try to make lba for given language?

 
0

https://gateoverflow.in/407/gate-cse-2008-question-9 3/4
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 9


Answer: D
 Login

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2008 | Question: 48

25  Which of the following statements is false? Every NFA can be converted to an



#1

asked
Sep 12, 2014

GATE CSE 2008 | Question: 13, ISRO2016-36

30  If and are recursively enumerable then is regular context-free context-



#2

asked
Sep 12, 2014

GATE CSE 2008 | Question: 10

43  Which of the following are decidable? Whether the intersection of two regular

#3

asked
Sep 12, 2014

GATE CSE 2008 | Question: 65

42  Which of the following is NOT true of deadlock prevention and deadlock avoidance

#4

asked
Sep 12, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/407/gate-cse-2008-question-9 4/4
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 10

  Login

GATE CSE 2008 | Question: 10

 10,794 views


asked
in Theory of Computation
Sep 12, 2014
edited
Jun 23, 2019
by akash.dinkar12

Which of the following are decidable?

43 I. Whether the intersection of two regular languages is infinite


II. Whether a given context-free language is regular


III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free

A. I and II
B. I and IV
C. II and III
D. II and IV

gatecse-2008
theory-of-computation
decidability
easy


Kathleen

 share
4 Comments
Show 5 previous comments

Doodle)
commented
Jan 4, 2020
It is membership problem and if u check  the decidability table ,it is clearly seen that the context free

languages are decidable when it comes to membership problems!

 
0

Jamyang Louts
commented
Dec 6, 2020
Whether a given grammar is a context free reduces to membership problem.


So membership of context free grammar is decidable.

 
0

Deepak Poonia
commented
Oct 28

Know the CORRECT Reasoning of Option 4th. Watch the following Detailed Video Solution:

https://gateoverflow.in/408/gate-cse-2008-question-10 1/5
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 10

   
Detailed Video Solution, With Correct Reasoning of 4th Statement

0
Login

3 Answers


Lets see options one by one :

43 I. The language here will be regular as intersection of regular languages will lead to regular

language only. And we know that given a regular language, whether it is finite or not is a

Best
decidable problem. This can be seen by observing the DFA -- if DFA contains a state which
contains a loop and that state is reachable from the start state and that state is either a final
state or leading to final state, then the language will be infinite.

answer  
II. The regularity property is undecidable for context free languages. Hence, it is undecidable.
Details regarding this : https://cs.stackexchange.com/questions/19482/why-is-deciding-
regularity-of-a-context-free-language-undecidable

 
III. Now equivalence of two CFLs is also an undecidable property. Hence, given  PDAs which is
nothing but characterizing CFLs, whether the  CFLs will be same or not cannot be decided.

 
IV. Given a grammar, it is context free iff its productions are of the type  which can
be verified with a Turing machine. Hence, it is a decidable property..

Hence, (B) should be correct answer.


answered
Aug 17, 2017
edited
Jun 15, 2018
by Milicevic3306


Habibkhan

2 Comments
chauhansunil20th
commented
Nov 5, 2018
"This can be seen by observing the DFA..If DFA contains a state which contains a loop" there should be a

mechanical solution to this problem. we have eyes so we can know that there is a loop in DFA but how a
m/c will recognize it?

 
0

Manu Shaurya
commented
Jun 8, 2021
@chauhansunil20th https://www.geeksforgeeks.org/detect-cycle-in-a-graph/

 
0

https://gateoverflow.in/408/gate-cse-2008-question-10 2/5

11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 10

 
 24
(1) Intersection of two regular languages is regular. And checking if a regular language is infinite is
decidable.
Login
 (2) Undecidable

(3) Undecidable

(4) Decidable as we just have to check if the grammar obeys the rules of CFG. (Obviously undecidable
had it been language instead of grammar)

Reference: http://gatecse.in/wiki/Grammar:_Decidable_and_Undecidable_Problems


answered
Sep 12, 2014


gatecse

4 Comments
Show 6 previous comments

Nitesh Singh 2
commented
Jun 22, 2019
edited
Jan 26, 2020
by Nitesh Singh 2
whether a grammar is context-free or not we can determine it by checking for CFG property on the

grammar, not by CYK algorithm. The CYK algorithm is used to check whether a given string could be
generated by a CFG grammar or not. and YES if it were language instead of grammar that is
undecidable.

 
2

MohanK
commented
Dec 10, 2020
@Nitesh Singh 2 @gatecse, 

I can understand, we can check a Grammar is CFG or not.

But, I can’t understand, why is it mentioned,


Obviously undecidable had it been language instead of grammar

 
1

neel19
commented
Aug 26, 2021
same doubt as Mohank

 
0


Answer – B ( 1st and 4th )

1 as we know, every thing is decidable for regular languages.

https://gateoverflow.in/408/gate-cse-2008-question-10 3/5
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 10

  
and for CFL only 3 thing are decidable.
Login
1st) Membership Problems ( Whether the given rammer is CFL )

2nd ) Emptiness problem ( The given language is empty or not)

3rd ) Finitness Problem( Means the given language is finte or not).  


answered
Jan 16, 2021


Surya_Dev Chaturvedi

Answer: B

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2008 | Question: 48

25  Which of the following statements is false? Every NFA can be converted to an



#1

asked
Sep 12, 2014

GATE CSE 2008 | Question: 13, ISRO2016-36

30  If and are recursively enumerable then is regular context-free context-



#2

asked
Sep 12, 2014

GATE CSE 2008 | Question: 9

25  Which of the following is true for the language It is not



#3

asked
Sep 11, 2014

GATE CSE 2008 | Question: 65

42  Which of the following is NOT true of deadlock prevention and deadlock avoidance

#4

asked
Sep 12, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us

https://gateoverflow.in/408/gate-cse-2008-question-10 4/5
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 10

 
Developed by Chun
Login

https://gateoverflow.in/408/gate-cse-2008-question-10 5/5
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 13, ISRO2016-36

  Login

GATE CSE 2008 | Question: 13, ISRO2016-36

 9,744 views


asked
in Theory of Computation
Sep 12, 2014
edited
Jun 20, 2021
by Lakshman Patel RJIT

If and  are recursively enumerable then is

30 A. regular

B. context-free
C. context-sensitive
D. recursive

gatecse-2008
theory-of-computation
easy
isro2016
recursive-and-recursively-enumerable-languages


Kathleen

 share
3 Comments
Utkarsh Pathak
commented
Dec 4, 2020
Doubt→ why regular is not the answer all regular languages are also closed in complement.


Answer→  L = {a^n b^n C^n} is a CSL, hence it is RE language too as every CSL is RE as per the Chomsky
hierarchy.

Complement of L, L' is also CSL as CSL is closed under complement operation. Hence L' is also RE.

Now, see the case, both L and L' are RE, but L is not regular.

 
0

Jordan71
commented
Dec 19, 2021
While attempting this question, I was sure that it is Recursive, CSL and not CFL.


But I got confused with the Option 1, as Regular Languages are also closed under Intersection so option
1 is correct too but it is not CFL.

So, my doubt is that, while attempting this type of question which are based on Closure Properties, do
we have to use the Hierarchical approach {Recursive --> CSL ---> CFL ---> Regular} if it fails in between we
don't have to check further?

Is it the right approach?

 
0

https://gateoverflow.in/411/gate-cse-2008-question-13-isro2016-36 1/6
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 13, ISRO2016-36

 Arjun
commented
Dec 19, 2021

If you're saying L is CSL, it is wrong. If you're saying L is regular that is also wrong. And on what basis is

Login

this question based on closure property?

 
0

5 Answers


(D) recursive

40
is recursively enumerable means a accepts all strings in is recursively enumerable means


a accepts all strings in . So, we can always decide if a string is in or not, making recursive.

http://goo.gl/RtV8MO
Best
answer

answered
Sep 12, 2014
edited
Jun 20, 2021
by Lakshman Patel RJIT


Keith Kr

3 Comments
HiteshRishi
commented
Nov 19, 2017
Let say if L is regular then L(complement) is also regular then both are RE.???


also if L is CFG then L(complement) is recursive(as CFG are not closed under complementation) then
also both will be RE.???

same with CSG and recursive

Then why not all option is correct?

Plz explain

 
1

Manu Thakur
commented
Nov 19, 2017
@Hitesh


L={ } is a CSL, hence it is RE language too as every CSL is RE as per the Chomsky hierarchy.

Complement of L, L' is also CSL as CSL is closed under complement operation. Hence L' is also RE.

Now, see the case, both L and L' are RE, but L is neither regular nor CFL.

 
3

Arjun
commented
Jun 25, 2018
Ref:

https://gateoverflow.in/411/gate-cse-2008-question-13-isro2016-36 2/6
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 13, ISRO2016-36

  Login

 
9


See folks I was also confused at first but now its cleared, lets see how

4
We all know why option d is correct since recursive lang is closed under complementation and hence L'

is also Recursive lang therefore L' is RE lang also

BUT what if the language is regular lang. , if L is regular that means its CFL also but CFL's
complementation property is not closed right? therefore L' is not CFL and hence not Rec. lang and
hence not RE lang.

but you may argue that if L is regular and we first check if its L' is regular or not and since its regular
therefore L' is CFL hence CSL and hence recursive and hence RE lang.  but thats not the procedure first
we need to go up till the position we can in the language itself till complementation property gets
violated like we went up from regular to CFL and there complementation property got violated and
hence we became sure ok this will not be our answer.

now you may again argue then why did we not go from recursive lang. to RE lang. ,its because in the
question its mentioned L is RE lang as well as L' is RE lang.

https://gateoverflow.in/411/gate-cse-2008-question-13-isro2016-36 3/6
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 13, ISRO2016-36

 
 

Login
Hope I could clear it a bit


answered
Dec 4, 2018


soumam007


as @Manu Thakur said

3 L = {a^n b^n c^n} is a CSL, hence it is RE language too as every CSL is RE as per the Chomsky hierarchy.

Complement of L, L' is also CSL as CSL is closed under complement operation. Hence L' is also RE.

Now, see the case, both L and L' are RE, but L is neither regular nor CFL.

Now if the question is "If L and L' are recursively enumerable then L is definitely"      

then answer is option D 

but if it is "If L and L' are recursively enumerable then L  may be" 

then answer is ALL OF THESE


answered
Jan 12, 2019


soumam007


Recursively enumerable language is NOT Closed under complementation where as Recursive lang is
Closed Under complementation .
2

Ans D) Recursive , is correct option.


answered
May 3, 2017


Warrior

4 Comments
Show 2 previous comments

Manu Thakur
commented
Nov 19, 2017

https://gateoverflow.in/411/gate-cse-2008-question-13-isro2016-36 4/6
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 13, ISRO2016-36

   
@warrior though your answer is correct but logic is incorrect!

0
Login

Warrior
commented
Nov 19, 2017
@ Manu Thakur The logic is simple, If L is recursively enumerable, then the complement of L is

recursively enumerable if and only if L is also recursive.For proof just see the best ans.Actually, this is
one of the best methods to differentiate (or to check whether the lang is rec or rel) B/w Recursive
language and Recursively Enumerable language.

 
1

adityaaswal
commented
Oct 28, 2018
" as every CSL is RE as per the Chomsky hierarchy. " isn't it the other way around


Every CSL is regular

 
0

1
2
next »

Answer: D

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2008 | Question: 16, ISRO2016-60

31  A clustering index is defined on the fields which are of type non-key and ordering

#1

asked
Sep 12, 2014

GATE CSE 2008 | Question: 14, ISRO2016-74

37  What is the maximum size of data that the application layer can pass on to the

#2

asked
Sep 12, 2014

GATE CSE 2008 | Question: 48

25  Which of the following statements is false? Every NFA can be converted to an



#3

asked
Sep 12, 2014

GATE CSE 1996 | Question: 2.13, ISRO2016-28

47  The average number of key comparisons required for a successful search for

#4

asked
Oct 9, 2014

https://gateoverflow.in/411/gate-cse-2008-question-13-isro2016-36 5/6
11/4/22, 9:52 PM Theory of Computation: GATE CSE 2008 | Question: 13, ISRO2016-36

  Login
Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/411/gate-cse-2008-question-13-isro2016-36 6/6
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 48

  Login

GATE CSE 2008 | Question: 48

 6,933 views


asked
in Theory of Computation
Sep 12, 2014
retagged
Jul 4, 2017
by Arjun

Which of the following statements is false?

25 A. Every NFA can be converted to an equivalent DFA


B. Every non-deterministic Turing machine can be converted to an equivalent deterministic Turing


machine

C. Every regular language is also a context-free language

D. Every subset of a recursively enumerable set is recursive

gatecse-2008
theory-of-computation
easy
recursive-and-recursively-enumerable-languages


Kathleen

 share

4 Answers


There exists a set of languages which is RE but not REC ( i.e. Recursively Enumerable but not
Recursive), this set is a subset of RE but is Not Recursive.
31

Option D tells us that every subset of RE is REC this is false.


Best
Hence, option D is chosen.


answered
Nov 6, 2015
answer
edited
Jun 15, 2018
by Milicevic3306


amarVashishth

2 Comments
ankyAS
commented
Dec 20, 2016

https://gateoverflow.in/461/gate-cse-2008-question-48 1/3
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 48

 
is B correct?

Login
every non-deterministic  turning machine is equal to deterministic one.?

 
0

Arjun
commented
Dec 20, 2016
yes, but it is "equivalent" not "equal". Equal requires them to be exactly same- which is not. But they are

equivalent in the sense that both accept the same class of languages - recursively enumerable set.

 
17


A language is recursively enumerable if there exists a Turing machine that accepts every string of the
language, and does not accept strings that are not in the language. Strings that are not in the language
8
may be rejected or may cause the Turing machine to go into an infinite loop.

A recursive language can't go into an infinite loop, it has to clearly reject the string, but a recursively
enumerable language can go into an infinite loop.

So, every recursive language is also recursively enumerable. Thus, the statement ‘Every subset of a
recursively enumerable set is recursive’ is false.

Thus, option (D) is the answer.


answered
Apr 12, 2017


Regina Phalange


(D) is correct answer

2 
answered
Sep 12, 2014

edited
Sep 12, 2014
by Keith Kr


Keith Kr

2 Comments
gatecse
commented
Sep 12, 2014
Yes. is recursively enumerable and any non recursively language must be a subset of this.

 
9

Ekta07_GATE
commented
Jan 5, 2019
Do recursively enumerable language and recursive language are synonyms or different?

 
0

https://gateoverflow.in/461/gate-cse-2008-question-48 2/3

11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 48

 
 2
Every NFA can be converted into DFA (as there exist a standard procedure to convert NFA into DFA).
Also, every non-deterministic Turing machine can be converted to an equivalent deterministic Turing
Login
machine. Every regular language is also a CFL , since if a language can be recognized by Finite
 automata, then it must also be recognize by PDA (as PDA is more powerful than FA). But every subset
of recursively enumerable need not be recursive.


answered
Aug 14, 2020


keshore muralidharan

Answer: D

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2008 | Question: 13, ISRO2016-36

30  If and are recursively enumerable then is regular context-free context-



#1

asked
Sep 12, 2014

GATE CSE 2008 | Question: 10

43  Which of the following are decidable? Whether the intersection of two regular

#2

asked
Sep 12, 2014

GATE CSE 2008 | Question: 9

25  Which of the following is true for the language It is not



#3

asked
Sep 11, 2014

GATE CSE 2008 | Question: 65

42  Which of the following is NOT true of deadlock prevention and deadlock avoidance

#4

asked
Sep 12, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/461/gate-cse-2008-question-48 3/3
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 49

  Login

GATE CSE 2008 | Question: 49

 10,776 views


asked
in Theory of Computation
Sep 12, 2014
edited
Apr 14, 2019
by Pooja Khatri

Given below are two finite state automata ( indicates the start state and indicates a final state)

59

Which of the following represents the product automaton ?

A. B. C. D.

gatecse-2008
normal
theory-of-computation
finite-automata


Kathleen

 share
4 Comments
Show 2 previous comments

Payal Rastogi
commented
Jan 19, 2016
thanks

 
0

Ravi prakash pandey


commented
Jan 9, 2018
ans will be option B bcz in last two row entries are (Q,P) and (P,Q)

 
0

Manu Shaurya
commented
Jun 21, 2021
For those finding it difficult to map the states, in ZxY:

https://gateoverflow.in/462/gate-cse-2008-question-49 1/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 49

   
Start State → b→ Final State & Final State→ b→ Start State. This can be used to eliminate the options
B, C, D. But although A satisfies first three transitions, last one wrongly given in the option. Login

1

4 Answers


54

Best
answer
is and is in choice. So, the answer should be (A) but in the row for , it should be and
and not and . 


answered
Dec 5, 2014
edited
Apr 15, 2019
by akash.dinkar12


Arjun

4 Comments
Show 19 previous comments

KUSHAGRA गुप्ता
commented
Dec 2, 2019

https://gateoverflow.in/462/gate-cse-2008-question-49 2/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 49

  Login

 
1

Sanjeev kumar Sen


commented
Sep 6, 2021
@ayush upadhaya sir mera bhi same table aya ha

 
0

Sanjeev kumar Sen


commented
Sep 6, 2021
@arjun sir i think you have made table of y*z which is incorrect

 
0


Correct answer is option A. 

22 New final state where finals of both FA's are together.


https://gateoverflow.in/462/gate-cse-2008-question-49 3/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 49

  Login


answered
Oct 23, 2018
edited
Nov 2, 2018
by Mostafize Mondal

https://gateoverflow.in/462/gate-cse-2008-question-49 4/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 49


Mostafize Mondal  Login

4 Comments
Show 2 previous comments

jeeruajay
commented
Aug 27, 2020
Hi,


  When we do Z x Y then from Z → a (it goes to state 2), From Y → a (it goes to state 1), from 11 by
reading a, it as to go 21, but your transition goes to 12 how?

let me know if I’m wrong?

 
0

raja11sep
commented
Jul 11, 2021
@jeeruajay  You are correct I also got the same.

 
0

GateOverflow04
commented
4 days ago
@gatecse @Kabir5454

@Abhrajyoti00 

see the comment of @jeeruajay

I am also getting the same thing.

 
0


Another alternative to get the answer can be :

10 Y represents strings with odd number of b {Nb(W) mod 2 = 1)} and Z represents odd number of strings

{|W| mod 2 =1}

If we take the product automata ZxY i.e. Odd number of String and Odd number of b in string which is
nothing but "Strings with Odd no of b and Even no of a" Draw the mod m/c for this and pick the correct
option i.e. A


answered
Nov 4, 2015


aayushranjan01

1 comment
krishn.jh
commented
Nov 18, 2018
Yes this way we can check the correct option.

https://gateoverflow.in/462/gate-cse-2008-question-49 5/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 49

  
0

 Login



Refer this pdf i think you will get all concepts related cross product

7
https://www.google.co.in/url?

sa=t&source=web&rct=j&url=https://www.andrew.cmu.edu/user/ko/pdfs/lecture-
3.pdf&ved=0ahUKEwjVofen6dnKAhUIbY4KHbzZALUQFggaMAA&usg=AFQjCNGzYD5ZB3il9wvu9ScUQ6
vuX5u8Wg&sig2=XVbLlspxl22Zjd1yeew1Kg


answered
Feb 2, 2016


Parth Lathiya

1 comment
Ekta07_GATE
commented
Jun 29, 2019
@Mostafize Mondal

Bro you did Y X Z. But we have to perform

Z X Y.

But yeah we have to choose option A) ( last two rows are wrong-print mistake)

 
0

Answer: A

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2008 | Question: 52

45  Match the following NFAs with the regular expressions they correspond to: P Q R S

#1

asked
Sep 12, 2014

GATE CSE 2008 | Question: 53

31  Which of the following are regular sets?


#2
https://gateoverflow.in/462/gate-cse-2008-question-49 6/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 49


 

asked
Sep 12, 2014
Login
GATE CSE 2008 | Question: 51

61
Match the following: $\small{\begin{array}{|ll|ll|}\hline \text{E.} & \text{Checking

#3

asked
Sep 12, 2014

GATE CSE 2008 | Question: 83

29  Consider the following diagram The minimum number of tables needed to



#4

asked
Nov 27, 2016

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/462/gate-cse-2008-question-49 7/7
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 51

  Login

GATE CSE 2008 | Question: 51

 10,967 views


asked
in Theory of Computation
Sep 12, 2014
edited
Apr 14, 2019
by Pooja Khatri

Match the following:

61

A.
B.
C.
D.

gatecse-2008
normal
theory-of-computation
grammar


Kathleen

 share
2 Comments
set2018
commented
Sep 21, 2017
https://gateoverflow.in/2461/gate1994_1-18

 
3

pritishc
commented
Dec 8, 2019
If anyone is interested, the languages for checking that identifiers are declared before use and matching

formal params to actual params of functions are both described in the dragon book on compilers.

The existence of these constructs raises the level of programming languages like C/C++ from context
free to context sensitive (both are CSLs).

 
2

https://gateoverflow.in/463/gate-cse-2008-question-51 1/6
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 51

4 Answers
  Login



H-S is true because strings generated by this grammar satisfy the definition of an even length
palindrome string. This rules out B and D options.
55

G-Q is confirmed as both options A and C has it as true.

Best
E-R is true because R is the only grammar that checks: what
afterwards. This equals the definition of E
 has occurred earlier is present

answer
Hence, option C is true.


answered
Nov 6, 2015
edited
Feb 20, 2018
by kenzou


amarVashishth

4 Comments
Show 10 previous comments

palashbehra5
commented
Aug 2, 2021
It is CSL.

 
0

raja11sep
commented
Nov 9, 2021
F-P


suppose, actual parameters contain 4 integers followed by 5 floats (here,a=int and n=number of int,
b=float and m=number of float) then the formal parameter should also contain 4 integers followed by 5
floats for semantic correctness (here,c=int and n=number of int, d=float and m=number of float).

 
0

Pranavpurkar
commented
4 days ago
Why and how are we considering this? 

“ d is opening paranthesis  "("

f is closing paranthesis ")"

 
0


The Answer is C

8 We can match H-S just by checking the grammar we can generate all the even lenght palindromes

So we left with option A and C(only in these options H-S matched)


https://gateoverflow.in/463/gate-cse-2008-question-51 2/6
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 51

 
In both the cases G-Q so we left with matching for E and F
Login
For E the grammar should check the identifiers are declared before their use So R is more accurate
since the grammar is

L={wcw ∣ w∈ (a∣b)∗ } where w is occured earlier and then it is used which matches with checking
declaratation of identifiers

and also E-P makes no sense 

Therefore we can conclude C. E-R, F-P, G-Q, H-S


answered
Jul 16, 2016
edited
Nov 28, 2016
by Prajwal Bhat


Prajwal Bhat


The grammar in S {X bXb | cXc | ϵ} derives all even length Palindromes, So H matches with S.

2
F matches with P, Number of formal parameters in the declaration…. matches with {L={ |

m,n >=1}

Since, corresponds to formal parameter (if n=2 and m=1, and “a” is int type and “b”is float type,
then it means (int,int,float)) and corresponds to actual parameter used in function.

Similarly other two can also be argued by their reasons, but with F matches with P and H matches with
S implies that option C is the only correct option.


answered
Jul 23, 2019


King Suleiman


In the programming languages, the “correctness” of a program is in terms of “syntax” as well as


“semantics”.
2

Syntax: the form or structure of the expressions, statements, and program units

Semantics: the meaning of the expressions, statements, and program units

The syntax related features are captured by Context Free Grammars i.e. Context-free grammars are
often used to define the syntax of programming languages.

There is a level of correctness deeper than syntax (grammar).

https://gateoverflow.in/463/gate-cse-2008-question-51 3/6
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 51

  Login

https://www.cs.mcgill.ca/~cs520/2021/slides/9-semantic-name.pdf

https://www.inf.ed.ac.uk/teaching/courses/ct/17-18/slides/8-semantic.pdf 

All these errors in the above picture are “Semantic errors”. None of them can be captured using CFGs.

Using CFG, we cannot capture some Context-sensitive aspects of the syntax of a language, such as
checking that an item has been declared before use and that the use of the item is consistent with its
declaration.

http://homepage.divms.uiowa.edu/~slonnegr/plf/Book/Chapter3.pdf

About names:

1. Is a scalar, an array or a function?

2. Is  declared? Are there names declared but not used?

3. Which declaration of does each use reference?

About types:

4. Is the expression type-consistent? (Type Checking)

5. In , does  have three dimensions?

6. How many arguments does a function take? What about printf ?

About memory:

7. Where can be stored? (register, local, global heap, static)

8. Does reference the result of a malloc()?

9. Do and refer to the same memory location?

10. Is an array access out of bound?

11. Where should a variable be stored (head, stack,…)

https://www.cs.purdue.edu/homes/xyzhang/spring11/notes/typecheck.pdf

https://gateoverflow.in/463/gate-cse-2008-question-51 4/6
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 51

 
https://www.ida.liu.se/~TDDB44/laboratories/instructions/lab4.html
Login
Types and Declarations: Done in Semantic Analysis.

A large part of semantic analysis consists of tracking variable/function/type  declarations and type
checking.

In many languages, identifiers have to be declared  before they’re used.  As the compiler encounters a
new declaration, it records the type information assigned to that identifier.  Then, as it continues
examining the rest of the program, it verifies that the type of an identifier is respected in terms of the
operations  being performed.  For example, the type of the right side expression of an assignment
statement should match the type of the left side, and the left side needs to be a properly declared and
assignable identifier.  The parameters of a function should match the  arguments of a function call in
both number and type.  The language may require that identifiers be unique, thereby forbidding two
global declarations from sharing the same name.  Arithmetic operands will need to be of numeric—
perhaps even the exact same type (no automatic int­to­double conversion, for instance). These are
examples of the things checked in the semantic analysis phase.

https://web.stanford.edu/class/archive/cs/cs143/cs143.1128/handouts/180%20Semantic%20Analysi
s.pdf

Static Semantic Errors: 

https://stackoverflow.com/questions/40430578/static-semantics-meaning

https://www.d.umn.edu/~rmaclin/cs5641/Notes/Lecture12.pdf 

https://personal.utdallas.edu/~cid021000/CS-4337_13F/slides/CS-4337_03_Chapter3.pdf

Classes of Errors:

https://www.d.umn.edu/~rmaclin/cs5641/Notes/Lecture12.pdf 

A context-free grammar is a set of recursive rewriting rules (or productions) used to generate patterns
of strings. Context-free grammars are often used to define the syntax of programming languages.

https://www.cs.rochester.edu/u/nelson/courses/csc_173/grammars/


answered
Sep 17


Deepak Poonia

Answer: C

← Previous Next →

← Previous in category Next in category →

https://gateoverflow.in/463/gate-cse-2008-question-51 5/6
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 51

Related questions
 Login

GATE CSE 2008 | Question: 50

52  Which of the following statements are true? Every left-recursive grammar can be

#1

asked
Sep 11, 2014

GATE CSE 2008 | Question: 53

31  Which of the following are regular sets?



#2

asked
Sep 12, 2014

GATE CSE 2008 | Question: 52

45  Match the following NFAs with the regular expressions they correspond to: P Q R S

#3

asked
Sep 12, 2014

GATE CSE 2008 | Question: 49

59  Given below are two finite state automata ( indicates the start state and ...
#4

asked
Sep 12, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/463/gate-cse-2008-question-51 6/6
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 52

  Login

GATE CSE 2008 | Question: 52

 9,586 views


asked
in Theory of Computation
Sep 12, 2014
edited
May 1, 2019
by Pooja Khatri

Match the following NFAs with the regular expressions they correspond to:

45

https://gateoverflow.in/464/gate-cse-2008-question-52 1/5
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 52

 
R
Login

1.

2.

3.

4.

A.
B.
C.
D.

gatecse-2008
theory-of-computation
finite-automata
normal


Kathleen

 share
4 Comments
Show 4 previous comments

wander
commented
Dec 24, 2020
@prateek  S is accepting 0101  initial 0→ first  1→ initial 0→ first 1→ initial


And initial state is also final state

 
2

Prateek.py
commented
Dec 25, 2020
tnx :) @wander

https://gateoverflow.in/464/gate-cse-2008-question-52 2/5
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 52

 
 

0


Login
neel19
commented
Aug 18, 2021
Although not needed for solving, NFA S gives us the format by which we can derive other options. 

 
0

11 Answers


is confirmed

36 is true coz everything it accepts ends with ; this is made mandatory only by

this rules out option B and option D 

 use string and compare

Best Hence, option C is correct.


Vs ; this makes  as confirmed.

answer


answered
Nov 6, 2015
edited
Jun 15, 2018
by Milicevic3306


amarVashishth

4 Comments
Show 5 previous comments

smn98
commented
Oct 14, 2020
Refer this link for conversion of the NFAs to regular expression

https://www.geeksforgeeks.org/gate-gate-cs-2008-question-52/

 
0

nvs16
commented
Oct 16, 2020
Do most of the regular expression questions are solved by trial and error?

 
0

Prateek.py
commented
Dec 24, 2020
S not accepting 0101 hows its possible as all 4 option shows its S-4

 
0


Lets go step by step by step, eliminating the given options:

12
Min string accepted by P is 00 , therefore 3, and 4 cant be the RE for it as they say 01 must be included.

https://gateoverflow.in/464/gate-cse-2008-question-52 3/5
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 52

  
Min string accepted by Q is 00 , therefore again 3, 4 cant be RE for Q for the same reason mentioned
above.

Login

So by now, we left only 2 options, answer has to be A or C.

2nd min accepted by P is 001, but RE in 2 says string start and end with 0. Therefore RE for P is 1
making 2 as RE for Q.

Therefore answer is Option C.


answered
Jan 28, 2018


Prateek K

2 Comments
vijju532
commented
Jul 22, 2018
nice!

 
0

Sanjeev kumar Sen


commented
Sep 6, 2021
best and smart+ fast approch

 
0


Correct Ans is (C)

2
Trace the given regular expressions with the diagrams


answered
Sep 12, 2014


Keith Kr


for P 00 and 001* is accepted.so this can be generated with option 1 only

0 for S 01 and 010* can be generated.so this can be generated with option 4 only

Now we will compare rest of the options to distinguish them.

for Q 00 is accepted so option should be 2

for R 01 is accepted so option should be 3

(C) is the ans

https://gateoverflow.in/464/gate-cse-2008-question-52 4/5
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 52


 

answered
Jun 3, 2016
Login

Pranabesh Ghosh 1

1
2
3
next »

Answer: C

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2008 | Question: 49

59  Given below are two finite state automata ( indicates the start state and ...
#1

asked
Sep 12, 2014

GATE CSE 2008 | Question: 53

31  Which of the following are regular sets?



#2

asked
Sep 12, 2014

GATE CSE 2008 | Question: 51

61  Match the following: $\small{\begin{array}{|ll|ll|}\hline \text{E.} & \text{Checking



#3

asked
Sep 12, 2014

GATE CSE 2008 | Question: 83

29  Consider the following diagram The minimum number of tables needed to



#4

asked
Nov 27, 2016

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/464/gate-cse-2008-question-52 5/5
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 53

  Login

GATE CSE 2008 | Question: 53

 7,461 views


asked
in Theory of Computation
Sep 12, 2014
edited
Jul 1, 2017
by Silpa

Which of the following are regular sets?

31 I.

II.

III.

IV.

A. I and IV only
B. I and III only
C. I only
D. IV only

gatecse-2008
theory-of-computation
normal
regular-language


Kathleen

 share
3 Comments
Ram Swaroop
commented
Aug 13, 2019
Why iv is regular anyone explain

 
0

Golam Murtuza
commented
Aug 18, 2019
Cz u can have a regular expression for iv


(a+b)*c(a+b)*

 
0

Payal1999
commented
Oct 23, 2020

https://gateoverflow.in/476/gate-cse-2008-question-53 1/4
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 53

  Login

But by pumping lemma it can be shown that a^n b^2m is not regular. Please correct me if I'm wrong.

 
0

2 Answers


Answer is A.

26
Since in option and is dependent on , therefore a comparison has to be done to evaluate those


and hence are not regular.

I and IV are clearly regular sets.


Best
answer


answered
Dec 11, 2014
edited
Jun 20, 2021
by Lakshman Patel RJIT


Gate Keeda

4 Comments
Show 4 previous comments

Shubham Aggarwal
commented
Dec 2, 2018
can you explain how 1st is regular by some explanation?

 
0

amitqy
commented
Mar 8, 2019
@Shubham Aggarwal I Think first can be written as -->(a)*(bb)* . Here both asterisks are independent of

each other and can be thought as n and m.

 
0

Payal1999
commented
Oct 24, 2020

https://gateoverflow.in/476/gate-cse-2008-question-53 2/4
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 53

  Login

But by pumping lemma it can be shown that a^n b^2m is not regular. Please correct me if I'm wrong.

 
0


I)Set of all strings containing any number of ‘a’ s followed by an even number of ‘b’ s. R.E=(a) (bb) .

2 IV) Strings containing a ‘c’. R.E= (a+b) c(a+b) .


Both these languages are regular as regular expressions exist.

By default a language is infinite. Eg : {a } it’s a infinite language.So both the languages II and III are
infinite and comparison has to be done to evaluate these and hence are not regular.

 Answer: A

NOTE:

Every finite language is regular.

Infinite language + Comparison = Non-Regular.

Infinite language + No Comparison = Regular.

Edit: As nothing is mentioned about ‘c’ in option IV and there is a comma after y, So I think It’s a typo ‘c’
should also belongs to {a,b} . IV will be a complete language. Which is regular. R.E=(a+b) .


answered
Jul 11, 2021
edited
Jul 11, 2021
by raja11sep


raja11sep

Answer: A

← Previous Next →

https://gateoverflow.in/476/gate-cse-2008-question-53 3/4
11/4/22, 9:51 PM Theory of Computation: GATE CSE 2008 | Question: 53

← Previous in category

Next in category →
Login

Related questions

GATE CSE 2008 | Question: 52

45  Match the following NFAs with the regular expressions they correspond to: P Q R S

#1

asked
Sep 12, 2014

GATE CSE 2008 | Question: 51

61  Match the following: $\small{\begin{array}{|ll|ll|}\hline \text{E.} & \text{Checking



#2

asked
Sep 12, 2014

GATE CSE 2008 | Question: 49

59  Given below are two finite state automata ( indicates the start state and ...
#3

asked
Sep 12, 2014

GATE CSE 2008 | Question: 83

29  Consider the following diagram The minimum number of tables needed to



#4

asked
Nov 27, 2016

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/476/gate-cse-2008-question-53 4/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 12, ISRO2016-37

  Login

GATE CSE 2009 | Question: 12, ISRO2016-37

 16,512 views


asked
in Theory of Computation
Sep 22, 2014
edited
Jun 15, 2018
by Milicevic3306

29

The language generated by the above grammar over the alphabet is the set of:

A. all palindromes
B. all odd length palindromes
C. strings that begin and end with the same symbol
D. all even length palindromes

gatecse-2009
theory-of-computation
context-free-language
easy
isro2016


Kathleen

 share
4 Comments
Show 12 previous comments

Pranavpurkar
commented
Oct 26
Abhrajyoti00

yes you are correct.

but if it is an mcq then we can’t select two answer’s right we have to choose the strongest one.

in MSQ both will be correct :)

 
1

Abhrajyoti00
commented
Oct 26
@Pranavpurkar Agreed! Bad framing of options

 
1

Pranavpurkar
commented
Oct 26
Abhrajyoti00

https://gateoverflow.in/1304/gate-cse-2009-question-12-isro2016-37 1/5
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 12, ISRO2016-37

   
it all depends on what the question setter wants from us.

1
Login

7 Answers


Answer is B. String generated by this language is

33 All this strings are odd length palindromes.



Best

answered
Oct 15, 2014
edited
Jun 21, 2021
by Lakshman Patel RJIT

answer

neha pawar

4 Comments
Show 5 previous comments

Niraj Singh 2
commented
Dec 6, 2017
but it is not written that grammar should generate all strings that begin and end with same symbol


option C should be " all strings that begin and end with same symbol"

then it is correct to remove option c

is it not?

 
1

suryaprakash
commented
Feb 8, 2018
even ur answer contains flaw


the language u given covers  BOTH B and C.

 
0

talha hashim
commented
Jan 24, 2019
aa is starting and ending with same symbal but not cover by above grammar.so option C) is wrong.only

option B) is correct

 
1


(A) Counter Example :- aa or bb not generated by above Grammar.

15
(C) Counter example :- aa not genetrated by above Grammer.

https://gateoverflow.in/1304/gate-cse-2009-question-12-isro2016-37 2/5
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 12, ISRO2016-37

 
(D) Counter Example :- aa not generated, but a generated.

Login
(B) Correct. Odd length palindromes are generated by this grammar.


answered
Nov 14, 2015


Akash Kanase


option b

11


answered
Mar 22, 2018


abhishekmehta4u

4 Comments
https://gateoverflow.in/1304/gate-cse-2009-question-12-isro2016-37 3/5
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 12, ISRO2016-37

 Raj Kumar 7
commented
Mar 22, 2018
I agree with you but I am asking about if all do not mention we assume that it talking about all. As in  
Login
option C.

 
0

abhishekmehta4u
commented
Mar 22, 2018
In option c it is saying it genrate starting and ending with same symble. But it can't genrate all string like

string aa.  So it is wrong.

 
0

abhishekmehta4u
commented
Mar 22, 2018
Yes it genrate all string . Not subset of string

 
0

Raj Kumar 7
commented
Mar 22, 2018
Thanks Bro!!

 
0


(B) all odd length palindromes

8

answered
Oct 15, 2014


Arjun

1
2
next »

Answer: B

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2009 | Question: 57, ISRO2016-75

105  Frames of are sent over a duplex link between two hosts. The

#1

asked
Sep 22, 2014

https://gateoverflow.in/1304/gate-cse-2009-question-12-isro2016-37 4/5
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 12, ISRO2016-37


 
GATE CSE 2009 | Question: 9, ISRO2016-52

17
In which one of the following page replacement policies, Belady's anomaly mayLogin

#2

asked
Sep 22, 2014

GATE CSE 2009 | Question: 16, ISRO2017-12

40  Which one of the following is FALSE? There is a unique minimal DFA for every

#3

asked
Sep 22, 2014

GATE CSE 2008 | Question: 13, ISRO2016-36

30  If and are recursively enumerable then is regular context-free context-



#4

asked
Sep 12, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1304/gate-cse-2009-question-12-isro2016-37 5/5
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 14

  Login

GATE CSE 2009 | Question: 14

 7,364 views


asked
in Theory of Computation
Sep 22, 2014
recategorized
Jan 12, 2018
by srestha

Let be a problem that belongs to the class NP. Then which one of the following is TRUE?

14 A. There is no polynomial time algorithm for .


B. If can be solved deterministically in polynomial time, then P = NP.

C. If is NP-hard, then it is NP-complete.

D. may be undecidable.

gatecse-2009
theory-of-computation
p-np-npc-nph


Kathleen

 share
2 Comments
happysingh
commented
Apr 20, 2020
If a problem is both NP hard and NP, then it is NP Complete.

 
1

GateOverflow04
commented
1 day ago
@Kabir5454

does NP  is in syllabus.

 
0

1 Answer


A problem which is in P, is also in NP- so, A is false. If problem can be solved deterministically in
Polynomial time, then also we can't comment anything about P=NP, we just put this problem in P. So, B
21
also false. C is TRUE because that is the definition of NP-complete.

https://gateoverflow.in/1306/gate-cse-2009-question-14 1/4

11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 14

 
D is false because all NP problems are not only decidable but decidable in polynomial time usingLogin
Best non-deterministic Turing machine.
a

answer


answered
Jan 31, 2015
edited
Jun 15, 2018
by Milicevic3306


shree

4 Comments
Show 12 previous comments

Aks9639
commented
Sep 8, 2019
@Arjun sir

we can surely say that if L in NPC and L is polynomial time reducible, then we can only say that P = NP ,
but still we can't say about P= NP= NPC, i have never found anything like this in CLRS ? NPC still a class
of problems that would be proper subset of NP but not equal to P, isn't it ?

 
0

KUSHAGRA गुप्ता
commented
Dec 5, 2019

 
0

Divyanshu Shukla
commented
Sep 6, 2020

https://gateoverflow.in/1306/gate-cse-2009-question-14 2/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 14

  Login

Cleary problem A is  NP-hard But it is not NP-complete so all the options are incorrect.

 
0

Answer: C

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2009 | Question: 41

37  The above DFA accepts the set of all strings over that begin either with or

#1

asked
Sep 22, 2014

GATE CSE 2009 | Question: 40

42  Let , where and are languages as defined below:



#2

asked
Sep 22, 2014

GATE CSE 2009 | Question: 27

41  Given the following state table of an FSM with two states and ... length of an

#3

asked
Sep 22, 2014

https://gateoverflow.in/1306/gate-cse-2009-question-14 3/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 14

 
GATE CSE 2009 | Question: 16, ISRO2017-12

40
Which one of the following is FALSE? There is a unique minimal DFA for every Login

#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1306/gate-cse-2009-question-14 4/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 15

  Login

GATE CSE 2009 | Question: 15

 12,790 views


asked
in Theory of Computation
Sep 22, 2014
edited
Mar 5, 2018
by kenzou

Which one of the following languages over the alphabet is described by the regular expression:
?
30

A. The set of all strings containing the substring


B. The set of all strings containing at most two 's
C. The set of all strings containing at least two 's
D. The set of all strings that begin and end with either or

gatecse-2009
theory-of-computation
regular-expression
easy


Kathleen

 share

7 Answers


Correct Option: C

37
Counter example for other choices:

Best
A.
B.
is accepted which doesn't contain
is accepted
C. is the answer.
answer D. is not accepted


answered
Oct 16, 2014
edited
May 6, 2021
by soujanyareddy13


Arjun

https://gateoverflow.in/1307/gate-cse-2009-question-15 1/3

11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 15

 
 a) all string contain substring 00
Login
14
 regular expression = Anything 00 Anything  = (0+1)*00(0+1)*  

b)all string contain atmost two 0's

regular expression = only 2 zeros  + only 1 zero  + No zero = Anthing 0 Anything 0 Anything + Anything 0
Anything  + Anything = 1*01*01* + 1*01* + 1* 

here anything means that is made of only 1's bcoz we have to restrict 0 (only two or less) so anything
cannot include 0.

c) all string contain atleast two 0's

regular expression = Anything 0 Anything 0 Anything = (0+1)*0(0+1)*0(0+1)*

d) all strings that begin and end with either 0 or 1

regular expression = either 0 or 1  Anything either 0 or 1 = (0+1)(0+1)*(0+1)


answered
Mar 9, 2015


Praveen Saini

1 comment
Praveen Saini
commented
Jun 7, 2015
All are same for strings containing atleast 2 0's.

 
1


The regular expression has two 0′s surrounded by (0+1)* which means accepted strings must have at
least 2 0′s.

0

So, C is the answer


answered
Apr 12, 2017


Regina Phalange


Option A is false, as the regular expression generates string “010” which doesn’t have “00” as
substring.
0

Option B is false, as we can have the string “000” from the given regular expression, which has more
than two 0’s.

https://gateoverflow.in/1307/gate-cse-2009-question-15 2/3
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 15

 
Option D is false, as we cannot generate the string “01” from the given regular expression and
according to option D, string “01” must be generated by regular expression, which clearly shows option
Login
D is not correct language as per regular expression.


answered
Aug 21, 2020


varunrajarathnam

1
2
next »

Answer: C

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2009 | Question: 41

37  The above DFA accepts the set of all strings over that begin either with or

#1

asked
Sep 22, 2014

GATE CSE 2009 | Question: 40

42  Let , where and are languages as defined below:



#2

asked
Sep 22, 2014

GATE CSE 2009 | Question: 16, ISRO2017-12

40  Which one of the following is FALSE? There is a unique minimal DFA for every

#3

asked
Sep 22, 2014

GATE CSE 2009 | Question: 12, ISRO2016-37

29  The language generated by the above grammar over the



#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1307/gate-cse-2009-question-15 3/3
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 16, ISRO2017-12

  Login

GATE CSE 2009 | Question: 16, ISRO2017-12

 12,306 views


asked
in Theory of Computation
Sep 22, 2014
edited
Oct 24, 2016
by go_editor

Which one of the following is FALSE?

40 A. There is a unique minimal DFA for every regular language


B. Every NFA can be converted to an equivalent PDA.

C. Complement of every context-free language is recursive.

D. Every nondeterministic PDA can be converted to an equivalent deterministic PDA.

gatecse-2009
theory-of-computation
easy
isro2017
non-determinism


Kathleen

 share
1 comment
Ravi_1511
commented
Feb 3, 2017
NFA can be drawn for Regular languages and every regular is DCFL and for each DFCL ..PDA can be

drawn ..Thus

NFA -> PDA

 
2

6 Answers


Correct Option: D

50 NDPA is more powerful than DPDA, so they are not equivalent. Actually, DPDA is a proper subset of

NDPA.


https://gateoverflow.in/1308/gate-cse-2009-question-16-isro2017-12 1/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 16, ISRO2017-12

 
Best C is TRUE as CFL is a proper subset of recursive languages and recursive languages are closed under
answer
complement. Login


answered
Nov 26, 2014
edited
May 6, 2021
by soujanyareddy13


Bhagirathi

4 Comments
Show 5 previous comments

Dhiraj Raj
commented
Dec 7, 2018
Can anyone Please explain me, why @Bhagirathi explicitly mentioned in this question that " recursive

languages are closed under complement". Is this statement have to do something with this question.

 
0

Sukhbir Singh
commented
Aug 23, 2019
What about option a? Nfa can't be converted to pda, as pda is finite automata + a stack.

 
0

Raj Bopche
commented
Jan 30, 2021
@Dhiraj Raj 

We know that CFL’s are subset of Recursive Languages, ie every CFL is also a Recursive Language. 

Now one of the properties of Recursive Languages is that Complement of a Recursive Language is also
Recursive, more formally Recursive Languages are closed under complementation. Hence complement
of every CFL would always be Recursive.

 
0


The Power of NPDA is greater than DPDA, hence we cannot convert NPDA into an equivalent DPDA.

8
Ans is D.


answered
May 7, 2017


AnilGoudar

1 comment
sardendu
commented
Aug 23, 2018
Can we say that


if a cfl is subset of rec enimurable so its complement is also rec enumurable

 
0

https://gateoverflow.in/1308/gate-cse-2009-question-16-isro2017-12 2/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 16, ISRO2017-12

  Login



1. There is a unique minimal DFA for every regular language       T
6
2. Every NFA can be converted to an equivalent PDA.                 T

3. Complement of every context-free language is recursive.           T

4. Every nondeterministic PDA can be converted to an equivalent deterministic PDA.           F


answered
Sep 16, 2017


rishu_darkshadow


(d) Every non-deterministic PDA can be converted to an equivalent deterministic PDA

4 
answered
May 7, 2017


anonymous

1
2
next »

Answer: D

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2009 | Question: 5, ISRO2017-57

23  is equivalent to
#1

asked
Sep 22, 2014

GATE CSE 2009 | Question: 12, ISRO2016-37

29  The language generated by the above grammar over the



#2

asked
Sep 22, 2014

https://gateoverflow.in/1308/gate-cse-2009-question-16-isro2017-12 3/4
11/4/22, 9:50 PM Theory of Computation: GATE CSE 2009 | Question: 16, ISRO2017-12


17
GATE CSE 1994 | Question: 1.16
Which of the following conversions is not possible (algorithmically)? Regular  Login


#3

asked
Oct 4, 2014

GATE CSE 1995 | Question: 1.9 , ISRO2017-13

29  In some programming language, an identifier is permitted to be a letter followed



#4

asked
Oct 8, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1308/gate-cse-2009-question-16-isro2017-12 4/4
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 27

  Login

GATE CSE 2009 | Question: 27

 9,717 views


asked
in Theory of Computation
Sep 22, 2014
edited
Jun 28, 2019
by ajaysoni1924

Given the following state table of an FSM with two states and ,one input and one output.

41

If the initial state is what is the minimum length of  an input string which will take the
machine to the state with .

A.
B.
C.
D.

gatecse-2009
theory-of-computation
finite-automata
normal


Kathleen

 share
3 Comments
Mitali gupta
commented
Dec 3, 2020
Solve using backtracking:

We need 01 and output as  1 

This is only in one case – 10 ( 10 on input 1 gives 01 with output 1)

Now we need 10 (which is possible when the initial state is either 01  or 11 )

Reject 11 as 11 is never next state in any row.


https://gateoverflow.in/1313/gate-cse-2009-question-27 1/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 27

 
This is only in one case – 01 (01 on input 0 gives 10)
Login
This is only in one case – 00 ( 00 on input 1 gives 01 )

So string will be 101 


 
5

Deepak Poonia
commented
Jan 27
edited
Apr 20
by Deepak Poonia
Detailed Video Solution

https://youtu.be/FCmID9qCn5c

Explanation of Finite State Machines (Mealy, Moore Machines), with ALL GATE Questions’ solution can
be found in the following playlist :

https://youtube.com/playlist?list=PLIPZ2_p3RNHjd6P9g6XoUm8E33CsUBqDv

 
2

Abhrajyoti00
commented
Oct 16
@Mitali gupta Best answer.

 
0

6 Answers


From above table, we look at next state part

48 Whenever we reach state we get output [at row ,row , row ], so we have state 00 with output 1


When we reach at state , we get output [at row , row ] and output  [row ], so we have two state
01 with output 0, 01 with output 1.

Best When we reach at state , we get output we get output [at row , row ], so we have state 10 with
answer
output 0.

We don't reach at state [ is not there in next state part], but we have state 11 with don't know (N)
output.

If we draw the Moore Machine for above FSM [ from the table: present state x input symbol -> next
state ]

https://gateoverflow.in/1313/gate-cse-2009-question-27 2/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 27

  Login

It is clear from FSM from state to reach state with output i.e, with need minimum length
input 101

Minimum length of input length of . That is 3.

Correct Answer:


answered
Mar 9, 2015
edited
May 10, 2019
by Naveen Kumar 3


Praveen Saini

4 Comments
Vicky rix
commented
Jan 4, 2018
The basic idea here is whenever we are trying to find shortest path from a node A to node B, we will

never take cycle (loops) inbetween...

 
1

Queenia Agrawal
commented
Jan 18, 2018
Sir I solved this question by looking at it as a mealy machine, not moore. Is that wrong approach?

 
1

Matrix
commented
Aug 2, 2018
How do we know that the two states A and B have to be considered as a single state in Moore machine?

 
1

https://gateoverflow.in/1313/gate-cse-2009-question-27 3/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 27

 Praveen Saini
commented
Aug 7, 2018
@Queenia .. No problem , Mealy and Moore are equivalent
 
Login

@Matrix, You need to go though sequential logic circuits. It is just as 2 variable makes 4 different
combinations

 
4


A = 0, B = 1, Output = 1 is given only by the second last transition in the table. So, we can go back from
here.

31

Here, the previous state is A = 1, B = 0. So, see which state gives next state as this. (1 char is gone here)

The second and fourth transitions in the table gives this as next state. Previous state of second
transition is  A = 0 and B = 1. Lets consider this first (2 chars gone).

The fifth transition gives A = 0 and B = 1 from A = 0, B = 0 which is our given initial state (3 chars). So,
we needn't check any other possibility as 3 must be the minimum length of the input string.


answered
Oct 29, 2014
edited
Oct 30, 2014
by makhdoom ghaya


Arjun

1 comment
Pranavpurkar
commented
Jan 30
great explanation👍

 
0


Mealy Machine Approach.

16

https://gateoverflow.in/1313/gate-cse-2009-question-27 4/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 27

  Login


answered
Nov 27, 2018


marcusD


Consider the below given FSM (represented as graph)

1

From the given FSM we can clearly see that, if we start from initial state (00) and follow the input “101” 

{state 00, 1} -> state “01” , output 0,

{state 01, 0} -> state “10” , output 0,

{state 10, 1} -> state “01” , output 1,

Hence it require an input string of minimum length 3, which will take the machine to the state A=0, B=1
with Output = 1.

https://gateoverflow.in/1313/gate-cse-2009-question-27 5/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 27


 

answered
Jul 23, 2019
Login

King Suleiman

1
2
next »

Answer: A

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2009 | Question: 41

37  The above DFA accepts the set of all strings over that begin either with or

#1

asked
Sep 22, 2014

GATE CSE 2009 | Question: 52

32  A hard disk has sectors per track, platters each with recording surfaces

#2

asked
Apr 23, 2016

GATE CSE 2009 | Question: 54

43  A sub-sequence of a given sequence is just the given sequence with some



#3

asked
Apr 23, 2016

GATE CSE 2009 | Question: 56

53  Consider the following relational schema:



#4

asked
Apr 23, 2016

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1313/gate-cse-2009-question-27 6/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 40

  Login

GATE CSE 2009 | Question: 40

 9,950 views


asked
in Theory of Computation
Sep 22, 2014
edited
Feb 21, 2018
by kenzou

Let , where and  are languages as defined below:

42

Then is

A. Not recursive 
B. Regular
C. Context free but not regular
D. Recursively enumerable but not context free.

Easy level question


gatecse-2009
theory-of-computation
easy
identify-class-language


Kathleen

 share
4 Comments
Show 18 previous comments

Mizuki
commented
Nov 17, 2018
DCFL are closed under intersection with regular languages.

 
0

Ajitgate21
commented
Oct 17
sir,  when L1 is cfl=>  Because Read input a, push into stack; seen ‘b’ pop ‘a’; seen c skip, again Read

input a, push into stack; seen ‘b’ pop ‘a’; using (dpda)and L2 is Regular Because, easily construct DFA
=>first take FOUR states to construct dfa  1,2,3,d; seen ‘a’ looping  on 1, other than ‘a’ goto dead state,
seen b goto the state 2 any number of b looping on 2, if ‘a’ come to here then go to dead state, if ‘C’ is
coming then go to state 3, in here a or b come goto dead state.  L=L1 intersection L2. so, L is cfl.

 
1

Abhrajyoti00
commented
Oct 17

https://gateoverflow.in/1326/gate-cse-2009-question-40 1/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 40

   
@Ajitgate21 When actual languages are given, it’s better not to use closure property but to work out the
language itself and check what type of language it is. Login

0

6 Answers


Answer is C.

36


It is a CFL. It will generate strings which start with a's followed by equal number of b's and single c
followed by a's followed by equal number of b's

Best i.e.,
answer

It is a Regular (and of course CFL). It will generate strings which begin with a's followed by any number
of b's followed by any number of c's

So, will be all strings which are common in both languages

So, those will be the strings which begin with a's followed by equal number of b's and ending with c

They would be of the form

Such a language is not regular as it requires equal number of a's and b's. But it is Context
Free language as we can make a PDA for it. Also, CFLs are closed under intersection with regular set.
So, any CFL intersection a regular set gives a CFL (may or may not be a regular set).


answered
Apr 1, 2017
edited
Jun 15, 2018
by Milicevic3306


Arunav Khare

3 Comments
iarnav
commented
Nov 3, 2017
@Arunav Khare Thank you!

 
0

Puja Mishra
commented
Nov 20, 2017
regular intersection with any language X is X only ...

 
2

jyoti pundir 1
commented
Jan 5, 2021
It was really a nice way to solve . The question could be solved using properties directly but what more

important is how to approach a question in  many ways. Thanks for the explanation 🙏🏻
https://gateoverflow.in/1326/gate-cse-2009-question-40 2/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 40

 
 

0

Login

Useful answer



, which is context free but not regular.

41
Option C.


answered
Jan 28, 2015
edited
Feb 21, 2018
by kenzou


Arjun

4 Comments
Show 11 previous comments

amolagrawal
commented
Jan 23, 2017
Thanks @Arjun Sir and @Sachin for the update.

 
0

Gate Fever
commented
Sep 10, 2018
sir please tell me whats wrong in this approach!


L1 contains all the strings that end with b's

L2 contains all the strings that end with c.

now ,

L=L1∩L2 = phi

since phi is regular. therefore option b

 
0

pranavsettaluri9
commented
Jul 27, 2020
@Gate Fever Would've been phi if it was  .. But since last a and b are powers of n and n

can be 0.. Right?

 
0


Option c is right.

5

https://gateoverflow.in/1326/gate-cse-2009-question-40 3/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 40

  Login


answered
May 9, 2018


abhishekmehta4u

4 Comments
Sona Barman
commented
May 9, 2018
This answer is quite similar with Gradup given explanation in their answer.But my doubt is still same.

 
0

abhishekmehta4u
commented
May 9, 2018
Any doubt in this solution??

 
0

https://gateoverflow.in/1326/gate-cse-2009-question-40 4/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 40

 Sona Barman
commented
May 9, 2018
Yes, i have doubt in this solution as same as Gradup answer logic.
 
Login

L1 intersection L2={a^ m b^ m c|m>=0}

Why?

 
0

abhishekmehta4u
commented
May 9, 2018
Here L1 gives like string

{abc,aabbc,aaabbbc, abcab.......} 

L2 gives like string 

{abc,aabbc,aabbcc,.............}

try to understand both language in

L1 it gives only one c . So comman string must be only one c.


In L2 a follow b and b follow c .

So comman string like abc,aabbc... So on

 
1


The language L1 accept strings {c, abc, abcab, aabbcab, aabbcaabb, …} and L2 accept strings {a, b, c,
ab, abc, aabc, aabbc, … }. Intersection of these two languages is L1 ⋂ L2 = {a{k}b{k}c | k >= 0} which is
2
context free, but not regular.


answered
Nov 21, 2017


Sandeep Verma

1
2
next »

Answer: C

← Previous Next →

← Previous in category Next in category →

https://gateoverflow.in/1326/gate-cse-2009-question-40 5/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 40

 Related questions
 Login

GATE CSE 2009 | Question: 41

37  The above DFA accepts the set of all strings over that begin either with or

#1

asked
Sep 22, 2014

GATE CSE 2009 | Question: 16, ISRO2017-12

40  Which one of the following is FALSE? There is a unique minimal DFA for every

#2

asked
Sep 22, 2014

GATE CSE 2009 | Question: 15

30  Which one of the following languages over the alphabet is described by the

#3

asked
Sep 22, 2014

GATE CSE 2009 | Question: 12, ISRO2016-37

29  The language generated by the above grammar over the



#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1326/gate-cse-2009-question-40 6/6
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 41

  Login

GATE CSE 2009 | Question: 41

 17,291 views


asked
in Theory of Computation
Sep 22, 2014
edited
May 1, 2019
by Pooja Khatri

37

The above DFA accepts the set of all strings over that 

A. begin either with or .

B. end with .

C. end with .

D. contain the substring  .

gatecse-2009
theory-of-computation
finite-automata
easy


Kathleen

 share

7 Answers


A. Begin either with or  

58 Regular expression


https://gateoverflow.in/1327/gate-cse-2009-question-41 1/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 41

 
Best
answer
Login

B. End with

Regular expression

 
 

C. End with

Regular expression

  

D. Containing the substring 

Regular expression          

https://gateoverflow.in/1327/gate-cse-2009-question-41 2/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 41

 
 
Login

So, C is the correct answer.


answered
Mar 6, 2015
edited
May 8, 2019
by Arjun


Praveen Saini

4 Comments
Show 6 previous comments

Pranavpurkar
commented
Nov 18, 2021
using Arden’s theorem the regex i am getting is..

[(0+01)*00(1(1+01)*00+0)*]

i.e always end with 00.

 
0

Abhrajyoti00
commented
Oct 16
@Pranavpurkar Arden’s theorem is lengthy from exam point of view. Don’t use it. Use option elimination.

 
1

Pranavpurkar
commented
Oct 16
Abhrajyoti00

Yes , brother.

I think i was getting more than one option here that’s why confirmed using Arden’s theorem.

 
1

https://gateoverflow.in/1327/gate-cse-2009-question-41 3/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 41

  1. begin either with 0 or 1 contain '0' and '1' which is not accepted so false  
Login

20

2. end with 0 contain '110' which is not accepted.so false

3. end with 00 contain True here

4. contain the substring 00. contain 00101 which is not accepted i.e. take any
string conatin the substring 00 and end with 1. so false

so c is answer


answered
Aug 6, 2016


Prashant.


I'll prove it by taking 'false string'

10
A: Begin with '0' or '1' False String: 11,111,etc.

B: End with '0'  False String: 10,110,etc.

D: Contain substring '00': 1001,10001,etc.

So remaining option is C


answered
Jan 13, 2017


smartmeet

1 comment
flash12
commented
Jan 10, 2018
10 also end with '0'


End with '0'  False String: 10,110,etc.

 
0


I go with C.

6
It contains all the strings which end up with 00.
https://gateoverflow.in/1327/gate-cse-2009-question-41 4/5
11/4/22, 9:49 PM Theory of Computation: GATE CSE 2009 | Question: 41


  

answered
Sep 23, 2014
edited
Oct 1, 2014
by Gate Keeda Login


Gate Keeda

1
2
next »

Answer: C

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2009 | Question: 40

42  Let , where and are languages as defined below:



#1

asked
Sep 22, 2014

GATE CSE 2009 | Question: 16, ISRO2017-12

40  Which one of the following is FALSE? There is a unique minimal DFA for every

#2

asked
Sep 22, 2014

GATE CSE 2009 | Question: 15

30  Which one of the following languages over the alphabet is described by the

#3

asked
Sep 22, 2014

GATE CSE 2009 | Question: 12, ISRO2016-37

29  The language generated by the above grammar over the



#4

asked
Sep 22, 2014

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/1327/gate-cse-2009-question-41 5/5
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 17

  Login

GATE CSE 2010 | Question: 17

 12,584 views


asked
in Theory of Computation
Sep 29, 2014
edited
Jul 1, 2017
by Silpa

Let be the recursive language. Let and be languages that are recursively enumerable but not
recursive. Which of the following statements is not necessarily true?
57

A.
B.
C.
D.

gatecse-2010
theory-of-computation
recursive-and-recursively-enumerable-languages
decidability
normal


go_editor

 share

2 Answers


Recursively enumerable languages are closed under union and intersection. So, lets consider each
option
83

A.

Best B.
Recursive languages are closed under complement, and so
recursively enumerable also. So,

is recursive and hence


is recursively enumerable is always TRUE.

answer
Recursively enumerable languages are not closed under complement. So, may or may not be
recursively enumerable and hence we can't say anything if is recursively enumerable or
not. 
C. Intersection of two recursively enumerable languages is always recursively enumerable(RE
closed under intersection).
D. Union of two recursively enumerable languages is always recursively enumerable(RE closed
under union).

https://gateoverflow.in/2190/gate-cse-2010-question-17 1/5
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 17

 
For verifying closure properties:

http://gatecse.in/wiki/Closure_Property_of_Language_Families Login

Correct Answer:


answered
Sep 30, 2014
edited
May 11, 2019
by Naveen Kumar 3


Arjun

4 Comments
Show 40 previous comments

Avinash Chaubey
commented
Aug 22, 2020
L1 is recursive languange


L2 is not recursive enumerable language

what can we say about L1 intersection L2

is result is recursive or not recursive enumerable

 
0

sanjaysharmarose
commented
Sep 5, 2020
I have a doubt…...….

(RL) U  (CFL) = CFL because every RL is CFL and CFL  is closed under  union. 

Now in  (RL) ⋂ (CFL) = CFL 

my doubt is every RL is CFL and CFL  is not closed under intersection so it can be CFL or non-CFL(which
is recursive). Hence in (RL) ⋂ (CFL)  we can also get recursive language.

 
1

ankit3009
commented
Nov 19, 2021
Whatever you said is correct.

 
0


0

https://gateoverflow.in/2190/gate-cse-2010-question-17 2/5
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 17

  Login

I hope this makes it simpler!

https://gateoverflow.in/2190/gate-cse-2010-question-17 3/5
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 17


 

answered
Aug 14, 2020
Login

keshore muralidharan

1 comment
Abhineet Singh
commented
Dec 12, 2020
I don’t think this is the correct logic. In your case L1-L3 is always a subset of L1(which is REC), therefore

REC ENUM.

L1 can be universal language, in that case L1-L3 will be L3’ which may or nay not be REC ENUM. you can
refer to above discussion

 
0

Answer: B

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2010 | Question: 41

57  Let be any string of length in . Let be the set of all substrings of .



#1

asked
Sep 30, 2014

GATE CSE 2010 | Question: 40

36  Consider the languages



#2

asked
Sep 30, 2014

GATE CSE 2010 | Question: 39

63  Let . i.e., is the set of all



#3

asked
Sep 30, 2014

GATE CSE 2010 | Question: 49

66  A computer system has an cache, an cache, and a main memory unit



#4

asked
Apr 21, 2016

https://gateoverflow.in/2190/gate-cse-2010-question-17 4/5
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 17

 
Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Login
Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/2190/gate-cse-2010-question-17 5/5
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 39

  Login

GATE CSE 2010 | Question: 39

 17,167 views


asked
in Theory of Computation
Sep 30, 2014
edited
Mar 5, 2018
by kenzou

Let . i.e., is the set of all the bit strings with


even numbers of s. Which one of the regular expressions below represents ?
63

A.
B.
C.
D.

gatecse-2010
theory-of-computation
regular-expression
normal


go_editor

 share
4 Comments
Show 9 previous comments

Tiklu_95
commented
Aug 28, 2021
I checked others website and orginal paper of year 2010 , its shows option C as  [ 0*(10*1*)*0* ] .. With

that option in hand option B is the correct answer .

 
0

abhishek_(123)
commented
Sep 10
option a . is incorrect because  the string end with 0 cannot be generated i.e 110


option b. is incorrect because string “110101” is not constructed which has even number of 1’s and also
it can generate epsilon .

option c . is incorrect because string “110101” is not constructed .

option d .is incorrect because string “110101” is not constructed .

→ there is no correct answer

 
0

https://gateoverflow.in/2340/gate-cse-2010-question-39 1/5
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 39

 DebSujit
commented
Sep 15
@abhishek_(123)  
Login

Option B can construct 110101 → 

First two 1 and one 0 using (10*10*) => 110

Next 101 using (10*10*) => 101

 
0

10 Answers


A. - If the string contains a , it must end in a hence cannot generate all bit strings with even
71 number of 's (eg, )

B. - is the answer

Best
C. - between the second and third 's a
D. - is not allowed, zero is an even number.
is not allowed (eg, )


answer

answered
Oct 16, 2014
edited
Mar 5, 2018
by kenzou


Arjun

4 Comments
Show 32 previous comments

Abhineet Singh
commented
Dec 12, 2020
did you start the timer as soon as you completed the reading the question and stopped it after solving ?

 
0

roo18
commented
Jul 13, 2021
How B is the ans? N if Yes then.. How String "1010101" Will be accepted by option B???? Plz someone

explain

 
0

Rutuja Desai
commented
Dec 7, 2021
Can option B generate 10111 ????


Can anyone pls explain

 
0

https://gateoverflow.in/2340/gate-cse-2010-question-39 2/5

11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 39

 
 31
(A) ( 0 * 10 * 1) * --->0110(valid string) not possible to produce from this Regular Expression.

Login
(B) 0 * (10 * 10 *) * ---> Produces all strings with even number of 1's.


(C) 0 * (10 * 1 ) * 0 * ----> 11011(valid string) cannot be produced from this.

(D) 0 * 1 (10 * 1) * 10 ---> epsilon or 0 (valid strings) can not be produced.( even number of 1's includes
zero number of 1's)

Therefore Answer : B Correct.


answered
Jan 22, 2016
edited
Dec 7, 2020
by Devwritt


Prasanna

4 Comments
krish
commented
Dec 5, 2016
@prasanna u take R.E of option c is wrong . bcz instead of 0*(10*1*)*0*  this .  it is given as 0*(10*1)*0*

just check it out

 
3

Hira Thakur
commented
Oct 24, 2017
 Prasanna  how from option C u generate 1 as substring??

 
0

Devwritt
commented
Dec 7, 2020
Edited

 
0

Pranavpurkar
commented
Nov 16, 2021
Devwritt

U have edited the option but the explanation for C is wrong. as here the option C can generate
11011...but in the actual paper the option C was different.

 
0


 method 1: draw the DFA and then derive reg ex from it 

7

https://gateoverflow.in/2340/gate-cse-2010-question-39 3/5
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 39

  Login

  

method 2: by verification 

option a. does n't generates strings ending with 0 ex:1100

option c :does n't generates strings like 110011,1101111,011011,...i.e it does n't producing 0 between
2nd 1 and 3rd 1 in the string

option d: does n't generate   

option b: is the answer


answered
Mar 15, 2018
edited
Mar 16, 2018
by varunraj


varunraj


We can omit out A because it cannot generate strings ending with 0 like 00

1
Omit D bcoz it cannot generate epsilon

now for B and C .we can clearly observe that C is a subset of B .Any language generated by C can be
generated by B so B is the correct option.


answered
Aug 1, 2019


Doraemon

https://gateoverflow.in/2340/gate-cse-2010-question-39 4/5
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 39

 1
2
3
next »
 Login

Answer: B

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2010 | Question: 41

57  Let be any string of length in . Let be the set of all substrings of .



#1

asked
Sep 30, 2014

GATE CSE 2010 | Question: 40

36  Consider the languages



#2

asked
Sep 30, 2014

GATE CSE 2010 | Question: 17

57  Let be the recursive language. Let and be languages that are recursively

#3

asked
Sep 29, 2014

GATE CSE 2010 | Question: 49

66  A computer system has an cache, an cache, and a main memory unit



#4

asked
Apr 21, 2016

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/2340/gate-cse-2010-question-39 5/5
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 40

  Login

GATE CSE 2010 | Question: 40

 9,577 views


asked
in Theory of Computation
Sep 30, 2014
edited
Feb 21, 2018
by kenzou

Consider the languages

36

A. Only is context free.


B. Only and are context free.
C. Only and are context free.
D. All are context free

gatecse-2010
theory-of-computation
context-free-language
identify-class-language
normal


go_editor

 share

1 Answer


Correct Answer: All are context free.

Push on stack and when comes, start popping. If stack becomes empty and 's are
48
remaining start pushing . At end of string accept if stack is non- empty.

Best
Do the same as for

Do, the same as for


, but accept if stack is empty at end of string.

, but for each , push two 's on stack and start the stack with a .

answer

Do the same as for , but for each , push two 's on stack

All are in fact DCFL. Pushing two 's on stack might sound non-trivial but we can do this by pushing
https://gateoverflow.in/2341/gate-cse-2010-question-40 1/3
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 40

 
one symbol and going to a new state. Then on this new state on empty symbol, push one more symbol
on stack and come back. Login


answered
Oct 3, 2014
edited
May 10, 2019
by Naveen Kumar 3


Arjun

4 Comments
Show 19 previous comments

Parth Patel 1
commented
Sep 15, 2019
reshown
Sep 17, 2019
by Parth Patel 1
Is not L1 regular (any number of 0's followed by any number of 1's). and hence CFL ??

 
1

mrinmoyh
commented
Sep 17, 2019
@Arjun sir,

In the last one, i 2j means i = j or i = 3j or i = 4j or i = 5j or i = 6j or ..............i = nj

so, there are many no. of non-determinism, How this is DCFL ???

 
0

IamDRD
commented
Dec 5, 2019
Sir, In L3 you written do the same as L2, but it should be "do the same as L1 n?" Because when i=2j+1

stack will be non empty which is same as L1.

And same problem in L4, it should same same as L2 n ??

 
0

Answer: D

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2010 | Question: 41

57  Let be any string of length in . Let be the set of all substrings of .



#1

asked
Sep 30, 2014
https://gateoverflow.in/2341/gate-cse-2010-question-40 2/3
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 40


63
GATE CSE 2010 | Question: 39

Let . i.e.,
 Login
is the set of all

#2

asked
Sep 30, 2014

GATE CSE 2010 | Question: 17

57  Let be the recursive language. Let and be languages that are recursively

#3

asked
Sep 29, 2014

GATE CSE 2018 | Question: 35

46  Consider the following languages:



#4

asked
Feb 14, 2018

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/2341/gate-cse-2010-question-40 3/3
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 41

  Login

GATE CSE 2010 | Question: 41

 18,998 views


asked
in Theory of Computation
Sep 30, 2014
edited
Oct 24, 2016
by go_editor

Let be any string of length in . Let be the set of all substrings of . What is the minimum
number of states in non-deterministic finite automation that accepts ?
57

A.
B.
C.
D.

gatecse-2010
theory-of-computation
finite-automata
normal
minimal-state-automata


go_editor

 share
4 Comments
Show 3 previous comments

ASNR1010
commented
Jan 15


Just accept the whole String first.. you will have n+1 states for that. Now
make every state final.. also make epsilon transition from initial state to
every state.

Ignore bolded part and that will give all possible suffixes of that string.  :)

 
1

Sonu12345
commented
Mar 8
If it says accept set of all subsequence then what will do?

 
0

Deepak Poonia
commented
Mar 8


If it says accept set of all subsequence then what will do?

https://gateoverflow.in/2342/gate-cse-2010-question-41 1/6
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 41

 
@Sonu12345, Refer this :
Login
https://gateoverflow.in/2342/Gate-cse-2010-question-41?show=372661#c372661

 
1

9 Answers


Answer: C

13 For any string let  be the set of all sub-strings of .



For any alphabet if is a string of length over then the number of states in a minimum
state NFA  for will be

Best Construction of such NFA with states is below :


answer
Just accept the whole String first, we will have  states for that. Now make every state
final, also make epsilon transition from initial state to every state.

NOTE that we can also have a NFA without epsilon moves, with states. Just take the above
and convert into NFA without number of states will not change. (Proof is left for
reader. Hint : See the to without  conversion) 

Now, coming to number of states in Minimal DFA for

This is interesting and much harder than it looks, also depends on size of alphabet

Result 1 :

If then number of states in Minimal DFA for  

Proof :

Proof is extremely simple for this. Just accept string , we need states, and make every state
on the way a final state, except the last state which is dead state.

Result 2 :

If then number of states in Minimal DFA for will be

where

and when

Proof of it is a matter for research students, should be skipped by GATE aspirants, But can be found
below :

https://www.sciencedirect.com/science/article/pii/S0304397500000645

NOTE that number of states in minimal DFA for may be more than and one such counter
example is string the minimal DFA for has states. Try creating this DFA.  

https://gateoverflow.in/2342/gate-cse-2010-question-41 2/6
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 41

 
Another such counter example is string the minimal DFA for has states. Try
creating this DFA as well.   Login


answered
Jun 5, 2021
selected
Jun 5, 2021
by Arjun


Deepak Poonia

4 Comments
Deepak Poonia
commented
Nov 5, 2021
Variation 1 :


For a given string of length Consider language :

To create a minimal NFA for language :

Make a minimal NFA that accepts .

It will have states. Now if we make every state final, new NFA will accept set of all prefixes of
i.e. language.

 
4

Pranavpurkar
commented
Nov 18, 2021
great explanation Sir!

 
1

Deepak Poonia
commented
Mar 8


A subsequence is like a substring, except it doesn't have to be consecutive characters.

Consider the string . The string has many subsequences, namely,

Let be any string of length in . Let be the set of all of . What is the
minimum number of states in non-deterministic finite automation that accepts ?

Answer :

Make a minimal NFA to accept the whole string first. We will have states. Let’s name these
states as Where is the starting state, and is the final state.

Now, for a minimal NFA for make every state of final, also make null moves from EVERY state to
EVERY state , where .

 
2

https://gateoverflow.in/2342/gate-cse-2010-question-41 3/6
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 41

 Sonu12345
commented
Mar 8
Great explanation sir👍  
Login

 
0


We need a separate state for counting each distinct length. So, for length we need states (one
for length zero). We don't need a reject state for larger strings as we need an NFA and not DFA. So,
70
totally states are required.

Correct Answer:


answered
Oct 3, 2014
edited
Jun 4, 2021
by gatecse


Arjun

4 Comments
Show 31 previous comments

mrinmoyh
commented
Sep 16, 2019
oldDoctor

n+2 is sufficient to make a DFA for this language.

what will you do with one more state.

 
0

Soumyabrata Chatterj
commented
Dec 4, 2020
does DFA accepting all substrings always have minimum n+2 states ?

 
0

Deepak Poonia
commented
Jun 5, 2021


does DFA accepting all substrings always have minimum n+2 states ?

NO. For counter example, take number of states in the minimal DFA for the language of
substrings of will be

Refer detailed analysis in my answer below :

https://gateoverflow.in/2342/gate-cse-2010-question-41?show=361376#a361376

 
1


https://gateoverflow.in/2342/gate-cse-2010-question-41 4/6
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 41

 
22 Suppose a string w from (0+1)* is 001 {n=3} 

 Step1. Draw a NFA that accept 001 so it requires (n+1=4) states 


Login

step2. Now our requirement is to draw a NFA for "L be the set of all substrings of w". so From NFA given
in step1 attach an branch containing ε from initial state to all other states. This  ε-NFA accepts L.

--- but there may be a confusion that it is a ε-NFA as i know that for an ε-NFA an equivalent NFA(w/o ε)
contains same no of states as in ε-NFA 

Hence this NFA also contains "n+1" states

Step3. now someone ask that how many minimum states DFA it requires to accept the L so i want to
tell u that there is no any standard result for it and also it is wrong to say that DFA for L contains "n+2"
states it is variying {u can check it also by taking some examples}.


answered
Oct 23, 2016


saurabh rai

4 Comments
anchitjindal07
commented
Sep 15, 2017
Sir, why it is wrong to say that DFA for L contains "n+2" states

 
2

meghna
commented
May 8, 2018
well explained :)

 
1

commenter commenter
commented
Jul 20, 2019


it is wrong to say that DFA for L contains "n+2" states

Exactly. The accepted answer stated that DFA would have "n+2" states which made me confused. 

 
0

Paatni22
commented
Nov 6, 2020
Best answer, cleared all doubts. Thanks

 
0


For n length string, the nfa needs n+1 states where all the states are final states and there are epsilon
transitions from the initial state to all final states. So, answer is n+1.
8


answered
May 3, 2017


Vishal Goel

https://gateoverflow.in/2342/gate-cse-2010-question-41 5/6
11/4/22, 9:48 PM Theory of Computation: GATE CSE 2010 | Question: 41

 1
2
3
next »
 Login

Answer: C

← Previous Next →

← Previous in category Next in category →

Related questions

GATE CSE 2010 | Question: 40

36  Consider the languages



#1

asked
Sep 30, 2014

GATE CSE 2010 | Question: 39

63  Let . i.e., is the set of all



#2

asked
Sep 30, 2014

GATE CSE 2010 | Question: 17

57  Let be the recursive language. Let and be languages that are recursively

#3

asked
Sep 29, 2014

GATE CSE 2007 | Question: 75

26  Consider the following Finite State Automaton: The minimum state automaton

#4

asked
Apr 23, 2016

Send feedback
Rank Predictor
College Prediction
Useful Links
FAQ
Corrections
Discuss
Copyright
Request

Testimonials
Chat Logs
Chat
Badges
Search tips
Exam Category
Blog Category
Blog Tags
Privacy
Test Series

Contact Us
Developed by Chun

https://gateoverflow.in/2342/gate-cse-2010-question-41 6/6
11/4/22, 9:56 PM GATE | GATE-CS-2002 | Question 7 - GeeksforGeeks

GEEKSFORGEEKS

GATE | GATE-CS-2002 | Question 7


The language accepted by a Pushdown Automation in which the stack is limited to 10
items is best described as

(A) Context Free

(B) Regular

(C) Deterministic Context Free

(D) Recursive

Answer: (B)

Explanation: Pushdown automata is used for context free languages, i.e., languages in
which the length of elements is unrestricted and length of one element is related to
other. To resolve this problem, we use a stack with no restrictions on length.

But in the given case, length of stack is restricted. Thus, this pushdown automata can
only accept languages which can also be accepted by finite state automata and a finite
state automata accepts only regular languages.

Thus, B is the correct choice.

Please comment below if you find anything wrong in the above post.

Quiz of this Question

Article Tags : GATE


GATE-CS-2002 GATE-GATE-CS-2002

Recommended Articles
1. GATE | GATE CS 1999 | Question 36
2. GATE | GATE CS Mock 2018 | Question 39
3. GATE | GATE CS 2013 | Question 1
4. GATE | GATE CS 2013 | Question 3
5. GATE | GATE CS 2013 | Question 4
6. GATE | GATE CS 2013 | Question 65
https://www.geeksforgeeks.org/gate-gate-cs-2002-question-7/amp/ 1/3
11/4/22, 9:56 PM GATE | GATE-CS-2002 | Question 7 - GeeksforGeeks

7. GATE | GATE CS 2013 | Question 6


8. GATE | GATE CS 2013 | Question 7
9. GATE | GATE CS 2013 | Question 8
10. GATE | GATE CS 2013 | Question 65
11. GATE | GATE CS 2013 | Question 65
12. GATE | GATE CS 2013 | Question 11
13. GATE | GATE CS 2013 | Question 65
14. GATE | GATE CS 2013 | Question 18
15. GATE | GATE CS 2013 | Question 19
16. GATE | GATE CS 2013 | Question 65
17. GATE | GATE CS 2013 | Question 65
18. GATE | GATE CS 2013 | Question 22
19. GATE | GATE CS 2013 | Question 23
20. GATE | GATE CS 2013 | Question 24
21. GATE | GATE CS 2013 | Question 25
22. GATE | GATE CS 2013 | Question 26
23. GATE | GATE CS 2013 | Question 65
24. GATE | GATE CS 2013 | Question 28
25. GATE | GATE CS 2013 | Question 65

Read Full Article

https://www.geeksforgeeks.org/gate-gate-cs-2002-question-7/amp/ 2/3
11/4/22, 9:56 PM GATE | GATE-CS-2002 | Question 7 - GeeksforGeeks

710-B, Advant Navis Business Park,


Sector-142, Noida, Uttar Pradesh - 201305
feedback@geeksforgeeks.org

COMPANY LEARN
About Us Algorithms
Careers Data Structures
Privacy Policy Languages
Contact Us CS Subjects
Video Tutorials

PRACTICE CONTRIBUTE
Company-wise Write an Article
Topic-wise GBlog
Contests Videos
Subjective Questions

@geeksforgeeks, Some rights reserved

https://www.geeksforgeeks.org/gate-gate-cs-2002-question-7/amp/ 3/3
11/4/22, 9:55 PM GATE | GATE-CS-2002 | Question 38 - GeeksforGeeks

GEEKSFORGEEKS

GATE | GATE-CS-2002 | Question 38


The smallest finite automation which accepts the language {x | length of x is divisible
by 3} has :

(A) 2 states

(B) 3 states

(C) 4 states

(D) 5 states

Answer: (B)

Explanation:

Thus, we require 3 states.

So, B is the correct choice.

Please comment below if you find anything wrong in the above post.

Quiz of this Question

Article Tags : GATE


GATE-CS-2002 GATE-GATE-CS-2002

Recommended Articles
1. GATE | GATE CS 1999 | Question 36
2. GATE | GATE CS Mock 2018 | Question 39
3. GATE | GATE CS 2013 | Question 1
4. GATE | GATE CS 2013 | Question 3

https://www.geeksforgeeks.org/gate-gate-cs-2002-question-38/amp/ 1/3
11/4/22, 9:55 PM GATE | GATE-CS-2002 | Question 38 - GeeksforGeeks

5. GATE | GATE CS 2013 | Question 4


6. GATE | GATE CS 2013 | Question 65
7. GATE | GATE CS 2013 | Question 6
8. GATE | GATE CS 2013 | Question 7
9. GATE | GATE CS 2013 | Question 8
10. GATE | GATE CS 2013 | Question 65
11. GATE | GATE CS 2013 | Question 65
12. GATE | GATE CS 2013 | Question 11
13. GATE | GATE CS 2013 | Question 65
14. GATE | GATE CS 2013 | Question 18
15. GATE | GATE CS 2013 | Question 19
16. GATE | GATE CS 2013 | Question 65
17. GATE | GATE CS 2013 | Question 65
18. GATE | GATE CS 2013 | Question 22
19. GATE | GATE CS 2013 | Question 23
20. GATE | GATE CS 2013 | Question 24
21. GATE | GATE CS 2013 | Question 25
22. GATE | GATE CS 2013 | Question 26
23. GATE | GATE CS 2013 | Question 65
24. GATE | GATE CS 2013 | Question 28
25. GATE | GATE CS 2013 | Question 65

Read Full Article

https://www.geeksforgeeks.org/gate-gate-cs-2002-question-38/amp/ 2/3
11/4/22, 9:55 PM GATE | GATE-CS-2002 | Question 38 - GeeksforGeeks

710-B, Advant Navis Business Park,


Sector-142, Noida, Uttar Pradesh - 201305
feedback@geeksforgeeks.org

COMPANY LEARN
About Us Algorithms
Careers Data Structures
Privacy Policy Languages
Contact Us CS Subjects
Video Tutorials

PRACTICE CONTRIBUTE
Company-wise Write an Article
Topic-wise GBlog
Contests Videos
Subjective Questions

@geeksforgeeks, Some rights reserved

https://www.geeksforgeeks.org/gate-gate-cs-2002-question-38/amp/ 3/3
11/4/22, 9:56 PM GATE | GATE-CS-2003 | Question 14 - GeeksforGeeks

Sale Ends Soon!


DSA Data Structures Algorithms Write & Earn Interview Preparation Topic-wise Practice

GATE | GATE-CS-2003 | Question 14


Last Updated :
27 Nov, 2018

The regular expression 0*(10*)* denotes the same set as

(A) (1*0)*1*

(B) 0 + (0 + 10)*

(C) (0 + 1)* 10(0 + 1)*

(D) none of these

Answer: (A)

Explanation: There is proper ty of regular expression (a+b)* = (a*b*)* = (a*+b*)* =

(a*+b)* = a*(ba*)*= (b*a)*b*.

(1*0)*1* can generate all strings that generated by given regular expression 0*

(10*)*.

So, option (A) is correct.

Quiz of this Question

Like 2

https://www.geeksforgeeks.org/gate-gate-cs-2003-question-14/#aoh=16675758255021&csi=1&referrer=https%3A%2F%2Fwww.google.com&am… 1/4
11/4/22, 9:56 PM GATE | GATE-CS-2003 | Question 14 - GeeksforGeeks

Start Your Coding Journey Now!


Previous Next
Login Register

RECOMMENDED ARTICLES Page : 1 2 3

GATE | GATE CS 1999 | Question 36 GATE | GATE CS 2013 | Question 4


01 04, Oct 17
05 17, Oct 13

GATE | GATE CS Mock 2018 | GATE | GATE CS 2013 | Question 65


02
Question 39 06 17, Oct 13

10, Dec 17

GATE | GATE CS 2013 | Question 1 GATE | GATE CS 2013 | Question 6


03 07 17, Oct 13
17, Oct 13

GATE | GATE CS 2013 | Question 3 GATE | GATE CS 2013 | Question 7


04 17, Oct 13
08 17, Oct 13

Ar ticle Contributed By :

GeeksforGeeks

Vote for difficulty

Easy Normal Medium Hard Expert

Article Tags : GATE-CS-2003, GATE-GATE-CS-2003, GATE

https://www.geeksforgeeks.org/gate-gate-cs-2003-question-14/#aoh=16675758255021&csi=1&referrer=https%3A%2F%2Fwww.google.com&am… 2/4
11/4/22, 9:56 PM GATE | GATE-CS-2003 | Question 14 - GeeksforGeeks

Report Issue
Start Your Coding Journey Now!
Improve Article Login Register

Writing code in comment?


Please use ide.geeksforgeeks.org,
generate link and share the link here.

Load Comments

A-143, 9th Floor, Sovereign Corporate Tower,

Sector-136, Noida, Uttar Pradesh - 201305

feedback@geeksforgeeks.org

Company Learn
About Us Algorithms
Careers Data Structures
In Media SDE Cheat Sheet
Contact Us Machine learning
Privacy Policy CS Subjects
Copyright Policy Video Tutorials
Courses

News Languages
Top News
Python
Technology
Java
Work & Career
CPP
Business
Golang
Finance
C#
Lifestyle
SQL
Knowledge
Kotlin

Web Development Contribute


https://www.geeksforgeeks.org/gate-gate-cs-2003-question-14/#aoh=16675758255021&csi=1&referrer=https%3A%2F%2Fwww.google.com&am… 3/4
11/4/22, 9:56 PM GATE | GATE-CS-2003 | Question 14 - GeeksforGeeks

Web Tutorials Write an Article


Start Your Django
Coding Journey Now!
Tutorial
Login
Improve an Article
Register

HTML Pick Topics to Write


JavaScript Write Interview Experience
Bootstrap Internships
ReactJS Video Internship
NodeJS

@geeksforgeeks
, Some rights reserved

https://www.geeksforgeeks.org/gate-gate-cs-2003-question-14/#aoh=16675758255021&csi=1&referrer=https%3A%2F%2Fwww.google.com&am… 4/4
11/4/22, 9:55 PM GATE | GATE-CS-2004 | Question 86 - GeeksforGeeks

Sale Ends Soon!


DSA Data Structures Algorithms Write & Earn Interview Preparation Topic-wise Practice

GATE | GATE-CS-2004 | Question 86


Last Updated :
28 Jun, 2021

The following finite state machine accepts all those binar y strings in which the

number of 1’s and 0’s are respectively.

(A) divisible by 3 and 2

(B) odd and even

(C) even and odd

(D) divisible by 2 and 3

Answer: (A)

Explanation:  

Option (B) is eliminated because string 100 contains odd number of 1s and even number of 0s but is not

accepted by the DFA.

Option(C) is eliminated because string 011 contains even number of 1s and odd number of 0s but is not

https://www.geeksforgeeks.org/gate-gate-cs-2004-question-86/#aoh=16675758600730&csi=1&referrer=https%3A%2F%2Fwww.google.com&am… 1/5
11/4/22, 9:55 PM GATE | GATE-CS-2004 | Question 86 - GeeksforGeeks

accepted by the DFA.

Start Your Coding Journey Now! Login Register


Option (D) is eliminated because string 11000 has number of 1s divisible by 2 and number of 0s divisible by 3 but

still not accepted by the DFA.

Option (A) accepts all strings with number of 1s divisible by 3 and number of 0s divisible by 2.

Extra note: In any case where (no of 1s) MOD N= some integer k and (no of 0s) MOD M= some integer q the

number of states in the DFA will be equal to N*M.

(The product could be taken for all input alphabets.)

E.g.: if we say no. of ones is even and no. of 0s is odd (we check if (no. of 1s) MOD 2=0 and (no. of 0s) MOD

2=0) so no. of states in the DFA=2*2=4.

Hence option (B) and (C) can directly be eliminated as the DFA has 6 states and we can look only at the

remaining two options.

This solution is contributed by Yashika Arora .

Quiz of this Question

Like 0

https://www.geeksforgeeks.org/gate-gate-cs-2004-question-86/#aoh=16675758600730&csi=1&referrer=https%3A%2F%2Fwww.google.com&am… 2/5
11/4/22, 9:55 PM GATE | GATE-CS-2004 | Question 86 - GeeksforGeeks

Start Your Coding Journey Now!


Previous Login Register
Next

RECOMMENDED ARTICLES Page : 1 2 3

GATE | GATE CS 1999 | Question 36 GATE | GATE CS 2013 | Question 4


01 04, Oct 17
05 17, Oct 13

GATE | GATE CS Mock 2018 | GATE | GATE CS 2013 | Question 65


02
Question 39 06 17, Oct 13

10, Dec 17

GATE | GATE CS 2013 | Question 1 GATE | GATE CS 2013 | Question 6


07
03 17, Oct 13
17, Oct 13

GATE | GATE CS 2013 | Question 3 GATE | GATE CS 2013 | Question 7


04 17, Oct 13
08 17, Oct 13

Ar ticle Contributed By :

GeeksforGeeks

Vote for difficulty

Easy Normal Medium Hard Expert

Article Tags : GATE-CS-2004, GATE-GATE-CS-2004, GATE

https://www.geeksforgeeks.org/gate-gate-cs-2004-question-86/#aoh=16675758600730&csi=1&referrer=https%3A%2F%2Fwww.google.com&am… 3/5
11/4/22, 9:55 PM GATE | GATE-CS-2004 | Question 86 - GeeksforGeeks

Report Issue
Start Your Coding Journey Now!
Improve Article Login Register

Writing code in comment?


Please use ide.geeksforgeeks.org,
generate link and share the link here.

Load Comments

A-143, 9th Floor, Sovereign Corporate Tower,

Sector-136, Noida, Uttar Pradesh - 201305

feedback@geeksforgeeks.org

Company Learn
About Us Algorithms
Careers Data Structures
In Media SDE Cheat Sheet
Contact Us Machine learning
Privacy Policy CS Subjects
Copyright Policy Video Tutorials
Courses

News Languages
Top News
Python
Technology
Java
Work & Career
CPP
Business
Golang
Finance
C#
Lifestyle
SQL
Knowledge
Kotlin

Web Development Contribute


https://www.geeksforgeeks.org/gate-gate-cs-2004-question-86/#aoh=16675758600730&csi=1&referrer=https%3A%2F%2Fwww.google.com&am… 4/5
11/4/22, 9:55 PM GATE | GATE-CS-2004 | Question 86 - GeeksforGeeks

Web Tutorials Write an Article


Start Your Django
Coding Journey Now!
Tutorial
Login
Improve an Article
Register

HTML Pick Topics to Write


JavaScript Write Interview Experience
Bootstrap Internships
ReactJS Video Internship
NodeJS

@geeksforgeeks
, Some rights reserved

https://www.geeksforgeeks.org/gate-gate-cs-2004-question-86/#aoh=16675758600730&csi=1&referrer=https%3A%2F%2Fwww.google.com&am… 5/5
11/4/22, 9:55 PM GATE | GATE-CS-2005 | Question 57 - GeeksforGeeks

Sale Ends Soon!


DSA Data Structures Algorithms Write & Earn Interview Preparation Topic-wise Practice

GATE | GATE-CS-2005 | Question 57


Last Updated :
28 Jun, 2021

Consider the languages:

L1 = {wwR |w ∈ {0, 1}*}

L2 = {w#wR | w ∈ {0, 1}*}, where # is a special symbol

L3 = {ww | w ∈ (0, 1}*)

Which one of the following is TRUE?

(A) L1 is a deterministic CFL

(B) L2 is a deterministic CFL

(C) L3 is a CFL, but not a deterministic CFL

(D) L3 is a deterministic CFL

Answer: (B)

Explanation:  

L1: {ww^R | w belongs {0,1}*}

This is a CFL but not a DCFL. It can be derived from the following grammar

S -> aSa | bSb | epsilon

But it can’t be derived from any deterministic pushdown automaton, because there is

no way to figure out where a word w ends and its reverse star ts.

L2: {w#w^R | w belongs {0,1}*}

This is a CFL, due to the same reason as described above. This is a deterministic CFL

because we have a marker to help us find out the end of the word w and star t of its

reverse. Thus a PDA where all the alphabets are pushed until we get # and af ter wards

https://www.geeksforgeeks.org/gate-gate-cs-2005-question-57/#aoh=16675759459847&referrer=https%3A%2F%2Fwww.google.com&amp_tf=Fr… 1/5
11/4/22, 9:55 PM GATE | GATE-CS-2005 | Question 57 - GeeksforGeeks

Start Your Coding Journey Now!


pop only if the top of the stack matches the current alphabet and reject other wise –

Login Register
will derive L2.

L3: {ww | w belongs {0,1}*}

This is not even a CFL. A bove claim could be proved using pumping lemma –

Consider a string z of the form (0^n 1^n 0^n 1^n).

A ssuming L3 is a CFL, and z obviously satisfies L3 – thus z should also satisf y

pumping lemma.

We will take n such that n = p, where p is the pumping length of L3, hence forcing our

string to be of length greater than pumping length.

Now, according to pumping lemma, there must exist u,v,w,x,y such that z = uvwx y,

|vwx| <= p, |vx| > 0 and u{v^i}x{y^i}z belongs L3 for all i>=0.

There doesn’t exist any such configuration of u,v,w,x,y such that u{v^0}x{y^0}z

belongs L3. Hence z doesn’t satisf y pumping lemma. Hence L3 is not a CFL.

Considering all the above conclusions, only correct option comes out to be (B) L2 is a

deterministic CFL.

Reference ;

https://courses.engr.illinois.edu/c s373/sp2013/Lectures/lec17.pdf

This solution is contributed by Vineet Purswani.

Quiz of this Question

https://www.geeksforgeeks.org/gate-gate-cs-2005-question-57/#aoh=16675759459847&referrer=https%3A%2F%2Fwww.google.com&amp_tf=Fr… 2/5
11/4/22, 9:55 PM GATE | GATE-CS-2005 | Question 57 - GeeksforGeeks

Start Your Coding Journey Now! Login Register

Like 0

Previous Next

RECOMMENDED ARTICLES Page : 1 2 3

GATE | GATE CS 1999 | Question 36 GATE | GATE CS 2013 | Question 4


01 04, Oct 17
05 17, Oct 13

GATE | GATE CS Mock 2018 | GATE | GATE CS 2013 | Question 65


02
Question 39 06 17, Oct 13

10, Dec 17

GATE | GATE CS 2013 | Question 1 GATE | GATE CS 2013 | Question 6


03 07 17, Oct 13
17, Oct 13

GATE | GATE CS 2013 | Question 3 GATE | GATE CS 2013 | Question 7


04 17, Oct 13
08 17, Oct 13

Ar ticle Contributed By :

GeeksforGeeks

Vote for difficulty

Easy Normal Medium Hard Expert


https://www.geeksforgeeks.org/gate-gate-cs-2005-question-57/#aoh=16675759459847&referrer=https%3A%2F%2Fwww.google.com&amp_tf=Fr… 3/5
11/4/22, 9:55 PM GATE | GATE-CS-2005 | Question 57 - GeeksforGeeks
y p

Start Your Coding Journey Now! Login Register

Article Tags : GATE-CS-2005, GATE-GATE-CS-2005, GATE

Improve Article Report Issue

Writing code in comment?


Please use ide.geeksforgeeks.org,
generate link and share the link here.

Load Comments

A-143, 9th Floor, Sovereign Corporate Tower,

Sector-136, Noida, Uttar Pradesh - 201305

feedback@geeksforgeeks.org

Company Learn
About Us Algorithms
Careers Data Structures
In Media SDE Cheat Sheet
Contact Us Machine learning
Privacy Policy CS Subjects
Copyright Policy Video Tutorials
Courses

News Languages
Top News
Python
Technology
Java
Work & Career
CPP
Business
Golang
https://www.geeksforgeeks.org/gate-gate-cs-2005-question-57/#aoh=16675759459847&referrer=https%3A%2F%2Fwww.google.com&amp_tf=Fr… 4/5
11/4/22, 9:55 PM GATE | GATE-CS-2005 | Question 57 - GeeksforGeeks

Finance C#
Start Your Coding
Lifestyle Journey Now!
Login
SQL
Register

Knowledge Kotlin

Web Development Contribute


Web Tutorials Write an Article
Django Tutorial Improve an Article
HTML Pick Topics to Write
JavaScript Write Interview Experience
Bootstrap Internships
ReactJS Video Internship
NodeJS

@geeksforgeeks
, Some rights reserved

https://www.geeksforgeeks.org/gate-gate-cs-2005-question-57/#aoh=16675759459847&referrer=https%3A%2F%2Fwww.google.com&amp_tf=Fr… 5/5

You might also like