2,179 views
1 votes
1 votes

my question is as it is odd length palindrome , so  it can be ababa , right ?

Now , in the given diagram , they have not mentioned the scenario :

1)  when a is the stack top element and input symbol is b  ( b , a / ? ) 

2)  when b is the stack top element and input symbol is a ( a, b / ? )

Now , my question is - without these two transitions can we design this pda ? ( as it is done in the given ans )

2 Answers

0 votes
0 votes

According to me this question is unclear but if we thinks that ∊ represents that at the top of the stack there can be anything then only we can say option c is correct ..

But in gate they will not ask such  unclear and confusing question...

at state B

there should be following transitions specified..

∱(B,b,Zo)=(B,bZ0) , ∱(B,a,Zo)=(B,aZ0) , ∱(B,b,b)=(B,bb), ∱(B,b,a)=(B,ba), 

∱(B,a,a)=(B,aa) , ∱(B,a,b)=(B,ab)  

Hope this will clear your doubt...

0 votes
0 votes

At first,  the question is confusing.

The solution which says that epsilon should be treated as anything(Zo, a, b) is correct.

The PDA already is designed to accept the Odd Length Palindromes i.e., there is no other strings in the language.

The key here is to first set your mind to that it will only be given inputs of odd length palindromes.

Another confusion is if A state is having (A, a, epsilon) → (A, a.epsilon) then why do we need to put (A, epsilon, epsilon) as a transaction again. the pick here is it is given to be a PDA which is by default NON DETERMINISTIC so we could have more than one transitions.

Also consider X transition as the transition for the special element (C or X in wCw or wXw) which will be used to go to some other state and after reaching that state we could pop each a for a and each b for b.

Let me know if there is any fallacy.

 

Related questions

2 votes
2 votes
1 answer
2
Purple asked Jan 28, 2016
13,902 views
Number of final state require to accept Φ in minimal finite automata.a) 1b) 2c) 3d) None of the mentioned
0 votes
0 votes
0 answers
3
radha gogia asked Dec 14, 2015
521 views
I have gone through this link already but still couldn't catch up the logic , so please clarify what is it trying to convey ? http://cs.stackexchange.com/questions/44195/...