1 / 5

Homework 6

Homework 6. due 12/21. 1 Pumping lemma for CFL. 1.1 Show that the language L 1 = { xx  {0,1}* | x  {0,1}* } is not context free. Instances of L 1 include 0101, 110110 etc, but do not include 00110 and 0111.

baruch
Download Presentation

Homework 6

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Homework 6 due 12/21

  2. 1 Pumping lemma for CFL 1.1 Show that the language L1 = { xx  {0,1}* | x  {0,1}* } is not context free. Instances of L1 include 0101, 110110 etc, but do not include 00110 and 0111. 1.2 Show that the language L2 = { xy  {0,1}* | x  {0,1}* and y is the 1's complement of x.} is not context free. Instances of L3 include 0110, 110001 etc, but do not include 0101, 010 and 0111.

  3. 2. Context free grammar composition • Given two grammar : • G1: S  bS | Ab A  a | BA | SB B  bA | bB • G2: T  Tb | aTC C aC | bT 2.1 Find a CFG G3 such that L(G3) = L(G1)  L(G2). 2.2 Find a CFG G4 such that L(G4) = { xy | x L(G1)*, y L(G2) }. • Notes • you can reuse production rules and symbols in G1 and G2. • You need not study the specific detail of G1 and G2, as studied in the lecture, there is a systematic method to compose both grammars directly from the general definition of two input CFGs.

  4. 3. CYK algorithm 3. Given the grammar G in Chomsky normal form • S  AB ABB | a B  AB | b | AA 3.1 Apply the CYK algorithm on the input string aabba to determine if it is in L(G) by completing the following table. 3.2 Is aabba a member of L(G) ? why ? 3.3 Is this grammar ambiguous ? why ?

  5. 4 Parse trees and derivations • Given the following grammar : • S  AB | e A  aB B  Sb 4.1 Find a left-most derivation for the string aabbbb 4.2 Find a right-most derivation for the string aabbbb. 4.3 Find a parse tree for aabbbb.

More Related