retagged by
3,419 views
2 votes
2 votes

#3 : Is the language L= { anbn : n>=1 } U {b} deterministic ?

#4 : Is the language L={anbn : n>=1} U {a} deterministic ?

#7 Is the following regular language deterministic?

  L= { anbmck : n=m or m=k }

#8 Is the L = {anbm : n=m or n=m+2} deterministic?

#9 Is the language {wcwR : w ∈ {a,b}* }  deterministic?

#10 Is the language L = {wwR : w ∈ {a,b}* } deterministic?

#11 An example  of a deterministic context-free language whose reverse is not deterministic?

My Analysis is as follows :

#3 : Non-deterministic as for one b we would go to another state which would indicate that only one b is there which accepts the  {b} part of the language. And if we see one a, then we would watch for anbn.

#4 : Non-deterministic : Same reason as for 3

#7   L= { anbmck : n=m or m=k } can be broken down as follows :

     L = { anbnck } U {anbmcm}

This is non-deterministic, as looking at the number of a's our PDA can determine that a string belongs to which part of the language and will make transitions accordingly. That is, whether to check for equivalence for a and b or to check for equivalence of b and c.

#8. L = {anbm : n=m or n=m+2} can be broken down as follows :

   L = {anbn } U {anbn+2}

Non-deterministic as by looking at the number of a's, our PDA has to decide(Non-determinism) that a string has either equal number of a's or number of a's are 2 less than the number of b's that appear after it.

#9. L= {wcwR : w ∈ {a,b}* }

 deterministic as c would act as an indicator after which our PDA can start to pop off from the stack corresponding to each input symbol that appears after c.Here our PDA knows exactly when to push and when to pop off values from the stack.

#10 L = {wwR : w ∈ {a,b}* }

Non-Deterministic as there is no central point after which our PDA can decide that W has ended and WR has started.

#11- No Idea about it.

Please someone verify and tell me is my way of analysis and the analysis is correct or not?

retagged by

5 Answers

1 votes
1 votes

3 is determinstic and also 4

reason:

for example as the language is cfl, so if it is deterministic  according to the definition, if in PDA of a cfl , each transition has only One state to go always that is deterministic.

now the language can be anything {abb,aabbb,aaabbbb...}

whenevr we see an A we loop and push an A in stack and Whenever we encounter B we match it and if we see an A on top of stack we pop it.. and when the stack becomes empty ,then if we encounter a B , we go to accepting state

Now here are two different transition

{b, tos(a)}->then pop

{b,tos(empty)}->then go to ACC

so it is deterministic

but for all transitions there is only one choice..

tell me if you need more clear explanation :D

answer for Q11

L={{anbn : n>=1} U {am m>=1}} is deterministic but the reversal of it {am m>=1}}U{anbn } is non deterministic because  whenever we encounter an A we may have to loop for first am .and for the same A transition we have to go to next state where we have to perform push and pop for the second part of Union.....

edited by

Related questions

0 votes
0 votes
1 answer
1
2 votes
2 votes
2 answers
3