This reminds me of a question I've had in the back of my head for a while: what's the point of the exercises? The first set is trivial (probably limited by typing speed) if you've taken a combinatorics class before and still remember the material; the second is similar, but for first-order logic. I could understand it if they covered the material in the class, but it seems like the lectures talk about some concepts and describe some syntax, and then the exercises are supposed to be solved using the same syntax coupled with completely different concepts.
The first exercise at least illustrated the simplicity of applying inductive reasoning, but I don't get the point of the abstraction employed in the second exercise at all. As Michael points out, in this case, it seems simpler to not use their abstractions. If the exercise is supposed to illustrate that their abstraction, or something similar, can be useful, I'd appreciate it if someone could explain why, because I must be completely missing the point.
I can see why you might want to implement sets that way if you wanted to be able to represent arbitrarily large sets (e.g., x % 2 == 0, or x > 100), but they explicitly remove that case by providing a bound. In that case, it seems like it would be a lot simpler to represent the sets directly. And, even given that we want to use their representation for sets, why not just write the "obvious" implementation for map?
On Saturday, September 29, 2012 3:44:12 PM UTC-5, Michael Douglass wrote: