I am told that this NPDA is wrong but I can't see why, could anyone spot the bug?
Asked
Active
Viewed 81 times
0

zetta
- 49
- 5
-
Is `lamda` starting symbol on the stack.? – Jay Joshi Dec 02 '17 at 12:18
-
I would explain but i am not sure about the value `z` on the stack,? – Jay Joshi Dec 02 '17 at 12:23
-
`lambda` here is a.k.a. epsilon transition, meaning that it makes no effect to the stack (although in the lecture we were taught that when the stack is empty, no transition could be made). `z` is a unique symbol, being the only element in the stack at the initial state, working as a sentinel. Thanks for your help! – zetta Dec 02 '17 at 12:26
-
Is it ok to remove the initial symbol `z` from the stack,..? – Jay Joshi Dec 02 '17 at 12:41
-
It is allowed to do so. – zetta Dec 02 '17 at 12:45
-
And suppose `b` is input and `z` is removed from the stack, and now if `a` is the input, will `a` will be pushed into the stack,? If Yes, it should not be the case because then `ba` will be accepted you know.. – Jay Joshi Dec 02 '17 at 12:46
-
But we were taught that when the stack is empty, i.e., `z` is gone, no further transitions are allowed, including epsilon transitions (which trying to accept ba must do). However I am very new to this, could I have misunderstood something, or the statement above is not correct? – zetta Dec 02 '17 at 12:54
-
to be honest, I am even more newer to this, sorry to waste your time, I was just trying to help. um, still let me check if it is true or not, if it is allowed to remove initial state and what is the behavior after removing. – Jay Joshi Dec 02 '17 at 12:57
-
It seems correct. it will read `a` first and will be ok if it gets same number of `b`. then when we add one more `b` then it it will remove the `z` but still accepted. If now we give any input, now stack is empty and the state will be unaccepted. – Jay Joshi Dec 02 '17 at 13:23