It is in French so I try to translate some parts. My goal was to teach as fast as possible the binomial distribution (number of successes when independently repeating a Bernoulli experiment) to students who, either have never seen an algorithm, or have seen some algorithmics in math lessons and don't like it at all. Both categories loved what I did with them. I precise that almost all of them are allergic to english language.
The assignment was "throwing 10 dices, what is the probability of having at least 2 times "6" around the 10 results?"
The whole job is related here:
http://irem.univ-reunion.fr/IMG/pdf/binomiale.pdf (but I did only pages 1-5 in one hour)
The first step was to show how one can simulate the throwing of 10 dices. I can do it without having to make a variable vary (explicitely at least), thanks to Seymour Papert:
10 timesRepeat: [ Transcript show: (6 atRandom)].Then I spoke about the usefulness of the Bag object when there are statistics: Adding the 10 results (small integers) inside a Bag makes it an object where one can see and count the 6es:
| urn |
urn := #( )�� asBag.
10 timesRepeat: [ urn add: (6 atRandom)].
Transcript show: urn.
(Why "urn"? This is the word used by Bernoulli, he was thinking about balls concealed inside a vase for which the latin word was "urna"; the balls where called "billets" by Condorcet, so that they could instead be pieces of paper; whatever they were, a vase was use to conceal them)
Then there remains only one difficulty: How can I automatize the counting of the 6es inside the bag? There is the most frightening challenge: Use a block with students who have never seen Pharo before. Very good surprise: They didn't seem to find this that difficult, I just had to say that
1. The pipe symbol means "such that" like in my lessons