- Answer the problems on the exam pages.
- There are four problems, each with multiple parts, for 120 total points. Actual scale A = 105, C = 70.
- The textbook, course website, and notes are allowed. No other books, calculators, or collaboration.
- In case of a numerical answer, an arithmetic expression like
"2
^{17}- 4" need not be reduced to a single integer.

Q1: 30 points Q2: 30 points Q3: 30 points Q4: 30 points Total: 120 points

- (a, 10) Translate the following statements as indicated:
- Statement I (to symbols): Every dog who sat nicely got a treat.
- Statement II (to English): (RO(p) ↔ ∃z:(z≠p) ∧ RO(z)) ∧ &neg;SN(p)
- Statement III (to symbols): Neither Duncan nor Maggie sat nicely, and one of them ran off while the other got a treat.
- Statement IV (to symbols): At least two different dogs sat nicely.
- Statement V (to English): ∀y:((&neg;RO(y)) → GT(y))

- (b, 5) Consider the six propositions GT(d), GT(m), RO(d),
RO(m), SN(d), and SN(m).
There are 2
^{6}= 64 possible assignments of truth values to these propositions. How many of these are consistent with Statement III? Justify your answer. (Hint: If you make a truth table, you can simplify your life by considering only four of the six variables.) - (c, 15) Using Statements I-IV, prove Statement V. You may use English, symbols, or a combination, but make your use of quantifier proof rules clear.

- (a, 5) Prove that for all naturals n, except for n = 1, there exists a string of length n in S. (Hint: Show the n = 0 case separately and then use induction on all n with n ≥ 2.)
- (b, 5) Let f(n) be the number of strings in S of length n. Explain why, for all n with n ≥ 3, f(n) = 3f(n-2) + 2f(n-3).
- (c, 10) Prove, for all naturals n, that f(n) =
[2
^{n+2}+ (-1)^{n}(3n+5)]/9. (Hint: Use strong induction on the recurrence from part (b), with base cases for n = 0, n = 1, and n = 2. - (d, 10) The Myhill-Nerode Theorem tells us that
Σ
^{*}is divided into a finite number of S-equivalence classes. How many are there? Justify your answer. You may quote the Myhill-Nerode Theorem to justify your answer if you do so correctly.

- (a, 10)
Construct an ordinary NFA N’ from N using the construction given in
lecture. You should
get six a-moves and eleven b-moves. (The NFA from the λ-NFA
on the 8:30 exam had eight a-moves and three b-moves.)
- (b, 5) Construct a DFA D from N’ using the Subset Construction.
- (c, 5) Construct a minimal DFA D’ equivalent to D. If you
do not use the minimization construction from the textbook
and supplemental lecture, prove that your D’ is in fact minimal.
- (d, 5) Construct a regular expression R with L(R) = L(D). You may start from either D or D’.
- (e, 5) Construct a lambda-NFA with the same language as R, using the construction from lecture and the textbook.

- (a) There exists a language that is not Turing recognizable.
- (b) Every language that is not the language of any DFA has an infinite number of words.
- (c) There exist languages L and M such that M, LM, and ML are all regular languages, but L is not regular.
- (d) There exist languages X and Y such that Y is regular, X is not regular, and X is a subset of Y.
- (e) The regular expressions
(1
^{*}0^{*})^{*}and (0 + 1)^{*}denote different languages. - (f) There exists a multitape Turing machine whose language is not the language of any single-tape Turing machine.
- (g) The less-than relation, <, on a set of real numbers is a partial ordering since it is antisymmetric and reflexive.
- (h) The maximum number of edges in a bipartite graph on 14 vertices is 49.
- (i) Let h
_{1}(s) and h_{2}(s) be two non-negative potential heuristics for the same search problem. If either h_{1}(s) or h_{2}(s) is an admissible heuristic, then so is h_{3}(s) = min(h_{1}(s), h_{2}(s)). - (j) There exist an undirected graph G and a node v in G such that the DFS and BFS trees of G rooted at v contain different numbers of edges.
- (k) There exists a natural x such that 5x is congruent to 3, modulo 10.
- (l) A basket contains a certain number of apples. If we take them out 6 at a time, 1 apple remains. If we take them out 5 at a time, 3 apples remain. Then the original number of apples must have been greater than 12.
- (m) If the converse of a statement is false, then its contrapositive is also false.
- (n) Let A and B be any two languages (sets of
strings). It is possible that A
^{*}⊆ B^{*}, but that A is not a subset of B. - (o) If T is any rooted tree with n nodes and e edges, then it is possible that n = e+2.

Last modified 19 May 2020