in Theory of Computation edited by
16,859 views
48 votes
48 votes

Consider the transition diagram of a PDA given below with input alphabet $\Sigma=\{a,b\}$ and stack alphabet $\Gamma = \{X,Z\}$. $Z$ is the initial stack symbol. Let $L$ denote the language accepted by the PDA

Which one of the following is TRUE

  1. $L =\{a^nb^n\mid n \geq0 \}$ and is not accepted by any finite automata 
  2. $L =\{a^n\mid n \geq0 \} \cup \{a^nb^n \mid n \geq 0\}$ and is not accepted by any deterministic PDA 
  3. $L$ is not accepted by any Turing machine that halts on every input 
  4. $L =\{a^n\mid n \geq0 \} \cup \{a^nb^n \mid n \geq 0\}$ and is deterministic context-free
in Theory of Computation edited by
16.9k views

4 Comments

1
1

@once_2019 when we say that a language is closed under some property, we guarantee that it will be closed in any case. But when we say that it is not closed, we say that it may not be closed. So the union of two DCFL is not closed means it may or may not be DFCL depending upon the language.

0
0

@once_2019 If you see first part of union then it is regular language &  union of DCFL with regular is DCFL.

1
1

6 Answers

84 votes
84 votes
Best answer
Strings accepted at $I^{st}$ final state are $a^n\; ,\;n\geq0$ and strings accepted at $II^{nd}$ final state are $a^nb^n\;,\;n\geq 0$ (actually $n\geq 1$ at this state, $n=0$ already included at first state).

$L=\{a^n\;|\;n\geq 0\} \cup \{a^nb^n\;|\;n\geq0\}$
Language is deterministic context-free  accepted by DPDA (dpda is already given) and so by TM too, and not regular (as we need stack to implement it), and so cannot accepted by FA

Correct Answer: $D$
edited by

22 Comments

It is violating prefix property then how can it accepted by any DPDA????Answer should be B.

1
1
prefix property is only for DPDA which accept string by Empty stack..
here final state method is used, so empty stack rule doesnot apply here

Check here: http://elearning.vtu.ac.in/e-con/FAFL/ch4/html/0040.htm
24
24

after all 'a' s pushed into the stack there is no ∈ transition on initial state i.e) ∈,z/z then how it accept the language {a^n/n>=0}

3
3
The initial state itself is the final state, isnt it?
3
3
@praveen saini Sir Yes D is correct I agree but why option A is not correct??
0
0
bcoz $L$ given in option D is correct, and that is wrong in option A
4
4
edited by

@praveen saini sir,

Option (A)as

$L=\{a^nb^n|n≥0\}$ and is not accepted by any finite automata 

As per option D is true for dcfl and in option (A) it talk about dfa&nfa then $a^nb^n$ should not be accepted by nfa&dfa should be right.

Please explain sir I am confused??

2
2
First of all, L is not equal to $\{a^nb^n:n\geq0\}$ so option A is wrong. No need to look anything else.
3
3

@Praveen Saini First of all, L is not equal to {anbn:n≥0} so option A is wrong. No need to look anything else.

Sir,L is not equal to WHAT? 

0
0
edited by
for $a^n$ there is no epsilon transition defined here didn't  any one notice that in that case option D shouldn't be right ?

or can we neglect that?

why should we even for strings with $a^n$ also end with epsilon right ?

@Praveen Saini sir
2
2
@Praveen sir, had been the first state not being a final state and only the last state a final state then, in that case, L would have been equal to as described in option A)

Am I right?
0
0

I think this DPDA has both acceptance by "empty stack" and "final state" as L= {a|n>=0} is accepted by a final state as no (, Z->Z) in the first state
and
L= {anbn | n>=0} is accepted by only when stack is emptied as we reach final state only when stack is empty((, Z->Z) present).
 

Then which one to consider? if consider it is as "empty stack" then the violation of prefix property makes it PDA.

@Bikram sir

@Arjun sir

1
1
how can we have both the kind of acceptances in the same PDA ? do u have any reference ? @bhuv
0
0
edited by

actually it was my dbout that i have commented above. But it got resolved today.

read this post to know more.

http://forum.thegatebook.in/t/gate2016-1-43-dpda-or-not/1024

0
0
in final state acceptance there will be atleast one final state and in empty stack acceptance there will be no final state but ultimately the stack should be empty upon reading the entire input :) thanks for the screen shots
1
1
can u please expalin this?
0
0
Also, the point to note is that the Language $\{a^n|n \geq 0\}$ is Accepted by PDA acceptance by Final state

And the Language $\{a^nb^n|n \geq 0\}$ is accepted by PDA acceptance by empty stack.
4
4
So if transition diagram is not given and only equation is given , then option B will be answer, since common prefix comes in picture?
0
0
Why is the given diagram considered as DPDA since there is not config defined for first state when input b and top of the stack is Z?
0
0

IN DPDA , IS UNION IS DECIDABLE OR NOT .?

0
0
@praveen saini This given pda is not DPDA, It is NDPA as it has epsilon(without reading any i/p symbol) transition, this makes multiple choices of states and violates the rule determinism.??

If wrong please correct me.
0
0

@Twinkle Shuklamay or may not be decidable

0
0
20 votes
20 votes
Ya it should be D option. As 1st state is also the final state

1 comment

it accpepts anbn also.. and is deterministic too as can be seen from the diagram

2
2
13 votes
13 votes

As we know Acceptence of given string by PDA in two ways Either by

1. Acceptance by final state: ( If you are scanning the input, and at the end of string machine enters to one of the final state then string is accepted.)

2. Acceptance by Empty Stack: In this case we don't bother, machine enter into final state or not, if at end of string stack is empty then we can say string is accepted.

Option D is correct:  

Bcz in option D, if u take L= a^n, a is pushed into the stack  and it remains in first state only, which is marked as Final state so this string is accepted by PDA (Acceptence by final state)

  L= a^n b^n, as we know this string is accepted by given PDA as shown in given figure, this is also acceptence by final state). This language is not accepted by FA.

Regarding deterministic, in both the case we are deterministic to push a in to stack. So this is accepted by DPDA. so option D

5 votes
5 votes

the first state is accepting all strings of type an for n>0

and if a b comes it will make a transition to second state and it will reach empty stack only when all the a's are popped out of stack so it is accepting an.bn   and  the given pda is dpda.

option d

Answer:

Related questions