+1. Recall that `ω ≡ \x. x x`, and `Ω ≡ ω ω`. Is `Ω` a fixed point for `ω`? Find a fixed point for `ω`, and prove that it is a fixed point.
+
+2. Consider `Ω ξ` for an arbitrary term `ξ`.
+`Ω` is so busy reducing itself (the eternal narcissist) that it
+never gets around to noticing whether it has an argument, let alone
+doing anything with that argument. If so, how could `Ω` have a
+fixed point? That is, how could there be an `ξ` such that
+`Ω ξ <~~> ξ`? To answer this
+question, begin by constructing `Y Ω`. Prove that
+`Y Ω` is a fixed point for `Ω`.
+
+3. Find two different terms that have the same fixed point. That is,
+find terms `F`, `G`, and `ξ` such that `F ξ <~~> ξ` and `G ξ
+<~~> ξ`. (If you need a hint, reread the notes on fixed
+points.)
+
+
+## Writing recursive functions ##
+
+4. Helping yourself to the functions given below,
+write a recursive function called `fact` that computes the factorial.
+The factorial `n! = n * (n - 1) * (n - 2) * ... * 3 * 2 * 1`.
+For instance, `fact 0 ~~> 1`, `fact 1 ~~> 1`, `fact 2 ~~> 2`, `fact 3 ~~>
+6`, and `fact 4 ~~> 24`.
+
+ let true = \y n. y in
+ let false = \y n. n in
+ let zero? = \n. n (\p. false) true in
+ let pred = \n f z. n (\u v. v (u f)) (K z) I in
+ let succ = \n s z. s (n s z) in
+ let add = \l r. r succ l in
+ let mult = \l r. r (add l) 0 in
+ let Y = \h. (\u. h (u u)) (\u. h (u u)) in
+
+ let fact = ... in
+
+ fac 4
+
+5. For this question, we want to implement **sets** of numbers in terms of lists of numbers, where we make sure as we construct those lists that they never contain a single number more than once. (It would be even more efficient if we made sure that the lists were always sorted, but we won't try to implement that refinement here.) To enforce the idea of modularity, let's suppose you don't know the details of how the lists are implemented. You just are given the functions defined below for them (but pretend you don't see the actual definitions). These define lists in terms of [[one of the new encodings discussed last week|/topics/week3_more_lists_]].
+<!--
+ empty? = \xs. xs (\y ys. false) true
+ head = \xs. xs (\y ys. y) err
+ tail = \xs. xs (\y ys. ys) empty
+-->
+
+ ; all functions from the previous question, plus
+ num_equal? = ???
+ empty = \f n. n
+ cons = \x xs. \f n. f x xs
+ take_while = Y (\take_while. \p xs. xs (\y ys. (p y) (cons y (take_while p ys)) empty) empty)
+ drop_while = Y (\drop_while. \p xs. xs (\y ys. (p y) (drop_while p ys) ys) empty)
+
+ The functions `take_while` and `drop_while` work as described in [[Week 1's homework|assignement1]].
+
+ Using those resources, define a `set_cons` and a `set_equal?` function. The first should take a number argument `x` and a set argument `xs` (implemented as a list of numbers assumed to have no repeating elements), and return a (possibly new) set argument `xs'` which contains `x`. (But make sure `x` doesn't appear in the result twice!) The `set_equal?` function should take two set arguments `xs` and `ys` and say whether they represent the same set. (Be careful, the lists `[1, 2]` and `[2, 1]` are different lists but do represent the same set. Hence, you can't just use the `list_equal?` function you defined in last week's homework.)
+
+ Here are some tips for getting started. Use `drop_while` and `num_equal?` to define a `mem?` function that returns `true` if ` number `x` is a member of a list of numbers `xs`, else returns `false`. Also use `take_while` and `drop_while` to define a `without` function that returns a copy of a list of numbers `xs` that omits the first occurrence of a number `x`, if there be such. You may find these functions `mem?` and `without` useful in defining `set_cons` and `set_equal?`. Also, for `set_equal?`, you are probably going to want to define the function recursively... as now you know how to do.
+
+
+6. Questions about trees.