Monday, August 17, 2015

Language games (first class)

We had an opportunity to spend some time with the 2nd grade class today playing some language games.

Warm-up
Not exactly a game, we got them started with a quiz on some frequently written words:
a, the, and, I, to, was, my, of, we, he, she

After the quiz, the kids took turns writing the words on the board and we talked about a couple of tricky points:
  1. "to" vs "two:" yes, they sound exactly the same, but mean different things. No one thought about "too" at this time (isn't English wonderful?)
  2. "th" sound: one of the English sounds that doesn't appear in Thai. Actually, there are two distinct sounds made by the "th" combination, but even most native speakers don't realize this (compare "this" and "with.") The fun thing about "th" is that we can exaggerate and stick out our tongues!
  3. "sh" is another one that doesn't exist in Thai
We gave out a list of top 100 sight words and will quiz another 10 (or so) next week. We talked through some practice/memorization strategies so everyone can prepare.

Making words (PDQ variation)
We have a set of cards to make 3 letter words. On one side, the cards have parts of pictures and a letter, so when you put the 3 matching cards together it will spell out a 3 letter word that describes the picture. For example: cow, zoo, hat, pin, fin, etc. The other side just has the letter in larger size.

For our game, I drew out two cards and showed the letter side. We then competed to make words that contained those two letters. To practice, we all worked together.  After getting comfortable, we split into two groups. For each round, two kids would go head-to-head, but their teammates could give them suggestions. The winner of each round was the person who came up with the longest word that uses both letters (though we sometimes awarded the person who came up with the most words). and that team would get the two cards.  Each round took 1-2 minutes.

A boggle twist
After going through all the players a three or four times, each team had collected a decent collection of letters. We then gave them 5 minutes to write down all the words they could make using only the letters they had collected.

Summary
Together, we found these activities were fun and engaging for the kids and good practice spelling. I think the slightly different mental processes involved in the two games made a good combination for the session.

The kids were making active use of their 100 sight words lists, so this turned into a good way to familiarize them with the list and give them some extra motivation for learning all the words.

Friday, August 14, 2015

math games class: 24 game and connect 4 dice

First grade

As a warm-up, the first grade played tic-tac-toe. This was to prepare them for the main game of they day: dice connect 4.

Dice Connect 4
Two players alternate occupying spaces on this grid:

The constraint is that, each turn, the player first throws two dice and then can only select a space in the column that corresponds to the sum. The winner is the first to get four in a row (horizontally, vertically, diagonally.) In our version, the winning spaces need to be a chain of neighbors, in the sense that each space has 8 neighbors.

Second and third grade

In both older grades, we played the 24 game. I saw this mentioned recently on Benjamin Leis's blog about his own math club (maybe just in passing here, I thought he had a more extensive post about the game elsewhere, too).

We played the "war" variation:
players: 4 (when necessary, three players can have a ghost player, or two players can modify each round slightly)
material: deck of playing cards with face cards removed
set-up: deal out all cards to the four players, cards stay in piles face down.
each round: players all turn over the top card in their pile and then race to get as close to 24 using the values of the four cards and standard arithmetic operations. In our version, we allowed addition, subtraction, multiplication, and division, but we didn't insist on using all four cards. When we played, someone would call out a value they could make and the number of cards, say "21 with 3 cards." The other players would then have a minute to try to improve that, either getting closer to 24 or making the same value with more cards.

The player who wins each round collects the four cards and puts them on the bottom of their pile, face down.

Ending the game: when any player runs out of cards, the game is over. The player with the most cards wins. Note: you can also keep going until only one player remains, but this wasn't suited for classroom play.

Playing at home: As mentioned above, you can play the game with 2-4 players. With two players, just have each player turn over their top two cards. With three, we used a dummy/ghost pile of cards to make sure each turn had four open cards. Another variation that is flexible is to keep all cards in one pile, turn over four each round, and then the player who is fastest or has the best result collects them. After the main pile is exhausted, the winner is the player who collected the most cards.

If no one else is available, this can also become a practice or puzzle session. Just turn over 4 cards and see how close you can get to 24. Write down your equations!

Sunday, August 9, 2015

Bullseyes and spirals

Fifth grade

The class focused on using variables and for loops in our spiral programs from the homework. Here are the programs the kids wrote:

More Variables and Loops

For the class, we worked on "refactoring" the spiral programs. First, we noticed that the spirals consisted of repeating lines of code that were all similar, for example:
rt 180, 20
rt 180, 40
rt 180, 60
rt 180, 80
rt 180, 100
Whenever we see the same code repeated, we should think about using a loop in some from. In this case, however, the code isn't perfectly identical, each line changes the size of the arc. That gives us the idea to make that size into a variable that can change in each iteration of the loop. Playing withthe basic programs, we learned the following about variables:

  • variables can have (almost) any name. The name is just a label, the computer can't interpret the label to figure out what the variable is supposed to do. We tested loops that used variables name size, howBig, and our names (in English and Thai).
  • if you use a variable without telling the computer what it is (either defining the values in a loop or with an explicit assignment) then the computer can't make sense of the variable. This is particularly a danger if we change the name of our variable, but accidentally leave some uses of the earlier name.
  • pencilcode already understands some words (dot, fd, rt, green, etc). We are allowed to use those as variable names, but it will create strange effects if we also try to use the default definitions. A great example is here: http://tatia512.pencilcode.net/edit/forrube and here http://jung.pencilcode.net/edit/green
In the for loops, we mostly played with different ways of specifying the list of values to iterate:

  • explicit list [20, 40, 60, 80, 100]
  • [100..20] by -20
  • using a reference variable (e.g,. for x in [1..4] and howBig = 100 - 20 * x). This is something we will expand in the future.
  • also, a key issue we considered was what happens when a command is in or outside the for loop!
Note: almost all of these observations and forms arose naturally from things the kids were trying in their investigations.

For future discussions

Homework

Reproduce the bullseye using a for loop and variables instead of individual lines of code. Recall this picture: 


We want to use for loops and variables so that we can easily change the size or colors of the bullseye.

Sixth grade

bullseye loops

We recalled the code paradigm
for x in [1..10]
  write x #don't forget the indentation!
We continued to test variations of the use of variables and for loops, quite similar to the discussion in Fifth Grade. The bullseye is giving a particular challenge because we want to take similar, but not identical action on alternating iterations of the loop. Here are a collection of techniques we identified:

  1. each iteration, create both the black and the white dots. The challenge here is to control the sizes so that all the bands end up with reasonable/pleasing sizes.
  2. find a way to alternate which color is used. Titus figure out he could do this with an if statement.
  3. Use a double for loop, possibly taking advantage of the counter reference variable that pencilcode for loops give us. That is, for color, iteration in [black, white] will loop two times with the following values: color = black and iteration = 0, then color = white and iteration =1. here is an implementation that solves our bullseye problem: http://titusorc.pencilcode.net/edit/project/dot/8-dots

A key point of confusion was whether to have the looping values increase or decrease.

Homework

Create your own version of this spiral team program:


It is possible that the kids won't be able to complete the whole program, but I would like to see how much progress they can make decomposing the picture and separating components of the program.

Other notes
flowers
change an old polygon program to a star maker

Equal? Ambiguous test questions

We have been looking at questions from a local exam contest. I thought two were worth discussing.

Climbing a mountain

Kaew had been in the mountains climbing for the last four days and recorded her distances on this graph (the first one below). The other graph shows the climbing distances from Ploy.


Below the graphs are 4 statements by other people and we're asked how many of the statements are true. The statements are:
  1. Weera claims: "Each day, Kaew climbed more than Ploy."
  2. Piti claims: "Kaew climbed more than 10,000 meters, in total."
  3. Mana says, "In total, Ploy climbed more than Kaew."
  4. Choojai says, "Each day, Ploy climbed 500 meters more than Kaew."
How many statements are true?

The math class answer

I'm only really interested in statement 2, did Kaew climb more than 10,000 meters?
In math class, we often ask students to enter a world of perfect accuracy and exact logic. Usually, the questions in this world only involve "nice" numbers.
Entering that framework,  we see that Kaew climbed 1500m+3000m+2000m+3500m = 10,000m
Because she climbed exactly 10,000 meters, she did not climb more than 10,000. Piti's statement is false.

Why is this unsatisfying?

We have two issues. First, how accurately did Kaew record her climbing distances? Second, how accurately are we reading the graph? Surely there is uncertainty here that prevents us from having any confidence in assessing Piti's comment.
My sense is that the data is accurate to the nearest 500 meters (so each day's distance is ±250m). Based on that, I feel confident that Kaew climbed between 9000m and 11,0000m over the four days.

Taking our medicine

In another question, we are told that a pack of pills comes in a 3x3 grid, pictured below. Each day, the patient has to take 3 pills. We are told that once a pill has been taken, the patient can't take a pill from the same row or column. How many ways are there to take the medicine?

Interpretation
How did you interpret the question? I guess you thought that each day the patient can take only one pill from each row and column, that we are asked how many ways the patient can take this medicine over three days. Right?

Looking carefully at the question, I came up with five interpretations:
  • no two pills back to back from either the same row or column on the same day vs no two pills in sequence from the same row or column (possibly over two different days) vs no two pills on the same day from either the same row or column (choice 1)
  • how many ways to take the medicine on the first day vs how many ways to take all 9 pills over three days (choice 2)

Putting it in perspective

I'm glad that we had ambiguous questions on the contest paper. It undermines the authority of the exam, the idea that there is only one right answer, and the importance of answering questions correctly. Instead, we are left with a collection of prompts that can lead us to interesting thoughts and interesting discussions.

Wednesday, August 5, 2015

math games class

First Grade

Warm-up
As a very quick warm-up, I asked the kids about days of the week: for example, what day follows Monday? what day precedes Friday? This was more challenging than I expected and I think need to practice.

First Game: number line squeeze
We made a number line with integers marked from 0 to 20. To start the game, I think of an integer in this range. Then, the kids take turns guessing. With each incorrect guess, I will give them an extra clue: "my number is smaller than [the number they just guessed]" or "[guess] is larger than my number," etc. When they get this clue, I had them draw a bracket on their number line, ( when their guess was too small and ) when their guess was too large.

This is a quick game to help encourage their familiarity with the number line and some logical inferences. For example: if they already know that 5 is too small, what do they know about 3?

We also took turns where they picked the secret number.

There are a couple of extensions we can play in the future:
  1. Allow them to ask about ranges, for example: is the number between 5 and 11?
  2. Ask "or" questions: is the number smaller than 3 or larger than 15?
  3. Ask calculations: is the number equal to 3+4? 

Don't make a triangle
Our second game was a fun one from Math4Love. Don't make a triangle. The idea is simple: draw a bunch of starting dots in black (we used 6). Each player has a chosen color takes turns connecting the original dots. You lose if you form a triangle with all sides of your own color.


This was a fun game which, as you can see, leads to some pretty pictures. Especially when we play this back to back with tic-tac-toe, it leads to an interesting question: can the game end in a tie? Why or why not? Subtle stuff for first grade.

2nd and 3rd grades

Our game this week was related to Dice Miner from last week and comes from friends at Logic Mills in Singapore. As with Dice Miner, players start with 11 tokens of the same color and we play on a grid with columns labeled 2 through 12. This time, though, the grid has 8 rows, 3 players use the same grid at one time, and we had three extra markers (we used loom bands).

On each player's turn, they throw 4 dice, then choose to group them into two sets of two. They take the sum of each set and place a temporary/common marker (the loom bands) in the columns. After marking their territory with the temporary markers, the player has a choice: throw again or claim their progress by placing one of their tokens on the spaces they've reached. If they throw and can't place a temporary marker (there are only 3 at a time!) then they lose all of their progress for the turn.

When a player has reached the top row of a column, they claim that number. The first player to claim 3 numbers wins.

For those who like this type of classification, the game has a territory conquest objective played through a race-against-each-other mechanic.

Here are some pictures, mid-play.

In this picture, orange has capture column 7. Now, any two dice that sum to 7 are safe for all the players and orange is 1/3rd of the way to victory.


A bit later, we see that blue is close to claiming 9 and pink is close to claiming 6, but orange is close behind there.

In a different group, white is close to claiming column 8, but a good turn from yellow could disrupt that plan.




Monday, August 3, 2015

Variable Ladder of abstraction (Programming classes)

Fifth grade

We started by discussing the homework from last time: drawing a 5 pointed star:
The students had two key questions from this activity:
  1. How do we get the star to close up exactly, making the final stroke end at the starting point? This question we are saving for a later class.
  2. how do we make a regular star (all sides and angles equal)? This served as the focal activity for the rest of the class.
Start with regular polygons
We noticed that a regular pentagram has a pentagon inside. How can we make a regular pentagon? As they wrote programs to meet this challenge, they quickly recognized that they could repeatedly move forward and turn, but the key issue is how much to turn.

I had already prepared this toy to help us investigate that question:

The code is here: Exterior Angles Toy. As desired, they noticed that the exterior angles have to add up to 360 degrees. To get every angle the same, we divide by 5 to get 72 degrees.

As a next step, we had them modify the program to use a for loop.  This opened up an opportunity to explore regular polygons with more (or fewer) sides and, again, the question of what the exterior angles should be.

Variables to the rescue
As we played with examples, we noticed that there are two key part of their code that need to change when they change the number of sides: the number of repeats in the loop and the angle. This leads us to two ideas that we will develop further next week:

  1. use a variable (numberOfSides, or something similar): how, when, why?
  2. get the computer to calculate the correct angle: how, why?


Here are our whiteboard notes from the class:



For reference next time, we will also talk about these ideas based on our flower programs from the prior session (our final session of last term):
Homework
  1. Draw a spiral that starts from the inside and grows outward
  2. Draw a spiral that starts outside and shrinks to the center
You can see where we explained the spirals on the whiteboard above.

Grade 6

Variables
Parallel to the discussion in Grade 5, we set a sequence of challenges around the use of variables. As it turned out, this was hugely helpful in revealing gaps in the students' understanding.

We started with a simple bullseye program: manual bullseye.

An easy program, now, what if we suddenly decide we want the bullseye to be bigger? The students came up with three solutions:
  1. add a command scale 3, for example, to the beginning of the program. This is a good approach because we then control the size with a single parameter in one location. One problem using this is that we then scale any other movement or drawing in the rest of the program, though that can also be fixed with a "closing" scale command to shrink back to normal size.
  2. manually change all of the parameters for the dots. This actually encompasses many different changes, depending on what relationships you want to preserve between the size of the layers. For the most part, the students chose to preserve the absolute difference in the sizes (e.g., 90-72-54 got changed to 108-90-72). The weakness of this approach shows up right away when the "client" asks to have the size changed again.
  3. add a variable to control the size. 
Again, there were many different ways to incorporate a size variable: linear differences (size - 15), proportional differences (size * 2), or inverse proportionality (300/size). We investigated these different approaches and talked about strengths and differences.

Non-numeric variable
After sorting out some ways to control size, the next "client" demand was to change the color of the black layers to blue and, later, to green. This flagged the fact that we could have a variable that is a number, as with size, or a color, or a string.

Variables allow flexibility
One of the key ideas from using variables is that they give our programs greater flexibility. That's particularly true when we combine with a loop, so, naturally, our last challenge was to try to reproduce the bullseye with a for loop. That was left for homework.

Homework
Finish the bullseye version using a for loop, get ready for some unreasonable demands from the teachers to change the number of layers, the sizes, and the colors!


Side note and future reference: 
Other interesting things the students have discovered, but which we didn't have time to discuss:
  • http://chunly.pencilcode.net/edit/triangle
  • donut loop: http://jung.pencilcode.net/edit/O./donut
  • nice fish: http://tatia512.pencilcode.net/edit/FISH
  • input/output: http://jung.pencilcode.net/edit/O./myprogram
6th Grade Projects
  • Gan chase game
  • Boongie animal sound recognition
  • Titus: space invaders variation
  • Win: car driving game