<p>This answer will be general, rather than specific to your proposed curriculum. Since you note in a comment that it is set theory that you want to stress over Racket programming, I'll suggest the following. </p>

<p>First, it is difficult to advance students on two orthogonal axes simultaneously without confusing at least some of them. Therefore you want to put the stress on set theory and its beauty and limitations over the programming aspect. If you were using a language that they already knew well, I'd make a slightly different suggestion. </p>

<p>But first, give them a good, traditional, view of set theory and how it relates in general to modes of thought. Any good book, even if it doesn't mention programming at all, could  be used, even Naive Set Theory by Halmos. Use programming primarily to illustrate things in a simple way so that the functional programming doesn't take up too much of their thought space - just enough to get the flavor of, for example deep recursive programming. </p>

<p>The programming exercises can be quite simple, but I would choose them in such a way that they also serve as an introduction to complexity theory and the problem of growth. Something simple with Cartesian product and many dimensions can illustrate the growth. It is also possible to write functional programs for things that seem simple but have terrible run-time. For example, a naive version of reversing a list can easily be quadratic if care isn't taken. </p>

<p>I don't know what libraries Racket offers for support of sets, but it might be useful to talk about the development of such a library - building a tool box of simple set operations. </p>

<p>But, in the main, use the programming as a way to reinforce the theory, not so much as an end in itself. Set theory is rich enough and with enough applications to math and CS that you don't really need to do much more. </p>

<p>If you really want to teach FP in Racket, then a different set of exercises that help the functional thought process develop would probably be better than trying to force it into one realm. </p>

CC BY-SA 4.0
2018-09-26T18:04:55.730Z
Perfect, thank you.  This is exactly the sort of thing that I had in mind.  You have helped to clarify my thinking on this matter!
Ben I.
CC BY-SA 4.0
2018-09-26T17:13:27.677Z
2018-09-26T17:13:27.677Z
Buffy
<p>The title of the question actually says almost everything there is to say.  I cannot think of any programming labs whatsoever that would naturally flow from set theory.</p>

<p>My students will be coding in Scheme (Racket), and will be pretty new at it when we approach this topic.  Are there any ways to translate the concepts of set theory into a reasonable lab?</p>

<p>We are covering:</p>

<ul>
<li>Basic definitions</li>
<li>Venn Diagrams</li>
<li>Union</li>
<li>Cardinality</li>
<li>Cartesian Products</li>
<li>Power Sets</li>
<li>Bijection (as proof of cardinality)</li>
<li>Infinite sets <span class="math-container">$\aleph_0$</span> and <span class="math-container">$\aleph_1$</span></li>
<li>Drawing a diagonal line to prove <span class="math-container">$|\mathbb{R}| \neq |\mathbb{N}|$</span></li>
<li>Russell's Paradox</li>
</ul>

CC BY-SA 4.0
2018-09-25T20:11:03.270Z
Are you more interested in set theory per se, or in the programming?
Buffy
CC BY-SA 4.0
2018-09-25T20:29:17.557Z
A problem you will have, if they know neither set theory, nor Racket, is that you are trying to advance them simultaneously on two independent axes. That is difficult in principle, as well as in practice.
Buffy
CC BY-SA 4.0
2018-09-25T20:38:20.663Z
@Buffy I'm more interested in set theory.
Ben I.
CC BY-SA 4.0
2018-09-29T17:43:21.223Z
I would be looking at using/creating a library that operates on sets/lists. With operations such as `is_all_in my_collection  (lambda x: x>7) : Boolean`. Some basic operations are `is_all collection lambda: Boolean`, `contains collection lambda: Boolean` (at least one), `is_subset collection collection:Boolean`, `union collection collection: set`, `intersection collection collection: set`. I have used these libraries in many languages, can't remember which.
ctrl-alt-delor
<lesson-ideas><labs>
Lab ideas for set theory
# Lab ideas for set theory

(Asked by: username_0 on 2018-09-25)

The title of the question actually says almost everything there is to say. I cannot think of any programming labs whatsoever that would naturally flow from set theory.

My students will be coding in Scheme (Racket), and will be pretty new at it when we approach this topic. Are there any ways to translate the concepts of set theory into a reasonable lab?

We are covering:

* Basic definitions
* Venn Diagrams
* Union
* Cardinality
* Cartesian Products
* Power Sets
* Bijection (as proof of cardinality)
* Infinite sets $\aleph\_0$ and $\aleph\_1$
* Drawing a diagonal line to prove $|\mathbb{R}| \neq |\mathbb{N}|$
* Russell's Paradox

**Tags:** lesson-ideas, labs

> **Comments:**
> **username_1**: Are you more interested in set theory per se, or in the programming?  
> **username_1**: A problem you will have, if they know neither set theory, nor Racket, is that you are trying to advance them simultaneously on two independent axes. That is difficult in principle, as well as in practice.  
> **username_0**: @username_1 I'm more interested in set theory.  
> **username_2**: I would be looking at using/creating a library that operates on sets/lists. With operations such as `is_all_in my_collection  (lambda x: x>7) : Boolean`. Some basic operations are `is_all collection lambda: Boolean`, `contains collection lambda: Boolean` (at least one), `is_subset collection collection:Boolean`, `union collection collection: set`, `intersection collection collection: set`. I have used these libraries in many languages, can't remember which.  

---

## 1 answers

### Answer by username_1 on 2018-09-26. Score: 3

This answer will be general, rather than specific to your proposed curriculum. Since you note in a comment that it is set theory that you want to stress over Racket programming, I'll suggest the following.

First, it is difficult to advance students on two orthogonal axes simultaneously without confusing at least some of them. Therefore you want to put the stress on set theory and its beauty and limitations over the programming aspect. If you were using a language that they already knew well, I'd make a slightly different suggestion.

But first, give them a good, traditional, view of set theory and how it relates in general to modes of thought. Any good book, even if it doesn't mention programming at all, could be used, even Naive Set Theory by Halmos. Use programming primarily to illustrate things in a simple way so that the functional programming doesn't take up too much of their thought space - just enough to get the flavor of, for example deep recursive programming.

The programming exercises can be quite simple, but I would choose them in such a way that they also serve as an introduction to complexity theory and the problem of growth. Something simple with Cartesian product and many dimensions can illustrate the growth. It is also possible to write functional programs for things that seem simple but have terrible run-time. For example, a naive version of reversing a list can easily be quadratic if care isn't taken.

I don't know what libraries Racket offers for support of sets, but it might be useful to talk about the development of such a library - building a tool box of simple set operations.

But, in the main, use the programming as a way to reinforce the theory, not so much as an end in itself. Set theory is rich enough and with enough applications to math and CS that you don't really need to do much more.

If you really want to teach FP in Racket, then a different set of exercises that help the functional thought process develop would probably be better than trying to force it into one realm.

> **Comments:**
> **username_0**: Perfect, thank you.  This is exactly the sort of thing that I had in mind.  You have helped to clarify my thinking on this matter!  

---

