# Mitderm II Review

## Topics to be covered on Midterm II:

- Push-Down Automata
- Non Context-Free Languages
- Pumping Lemma for Context-Free Languages

- Turing Machines
- "Standard" Turing Machines
- Deciding vs Semi-Deciding
- Computing Functions
- Random Access Machines & Church-Turing Thesis
- Non-Determinisitic Turing Mahcines
- Universal Turing Machine
- Enumeration Machines

- Unresricted Grammars
- Counter Machines

## Book Sections to be covered on Midterm II

- Chatper 3, sections 3.3 - 3.5
- Chapter 4, sections 4.1-4.7

## Sample Questions

- Give a Push-Down Automataon that accepts the langauge L = {w : w in (a+b)* and w contains aba and w has more a's than b's}
- Show that the following language is not context free: L = {www : w in (a+b)*}
- Give a Turing Machine that
*decides* the language L = {wcw
: w in (a+b)*}. So, ababcabab, aabcaab are in L, while abab, abcba,
aabcaba are not in L
- Give a Turing Machine that
*semi-decides* the language L =
all strings over (a+b)* that contain the substring aba
- Give a Turing Machine that computes the function
^{⌈}n/2^{⌉} for strings that represent binay numbers. So, 110 (6)
would be transformed into 11 (3), 101 (5) would be transformed into
11 (3), and 111 (7) would be transformed into 100 (4).
- Give a Turing Machine that enumerates the language a*bab
- Give an unrestricted grammar for the language L =
{a
^{i}b^{j}c^{k} : i >=j and i >=k}
- Give a 1-counter machine that accepts the language
{a
^{2n}b^{2n} : n > 0}