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.
- Supposing towards this language is regular and consider the string
- Matching all the conditions
- 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, :
- What are the variables of ?
- What are the terminals of ?
- What is the start variable of ?
- Give three strings in
- , therefore
- , therefore
- , therefore
- Give three strings not in .
- smallest valid string require at least one occurrence and together, so
- for same reason as above, requires at least one , therefore
- 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 $$