Question text is in black, answers in blue.
Sorry, the book isn't as clear as it should be about two definitions. A simple path is a path that never visits a vertex more than once. A simple cycle is a path from a vertex to itself that never visits a vertex more than once (except that the first and last vertices are the same).
Should I use induction to solve 9.1.4?
You don't need to. You are proving "for any tree, for any pair of nodes..." and you can do this by Generalization, just letting T be an arbitrary tree and letting (x,y) be two arbitrary nodes meeting the assumptions. You will need the fact that there is a unique simple path between any two nodes in any tree.
You do count the original call, so the number in that case is 1.
I think I have an answer in terms of the Fibonacci function. Is that good enough, or do I need a closed form using powers of 1 + φ and all that, as in Discussion #7?
An answer in terms of the Fibonacci function is fine. Lots of operations on the Fibonacci function return answers that are the same function with different parameters.
Sure, this could be clearer. We need a convention on when to start and when to stop, so let's count both the initial and the final visit to (0,0), and for that matter let's call that node 00 to make my typing easier. With n= 0 the initial and final visit are the same so we get 1 visit. With n=1, we visit 00, then 10, then 00 again, then 01, then 00 for a total of five visits. For n=2, we visit 00, 10, 20, 10, 11, 10, 00, 01, 11, 01, 02, 01, and 00 for a total of 13 visits. With n=3 and this convention I get 29 visits. The pattern may not be obvious yet, but you need to determine how f(n+1) depends on f(n). Then you can calculate f for larger numbers, which should allow you to find a pattern you can prove by induction.
You must be using the green book, because that error is fixed in the blue book (it is Exercise 9.3.2). If you are using the green book, you need to copy down all the corrections on the errata page from last fall.
It's a boolean expression that uses only ∧, ∨, 0, and 1, like (1 ∧ (0 ∨ (1 ∧ 1)) ∨ (1 ∧ 0). The point of this exercise is that you know that (1 ∧ (1 ∨ (1 ∧ 1)) ∨ (1 ∧ 1), for example, evaluates to 1 without working it out operation by operation, and that (0 ∧ (0 ∨ (0 ∧ 0)) ∨ (0 ∧ 0) evaluates to 0. Your inductive proof should use an inductive definition of monotone expressions, with a base case and two inductive cases. You can then make inductive definitions of "monotone boolean expression with all 1 leaves", and so forth, and prove by induction on these definitions that all such objects evaluate to what you say they evaluate to.
Here is a simple one that might be useful. Let P(n)
be the statement that "n has at least one prime divisor". We will prove by
strong induction that whenever n is a natural with n ≥ 2, P(n) is true.
For the base case we must prove P(2), that 2 has a prime divisor. This is true
because 2 is prime and 2 divides 2. Now we assume that P(m) is true for all
m with 2 ≤ m and m ≤ n, the strong inductive hypothesis, and prove
from this assumption that P(n+1) is true. There are two cases. If n+1 is
prime, it has a prime divisor because it divides itself. If it is not prime.
then by the definition of prime, since it is not 1, n+1 = yz for two naturals
y and z with y ≥ 2 and z ≥ 2. Note that y ≤ n because y < n+1.
So by the IH, we know that y has a prime divisor d. This d is also a prime
divisor of n+1. So we have proven in each case that P(n+1) is true, and
completed the strong inductive proof.
For n=1 I agree you are right, as you can't have
an optimal path of one edge if there are no edges. For n=2 you need
the optimal path to have one edge and for the DFS to visit all nodes,
and those conditions are achievable together. So the problem should
say "with n ≥ 2" after "any positive natural".
By "d(v,u)" there I mean the length of the arc
from v to u. For h to be consistent means that there are not
two nodes u and v, with an edge from v to u of length x, such that
h(v) > h(u) + x. Remember that h(w), after the correction, is
supposed to be a lower bound on the best-path distance from w to a
goal node. If h(u) and h(v) meet those conditions, then it is
possible for the A* search to return the wrong path -- see the
solution to Exercise 9.9.2 in the book.
Actually that solution also needs to be fixed -- there is an edge
(b,a) of weight 1 and not an edge (a,b) of weight 1. The A*
algorithm as written then performs as follows: When s is explored,
a goes on with priority 3 + 0 = 3 and b goes on with priority 1 + 3 =
4.
Then a is explored, and we put on t with priority 5 + 0 = 5. Then we
explore b, but since a is on a closed list (it is already explored),
we don't look at it again and we miss the better path to t of length
4. Then t comes off the closed list and we return the path of length
5
that we found.
To make A* search work with an admissible but inconsistent
heuristic, we must be prepared to reopen and reexamine nodes on the
closed list if we find better paths to them.
Last modified 30 March 2011