Assignment 1

Opened: Monday, 26 September 2022, 12:00 AM
Due: Friday, 30 September 2022, 12:00 AM

Write down the answer in any page and then capture the pages and combine it into pdf file and then submit it.

Question: Give a context-free grammar (CFG) for each of the following languages over the alphabet Σ = {a, b}: 

(a) All strings in the language L : {a n b ma 2n |n, m ≥ 0} 

(b) All nonempty strings that start and end with the same symbol.

(c) All strings with more a’s than b’s.

(d) All palindromes (a palindrome is a string that reads the same forwards and backwards).