Q1: 10 points Q2: 20 points Q3: 20 points Q4: 20+10 points Q5: 30 points Q6: 20 points Total: 120+10 points
Question 2 deals with a set D of dogs, containing exactly the three distinct dogs Cardie (c), Duncan (d), and Whistle (w), and a set M of mealtimes. As all hobbits know, there are six possible mealtimes in a day: breakfast (b), second breakfast (sb), lunch (l), tea (t), supper (s), and evening snack (e). The relation F ⊆ D × M is defined so that F(x, y) means "dog x is fed at mealtime y".
Question 2 also refers to the following five statements, where the variables are of type "dog" or type "mealtime". The statements are:
N is the set of naturals (non-negative integers), {0, 1, 2, 3,...}
Z is the set of all integers, {..., -3, -2, -1, 0, 1, 2, 3,...}.
Question 3 uses a function g from Z × N to Z. This function is defined recursively on its second argument. We define g(n, 0) to be n for any integer n. For any integer n and natural k, we define g(n, k+1) to be 2g(n, k) - 3.
Question 4 uses a recursively defined function h from {0, 1}* to {0, 1}*. We define h(λ) = 1, and for any string w we define h(w0) to be 0h(w)0 and define h(w1) to be 1h(w).
Question 5 begins with the following λ-NFA N. The alphabet is {a, b}, the state set is {1, 2, 3, 4, 5}, the start state is 1, the final state set is {5}, and the transition relation Δ is
{(1, λ, 2), (1, a, 3), (2, a, 1), (2, λ, 4), (3, b, 4), (4, λ, 5), (5, b, 5)}.
Here is a diagram of N, with "L" meaning λ:
L
>(1) - - - - - > (2)
| < - - - - - - |
| a |
| | b
|a |L ----
| | / \
V b V L V |
(3) - - - - - > (4) - - - - - > ((5)) - -|
A one-to-one function f from X to Y is a function (a well-defined and total relation) that satisfies the additional rule ∀x1:∀x2: (f(x1) = f(x2)) → (x1 = x2). In other words, "every output has at most one input". Many people said some variant of "every input has exactly one output", which is just the definition of a function.
If "p → q" is any implication, its contrapositive is the statement "¬q → ¬p". The contrapositive is logically equivalent to the original implication.
The open list is a set of nodes still being processed. Nodes go on the open list when discovered, and come off when we are ready to consider their neighbors. The order in which items come off the open list defines the type of search.
A TD language X is one where there exists a Turing machine M such that for any string w over the input alphabet, M accepts w if and only if w ∈ X and M (halts and) rejects w if and only if w ∉ X.
The blank symbol is an element of the TM's tape alphabet, but not of its input alphabet. In the standard starting configuration, all tape cells to the right of the input start off with the blank symbol.
∀m: F(w, m) ↔ (m ∈ {sb, t, e}. Alternatively, we could say "F(w, sb) ∧ F(w, t) ∧ F(w, e) ∧ ¬F(w, b) ∧ ¬F(w, l) ∧ ¬F(w, s)".
There is no mealtime when Cardie is fed and Duncan is not.
∀m:∃x:F(x, m). Following the English more closely, we could say ¬∃m:∀x:¬F(x, m), which is equivalent by the DeMorgan quantifier translation rules.
There exists a mealtime at which Duncan, and only Duncan, is fed.
∀x:∃m:∃n:F(x, m) ∧ F(x, n) ∧ (m ≠ n). The last part is crucial, as otherwise the dog might be fed at only one mealtime that was both m and n. Solution corrected 28 April 2016.
I tells us that F(w, t) is true. II, specialized to t, tells us that if F(c, t) is true, then so is F(d, t). III tells us that at least one of the three atomic propositions is true, which gives us no new information since F(w, t) is true by I. IV and V give no information about these three atomic propositions. So (F(c, t), F(d, t), F(w, t)) might have three possible truth settings: (0, 0, 1), (0, 1, 1), or (1, 1, 1).
For any integer n, g(n, 0) = n, g(n, 1) = 2n - 3, g(n, 2) = 2(n - 3) - 3 = 4n - 9, and g(n, 3) = 2(4n - 9) - 3 = 8n - 21. This makes g(-1, 3) = -8 - 21 = -29, g(1, 3) = 8 - 21 = -13, g(3, 3) = 24 - 21 = 3, and g(5, 3) = 40 - 21 = 19.
For the induction, we take k = 1 as our base. We observed above that g(n, 1)
= 2n - 3 which must be odd. Now assume that g(n, k) is odd (though we don't
actually need the assumption). Then g(n, k+1) = 2g(n, k) - 3 which is odd.
Directly from part (c), we could observe that if k ≥ 1, 2k
is an even number and so 2k(n - 3) + 3 must be odd.
h(λ) = 1, h(0) = 010, h(1) = 11, h(00) = 00100, h(01) = 1010, h(10) = 0110, h(11) = 111, and h(010) = 010100.
The strings w such that h(w) has exactly one 1 are exactly the strings in
the language 0*. (By an induction similar to part (b), we could
prove that |h(w)|1 = |w|1 + 1 for all strings w.)
If w = 0n, it is easy to see (and prove by induction) that
h(w) = 0n10n. So the string 0i10j
is in the language X if and only if i = j.
This means that the set of strings {1, 0, 001, 0001,...} is a pairwise
X-distinguishable set (since 0i10i is in X and
0i10j is not if i ≠ j) and is an infinite set.
So by the Myhill-Nerode Theorem, X is not a regular language.
The state set and start state are the same, and the new final state set is
{1, 5} since there is a λ-path from 1 to 5.
The transitive closure
of the λ-moves includes (1, λ, 4), (1, λ, 5), and
(2, λ, 5) as well as the three given λ-moves.
Move (1, a, 3) gives rise only to itself.
Move (2, a, 1) gives rise to (1, a, 1), (1, a, 2), (1, a, 4), (1, a, 5),
(2, a, 1), (2, a, 2), (2, a, 4), and (2, a, 5).
Move (3, b, 4) gives rise to itself and (3, b, 5).
Move (5, b, 5) gives rise to (1, b, 5), (2, b, 5), (4, b, 5), and (5, b, 5).
We thus have 15 letter moves in N', nine labeled with a and six with b.
The start state is {1}, which is final.
There is an a-move from {1} to the
final state {1, 2, 3, 4, 5}, and a b-move from {1} to the final state {5}.
There is an a-move from {1, 2, 3, 4, 5} to itself, and a b-move from
{1, 2, 3, 4, 5} to the final state {4, 5}.
There is an a-move from {5}
to the nonfinal state ∅, and a b-move from {5} to itself.
There is an
a-move from {4, 5} to ∅, and a b-move from {4, 5} to {5}.
We thus have
five total states, four of them final.
If we minimize this DFA (although we were not asked to do so) we find that
{1} and {1, 2, 3, 4, 5} merge, and that {5} and {4, 5} merge, so that the
minimal DFA has three states: Start state X (final) with an a-move to itself
and a b-move to final state Y, state Y with an a-move to non-final state N
and a b-move to itself, and a death state N.
(Solution corrected 13 December 2015 -- the
final regular expression is as it was but we add a new initial state.)
Starting from N, we add a new initial state i, a new final state f and
two
λ-moves (i, λ, 1) and (5, λ, f).
We eliminate 5, making one new move (4, b*, f).
We eliminate 3, making one new move (1, ab, 4).
We eliminate 4, making two new moves (1, abb*, f)
and (2, b*, f).
We eliminate 2, making two new moves (1, a, 1) and (1, b*, f).
The latter merges with an existing move to make (1, abb* +
b*, f).
Finally we eliminate 1 to make the one new move
(i, a*(abb* + b*, f) and read off the
final regular expression as a*(abb* + b*).
FALSE. If X has any strings in it at all, X2 has strings of even length.
TRUE. This is easy to prove by cases.
TRUE. We can factor n2 - 1 as (n + 1)(n - 1), and if n > 2, then each of those factors is greater than one.
FALSE. This is similar to a Chinese Remainder Theorem instance but not a correct one since 3 and 6 are not relatively prime. If x = 5, for example, the first two congruences hold but the third does not.
TRUE. The machine has overwritten the a with a b, moved left, and entered state q.
FALSE. It is proved in the text that 2WDFA's can recognize only regular languages, and we proved that language to not be regular.
TRUE. This is an instance of the TR/TD Theorem. Each language is TR and has a TR complement, so each is TD.
TRUE. We need only use a universal TM to simulate M for ten steps on input w, and see what happens.
FALSE. If it were we could decide whether an arbitrary M ever halts on an arbitrary w by forming a machine M', that does nothing for ten steps and then simulates M, and seeing whether (M', w) was in this language.
TRUE. Given the definitions in the text, on any input this TM is guaranteed to hang on its first step by trying to go off the left end of its tape.
Last modified 28 April 2016