retagged by
1,709 views
2 votes
2 votes

Please Explain why the following is accpeted/rejected by PDA .  ( Need detail explanation )

  • S1 = { 0n 0m 1n 0m    | n,m>0 }
  • S2 = { 0n 0m 11m 0m   | n,m>0 }
  • S3 = { am 0m 11n  | n,m>0}
  • S4 = { am 0n 11m  | n,m>0}
retagged by

1 Answer

Best answer
9 votes
9 votes
  • S1 = { 0n 0m 1n 0m    | n,m>0 }...it can be accepted by pda...just push all(n+m) 0s first...now when 1 comes start poping...for all n 0s,n 1s will be popped...and we will be reamining with m 0s....now when another m 0s comes just start poping....can be done easily with a stack so (deterministic) pda possible
     
  • S2 = { 0n 0m 11m 0m   | n,m>0 }...it's not possible with a pda....first push all n+m 0s...now pop n 1s..we are left with m 0s and we have to match it with m 1s followed by m 0s...if we pop it for m 1s then nothing will remain in the stack to match it with last m 0s..so pda not possible
  • S3 = { am 0m 11n  | n,m>0}....it's simple..push m number of a first then pop for m 0s.. for 1, just see if at least one 1 is there...so (deterministic) pda possible
  • S4 = { am 0n 11m  | n,m>0}....it's also possible.....push m number of a..then push n 0s then pop them for n 1s..now we have m number of a in our stack....pop it off for m 1s...so  (deterministic) pda possible
selected by