Monday, June 29, 2015

Programming class (grade 5 and 6)

Grade 5

We started out with everyone showing their homework programs (drawing our names in Thai and English) and telling us one thing they really liked about the program and one thing that they found challenging.

Here are a couple of highlights from the discussion

  1. Repurposing commands: Tatia and Chunly both made use of dots instead of drawing explicit curves. This led us to talk about two different approaches: getting a program to implement a known method (e.g., draw your name the way you would move your hand) vs inventing a new method that uses the tools the computer already knows. There are strengths and weaknesses of each approach and the name programs show a mix.
  2. Reusing code: when do you write something new or just use code you have already written? We compared these two programs พิชชี่  and Pitchee. In the first, every component/character of the name is drawn with unique code, even though there are two identical letters (ช) and the vowel _ิ is a subcomponent of _ี. In contrast, the English version has two e's that are drawn with identical code. 
  3. Simultaneity: Jung was the only one (including last year) to have the idea of using multiple turtles to draw different components of her name. This extends the first point of our discussion: doing things with the computer differently than our organic methods. we only touched on this briefly, but it will be good to return to it.

Multiple turtles
Again, we talked about syntax related to hatching multiple turtles. This time, we started with this code:
e = hatch plume.b = hatch redb.fd 100
The puzzle was: why doesn't turtle b (our red one) move? Two possible corrections:

  • change the second line to b = hatch red
  • change the third line to e.b.fd 100

We talked a little about what e.b meant in the second line and whether we would prefer the first correction or the second correction.

For loops
After the homework conversation, I wanted to continue the theme of using repeated code, the idea that the computer will faithfully and precisely repeat the same commands again and again. The idea that this is a major difference between a machine and a person, and to start finding ways to make use of that.  Naturally, looping provides a key example.

To start, we wanted to get the mechanics right with a simple square:
pen blue
for [1..4]
  fd 100
  rt 90
Even doing this, there are a lot of little details to discuss:

  • what is this funny punctuation: "[" ".." and "]"
  • why do the third and fourth lines have to be indented? what if they aren't?
  • the different views between code and blocks. This is one case where the blocks really work nicely to show the commands captured by the loop

After this, we did several experiments:

  1. adding a new command to the loop (for example, making a dot at each vertex)
  2. changing into a triangle instead of a square
  3. modifying the size of the shape
  4. moving commands into and out of the loop

Possibilities for next time
There were many ideas I'd prepared for class that we didn't have time to cover:
The challenge this week is to draw a 2 color yin-yang like in the center of the Korean flag. This is mostly an exercise in understanding arcs, but let's see if anyone uses a for loop or multiple turtles!

Grade 6

I wanted to continue some of the if and or ideas from last time. In addition, all of the students have been a bit stuck on their projects because they are having trouble understanding code examples from other people's programs. I thought that some debugging work would be helpful for both of these.

Challenge 1: This program (from last week) has an error: TurtleRace. What is wrong? How can we investigate?

Since we had seen a complete example of this program last time, everyone understood that turtle boongie was not making the dots that were intended.

We explored several strategies to investigate why this was happening:

  1. comment out lines of code using # or sections of code using ###: This let's us investigate whether a particular code is causing a problem, not doing what we intend, or simply not doing anything. For example, in our turtle race program. commenting out line 30 does not change the output. That tells us something is wrong.
  2. Add test code that has a function we clearly understand. In particular, for conditional statements, we can add code that helps us verify whether the conditions are being treated the way we want. In this case, we could have added a new drawing command at line 31 or a write to give us a message.
  3. reduce the number of iterations and trace line by line: this is a brute force approach. 

The error in this program is subtle and an example of something that often happens: we have a slight error, but the overall line of code looks familiar, so it makes it harder to spot the problem.

Challenge 2: My program doesn't work properly: FactorGameWindows.
  1. How do the windows move and how does the program make them stay along one line?
  2. What doesn't work properly?
  3. Can we fix it?

This is a much more complicated challenge, partly because the code is more complex, but also because the program itself is less familiar. However, investigating this program was part of the homework for both Titus and Win, so really this challenge amounted to working on the homework together.

Some of the earlier techniques for debugging came back into play. In particular, Win experimented by commenting out code and seeing the effect.

Challenge 2 amounted to project work for Titus and Win. For the other two, we had private conversations about
- The program Sounds with Boongie
- Correction to bomb program for Gun

- Titus: (same as last week) make a rocket that moves side to side
- Win: (same as last week) make a care that moves side to side
- Gan: combine the bomb code with the target+points programs to complete his project
- Boongie: get more sound-file links from

Saturday, June 27, 2015

Math pictures

We adopted a warm-up activity from Mathematics Mastery that the kids have really enjoyed. We look at interesting pictures and make mathematical comments.

The MM team developed a series of great cartoon pictures based around various fairy tales where the pictures link naturally with particular lessons.

As substitutes, I've found some publicly available pictures to use at home. Naturally, these won't necessarily link with a particular lesson, but there is always something interesting to discuss. If you find others you like, let me know in the comments, please!

How do we use these pictures
The point is to use the pictures as triggers for the students to say full sentences or questions with some math content. There is no real limit or bound on what is allowed. Here are some examples of the typical types of comments (taken from actual conversations):

  • I see 3 flowers.
  • There are more people than chairs.
  • The windows are rectangle shapes.
  • Half of the plates are empty.
  • The stars are arranged like 5 dots on a dice.
  • This tree is smaller than this tree (pointing at the picture).
  • The dog is in front of the horse.
  • The bricks on the path make a 3x4 array.

As you can see, this is mostly about shape and number.

Examples from the web
Symphony orchestra, from

Floating market from

Family room, from

Hello Kitty Bakery from

Coral reef scene from

Other ideas
Without a picture, you can do a similar activity around your house.  The number scavenger hunt was suggested at Kid's Quadrant.  Go take a look: here!

Thursday, June 25, 2015

A cheating friend (or funny dice)

who: J1 and J2
when: at dinner

The basic puzzle

In class recently, we've been using a warm-up puzzle where we tell the students we have two secret numbers and give them two clues: the sum of the numbers and their difference. The challenge is to find the two secret numbers.

This is a simple algebra problem that can also be attacked easily by guess-and-check (for small values) or by a systematic table of trials. These are the methods being used by the 2nd and 3rd graders, so the puzzles result in a lot of arithmetic practice as well as reinforcing different number bonds.

Our twist

Over dinner, I told the kids that a friend gave me a similar puzzle, but with a slight twist. This friend rolled a 6-sided dice twice and told me the sum and the difference of the values. Sounds the same, but easier, right...?

Unfortunately, our friends are all a bit tricky.
First clues
So, the first clues my friend gave me were that her two numbers sum to 12 and have a difference of 4. The two talked through these clues and found the answer (which I'll leave to you).

But wait: these were supposed to come from dice throws!?

Second clues
I told them that I'd gotten the same conclusion and had challenged my friend. When confronted with this result, the friend said, "oh, there was a mistake. Actually, the difference was 12 and the sum was 4."

After a minute, but before finding a solution, the J2 realized that there was something fishy about this one, two. How can two dice rolls have a difference of 12?!!

Are there two numbers that fit the clues, even if they aren't from dice rolls? Yes, J1 and J2 found them.

Third clues
So, the friend was tricking us again. So what were the actual values? This time, the friend claimed that the sum is 7 and the difference is 2.

At this point, both were highly suspicious, but also very curious to see what would go wrong. This time, they made a table with number bonds of 7 and the differences. It looked something like this:
7+0 = 7        7-0 = 7
6+1 = 76-1 = 5
5+2 = 75-2 = 3
4+3 = 74-3 = 1

At this point, they noticed a troubling pattern in the differences: always odd. J2 suggested adding another line to the table:
7+0 = 7        7-0 = 7
6+1 = 76-1 = 5
5+2 = 75-2 = 3
4+3 = 74-3 = 1
3.5+3.5 = 73.5-3.5 = 0
Ah, now we've got an even value! From there, it took another couple of minutes to find the combination of numbers that add to 7 and have a difference of 2.

Final answer, Final puzzle
Once again, the friend seems to be tricking us: these numbers aren't on a regulation 1 to 6 die either! It was time for the final revelation: actually, all of these were from my friend's dice throws, but they just had very strangely marked dice.

Looking over our work, we saw that we had only come up with 5 different numbers as answers in our puzzles. We confirmed that, yes, the dice was 6 sided, so what was the value of the last side?

This was the last clue from the friend: the average value of the faces on her die is the same as the average value for a regular die.

So, how are the sides of my friend's die marked?

Wednesday, June 24, 2015

Deep Tic-Tac-Toe and tangram initials (1-3rd grade math games)

Note: we did 1st and 2nd grades in parallel this week.

First Grade


Our simple warm-up this week was a little before/after game with the days of the week and the months of the year. Starting out, we had a little discussion (debate) about what day it was (Tuesday, at the time). Then, what came immediately before and what came immediately after?

For months, no one was quite sure of the current month, so we talked about that for a moment, then talked about which months would be coming up. We should keep repeating and integrating into some other games so the students can get more comfortable with the sequence of months.

Clap and pat patterns

Moving on from the warm-up, I asked if they could guess some clapping patterns, where I would either clap my hands or pat my lap. Too easy, they both exclaimed. Okay . . .
Pattern 1: I clap 5 times and then ask them what comes next.  More claps! (admittedly, this was easy)
Pattern 2: Alternate clapping and patting (C-P-C-P-C-P) and then what comes next. Again, pretty easy for them to continue C-P-C-P. It was actually a step trickier for them to continue if I ended my sequence on a clap (so their continuation goes P-C-P-C etc)
Pattern 3: Same deal, but pattern is C-P-P- C- P-P etc. At this point, they were clapping and patting along with me to make sense of the patterns.
Pattern 4: C CP CPP CPPP CPPPP CPPPPP etc. Now, here's where it got complicated! We did this one several times.

Next time, we will do these patterns visually as well as aurally.

Tic-tac-toe Game

We played a couple rounds of classic tic-tac-toe (also called X-O here in Thailand). As we played, I asked them questions about what they noticed:

  • how many spaces are there on the game board?
  • how many lines do we draw to get those spaces?
  • What shapes are the spaces?
  • When we draw the board in the usual/lazy way (2 horizontal lines, 2 vertical) do all the spaces have the same number of border edges?
  • If we made more lines, how many spaces would we get?
  • At the end of the game, how many Xs and Os are there? Is it the same number for both?
  • Do they prefer to go first or second?
We had several reasons for playing. The first is to encourage their habits of noticing and wondering. Even in such a simple game, there are a lot of mathematical things they can see and talk about. Our second reason is to prepare for the huge number of tic-tac-toe variations that we can play with number recognition, arithmetic operations, and more involved strategy.

A colorful pattern

We continued our exploration of the 100 board and the bead abacus with a coloring activity. This time, we wanted to color the even numbers (multiples of 2) and not color the odd numbers. For both of the kids, though, they preferred to use different colors for the two types of numbers rather than leave anything entirely plain. As they worked on each new number, they used a 100 bead abacus to figure out whether the number was an even or an odd.

Before beginning the activity, I asked if they had a guess about what pattern would result at the end. There seemed to be a consensus that we would get a checkerboard pattern. After working for a while on the first row, though, one student suddenly had the idea that the evens and odds would be in alternating columns. An interesting conjecture!

I promise pictures of the results next week.


Play X-O 3 times with a parent or older sibling and finish coloring their 100 boards.

Second and Third Grade


We used a warm-up game similar to last week. When someone has two secret numbers, can we figure out their values if we know the sum and the difference?

Tangram intro

In class, we worked on classic tangram rabbit and fox outlines. This was a really good exercise in paying attention to detail. For most of the class, students would claim to have a solution and we would point out something in their outline that didn't match the target (for example, a horizontal line where it should be on a diagonal or vice versa).

As with tic-tac-toe for the 1st graders, there is a lot to notice and wonder about in the simple tangram puzzles. For example:
  • How many pieces are there? What are the shapes, what are the sizes?
  • If we are using only some of the pieces, can we make the same shape in different ways? Trying to make different types of right isosceles triangles is one version of this.
  • Which edges match exactly?
  • What angles can we match up?


Make their initials with the 7 piece tangram. As many versions as possible and, if they want, try out other letters/other shapes.

Class notes (grades 5 and 6 programming)

Fifth Grade

Ideas and questions from homework

  1. How do we make multiple turtles? This was actually the second exercise I planned for the day, so we reserved it for later in the session.
  2. What does dot() mean, compared with dot green, for example?
  3. Why were all three of the dots in our exercise different colors?
  4. How can we change the color of the background? For example, pink?

Background: make it big!
We started with the last question. I asked the group if they could come up with ways of doing this. The first idea was to try typing a command "background." In pencilcode, that doesn't work as this function isn't defined so they got an error message. I suggested that they already know commands they could use and then gave them more time. Shortly after that, each came up with a variation, using either dot or box to draw a very large shape of the right color.

Note: I have since noticed that background is a function in processing.JS, used in Khan Academy. I wonder if that was the source of this idea?

Dotty dots
We tackled questions 2 and 3 together. In a fairly quick discussion, the students explained to each other than dot <color> makes a dot of that color and "lightgray" is different from "gray." That left dot() a little bit unclear.

P and I explained that the parentheses told pencilcode that we had just entered a command (or function.) We had already seen another example of this with home(). Usually we would have to tell dot a color and a size. However, the system seems to have built-in defaults in case we call the command without giving extra parameters.

We explored a couple of other commands we know, fd and rt to see if they also had built in defaults and found that they do! fd()  is equivalent to fd 100 and rt() is the same as rt 90.

We also talked about which version is easier to understand and everyone was clear that it was easier to understand if we made the parameters explicit.

The Plum triangle redux
A fairly short discussion that the plum triangle was an artifact of the fact that we could only move by whole pixels, so any irrational distance can only be approximated. We all agreed that this was fine, but needs to be handled carefully in two cases:

  • If we suddenly make our drawings much larger, then the approximations may be visible and need adjustment
  • If we have a series of approximate moves, then the little errors might accumulate. One habit is to return the turtle to the origin using home() between drawing different elements of a complicated drawing.

Hatching new turtles
Falling in perfectly with my plans, the kids wanted a reminder about how to create new turtles. One student hadn't seen this before, but the others quickly remembered something like
e = hatch 'yellow'
e = rt 90
We corrected the second line to e.rt 90 and talked about the syntax (hatch creates a new turtle wearing the indicated color, e =  gives it a name, e. is how you tell the turtle e that there is a command for it to execute.
As a challenge, we got them to draw a square with the old turtle and a triangle with the new one.

The homework this week is for everyone to draw their names in Thai and English.
Last year, I had created 5 different programs that drew my name and/or animated it in different ways. Unfortunately, 2 of those seem to be broken, so I also have homework this week!

Sixth Grade

Trying to be logical
After the discussion last week, we saw that we would need to spend more time on while and logical conditions (if, and, or).  This time, I gave them sample code (you can play here):

I asked them to just focus on the gun turtle and to figure out what it does. Most of the action is in lines 22-24.
Ultimately, this led to a discussion of how many dots it would draw. We got 2 votes for 5 dots and 2 votes for 10. In the end, we created code to cover that part of the program and saw the turtle actually draws 6, so we needed to do some work to figure out why.

We stepped through the while loop and checked to see what was happening each stage.

Before moving on, we tried changing line 21 so that innerLoop would iterations from 1 to 100. Would that change turtle gun's output? Why or why not?

There was very limited progress on the projects this week. As a result, most of the homework assignments were the same, but with some extra guidance:

  • Titus and Win: look at this example program to see if you can figure out a way to get your game characters to follow the mouse, but to stay on a fixed horizontal line.
  • Boongie: look at this Thai flag program to see how to play sound files you find on the web
  • Gun: figure out a way to integrate bombs into your game

Here is Gun's progress so far:

Sunday, June 21, 2015

Triangles and Angles: a proof for 5 year olds

who: J2 (also P and J0)
what did we use: polydrons, polydron protractor

J2 and I were playing with polydrons and he got interested in measuring the various angles. Since there are three different triangles in the set, he got to test each of them and found that the angle sum was always 180 degrees. We went on to examine squares and pentagons to see what he could make of those.

In the evening, P and I were talking about about this investigation and I mentioned this proof that the interior angles of a polygon sum to $180 \times (n-2)$:

P was surprised and said that she likes this proof more:
In this version, you have to subtract the middle 360 degrees.

I was a bit surprised that I hadn't ever thought of this version or seen it elsewhere, but quickly realized we could repurpose it to finding the interior angles of a triangle itself.  Here's the picture:

Now, the argument:
  1. Angles of the large triangle are equal to the sum of the angles of the smaller triangles - 360
  2. Let x be the sum of interior angles of a triangle.
  3. Based on 1, we have x = 3x - 360
  4. Rearranging, we get x = 180.

Where we get stuck: a challenge for you

Here's the thing: the sum of interior angle measures of a triangle isn't 180 degrees. That is, it doesn't have to be if you are working in non-euclidean geometry. Here's a nice picture (not mine) of a triangle with angle sum of 270 degrees:

Comes from MathStackExchange

However, our proof doesn't seem to use any fancy postulates. Your challenge, why doesn't it work on a sphere? What extra postulate did we secretly use?

A side point about measurement

When my son was measuring the angles for an isosceles right triangle, he read 46 degrees off the protractor. I was too focused on getting to the punchline about all triangles having the same angle sum and I "corrected" the measurement to 45 degrees. He still said some things and we had a conversation about ideal mathematics and real measurement, but I felt it was a missed opportunity.

Seasonal math and dice, dice, dice

who: J1, J2, J3
what did we use: mangosteen(!), dice, a checkers set.

Queen of mathematical fruits

My condolences to everyone outside of Thailand, you are current missing some delicious pre-school math: Mangosteen!

The mathematical secrete is on the bottom of the fruit. The flower shape on the bottom has petals that correspond to sections of the fruit inside. This one will have 7 sections

Just to trick you, this is a view from a different one, with 6 fruit sections.

J3 has been having a lot of fun counting the "flower" petals, opening the fruit, then counting the segments to check.

J2 has been using these to practice subitizing (recognizing number groups without counting them). J1 has just been gobbling down the mangosteen.

Dice Games

A dotty dice puzzle
In school for the 2nd and 3rd grades, we introduced a tic-tac-toe variation using dice where the winner is the first player to make a straight line that is a multiple of 5 (more notes here). For homework, the kids played this game with other multiples, in our case 6. During one game with J1, there was an interesting scenario that I saved to discuss with J2. The board has the numbers as marked and the player has just rolled a 4. Where should you play (you can add 4 to any cell of the grid, remember that you don't want your opponent to be able to make a multiple of 6 on their turn):

Race to 20
For J3, we modified one of the games that we had played in the 1st grade class last week. In this game, two players race to be the first to 20 on a 100 board. In this version, both player has a token/marker of their own. For each move, the players roll 2 dice and choose which value to move, then count up their position on the board. First player to 20 or more wins.

The strategy here is very simple, but it was a good game for J3 to start learning about dice and the 100 board. Once she got the point of the strategy, though, she had her own idea:"I'm going to add both dice together and move that amount!"

Snakes and Ladders experiment
J1 and I tried an experiment with snakes and ladders: a race between two different teams.
Team 1: a single marker that has to move according to the roll of one hexahedral die.
Team 2: two markers, the player can choose which one to move on each turn.
The winner is the player who gets a marker to 100.

Which team has an advantage? How big is that advantage? What if you play so that the winning marker has to land exactly on 100 (otherwise bounces back)?

Knights Move

SolveMyMaths recently tweeted about Knights Move (aka Razzle Dazzle.) Since we are always looking out for more/new games to play, it sounded interesting. Also, we could repurpose existing material to play. The game is a cross between chess and basketball. Below, see J1's set-up:

Yes, we are using icosahedral dice as the balls. Also, the chess pieces on the side are spectators, they aren't part of the action (since this is played on a 7x8 board).

One of the most interesting parts was our ability to experiment with rules. Since we didn't have a definitive version, we felt free to try slight modifications. In particular, we experimented with:

  • Passing: allowing multiple (chain) passes or just a single pass on a turn.
  • Defense: moving into the 8 squares around the ball holder forces them to pass on their turn
  • back-and-forth passes: player who passed the ball has to move again before they can receive the ball (we turned the checkers upside down to indicate they couldn't receive a pass). 

Saturday, June 20, 2015

Crazy Tangles and the order of the months

who: J1, J2, J3
when; a couple of minutes scattered through the day, 5 minutes at dinner
what did we use: two colored pieces of string (shoelace weight)

Playing with string

2 years ago, Fawn Nguyen wrote a note about Conway's Rational Tangles. It was a great activity for her algebra class (so go read her note) and I thought our little ones might enjoy it. While getting a soldering iron to fix a toothbrush robot (another upcoming post?) I found two blue and red string that looked really perfect for this investigation.

There are two moves, twist and rotate. Since Fawn does such a fantastic job of showing these moves, I won't even bother trying to describe them. For us, we made it into a two person activity where we hold different strings in each hand. I introduced the ideas in the following sequence:

  1. told J1 that there were two moves and showed him. 
  2. Then we did a bunch of twists and I counted one each time. 
  3. After that, I told him a twist counts as +1. 
  4. We did a sequence (3 twists, rotate, one twist, rotate, two twists, rotate, two twists)
  5. at that point, he insisted on leading the moves, so he was in charge
J2 had been watching and basically understood the pattern, but we did something similar later as his turn.

J3 had her turn as well and basically just wanted to get tangled up in the string

J1 got very excited about making conjectures about what the rotation operation does. His first guess was multiply by -1. We tested with twist, rotate, twist and found that we were back to state 0. However, when we did 2 twists, rotate, then 2 more twists definitely didn't get us to state 0.
Next conjecture was that rotate subtracts 2, but that also is disproven by the fact that TTRTT(0) is not 0. He is still working on it.

For J2, he liked to get complicated and started out with 10 twists and then a rotate. From that point, he let me call the moves (TRTTRTTRTTRTTRTTRTTRTTRTTRTT) and was totally delighted to see us get untangled back at state 0 after all of that.

J3 got a lot of mileage out of disrupting other people's tangles. This was certainly fun for her, but a bit frustrating for the older two.

Which month is first?

At dinner, I asked the kids which is first, January or February? J1 and J2 quickly said "January."
Next question, which is first, January or March? January again.
Next, January or April? Again, quick answer of January. P interjects, is that going to last?
January or May? J2 again says "January" quickly, J1 is starting to hesitate.
January or July? January again from J2, July from J1.

J2 is pretty clear; "January is the first month of the year, so it always comes first."
J1 has a different idea. It is June now, so our next July will come before the next January. Thus, July is first.

Next question, which comes first, January or December?
J2 again says "January, it is the first month of the year, so it has to come first."

What month comes immediately before January?
J2 says "December."

Note :J3 doesn't really know the months yet, so she wasn't very proactive, but she did enjoy repeating the others' answers.

This question occurred to me when reading Who's the Oldest over at Musings of a Mathematical Mom.

Wednesday, June 17, 2015

Mystery Numbers and a Tricky Pattern (math games grades 1-3)

who: Baan PathomTham grades 1, 2, 3
when: Tuesday morning
where: in school
what did we use: a pack of playing cards, some cube dice

While our second time with the older kids, this was actually our first time with the new 1st grade students since both were out sick last week.

Grade 1

This time, we wanted to play a tricky pattern game involving various ways to write numbers. To start, we all practiced writing the numerals 0-9 using Thai and arabic numbers. To help show the commonality of value, I also included little dot pictures for each. After that, we played a game where I started a sequence, then each child tried to guess and draw a number that would continue our sequence. Here is an example. The guesses that are crossed out are values that don't fit my rule:
This is a re-creation of the actual play. Obviously, the kids have better handwriting than I do

This is a strange game where wrong answers give you more information than correct answers. See if you can figure out what is allowed to come next.

Our friend: The 100 board
We had used 100 boards last week, but I realized that the kids would need a chance to really examine them, notice, and ask questions about what is there. Here are the types of things we discussed:
  • what is the largest number?
  • what is the smallest number?
  • how many spaces are there across the top? what about down the side? what about the long diagonal?
  • when we go down, do the numbers get smaller or larger?
  • when we go to the left, do the numbers get smaller or larger?
Another dice challenge: Race to 20
Armed with our 100 board, we were ready for a new dice game. I think this was my own invention, but I spend so much time reading about games and mathematical activities, that it might come from someone else. If you know who I should credit, please tell me in the comments.
# of players: 2
tools: 2 dice, a 100 board, a small object to mark our position
Game play: first player rolls both dice, chooses one value and adds that to the accumulated sum, moving the marker up to our new position. The next player takes a turn in the same way.
Winning: the first player at or over 20 wins .
Obviously, this gives some adding practice, along with reinforcing the 100 board as a tool for visualizing. After playing a couple of rounds, though, some strategy emerged when we got over 10 as we started to notice that adding smaller values was better than adding larger values. This was a slightly tricky observation since strategic errors don't necessarily lead to a loss, they just increase the probability that the opponent will win.

Most components can be varied: increase the number of dice, use non-cube dice, change the target from 20, increase the number of players. The last one, however, is a bit dangerous as it makes the game even less strategic, though I think that could also be fixed by creating partnerships for a 4 player game.

Homework this week is to play the Race to 20 (or a higher target) 5 times with a parent or friend and to test their parents with the original pattern rule.

Grades 2 and 3

We started with a couple of mystery number puzzles:

  • Mystery couple 1: two numbers that add to 10 and have a difference of 2.
  • Mystery couple 2: two numbers that add to 12 and have a difference of 4
Several students created their own puzzles to challenge me:

  • Student mystery a: add to 16 and difference of 7. I told them to figure out the product of their two numbers, I would write down the product as well, and they could come back and check me.
  • Student mystery b: add to 20 and difference of 5. Good to see some fractions come into play!
We didn't prescribe any particular way to attack this warm-up challenge. For students who were guessing-and-checking and got a bit stuck, we did help them organize their information into tables to make things clearer.

Challenge Josh: make 31 strategies
From last week's homework, kids came prepared with their variations of the make 31 game. For simplified games with either 1s and 2s or 1s, 2s, and 3s, they got to choose the target value and whether to go first or second. To my delight, there were conflicting views in each class, where kids had the same target value, but disagreed about whether to go first or second. I paired up those groups and we got to test it out. In a couple of cases for each class, I accepted the challenge and played against the kids. The results were mixed, I scored my share of victories, but was defeated twice.

More dotty dice
Remember, this family of games is itself a variation of tic-tac-toe, so we have a 3x3 grid, roll a cube dice, and add that number of spots to a square in our grid.  The first version we played was for each square to be filled when it got 6 dots, then the winner was the first to get 3 filled squares in a row. As an alternative, we tried playing so that the objective was to get a straight line that added up to 20.

This version proved unpopular for two reasons. First, squares would get filled with so many dots that it was hard to tell how many were there. Unsurprisingly, that was exacerbated because not every player was very neat about their dots. Second, it was possible to overfill a row so that it already had more than 20.  This week, we introduced a couple of fixes.

First, instead of using dots, we raised the idea of using tally marks. As far as I can tell, this is the whole point of tally marks, so not a surprise that it comes in handy for this problem.

Second, we changed the objective so that the target was any multiple of five, with the restriction that all squares in the line had to be greater than 0 (none could be empty). This variation proved quite popular, so it became the standard for the rest of the class. When played to win, this provides a lot of practice adding since there are so many lines that need to be checked.

Challenge: what square was last played in the RHS version?

Play 5 rounds of dotty dice, either with the target being a multiple of 5 or, for a more challenging game, multiple of 6, 7, 8, or 9.

Drawing, While and Music (5th and 6th Grade Programming)

Who: Baan PathomTham 5th and 6th grades
Where: at school
When: Monday morning

Fifth Grade

Questions and observations from the homework
This week, the students had noticed two things. First, though everyone was asked to draw a triangle as part of the homework, all the versions were different. They've seen this before, but I really like to emphasize that there is no single right answer.

Second, Jung had been playing with message program from the homework and noticed: "it doesn't do anything!" We talked about what they expected would happen (it would write "Hello you" twice). Then I showed them the test panel, where the output from see gets displayed. For some reason, this panel is often closed, so it wasn't surprising that Jung didn't see any output. However, now, they got a surprise because the output still wasn't what they expected. That led us to talk about literal strings and variables and then do an example with write instead of see.

Challenge 1: A map puzzle
For our first challenge of the day, we used a program that Chunly wrote:

My question: can they make this same picture, but without the purple tail on the green dot?
Everyone completed this challenge, but, given the many ways to move the turtle and to draw something, they all had different approaches:

  1. Movement: adjust the purple line from the start, jump back to the origin, use home() to get back, or retrace the path the turtle had originally followed
  2. Drawing: draw a new dot, draw green over the dot, start drawing the purple line only at the edge of the green dot

This simple example got us to experiment with several new commands: home(), pu(), pd(). Again, it reinforced the message that there are many paths to the target destination.

Challenge 2: A plum triangle
For the second challenge, we used Pitchee's triangle from the homework. She had created an isosceles right triangle through trial and error on the hypotenuse length:

For this challenge, we added scale 10 at the start of the program (to make all the drawing elements gigantic) and ht() at the end so that the turtle wouldn't block our view. Following this, we started discussing:
What did we notice? Why was it like that? What could we do to fix it? Is this a bug or a feature?
This is something we will continue next class.

For this week, the homework is to test out the code on the right side of this page:

Sixth Grade

While we make music
Last week, students noticed the play command. I wanted to build on this by giving them more examples of ABC notation,  but I also wanted to review while and logic keywords if, and, or. In retrospect, this idea was too ambitious for one class.

Through a series of stages, I wanted them to think about how many times each line of music got played based on when and how often the conditions in the if statements were true. This was actually hard to tell and it would have been better to give them visual signals instead (or in addition).

I think we will have to return to these key words again next week. We will also discuss the guessing game that we've been writing.

Projects begin
Last week, the kids submitted outlines for their term projects. These are the ideas:

  • Boongie: a clue-and-guess game where the computer plays different animal sounds and then the player enters the name of the animal.
  • Win: a driving game where we control a car that drives along a path avoiding obstacles. The screen mechanism he wants is  to keep the car fixed vertically and have the path scroll down.
  • Gan: a chasing game where we try to move around the screen collecting point-objects while avoiding bombs and keeping away from an enemy turtle who is chasing us. 
  • Titus: a version of space invaders.

The homework for each depends on their project:

  • Boongie: Find sound files for as many animal sounds as he can locate
  • Win: work on how to control the car's left-right position with the mouse, while keeping the vertical position fixed.
  • Gan: he had found a program that did many of the things he wants in his game. One homework element is to go through that code and come up with questions about thins he doesn't understand. The second component is to figure out how to create point-objects to appear randomly on the screen.
  • Titus: Create a sprite that can shoot lasers. 

Tuesday, June 16, 2015

Is John a liar? and other good puzzles

who: J1 and J2
what did we use: Smullyan's Alice in Puzzle Land and some online games
when: after dinner

This post is basically a thank-you to all the people who create wonderful books, puzzles, and games. Also, thanks to the people who spread the message by telling us about these resources. In this case, we're directly indebted to A O Fradkin, Annie at the Math Forum, Mike Lawler for these specific activities.

Alice in Puzzle Land

The title of this post comes from one of the opening puzzles in Smullyan's book of logic puzzles: Alice in Puzzle Land. Here's how it goes:
John, and his brother, have the peculiar characteristic that one always tells the truth and the other always lies. Unfortunately, we don't know which one tells the truth and we don't know which one is John. Gosh, we don't even know John's brother's name! What single yes/no question can you ask one of the brothers to figure out which is John? 
What if we want to figure out whether John always tells the truth or always lies, what single yes/no question can we ask one of the brothers to determine this?
To be honest, I didn't get the answer, but J2 managed to figure it out after they posed a bunch of questions and we worked through the possibilities together, example "what if the one we are asking is John and he tells the truth?"

The Js (mostly J1 and J2) have had a lot of fun discussing this particular challenge and have also really enjoyed the tart-ingredient thieves series. They are currently working on the "very complicated logic puzzle" at the end of the first chapter to determine whether the Gryphon or the Mock Turtle was the tart thief.

SolveMe Mobiles

Since we started teaching the math games class at school last year, I have had a strong bias away from on-line games and puzzles. Part of this is simply that we wouldn't be able to use these puzzles in the class, but also because I wanted to help parents see that they don't need any special tools to help their kids have deep mathematical experiences.

Anyway, the SolveMe Mobiles and Game About Squares (below)  helped me recognize and reject this bias!

The mobile puzzles are from EDC, a group with which I am not affiliated, but which I hold in high regard. Each puzzle gives you a balanced mobile that, secretly, codes equations to solve for the weights of the various shapes. J2 (5yrs old) has especially enjoyed this and has just finished puzzle 51:

Even J3 (3yrs old) has gotten something out of this puzzle. She was looking at the screen and we (J0, J1, J2) asked: what do you see, what do you notice, what do you wonder (not all at once.) She talked about shapes, she talked about how many, she asked questions about what different things meant, she tested putting numbers into the blanks.

Game About Squares

Another cool puzzle: Game About Squares. I don't know who to thank for creating this and making it freely available, but it was part of a really nice Notice and Wonder post by Annie which is, itself, great and you should go read it. In the spirit of the game, I'm not really going to tell you much about it, just go play!

Monday, June 15, 2015

Bath-time math

Who: J3
When: bath before bedtime
Where: bathtub (of course)

A simple, but classic bath-time investigation: which container holds more water? We've got three, and it is easy to see that the white cup holds less than the other two. However, comparing the silver and blue isn't so easy. Are they the same size? If not, which is larger?

J3 started with the basic technique filling one with water and then using that to try to fill the other. Then, she moved on to usin a common measure, counting how many white cups were required to fill each of the larger containers. Her technique was very splashy, so I wouldn't say every cup of water was equally full or that every drop successfully made the transition from cup to bucket. At this stage, the play was about the spirit of the investigation, the joy of counting, and the fun of splashing water around the bathroom.

More math around the house

Triplet of decorative paper airplanes (courtesy of J1)

A mathematical pizza (courtsey of J2 who made the dough and J1 who snapped the picture)

What's mathematical about pizza? Measuring ingredients, tracking the time to mix the dough, talking different shapes for the base (circle and rectangle are never quite achieved, of course), temperature of the oven, time to cook, ways of cutting, probability that any will be left for mommy or daddy to taste....

Wednesday, June 10, 2015

Sunburst and guessing (5th and 6th grade programming)

Who: Baan PathomTham 5th and 6th grades
Where: at school
When: Monday morning

Fifth Grade

Note: My original intention was to focus on discussing the homework and making some extensions. Because one student wasn't in school and I had especially wanted to use her code, we changed plan slightly.

Other interesting code
Between classes, the students spent a lot of time exploring code they found from other people. I started by asking whether they saw anything that was interesting and they wanted to understand better. There was a quick response, focusing on two programs:

  1. The jump command in this sun:
  2. How to make new turtles, like in this chasing game:

These were really great questions and gave us two interesting examples of how to understand code that we find.

Jump (jump, jump)
Basically, I walked the student through the process I follow for understanding a new command: play with it, test it, put it in a bunch of different situations, and see what happens. We created new files (mostly with names like jumpPlay) and then started adding jump commands. It quickly became clear that we needed something to help us see what was happening, where the turtle was jumping from and to, so we started adding dot between the jump commands.

I asked them to keep playing and testing until they thought they understood jump.  While waiting, I wrote a little code with some jump lines and, for a twist, an rt 90 in between. When they said they understood, I asked them to guess what my code would do. The effect of changing the turtle's direction surprised everyone, but soon they had a new explanation.

We wrapped up this section by briefly discussing a picture of grid coordinates, but this will have to be continued next session.

The chase game uses 3 turtles, so how do we create the extra 2? I pointed out the hatch command and then we followed some of the same steps as for jump. We didn't have time for me to do a challenge program to test their understanding, but we can include that in the next session as well.

Both jump and the chase program illustrate the importance of context to understanding the code. In the case of jump, copying an isolated line from the sun program will still create sensible code, but it might not do the same thing if the turtle isn't starting in the same location or pointing in the same direction. For the chase program, though, there are many lines of code that simply can't be interpreted if taken out of context. For example, line 15:
e.jumpto -250,-100
Because this requires an object e, it has to be preceded with code that defines or creates that object.

For homework, I asked the students to notice and wonder about any interesting code they find. In addition, I wanted them to try to create the pictures on the left hand side of this set of exercises:

Sixth Grade

Guest Teacher
For sixth grade, we had a guest teacher: Win. They are currently trying to solve a problem that he attacked in his project from last term, so I asked him to talk about his prior solution. In that case, he had two loops running, one for loop to ask many calculation questions and an inner while loop to give the student several chances to get the right answer. In our case, we are currently working on improving our guessing games so that the player has multiple chances to guess.

A musical interruption
As Grade 5 had found, there is a lot of interesting code out there. Several students had found a snippet of music playing code and wanted to investigate. I have to admit I didn't handle this unexpected interest as well as I had for the earlier class. I will craft an exercise related to ABC notation and the play command for next class.

Since I want to build on the guessing game, we need to finish that code. Homework this week is to add the right components so that the basic guessing game is complete:

  • a random number is chosen
  • the player gets several chances to guess the number
  • after each guess, they get feedback on whether their guess was too high or too low (if it wasn't correct)
The part that is currently challenging is to create a loop that will allow multiple chances.

Tuesday, June 9, 2015

We learn to simplify and Dotty Dice (math class 2 Y2)

who: Baan PathomTham grades 1, 2, 3
when: Tuesday morning
where: in school
what did we use: a pack of playing cards, some cube dice

While our second time with the older kids, this was actually our first time with the new 1st grade students since both were out sick last week.

Grade 1

To get started, we did some skip counting by 2 and counting backward from 20. For counting backward, we got a funny reaction when it came time to say 0. At this stage, neither student was willing/able to go below 0, but we did get to talk a little about whether there are numbers below zero. Next time, we will make this a more explicit part of the class.

Dice sums and re-roll game
Our first game is a simple one. All players have 2 dice (regular, 6-sided, for now). Players roll their dice, identify the numbers that are showing and say the addition number sentence. For example, if someone rolls a 2 and 3, they would say "this is 2, this is 3, 2+3 is 5." Next, they choose how many dice to re-roll, either all, one, or none of their dice. Once everyone has re-rolled, they again talk about the numbers showing, the addition fact, and then figure out which player got the largest sum.

We played a sample game to show them how it works and then split up, one student playing with Pooh and another playing with Josh. As we played, we would ask various questions about what they noticed and why they made certain choices. For example:

  • How many sides are on the dice
  • What numbers are on the dice? What is the largest, what is the smallest?
  • What is the largest sum they could get? What is the smallest?
  • What do they think of our choices? Did we play well or badly?

While we were playing, we noticed there are actually two slightly different versions. In one game (Version A), all players choose which dice to re-roll and then roll at the same time (or, equivalently, in secret). In Version B, players take turns deciding what to re-roll.

We only played as a 2 player game, but there are additional variations if we include more players. Again, they can re-roll simultaneously or in sequence. However, you could also add a points system based on which player has the largest sum, the second largest, etc.

We asked the students to play this game at home. They should play Version A and Version B at least 5 times (play at least 10 total rounds). Are the games the same or different? Do they use different strategies? Why or why not?

Grades 2 and 3

As with grade 1, we began the older kids with skip counting warm-ups. We did two things slightly differently that I wanted to note. First, when we said that we would skip count by 7, several of the kids grabbed their notebooks with the times table on it. Instead of starting with 0, though, we started with 2. Second, I sat next to one of the students and had him secretly point to the numbers of the sequence on our 100 board while waiting for his turn. That also made it possible for him to predict what was coming next and to figure out the number he would say, which he thought was really cool.

31 strategy
The homework from last week involved playing a variation of the 31 game and investigating strategy. Almost none of the students ended up playing the original 31 version. Instead they generally played with 1 (ace) through 10 with a target of 71. When we talked about strategy, almost everyone had figured out that there was something interesting happening in the 60s, with several ideas that you wanted to make 60 on your turn, though there were some thinking 61 was an interim target. Everyone acknowledged there was complexity if you had already used up all of a particular number and there were some ideas about explicitly forcing that outcome, mostly looking at using all of the aces or other small values.

No one felt they had a clear strategy and no one was sure whether it was best to be first player or second.

I told them this wasn't surprising because the game is actually pretty complex. One of the ways we can get a better understanding is to make it simpler. We then talked about ways to make the game simpler (use fewer card values, have a smaller target) and then began to investigate.

  • Ace only: the simplest game we wanted to study was to use only 4 aces. What is the largest target we could use? I joked in each class about playing to 1000. For all the reasonable targets (1 to 4) who wins, first player or second player? This was very easy, but I wanted to emphasize that it is great to start with something we really understand well as preparation for jumping into a more complex version.
  • Ace and 2: an obvious next step is to add the next value card. Again, we talked about what the largest reasonable target is and then stepped through strategy for different targets. First player has a winning strategy if we target 1, 2, or 4, while the second player can win targeting 3. Are there any values larger than 3 for which the second player has a winning strategy? We didn't talk through all strategies for all targets, so this is part of the homework.
  • Ace, 2, and 3: stepping up again. This time, we played a couple rounds with a target of 24. I was slightly surprised that this held their interest, even on the second round. Again, we worked a bit on strategies for different targets, but we didn't talk through it completely, so this is part of their homework. One student guessed that 17 might have a different strategy to smaller targets. 

Dotty Six (another dice game)
The basic idea for this game family comes from NRich, so I won't repeat the basic rules. In addition to the dotty six version, we played a dotty ten version where each cell of the board is only filled once it has ten dots (or tally marks) in it.

Homework (grades 2 and 3)

  1. For the Aces+2s variation of 31, find a target larger than 3 for which the second player has a winning strategy.
  2. Prepare to challenge Josh: for the Aces+2s+3s variation of 31, choose a target (larger than 4) and whether you want to be first or second player against Josh.
  3. Keep making observations about the strategy for these games.

Monday, June 8, 2015

Math is all around (proof without words)

Ok, I can't resist writing a little explanation. These are pictures of activities from the last 2 months that never quite made it into blog posts or, if they did, I just like the pictures and wanted to show them again.

A fractal tree made from rummy king tiles (part of our Natural Math/Moebius Noodles Multiplication explorers course):

Another fractal tree:

Is it an alien or a self-similar bug? How many body segments would we need to draw for the next smaller level?

Family Tree fractal:

I think this was a substitution fractal, again, Multiplication Explorers:

Halving sequence, another activity from the Multiplication Explorers course:

This little piece was 1/16536th of the starting square (2-14)

How many animal hybrids can we make?

Many ways to make a whole. How many ...?

Even in the round:

A version of Pascal's triangle made into a puzzle. I think we made all the cells mod 10. Hand cut!

Some pictures we saw at an exhibit in one of the halls at NASA in Houston. We did our own calculations and didn't agree with their claims about how many stamps or how many coins were used.

Finally, a couple of nice magic squares, fraternal twins or identical? I can't take credit for this, but don't remember where I saw it (prob on twitter):

Tuesday, June 2, 2015

31 Game (math class 1 year 2)

who: 2nd and 3rd grade at Baan Pathom Tham school
when: Tuesday morning, around snack time
what did we use: regular playing cards

In our class today, we mostly borrowed the game 31 from Dudeney, via Denise at Let's Play Math. You can find the basic rules there, so I will write about slight variations we played and our experience playing with the kids.

The first modification we made was to start playing as a group instead of head-to-head. Going around in a circle, each student took a turn choosing a card from the grid and adding that value to the running total. This made the game less competitive and involved more people. Because it was less competitive, the kids were willing to choose cards fairly randomly and speed up game play. This was a big advantage for introducing the game, otherwise a couple of the more competitive kids wanted to take a long time thinking through the game to work out their own strategy.

This version also offered natural points where we could ask the kids to look ahead to see who would be able to reach 31, with everyone participating in the question.

After playing this version for a while, we split up and continued this way with half the class. After another couple of rounds, we split into teams and played head-to-head.

Finally, we added cards 7, 8, and 9 to the grid and played to a target of 61.

*Update*: After talking to one of the parents about this game, we came up with another variation. For this, arrange the cards in order 1 to 6, but turn them face-down. Players then alternate turning the cards up and the running total is the sum of the cards showing. Two reasons for considering this version: first, it provides an extra pattern for the kids to consider when they are deciding which card to turn and, second, it is easier for them to recalculate the running total based on the values they can see than the ones they can't see.

In the basic strategy for the 31 game, the numbers 24, 17, 10, and 3 have special significance. As we were playing, most of the kids recognized the importance of 24. A couple were also able to work back to 17. I didn't see anyone fully work out the associated strategy. Then, it will be fun to see if they can figure out that this isn't a complete strategy for the game.

When playing the game, the kids who just wanted to play randomly were still very interested in questions that hinted at strategy. For example, I would pause the play briefly to ask whether either one had a winning strategy from that point or for someone to explain why they had made a certain play. Generically, these were good conversations.

The kids who wanted to figure out a strategy were generally less fun as playing partners because they were cautious and slower in their play. I'm not sure whether this is a feature or bug.

In second grade, all of the games ended exactly on 31. In third grade, they managed to get a couple of endings where 31 was impossible. I don't think they were yet able to work out exactly what happened to create that result.

Finally, I am looking forward to discussing the targets. Is 31 a good value for the 1-6 game? What would be different if the target were lower or higher? What about the 1-9 game or 1-10 game? What makes a good target anyway?

Playing either A (value of 1) to 9 or A through 10, play 5 times and record the outcome. Write down your thoughts on strategy for how to win this game.