Question 126 – Theory-of-Computation
May 12, 2024
Question 17142 – NTA UGC NET JUNE-2023 Paper-2
May 12, 2024
Question 126 – Theory-of-Computation
May 12, 2024
Question 17142 – NTA UGC NET JUNE-2023 Paper-2
May 12, 2024

Question 1156 – Theory-of-Computation

Consider the following language:

    L1 = { an+m bna| n,m ≥ 0}
    L2 = { an+m bn+m an+m |n,m ≥ 0}

Which one of the following is correct?

Code:

Correct Answer: A

Question 338 Explanation: 
→ L1 is Context Free language because we can push all the a’s that come as input and when b’s come as input pop “n” number of a’s for “n” b’s from top of the stack and when again a’s come as input pop-up all the remaining a’s(i.e. “M” number of a’s) from top of the stack for “m” number of a’s coming as input.
Since we can have a pushdown automata for L1 so we can say L1 is a CFL.
→ L2 is not a context free language because L is equivalent to language = {apbpap | p ≥ 0}.
So for every “b” we can POP a’s came before “b” but for “a” which came after “b” we have nothing to POP on the top of stack. Since we can’t have a pushdown automata that can accept L2.
L2 is not a CFL.
A
Only L1 is Context Free Language
B
Both L1 and L2 are not Context Free Language
C
Only L1 is Context Free Language
D
Both L1 and L2 are Context Free Language
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!