Question text in black, solutions in blue.
Q1: 15 points Q2: 20+10 points Q3: 35 points Q4: 30 points Total: 100+10 points
Base cases: G(0) is defined to be 0, and 30 - 20 = 1 - 1 = 0.
G(1) is defined to be 1, and 31 - 21 = 3 - 2 =
1.
Assume as strong inductive
hypothesis that G(i) = 3i - 2i for all i with i ≤ n. Our inductive goal is to prove
that G(n+1) = 3n+1 - 2n+1.
We know that G(n+1) = 5G(n) - 6G(n-1). Applying
the inductive hypothesis, we get G(n+1) = 5(3n -
2n) -
6(3n-1 - 2n-1) =
3n-1(5(3) - 6) + 2n-1(-5(2) + 6) =
3n-1(9) +
2n-1(-4) = 3n+1 - 2n+1.
The rules for T are:
Base case: n = 0, string is “b”, string is in L by the first rule.
Inductive hypothesis: anbcn is in L.
Inductive goal: an+1bcn+1 is in L.
Inductive step: By the second rule, since
anbcn is in L,
a(anbcn)c =
an+1bcn+1 is in L.
Base case: n = 1 (since we are proving this for positive naturals),
wi = “b”, and
b is in L by the first rule.
Inductive hypothesis: wn is in L.
Inductive goal: wn+1 is in
L.
Inductive step: In the third rule, we let u and v both be
wn, and derive that wndwn is
in L.
But wndwn is exactly the same string as
wn+1, because its length is 2(2n - 1) + 1
= 2n+1 - 1, and it alternates between b’s and d’s, since the new d goes between the last
b of the first wn and the first b of the second wn.
Base case: If a string is made by the first rule, it is “b” and its length is 1, which is odd.
Inductive hypothesis: All shorter strings in L have odd length.
Inductive goal: A new string made
by the second or third rules has odd length.
Inductive step: If w is a string of odd length and
we make awc, we make a string of length 2 greater than w’s length, which is also odd. If u and v are
both of odd length and we make udv, we make a string whose length is the sum of two odd
numbers, plus one, and thus is an odd number.
We first prove that every string in L is the leaf string of a tree in T. For the base
case, b is the leaf string of the base case tree of T. If w is a string in L, w is the leaf string of
t, and we make awc, then awc is the leaf string of the tree made from t by the second rule.
If u and v are strings in L, and are the leaf strings of t and u respectively, then udv is the leaf
string of the tree made from u and v by the third rule.
Now we prove that every tree in T has a leaf string in L. For the base case, the leaf string of
the base tree is “b”, which is in L. If t is a tree in T, and we make a tree from t by the second
rule, then because the leaf string of T (call it w) is in L we know that awc is also in L. If t and
u are trees in T, with leaf strings x and y respectively, and we know that x and y are in L, then
if we make a tree from u and v by the third rule, its leaf string is xdy, which is in L by the third
rule for L.
q(7)
/ \
1 1
/ \
r(6) s(8)
| |
1 3
| |
t(5) u(6)
\ / \
2 3 2
\ / \
v(3) w(5)
| |
2 3
| |
x(1) y(2)
\ /
2 2
\ /
z(0)
The tree is a single chain s-q-r-t-v-u-w-y-z-x with back edges from u to s and from x to v.
Level 0 of the BFS tree has just s.
Level 1 has q and u, each with tree edges from s.
Level 2 has r with tree edge from q, v with tree edge from u, and w with tree edge from u.
Level 3 has t with tree edge from r and non-tree edge from v, x with tree edge from v,
and y with tree edge from w.
Level 4 has just z, with tree edge from x and non-tree edge from y.
G has ten nodes and eleven edges. Wherever you start either kind of search, the tree edges will form a tree that includes all ten nodes. Such a tree has nine edges by a theorem proved in lecture, so there will be exactly two edges left to be non-tree edges.
FALSE. It might not be connected.
FALSE. BFS is the same as UCS with unit edge weights.
TRUE. If both g(s) and h(s) are in the range from 0 to d(s, g), then so is their average.
FALSE. We proved that it is transitive.
FALSE. The depth is the length of the longest path from the root to a leaf, which in this case is 0.
FALSE. The single node tree has an odd number of nodes, and adding exactly two children to any leaf keeps the number odd, so the number is always odd.
TRUE. A simple example has three nodes and edges (s, x, 1), (s, t, 3), and (x, t, 1). The optimal path is two steps, but if we add 10 to every edge cost the one-edge path becomes optimal.
FALSE. Black might also have a better strategy that assures him more than 3.
TRUE. We have enough to prove ∀n:P(n) by strong induction.
FALSE. If both players use their optimal strategies, the result will be the value of the game. But in a finite game the result must be the payoff at some leaf node.
FALSE. These premises are enough to prove ∀w:Q(w).
FALSE. The DFS could happen upon the shortest path immediately, while if the heuristic is zero and we have unit weights, A* becomes BFS, which will examine all paths from the start that are shorter than the shortest one to the goal.
TRUE. Tree and forward edges only go from ancestors to descendants. And no sequence of cross edges can get from a descendant to an ancestor.
TRUE. The edge can go to the following level, the same level, or any previous level, but if v were not yet discovered it would be at the next level after u’s.
TRUE. Zero is the successor of a number (6), which the Peano Axioms forbid.
Last modified 18 May 2020