CS 4510: Problem Set 2 - Automata and Complexity, Assignments of Computer Science

Problem set 2 for the cs 4510: automata and complexity course. The problems cover topics such as proving languages are not regular, all-paths-nfas, first halves of strings in regular languages, context-free grammars, and the pumping lemma.

Typology: Assignments

Pre 2010

Uploaded on 08/05/2009

koofers-user-e83
koofers-user-e83 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 4510: Automata and Complexity
Problem Set 2
All problems are worth 10 points.
Problem 1
Prove that the following languages are not regular:
1. {0n1m0n|n0}
2. {w|wis not a palindrome}
Problem 2
Consider a new kind of finite automaton called an All-Paths-NFA. An All-Paths-NFA Mis a 5-
tuple (Q, Σ, δ, q0, F ) that accepts xΣif every possible computation of Mon xends in a state
from F. Note, in contrast, that an ordinary NFA accepts a string if some computation ends in an
accept state. Prove that All-Paths-NFAs recognize the class of regular languages.
Problem 3
If Ais a language, let A1
2be the set of all first halves of strings in Aso that
A1
2={x|for some y, |x|=|y|,and xy A}
Show that if Ais regular, so is A1
2.
Problem 4
Give context-free grammars that generate the following languages. Also give informal description
of the PDAs accepting these languages. The alphabet is {0,1}.
1. {w|length of wis odd}
2. {w|wcontains more 1s than 0s}
3. {w|wis a palindrome}
Problem 5
For a language A, let SUFFIX(A) denote the set of all suffixes of strings in A, i.e.
SUFFIX(A) = {v|uv Afor some string u}
Show that if Ais a context-free language, so is SUFFIX(A).
Problem 6
Use the pumping lemma to show that the following languages are not context free:
1. {0n1n0n1n|n0}
2. {0i1j|i1, j 1, i =jk for some integer k}
1

Partial preview of the text

Download CS 4510: Problem Set 2 - Automata and Complexity and more Assignments Computer Science in PDF only on Docsity!

CS 4510: Automata and Complexity

Problem Set 2

All problems are worth 10 points.

Problem 1

Prove that the following languages are not regular:

  1. { 0 n 1 m 0 n^ | n ≥ 0 }
  2. {w | w is not a palindrome}

Problem 2

Consider a new kind of finite automaton called an All-Paths-NFA. An All-Paths-NFA M is a 5- tuple (Q, Σ, δ, q 0 , F ) that accepts x ∈ Σ∗^ if every possible computation of M on x ends in a state from F. Note, in contrast, that an ordinary NFA accepts a string if some computation ends in an accept state. Prove that All-Paths-NFAs recognize the class of regular languages.

Problem 3

If A is a language, let A− 12 be the set of all first halves of strings in A so that

A− 1 2

= {x | for some y, |x| = |y|, and xy ∈ A}

Show that if A is regular, so is A− 1 2

Problem 4

Give context-free grammars that generate the following languages. Also give informal description of the PDAs accepting these languages. The alphabet is { 0 , 1 }.

  1. {w | length of w is odd}
  2. {w | w contains more 1s than 0s}
  3. {w | w is a palindrome}

Problem 5

For a language A, let SUFFIX(A) denote the set of all suffixes of strings in A, i.e.

SUFFIX(A) = {v | uv ∈ A for some string u}

Show that if A is a context-free language, so is SUFFIX(A).

Problem 6

Use the pumping lemma to show that the following languages are not context free:

  1. { 0 n 1 n 0 n 1 n^ | n ≥ 0 }
  2. { 0 i 1 j^ | i ≥ 1 , j ≥ 1 , i = jk for some integer k}