**Part I: Proofs**

Prove the following:

- (Direct Proof Warmup) Prove that every odd integer is the difference of two square numbers.
- (Proof by Contradiction Warmup) Prove that there is no largest rational number.
- Prove or disprove, that, if is odd, then
*n*is odd. - In logic, the contrapositive of a statement is defined as . Prove or disprove that the contrapositive of a statement is equivalent to the original statement.
- In logic, the inverse of a statement is defined as . Prove or disprove that the inverse of a statement is equivalent to the original statement.
- Prove or disprove that is irrational.
*r*is a rational number.*i*is an irrational number. Prove or disprove that*r*+*i*is irrational.- For , prove or disprove that .
- Prove or disprove that every natural number divisible by 10 is the sum of two primes.
- Prove or disprove that has no rational sotlusions for x
- Prove or disprove that has no rational solutions for
*x*. - Prove or disprove that every non-zero rational number is the product of two irrational numbers.
- If and
*f*and*g*are both injective, then prove or disprove that*f*composed with*g*is also injective. - Prove or disprove that .
- (Challenge) Show that .
- (Challenge) The Tower of Hanoi game is one where you have three posts and
*n*disks, originally all on one pole. They are arranged with the largest disk at the bottom, and each disk above it smaller than the disk below. Your goal is to move all the disks to another pole, with the only move being to take the top disk off of any stack, and placing it on another stack, with the restriction that a disk can only go on either an empty stack, or a stack with only larger disks. Prove that this game always has a solution for*n*disks. How many moves are required given an initial stack of*n*disks? - (Super extreme challenge) Catalan numbers come up in random situations. For example, given
*n*pairs of parentheses, let be the number of ways they can be arranged in a valid mathematical expression. For example, with*n*= 3, there are 5 ways to rearrange the parentheses: ((())),(())(),(((()),(()()), and ()()(), so . We define . Show that .

**Part II: Problem Formulation & Heuristics & Distances**

- (Warm-up) Explain, briefly, to a middle-school student not very familiar with computer science, the following terms:
*state, state space, search tree, search node, goal, action, transition model,*br*anching factor*,*heuristic, and distance*. - (Warm-up) (Russell/Norvig ex3.3.9) The
**missionaries and cannibals**problem is usually stated as follows. Three missionaries and three cannibals are on on one side of a river, along with a boat that can hold one or two people. Find a way to get everyone to the other side without ever leaving a group of missionaries in one place outnumbered by the cannibals in that place. This problem is famous in AI because it was the subject of the first paper that approached problem formulation from an analytical viewpoint (Amarel, 1968).- Formulate the problem precisely, making only those distinctions necessary to ensure a valid solution. Draw a diagram of the complete state space.
- Implement in code, and solve the problem optimally using an appropriate search algorithm. Is it a good idea to check for repeated states?
- Why do you think people have a hard time solving this puzzle, given that the state space is so simple?

- Given the 8-puzzle, invent a heuristic function that is admissible. Run through A* search with that heuristic. Now, invent a heuristic function that sometimes overestimates. Show an initial state where it can lead to a suboptimal solution.
- We talked about formulating the spell checker problem in class. Now, implement some code to represent this problem, and using the Lexicon from yesterday’s recursion problems, write a search to solve it. Note that the full lexicon is huge, so you may want to use the small one to test, or make a smaller one yourself.
- (Challenge) Show that if a heuristic is consistent, then it is admissible.

**Part III: Heuristic Searches**

- Explain, using
*f(n)*,*g(n),*and*h(n),*the difference between greedy best first search and A*. - If given an
*h*(n)*, construct the simplest search algorithm that optimally uses*h*(n)*in its search. Show that it is complete, optimal, and optimally efficient. - Using the same search grid as yesterday (Part II #2), trace through a run of A* search. Using the following heuristics
- L1 norm.
- $latex L_{\infty} (what is interesting about this?)
- Another heuristic of your choice.

- (Challenge) Prove A* is optimal.

**Part IV: Pathfinder, final day**

For pathfinder, you have implemented several uninformed searches by now. Now implement Best-first search and A*. Again, use good design and coding principles when doing this. If you wish, you may look at any of the algorithms listed in Wikipedia’s List of Search Algorithms, and implement any you find interesting.

Once you’re done with this, you can do arbitrary searches correctly and efficiently!

Make some huge maps, clean up your user interface, find a good way of displaying the path, and go find some paths!

**Part V: Pick a Project Topic**

Once you find a topic, post a half-page vignette on the blog about your topic, what your initial thoughts are about what significant implementation you will do, and any information you’d like to know. I will try to post replies as soon as I can to all of them. This will be due by the end of lecture on Monday.

Make sure to check the categories “Student” and “Vignettes.”