Give a CFG for the language A abnabn n 1 SolutionFollowing

Give a CFG for the language A = {(ab)n(ab)n | n 1 }

Solution

Following is CFG for the language A = {(ab)n(ab)n | n 1 }

A can be simplified to

=> {(ab)2n | n 1 }

=> {(abab)n | n 1 }

S -> ababS | abab

It means one or more abab.

Give a CFG for the language A = {(ab)n(ab)n | n 1 }SolutionFollowing is CFG for the language A = {(ab)n(ab)n | n 1 } A can be simplified to => {(ab)2n | n 1

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site