create page
[lambda.git] / exercises / _assignment4.mdwn
index 33c7e77..1442faf 100644 (file)
@@ -44,7 +44,7 @@ For instance, `fact 0 ~~> 1`, `fact 1 ~~> 1`, `fact 2 ~~> 2`, `fact 3 ~~>
 
         let fact = ... in
 
-        fac 4
+        fact 4
 
 6.  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_lists#v5-lists]].
 
@@ -99,7 +99,7 @@ point, i.e., demonstrate that `succ ξ <~~> ξ`.
     We've had surprising success embedding normal arithmetic in the Lambda
 Calculus, modeling the natural numbers, addition, multiplication, and
 so on.  But one thing that some versions of arithmetic supply is a
-notion of infinity, which we'll write as `inf`.  This object usually
+notion of infinity, which we'll write as `inf`.  This object sometimes
 satisfies the following constraints, for any finite natural number `n`:
 
         n + inf == inf
@@ -107,18 +107,18 @@ satisfies the following constraints, for any finite natural number `n`:
         n ^ inf == inf
         leq n inf == true
 
-    (Note, though, that with some notions of infinite numbers, operations like `+` and `*` are defined in such a way that `inf + n` is different from `n + inf`, and does exceed `inf`.)
+    (Note, though, that with *some* notions of infinite numbers, like [[!wikipedia ordinal numbers]], operations like `+` are defined in such a way that `inf + n` is different from `n + inf`, and does exceed `inf`; similarly for `*` and `^`. With other notions of infinite numbers, like the [[!wikipedia cardinal numbers]], even less familiar arithmetic operations are employed.)
 
-9. Prove that `add 1 ξ <~~> ξ`, where `ξ` is the fixed
-point you found in (1).  What about `add 2 ξ <~~> ξ`?  
+9. Prove that `add ξ 1 <~~> ξ`, where `ξ` is the fixed
+point you found in (1).  What about `add ξ 2 <~~> ξ`?  
 
 Comment: a fixed point for the successor function is an object such that it
 is unchanged after adding 1 to it.  It makes a certain amount of sense
 to use this object to model arithmetic infinity.  For instance,
 depending on implementation details, it might happen that `leq n ξ` is
 true for all (finite) natural numbers `n`.  However, the fixed point
-you found for `succ` may not be a fixed point for `mult n` or for
-`exp n`.
+you found for `succ` and `(+n)` (recall this is shorthand for `\x. add x n`) may not be a fixed point for `(*n)` or for
+`(^n)`.
 
 
 ## Mutually-recursive functions ##
@@ -178,4 +178,4 @@ definitions of `even?` and `odd?`?
                                        
 11. (More challenging.) Using our derivation of `Y` from [[this week's notes|topics/week4_fixed_point_combinators#deriving-y]] as a model, construct a pair `Y1` and `Y2` that behave in the way described above.
 
-    Here is one hint to get you started: remember that in the notes, we constructed a fixed point for `h` by evolving it into `H` and using `H H` as `h`'s fixed point. We suggested the thought exercise, how might you instead evolve `h` into some `T` and then use `T T T` as `h`'s fixed point. Try solving this problem first. It may help give you the insights you need to define a `Y1` and `Y2`.
+    Here is one hint to get you started: remember that in the notes, we constructed a fixed point for `h` by evolving it into `H` and using `H H` as `h`'s fixed point. We suggested the thought exercise, how might you instead evolve `h` into some `T` and then use `T T T` as `h`'s fixed point. Try solving this problem first. It may help give you the insights you need to define a `Y1` and `Y2`. [[Here are some hints|assignment4_hint]].