GATE Overflow - Recent questions in Theory of Computation
https://gateoverflow.in/questions/theory-of-computation
Powered by Question2AnswerMade easy test
https://gateoverflow.in/217529/made-easy-test
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=8897206129877570085"></p>Theory of Computationhttps://gateoverflow.in/217529/made-easy-testTue, 22 May 2018 03:55:33 +0000Made easy test series
https://gateoverflow.in/217504/made-easy-test-series
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=6575122670732595927"></p>Theory of Computationhttps://gateoverflow.in/217504/made-easy-test-seriesTue, 22 May 2018 02:14:56 +0000Made easy test series
https://gateoverflow.in/217502/made-easy-test-series
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=14697326920139199498"></p>Theory of Computationhttps://gateoverflow.in/217502/made-easy-test-seriesTue, 22 May 2018 02:12:59 +0000Made easy test series
https://gateoverflow.in/217501/made-easy-test-series
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=7886087586729908584"></p>Theory of Computationhttps://gateoverflow.in/217501/made-easy-test-seriesTue, 22 May 2018 02:10:41 +0000Doubt .... Theory of Computation ..... Regular Expression
https://gateoverflow.in/217441/doubt-theory-of-computation-regular-expression
Design regular expression for no $2$ $a's$ should come together ...... (Standard question in many text books)<br />
<br />
I came to know the answer is .... $(a + E) (b + ba)$ or $(b + ab) (a + E)$ ...... this I have understood Logically ....<br />
<br />
but when I tried it on my own for the first time ... I came up with $(b + ab)^* + (b + ba)^{*} + a + E $....... please help me with any case or scenario where my expression fails.<br />
<br />
This community is always helpful to me. Thanks in advance ...Theory of Computationhttps://gateoverflow.in/217441/doubt-theory-of-computation-regular-expressionMon, 21 May 2018 13:18:59 +0000Doubt ..... Theory of Computing
https://gateoverflow.in/217346/doubt-theory-of-computing
<p>find regular expression over $\{a,b\}$ corresponding to <strong>"set of strings containing Exactly $2a's$.".</strong></p>
<p> </p>
<p>I have come up with two answers and are seeming Logically correct to me. Please correct me If I am wrong.</p>
<p>1. $b^* a b^* a b^*$ --- This will have $0$ or any number of $b's$ at start and $0$ or any number of $b's$ in the middle and $0$ or any number of $b's$ at the end .... So it should cover all the Strings in the Language.</p>
<p>2. $a a b^* + a b^* a + b^* a a$ -- This contains the three scenarios where the two $a's$ are at start, one $b$ In the middle of $2 a's$ and $2 a's$ at the end.</p>
<p>I am wondering if both of them are correct.</p>
<p>Thanks in advance.</p>Theory of Computationhttps://gateoverflow.in/217346/doubt-theory-of-computingSun, 20 May 2018 18:20:36 +0000Regular expression#previous year gate
https://gateoverflow.in/217334/regular-expression%23previous-year-gate
<p>Give a regular expression for the set of binary strings where every $0$ is immediately followed by exactly $k$ number of $1's$ and preceded by at least $k$ number of $1's$ ($k$ is a fixed integer).Choose the correct one out of two.</p>
<ol start="1" style="list-style-type:lower-alpha">
<li>$1^*1^k(01^k)^*1^*$ </li>
<li>$1^*(1^k01^k)^*$</li>
</ol>Theory of Computationhttps://gateoverflow.in/217334/regular-expression%23previous-year-gateSun, 20 May 2018 16:35:44 +0000PDA for a language
https://gateoverflow.in/216991/pda-for-a-language
$a^i b^j / i$ should not be equal to $2j+1$<br />
<br />
give PDA for this languageTheory of Computationhttps://gateoverflow.in/216991/pda-for-a-languageThu, 17 May 2018 08:36:53 +0000TOC Language is CFL or not
https://gateoverflow.in/216981/toc-language-is-cfl-or-not
xx^r /x=[0,1]* , |x|=l<br />
<br />
Here we have restriction that on length of x should be exactly l <br />
<br />
If only the language is given How can we say that l is finite or infinite <br />
<br />
In one of the videos they have taken subsets of l also 2^l , how can this language be Regular and CFL<br />
<br />
plzz explain each point properlyTheory of Computationhttps://gateoverflow.in/216981/toc-language-is-cfl-or-notThu, 17 May 2018 07:16:32 +0000regular language and CFL
https://gateoverflow.in/216979/regular-language-and-cfl
$L=\left \{ a^{n}b^{n}c^{n}d^{n} | n<10^{10} \right \}$<br />
<br />
I know this language is regular language so it is DCFL AND CFL also<br />
<br />
but how can we implenment this language with DCFL with stack because till we reach c there will be nothing in the stack to compare c with<br />
<br />
this language can be implemented using FA We can have these many states to compare how we will compare in stack<br />
<br />
explain the logic of this language with DCFLTheory of Computationhttps://gateoverflow.in/216979/regular-language-and-cflThu, 17 May 2018 06:57:00 +0000Regular grrammar
https://gateoverflow.in/216961/regular-grrammar
S->abA<br />
<br />
A->baB<br />
<br />
B->aA|bb<br />
<br />
convert this to left linear grammarTheory of Computationhttps://gateoverflow.in/216961/regular-grrammarThu, 17 May 2018 04:34:14 +0000Gate1994
https://gateoverflow.in/216914/gate1994
The number of substrings(of all lengths inclusive) that can be formed from character string of length n is<br />
<br />
a)n<br />
<br />
b)n^2<br />
<br />
c)n(n-1)/2<br />
<br />
d)(n(n+1)/2)+1Theory of Computationhttps://gateoverflow.in/216914/gate1994Wed, 16 May 2018 16:08:27 +0000Peter Linz 2.1.7(g)
https://gateoverflow.in/216272/peter-linz-2-1-7-g
Draw a DFA $L = \left \{ w : |w| mod 3 = 0, |w| \neq 6 \right \}$Theory of Computationhttps://gateoverflow.in/216272/peter-linz-2-1-7-gMon, 14 May 2018 06:03:15 +0000Context Free Grammar
https://gateoverflow.in/216626/context-free-grammar
What is Non-Inheritant grammar and inheritant Grammar? Please explain with an example.Theory of Computationhttps://gateoverflow.in/216626/context-free-grammarMon, 14 May 2018 05:59:55 +0000what is the regular expression and design dfa and nfa for arthimatic expression
https://gateoverflow.in/216623/what-the-regular-expression-design-arthimatic-expression
Theory of Computationhttps://gateoverflow.in/216623/what-the-regular-expression-design-arthimatic-expressionSun, 13 May 2018 16:17:47 +0000decidability
https://gateoverflow.in/216411/decidability
<p>Let L(R) be the language represented by regular expression R. Let L(G) be the language generated by a context free grammar G. Which of the following decision problems are decidable?
<br>
<strong>I.</strong> Whether L(G) is deterministic context free language?
<br>
<strong>II.</strong>Whether L(G1)∩L(G2) is a context free language, where G1 and G2 are deterministic grammar?</p>Theory of Computationhttps://gateoverflow.in/216411/decidabilityFri, 11 May 2018 17:07:03 +0000Theory of computation doubt
https://gateoverflow.in/216196/theory-of-computation-doubt
Cfl is closed under intersection with regular language.<br />
<br />
Then resultant languages will be regular or cfl ?<br />
<br />
Let X is cfl<br />
<br />
Y is regular language<br />
<br />
L=X intersection Y <br />
<br />
Then L is what?Theory of Computationhttps://gateoverflow.in/216196/theory-of-computation-doubtThu, 10 May 2018 04:56:37 +0000Minimal Dfa
https://gateoverflow.in/216163/minimal-dfa
Design minimal dfa for every 'a' has to be followed by 'bb'.Theory of Computationhttps://gateoverflow.in/216163/minimal-dfaWed, 09 May 2018 18:56:23 +0000what the language accebted by
https://gateoverflow.in/215842/what-the-language-accebted-by
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=16528662331799979384"></p>Theory of Computationhttps://gateoverflow.in/215842/what-the-language-accebted-byWed, 09 May 2018 12:00:15 +0000FA to Regular Expression: when no two a's and no two b's should come together
https://gateoverflow.in/216058/fa-regular-expression-when-two-and-two-should-come-together
<p>I wanted to covert the finite automata of the question 'when no two a's and no two b's should come together' to regular expression. But I am not able to do so.</p>
<p>I have attached my working. Kindly see it and please tell where I am wrong. Also, I am not able to eliminate state B (and not eliminating step C) or vice-versa and draw it as a FA. Please also show the diagram if I eliminate B after eliminating C.</p>
<p> </p>
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=6584172395281603965"></p>Theory of Computationhttps://gateoverflow.in/216058/fa-regular-expression-when-two-and-two-should-come-togetherWed, 09 May 2018 11:59:19 +0000Grade up topicwise questions
https://gateoverflow.in/216008/grade-up-topicwise-questions
L1={a^n b^n c ^m|m>=0 and n>=0}<br />
<br />
L2={a^m b^ n c^ n|n>=0 and m>=0}<br />
<br />
If L3=L1UL2 then how many of L1,L2,L3 are context free languages?<br />
<br />
A)1 (B)2 (C)3 (D) none<br />
<br />
Answer given option C.<br />
<br />
Please explain?Theory of Computationhttps://gateoverflow.in/216008/grade-up-topicwise-questionsTue, 08 May 2018 14:46:17 +0000OMG! What an Interesting Combinatorics Question!
https://gateoverflow.in/215989/omg-what-an-interesting-combinatorics-question
A poker hand consists of 5 cards. If the cards have distinct consecutive values and are not all of the same suit, we say that the hand is a straight. For instance, a hand consisting of the five of spades, six of spades, seven of spades, eight of spades, and nine of hearts is a straight. How many ways are there to get a "straight"? Assume that there are totally 52 cards.Theory of Computationhttps://gateoverflow.in/215989/omg-what-an-interesting-combinatorics-questionTue, 08 May 2018 13:39:59 +0000No of states in Minimal DFA
https://gateoverflow.in/215804/no-of-states-in-minimal-dfa
Ques:- Let ∑= {0, 1} What will be the number of states in minimal DFA, if the Binary number string is congruent to (mod 8)?<br />
<br />
*[ Can anybody explain this as I am getting 8 states for this since remainders will be 8 (0,1,2,3,4,5,6,7). But the answer is 4].Theory of Computationhttps://gateoverflow.in/215804/no-of-states-in-minimal-dfaTue, 08 May 2018 13:30:14 +0000Minimal Final States in DFA
https://gateoverflow.in/215807/minimal-final-states-in-dfa
Ques:- What are the number of final states in minimal DFA, where ∑= {a, b}, if every string starts with “aa” and length of the string is not congruent to 0 (mod 4).Theory of Computationhttps://gateoverflow.in/215807/minimal-final-states-in-dfaTue, 08 May 2018 13:30:11 +0000what the language accepted by dfa?
https://gateoverflow.in/215839/what-the-language-accepted-by-dfa
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=9382488283898249715"></p>Theory of Computationhttps://gateoverflow.in/215839/what-the-language-accepted-by-dfaTue, 08 May 2018 13:29:51 +0000Peter Linz Chapter 1 exercise 14.e
https://gateoverflow.in/215936/peter-linz-chapter-1-exercise-14-e
L1={$a^nb^m$:n>=0,m>n}<br />
<br />
L2={$a^nb^{2n}$:n>=0}<br />
<br />
find the grammar for L1L2Theory of Computationhttps://gateoverflow.in/215936/peter-linz-chapter-1-exercise-14-eTue, 08 May 2018 03:56:34 +0000TOC language is CFL or not
https://gateoverflow.in/215899/toc-language-is-cfl-or-not
L={a^n,b^n,c^m / n>m}<br />
<br />
we have to compare n and m everywhere I know till we reach b there will be nothing in the stack BUT generally we can make this language if possible <br />
<br />
suppose when we are putting one a into the stack suppose we put Two a's on behalf of one a then the no'of a's 2*n into the stack and the we pop one a for one b after completing allb's still there will be n number of a's will be remaining into the stack then we can compare number of a's and number of c's if and one a or more than one a is remaining in the stack then we can accept the string otherwise we can reject the string <br />
<br />
I'm asking this question because in one of the video for the question we were taking two a's on behalf of one .......Theory of Computationhttps://gateoverflow.in/215899/toc-language-is-cfl-or-notMon, 07 May 2018 14:45:35 +0000TOC PDA machine
https://gateoverflow.in/215896/toc-pda-machine
<p> </p>
<p> </p>
<p>Is my PDA correct or not plzz rectify me If I have made a mistake<img alt="Is this PDA correct for this language plzz rectify me If'm wrong somewhere" src="https://gateoverflow.in/?qa=blob&qa_blobid=9963975029591073388"></p>Theory of Computationhttps://gateoverflow.in/215896/toc-pda-machineMon, 07 May 2018 13:33:06 +0000Test Series
https://gateoverflow.in/215816/test-series
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=13257554428337781653"></p>
<p>If there are Q states in NFA, DFA should have at max $2^{Q}$ states. Keeping this thing in mind I answered the question but it went wrong.</p>
<p>Please if anyone can give the correct solution.</p>Theory of Computationhttps://gateoverflow.in/215816/test-seriesSun, 06 May 2018 17:35:01 +0000Context Free Language
https://gateoverflow.in/215812/context-free-language
L= { $a^{n}b^{m}$ | $n<=m<=2n$ }<br />
<br />
a) DCFL<br />
<br />
b) CFL but not DCFL<br />
<br />
c) Not CFLTheory of Computationhttps://gateoverflow.in/215812/context-free-languageSun, 06 May 2018 16:15:12 +0000TheGateAcademy Test Series
https://gateoverflow.in/215797/thegateacademy-test-series
In DFA, does each state need to have transition on "EACH" input alphabet?<br />
<br />
The answer was given "False" but I dont think so. Can anyone explain?<br />
<br />
Because if this statement is False, then there is no use of "Dead State"Theory of Computationhttps://gateoverflow.in/215797/thegateacademy-test-seriesSun, 06 May 2018 13:09:48 +0000How to find out the quotient of regular language with example?
https://gateoverflow.in/215671/how-to-find-out-the-quotient-of-regular-language-with-example
How to find out the quotient of regular language with example?Theory of Computationhttps://gateoverflow.in/215671/how-to-find-out-the-quotient-of-regular-language-with-exampleSat, 05 May 2018 18:51:48 +0000Automata (How to create DFA for the language)
https://gateoverflow.in/215676/automata-how-to-create-dfa-for-the-language
Ques:- How to create minimal DFA over w where w belongs to (a,b)* such 2nd symbol from RHS should be 'a'?Theory of Computationhttps://gateoverflow.in/215676/automata-how-to-create-dfa-for-the-languageSat, 05 May 2018 18:51:36 +0000peter linz
https://gateoverflow.in/215674/peter-linz
given regular language L = {$a^n$b:n≥0}<br />
<br />
$L^2$ - L = $L^2$ since there's no string in $L^2$ which is in L.<br />
<br />
Am i correct ?Theory of Computationhttps://gateoverflow.in/215674/peter-linzSat, 05 May 2018 15:37:41 +0000TOC push down automata
https://gateoverflow.in/215622/toc-push-down-automata
<p>Can we put simultanously Two symbols in stack in one of the video on youtube it is showing that we can put two a's on to the stack I'm not finding it correct plzz calrify my doubt it on place of one a we are putting two a's one extra a is also there what about that because any how 1 b is poping out 1 a then no.of b's will be fine but what about one extra which has been take out<img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=9994814418326836223"></p>Theory of Computationhttps://gateoverflow.in/215622/toc-push-down-automataSat, 05 May 2018 03:53:49 +0000Peter Linz Chapter 4.3 Exercise Q.20
https://gateoverflow.in/215601/peter-linz-chapter-4-3-exercise-q-20
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=4146095621966885214"></p>
<p> </p>
<p>I don't think it will be regular .</p>
<p>Had the language been uww<sup>R</sup>v the expression could have been (a+b)*(aa+bb)(a+b)* as there is no restriction on w.</p>
<p>Is it correct? and if it isn't regular, is it a CFL?</p>Theory of Computationhttps://gateoverflow.in/215601/peter-linz-chapter-4-3-exercise-q-20Fri, 04 May 2018 17:40:21 +0000Peter Linz Chapter 4
https://gateoverflow.in/215592/peter-linz-chapter-4
<p><span style="font-size: larger;">
<samp>L = {a^n: n ≥ 2, is a prime number}.</samp></span></p>
<p><span style="font-size: larger;">
<samp>This is not a regular language.</samp></span></p>
<p><span style="font-size: larger;">
<samp>What about L*?</samp></span></p>
<p><span style="font-size: larger;">
<samp>Is it regular? Please explain.</samp></span></p>Theory of Computationhttps://gateoverflow.in/215592/peter-linz-chapter-4Fri, 04 May 2018 15:57:33 +0000TOC Push down automata
https://gateoverflow.in/215587/toc-push-down-automata
<p>Can we put simultanously Two symbols in stack in one of the video on youtube it is showing that we can put two a's on to the stack I'm not finding it correct plzz calrify my doubt it on place of one a we are putting two a's one extra a is also there what about that because any how 1 b is poping out 1 a then no.of b's will be fine but what about one extra which has been take out<img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=9994814418326836223"></p>Theory of Computationhttps://gateoverflow.in/215587/toc-push-down-automataFri, 04 May 2018 14:19:52 +0000Peter linz
https://gateoverflow.in/215467/peter-linz
how to draw dfa for this?<br />
<br />
L= {w: there are at most two runs of a’s of length three}.Theory of Computationhttps://gateoverflow.in/215467/peter-linzThu, 03 May 2018 17:42:05 +0000TOC questions
https://gateoverflow.in/215381/toc-questions
L={a^n \ n>=0} <br />
<br />
M={b^n \ n>=0}<br />
<br />
L.M is a regular language and the DFA for this is going to be ending with b and epsilon and it will have two states <br />
<br />
Am I correct or notTheory of Computationhttps://gateoverflow.in/215381/toc-questionsThu, 03 May 2018 05:21:43 +0000TOC question on Regular expresstion
https://gateoverflow.in/215181/toc-question-on-regular-expresstion
Find length of string of minimum length on {0,1}* not in the language corressponding to the given RE <br />
<br />
0^*(01^*)^* <br />
<br />
options are <br />
<br />
1<br />
<br />
2<br />
<br />
3<br />
<br />
None of these<br />
<br />
Is it asking to find the minimum length string and then length of it <br />
<br />
if yes then minimum length can be accepted is Epsilon in the first RE the would have been none of these but the ans is 1 <br />
<br />
plzz rectify me if I have not understand the question properly <br />
<br />
<br />
<br />
second RE <br />
<br />
1^*(0+10)^*<br />
<br />
options are<br />
<br />
2<br />
<br />
3<br />
<br />
4<br />
<br />
5Theory of Computationhttps://gateoverflow.in/215181/toc-question-on-regular-expresstionTue, 01 May 2018 10:53:38 +0000TOC regular language
https://gateoverflow.in/215121/toc-regular-language
L={a^n b^n :n>=1} and R = (a+b)^* <br />
<br />
L union R is going to be regular or not regular <br />
<br />
plzz give reason L is not regular if N leads to infinity then how it can be regular ..........Theory of Computationhttps://gateoverflow.in/215121/toc-regular-languageTue, 01 May 2018 06:30:42 +0000give cfg for the language
https://gateoverflow.in/215036/give-cfg-for-the-language
<p>Let $L=\{w \mid w \in (0+1)^+ , N_0(w) \le N_1(w) \le 2N_0(w) \}$,where $N_i(w)$ represents number of $i's$ in string $w$.</p>
<p>a) Give a CFG for $L$</p>
<p>b) is L<sup>c </sup>= Σ*- L context - free?</p>
<p>c) Let $\frac{1}{2}$L = $\{x | ∃y ∈ L , |x| = |y| , x.y ∈ L \}$.is $\frac{1}{2}$L context-free?</p>Theory of Computationhttps://gateoverflow.in/215036/give-cfg-for-the-languageMon, 30 Apr 2018 13:18:26 +0000kleene method TOC
https://gateoverflow.in/214997/kleene-method-toc
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=14820172384761096322"></p>
<p>plzz help to understand this kleene method </p>
<p>plzzzz explain properly</p>Theory of Computationhttps://gateoverflow.in/214997/kleene-method-tocMon, 30 Apr 2018 08:57:02 +0000Moore machine example
https://gateoverflow.in/214984/moore-machine-example
<p><img alt="" src="https://gateoverflow.in/?qa=blob&qa_blobid=1992397174286117142"></p>
<p>plzz expain this machine how it is working </p>
<p>machine is Addition of two binary numbers</p>Theory of Computationhttps://gateoverflow.in/214984/moore-machine-exampleMon, 30 Apr 2018 07:07:22 +0000please anyone explain me the concept of utm ,queue automata ,ntm,htm
https://gateoverflow.in/214949/please-anyone-explain-the-concept-utm-queue-automata-ntm-htm
Theory of Computationhttps://gateoverflow.in/214949/please-anyone-explain-the-concept-utm-queue-automata-ntm-htmMon, 30 Apr 2018 05:30:15 +0000can an npda be converted to pda
https://gateoverflow.in/214950/can-an-npda-be-converted-to-pda
Theory of Computationhttps://gateoverflow.in/214950/can-an-npda-be-converted-to-pdaMon, 30 Apr 2018 05:30:11 +0000Theory of computetion
https://gateoverflow.in/214867/theory-of-computetion
Suppose we have a FA N(a)mod3=0 In this FA the initial state and final state is same<br />
<br />
If we will reverse this FA the state will be remain same or not that initial state and final state is going to be the same or not<br />
<br />
and after reversing the string the strings are not getting reverse it will accept only<br />
<br />
$L=\{\epsilon,b,bb,bbbb,bbb,bbbbbb.............\}$<br />
<br />
plzz rectify my doubtTheory of Computationhttps://gateoverflow.in/214867/theory-of-computetionSun, 29 Apr 2018 07:41:38 +0000Turing Machine
https://gateoverflow.in/214775/turing-machine
Design a TM that accepts strings over the alphabet{a,b}<br />
<br />
i)Of even length<br />
<br />
ii)containing the substring "abababa"<br />
<br />
iii)not containing two consecutive zerosTheory of Computationhttps://gateoverflow.in/214775/turing-machineSat, 28 Apr 2018 14:49:00 +0000#Peter Linz #8.9
https://gateoverflow.in/214625/%23peter-linz-%238-9
In Theorem 8.1, find a bound for $m$ in terms of the properties of the grammar $G$.Theory of Computationhttps://gateoverflow.in/214625/%23peter-linz-%238-9Fri, 27 Apr 2018 19:51:19 +0000