Question text is in black, solutions in blue.
The total number of possible throws, each equally likely, is 63 = 216 (first counting problem). The total number of throws with the three results all different is 63 = 6*5*4 = 120 (second counting problem). The probability is thus 120/216 = 5/9, which is greater than 1/2.
The possible sets are exactly the subsets of {1,2,3,4,5,6} of size either 1, 2, or 3. There are (6 choose 1) = 6 sets of size 1, (6 choose 2) = 15 sets of size 2, and (6 choose 3) sets of size 3, for a total of 6 + 15 + 20 = 41. (For each individual size, this is an instance of the third counting problem.)
By the fourth counting problem, with n=6 and k=3, the number of multisets is (6+3-1 choose 3-1) or (6+3-1 choose 6), which is 8*7 or 56. Another way to see this is that the sets of size 1 or 3 in part (c) are in one-to-one correspondence with multisets, but a set of size 2 such as {2,5} corresponds to two multisets ({2,2,5} and {2,5,5}). So the total number of multisets is 6 + 2*15 + 20 = 56.
Base case: The string "a" has exactly one a. Inductive cases: Assume that w has exactly one a. Then bbw (rule 2) and wb (rule 3) also have exactly one a. So all strings formed by rules 1, 2, and 3 have exactly one a, and by rule 4 these are all the strings for which P(w) is true.
(bb)*ab*
ASCII art:
From the construction ("L" means "lambda"):
L
__________ L
/ \ ____
L / b b V L a L / b V L
>(1)--->(2)--->(3)--->(4)--->(5)--->(6)--->(7)--->(8)--->((9))
<-----------/ <---/
L L
A simpler, ordinary NFA:
(2)
|A
b||b _
|| / \ b
V| a V \
>(1)---------->((3))/
For the base case, by (2a) we know that there are 0 strings of length 0 in A.
We know that there is at most one string of length 1 by (2a),
and by Rule 1 there is exactly 1. For n=2 (2a) rules out all strings except
ab and ba. We see that ab is in by Rules 1 and 3, and that ba is out because
we cannot form it by either rule. So the three base values of f(n) for n=0,
n=1, and n=2 match the number of strings in A of those lengths.
For the inductive case, let n ≥ 3 be arbitrary. A string in A of length
n must be formed either by Rule 2 or by Rule 3. Since Rule 2 can form a
string in A from any string of length n-2 in A, and Rule 3 can do so from any
string of length n-1 in A, we have that the strings of length n are the union
of two sets, whose size (by the strong IH) are f(n-2) and f(n-1) respectively.
To find the size of this union we must subtract out the number of strings in
both sets, i.e., those that can be formed by either Rule 2 or Rule 3. These
are exactly the strings bbub for every string u in A of size n-3, so there are
exactly f(n-3) of these by the strong IH, and our total number of strings of
length n is f(n-1) + f(n-2) - f(n-3) as claimed.
We have f(0)=0, f(1)=1, f(2)=1, f(3) = 1 + 1 - 0 = 2, f(4) = 2 + 1 - 1 = 2,
f(5) = 2 + 2 - 1 = 3, f(6) = 3 + 2 - 2 = 3, f(7) = 3 + 3 - 2 = 4, and f(8) =
4 + 3 - 3 = 4. The rule is that f(n) = (n+1)/2, where the "/" is Java integer
division. That is, if n = 2k then f(n) = k, and if n = 2k+1 then f(n) = k+1.
Let g(n) be (n+1)/2. We must prove by strong induction for all naturals
n that f(n) = g(n):
(If you are unsure about Turing machines, don't panic. Parts (a) and (b) of this question can be answered by the rules of logic without specific knowledge about Turing machines.)
Let x be an arbitrary string and assume that T(x) is true. By the definition of T(x), H(x,y) is true for all y so it is true for y = λ. (We could pick any specific string for y but we must specify a particular y to continue the reasoning.) By the definition of H, H(x,λ) means that C(x) and something else is true, so by left separation C(x) is true. We have completed a direct proof of T(x) → C(x).
¬∃u:∀v: C(u) ∧ [H(u,v) ↔ ¬H(v,v)]
(Hint: Assume the negation of this statement and derive a contradiction using quantifier rules.)
∃u:∀v: C(u) ∧ [H(u,v) ↔ ¬H(v,v)].
∀v: C(a) ∧ [H(a,v) ↔ ¬H(v,v)] true.
C(a) ∧ [H(a,a) ↔ ¬H(a,a)].
H(a,a) ↔ ¬H(a,a).
There is no string u that denotes a Turing machine such that for any string v, u halts on v if and only if v does not halt on v. That is, it is impossible to design a Turing machine that halts on exactly those inputs that are not Turing machines that halt on themselves. In other words, the set of descriptions of TM's that do not halt on themselves (called in lecture the "Barber of Seville language") is not Turing recognizable.
∀x:[T(x) → ∃z: C(z) ∧ ∀w: [H(z,w) ↔ A(x,w)]]
Explain informally why it is true.
If a string x denotes a TM that halts on every input, there is another string
z that denotes a TM that halts on any input if and only if x says
yes on it. That is, any Turing decidable language {w: x says yes on w}
is also a Turing recognizable language {w: z halts on w}.
This statement is true because we can take any TM x and modify it so that
when it was going to halt, it actually halts if it was going to say yes and it
runs forever if it was going to say no.
_ a _ b
| V L | V
>((1))------->(2) Again, "L" means "lambda".
<--------/
a
The state set and start state are the same, and the final state set is the
same because the start state is already final. The transition (1,a,1) gives
us itself and (1,a,2). The transition (2,a,1) gives us itself, (1,a,1),
(1,a,2), and (2,a,1). The transition (2,b,2) gives us itself and (1,b,2).
We thus have six distinct transitions in the ordinary NFA:
_ a _ a,b
| V a,b | V
>((1))------->(2)
<--------/
a
The initial state is {1}, a final state. It has an a-move to {1,2}, a final
state, and a b-move to {2}, a non-final state. The state {1,2} has an a-move
to itself and a b-move to {2}. The state {2} has an a-more to {1,2} and a
b-move to itself. The DFA can be drawn as follows:
_____
| \ a
a V /
>(({1}))----------->(({1,2}))/
| | A
| b b| | a
V | |
->({2})<--------------- |
| | \_________________/
\__|b
We divide the states into two sets F = {{1}, {1,2}} and N = {{2}}. Since
N contains only one state, which is reachable, we are finished with it.
Both the states in F have a-arrows into F and b-arrows into N, so we may merge
these two states into a single state to get the following minimal DFA:
_ a _ b
| V b | V
>((F))------->(N)
<--------/
a
Last modified 17 May 2005