Exercise 01

The pumping lemma for regular languages (Sipser, Theorem 1.70) states: “If  is a regular language, then there is a number  where if  is any string in  of length at least , then  may be divided into three pieces , satisfying the following conditions:

Write a proof by contradiction which uses the pumping lemma to show that the language

is not regular.

  1. Supposing towards this language is regular and consider the string
  2. Matching all the conditions
  3. Now pumping this we can get strings that are unbalanced and not in the language

set union set intersection set membership not a member greater than or equal to less than or equal to


Exercise 02

Consider the following context-free grammar, :

  1. What are the variables of ?
  2. What are the terminals of ?
  3. What is the start variable of ?
  4. Give three strings in
    1. , therefore
    2. , therefore
    3. , therefore
  5. Give three strings not in .
    1. smallest valid string require at least one occurrence and together, so
    2. for same reason as above, requires at least one , therefore
    3. if , the must produce a pattern of or for symmetry. does not fit this pattern, therefore

Exercise 03

Consider the grammar given in Exercise 02, and answer true or false to the following:


Exercise 04

Consider this context-free grammar,

Give a parse tree and leftmost derivations for the following strings:


Exercise 05

Explain, in plain English, in a sentence or two, the meaning of

with respect to context-free languages, i.e., where  is some context-free grammar, and  is the start variable.

This Grammar constructs languages that start with the symbol and have symbols in the language $$