If ๐ฟ is a regular language over ฮฃ = {๐‘Ž, ๐‘}, which one of the following languages is NOT regular ?

Q. If ๐ฟ is a regular language over ฮฃ = {๐‘Ž, ๐‘}, which one of the following languages is NOT regular ?

(A) ๐ฟ โ‹… ๐ฟ๐‘… = {๐‘ฅ๐‘ฆ | ๐‘ฅ โˆˆ ๐ฟ, ๐‘ฆ๐‘… โˆˆ ๐ฟ}

(B) {๐‘ค๐‘ค๐‘… | ๐‘ค โˆˆ ๐ฟ}

(C) Prefix (๐ฟ) = {๐‘ฅ โˆˆ ๐›ดโˆ—|โˆƒ๐‘ฆ โˆˆ ๐›ดโˆ— such that ๐‘ฅ๐‘ฆ โˆˆ ๐ฟ}

(D) Suffix (๐ฟ) = {๐‘ฆ โˆˆ ๐›ดโˆ—|โˆƒ๐‘ฅ โˆˆ ๐›ดโˆ— such that ๐‘ฅ๐‘ฆ โˆˆ ๐ฟ}

Ans:{๐‘ค๐‘ค๐‘… | ๐‘ค โˆˆ ๐ฟ}

Solution:

language L = {wwR โ w โˆˆ L} is infinite and not regular because it involves string matching and we can increase in length indefinitely and then finite automata will run out of memory, so it require stack. Hence, it is context-free but not regular.

We will be happy to hear your thoughts

Leave a reply

Gkseries.com
Logo
Register New Account