Saturday, November 29, 2014

Blog tools

We've gotten feedback that it is hard to find particular content and navigate our blog. Today, I added two utilities that should help.

Search bar: pretty standard for all of us who use Google search everyday.  I haven't experimented much to see how the pages get ordered, so I'm interested to hear whether this is helpful.

Tag cloud: we try to tag all of our posts with key words.  These are shown with the most frequent tags at the top in a larger size, while the least used are small at the bottom. Clicking on a tag will take you to the collection of posts with that label. Make sure to check out some of the little-used tags as they are references to fun games or explorations.

What do you think? Is this enough structure to get you to the content you want to see?

Flowers, Squares, and Functions (programming class 11)


who: Baan Pathomtham Grade 5
when: Monday morning
where: at school



Homework review
Forests/flower gardens (some of these were old?): 

Boongie made two versions: 
The first led very nicely into functions, the topic of the day as he had put the petal drawing into a function.  The second was a really nice cap to our discussions about for loops. In his original version, it drew one lime flower and three blue ones. Working together, the class modified the code so that all the flowers were a different color.

Win showed us his flower program, cryptically named untitled5: http://win.pencilcode.net/edit/untitled5

This is a good candidate for streamlining using a function.  Something for him to consider over the week.

To round out the discussion, I showed two related programs that I had found from other users and modified: http://jgplay.pencilcode.net/edit/otherPpl/flowerPattern
and http://jgplay.pencilcode.net/edit/otherPpl/forestRand


We didn't discuss this program as Titus thought it had gotten lost: http://titusorc.pencilcode.net/edit/flower/flowers

Focus for the day: Functions and vectors
Today, our plan was to build up a more complex function structure based around drawing some simple squares.

The first task was just to create a function that would draw a single red square. This code is an example.

Once completed, we added an input variable that would allow them to control the size of the square. Finally, we wanted them to make nested squares that would show why it is useful to capture a block of generic code in a function.  Here's our example.

At this point, Kan had two interesting ideas: First, he wanted to add the color as a parameter to the function.  That was pretty easy, but it was a nice way to see that functions can take numbers and words (in this case a color keyword) as arguments and that they can take multiple arguments.  His next idea was to include a variable that would tell the turtle to move after drawing the square. I've copied his code here 

http://jgplay.pencilcode.net/edit/class/kanBoxboxboxbox1234

He wasn't quite sure how to properly call the function.  Notice what he did: three arguments to the function, one of which is a vector!  Good stuff . . . and we will discuss this more next time.


We also talked about the idea of functions in mathematics and worked through three examples:

  • f(x) = x+2
  • goal(y) = 2y
  • birthday(name) = {the day of that person's birthday}


Homework
The challenge this week is to write the birthday function that will work whenever a member of their immediate family is entered as the input variable.  This is not going to be easy, so we expect them to experiment, explore, and ask questions if they get stuck.

Some other interesting code
In preparation for the class today, I noticed Kan had created this program:
http://jgplay.pencilcode.net/edit/otherPpl/kanthapStinky

Both Win and Kan had these programs

At some point, we will return to these programs to talk about what they do and why.  I know the two were experimenting with them at the end of class and I'm eager to see what they can discover.

Wednesday, November 26, 2014

เกมคณิตศาสตร์ ป.1 - ป.2 (25/11/2014)

เกมใกล้เข้ามาอีกนิด

Source: Snugglenumber by Anna Weltman 
Link: http://recipesforpi.wordpress.com/2013/10/16/snugglenumber/

สิ่งที่ต้องเตรียม: ไพ่ 1 สำรับเอา 10, J, K ออก
วิธีเล่น:
     ๑. แจกไพ่คนละ ๑๑ ใบ
     ๒. ให้ A แทนเลข ๑ และ Q แทนเลข 0
     ๓. เด็กๆจะต้องนำไพ่ทั้ง ๑๑ ใบมาใช้ โดยที่ไพ่แต่ละใบใช้ได้ครั้งเดียว ให้เอาตัวเลขตามไพ่ที่ได้มา             ใส่ในช่องตามแผ่นเกมที่แจก (ดูตัวอย่างข้างล่าง)

              0     ____
              5     ____
             10    ____  ____
             25    ____  ____
             50    ____  ____
            100   ____  ____  ____
   
     โดยนับคะแนนดังนี้
            - ได้ ๓ คะแนนถ้าไพ่เท่ากับจำนวนพอดี
            - ได้ ๑ คะแนนถ้าค่าต่างไพ่กับจำนวนที่ต้องการไม่เกิน ๖
            - ไม่ได้คะแนนถ้าค่าต่างไพ่กับจำนวนที่ต้องการเกิน ๖
            
     ตัวอย่าง:
            มีไพ่ในมือดังต่อไปนี้  2, 2, 3, 5, 6, 6, 7, 8, 9, Q, Q  นำมาเรียง

              0     _Q__
              5     _6__
             10    _2__  _7__
             25    _2__  _8__
             50    _5__  _3__
            100   _Q__  _9__  _6__
  
         คะแนนที่ได้คือ 3, 1, 0, 1, 1, 1 รวมกันได้ 7
 
Update: some pictures of players in action




Monday, November 24, 2014

Nested Loops Review (Programming Class 10)

who: Baan Pathomtham Grade 5
when: Monday morning
where: at school



Reviewing last week assignment

Last week, students were asked to draw this shape using double for loops if possible.  Only 1 in 4 students managed to use double for loops but none of them see this as drawing a triangle 3 times.


                                      

Nested for loops revisit

Using the homework as a starting point, I simplified the task by having them imagine the triangle to be just a line.  After they wrote the simplified program, I asked them to change the line into a triangle.  Eventually, we made our program to take any number of petals.

    num_petals = 3
    speed 10
    pen blueviolet
    for [1..num_petals]
      for [1..3]
        fd 50
        rt 120
      rt 360/num_petals

The next task is to get the students to understand how the use the counter in the for loops and the importance of placement of commands and indentation inside the for loops.  I actually had them do a simplified program before we get to the one below which creates 3 rows of colored dots (I first asked for one row of all the colored dots.)  Even these few lines of codes, it's still useful to breakdown the task into smaller, more simplified programs to learn the concepts.

    rt 90
    for x in [blue,green,pink]
      jump 25,-75
      for y in [yellow,orange,red]
        dot x, 21
        dot y, 7
        fd 25

Homework

Draw a flower garden using at least double loops.  I encouraged students to use triple loops or as many as they fancy.  I also mentioned that I didn't get to review functions but that could be handy for them to use for this homework.  Some of them seemed intrigued and I am hopeful that they will do their own review of functions to do this homework.

Fun with Polygons (Programming Class 9)

who: Baan Pathomtham Grade 5
when: Monday morning
where: at school



Reviewing last week assignment

As usual, I started with homework review which is to draw a scary ghost with a bonus point if they can make their ghosts disappear and reappear.  Turned out to be a nice segue into my main agenda this week which is to review the for loop and a little bit of geometry.  I pointed out that their codes could be shorten by using for loops.

Fun with Polygons

Although my main goal for this session was to review for loops, I wanted to throw in a bit of geometry review (have been noticing that the kids were using too much trial and error strategy when they drew non-quadrilateral shapes).  The structure of this session was I asked them to draw various polygons using for loops: 
  - we started off with the basics: square and equilateral triangle   
  - Then I asked them to generalize their program to make any polygon.  This requires two things:
       1) Understand how to change the number of iterations in the for loops
       2) Recognize that the angle for the turtle to turn is 360/n where n is the sides of the polygon.  I showed them Josh's little program to illustrate this fact (http://jgplay.pencilcode.net/edit/explainer/extAngles)
  - Next I asked them to use for loops to draw a rectangle.  Here they have to recognize that the input into for loops can be other things than a sequence of natural numbers.

Things to Note (Debate?) for Future Lessons
 
Up til now, our main teaching approach has been to show them codes, run it to see what happens, and then ask the students to extend the codes.  While this show-don't-tell approach is great at stimulating their creativity and interest in class, my opinion is that our G5 students need a bit more explicit blackboard instructions to get a strong grasp of the concept.  Thus, I think we need a balance between learning by exploration vs. with explicit instructions.

Math Games (Class 3)

Who: Baan Pathomtham First and Second grade classes

Where: at school
When: mid-morning

Here is the third installment of our math games series.  Despite shortage of staff (Josh is traveling), it's a successful session -- the kids loved it so much they begged for more after they finished their first round.

Indian Poker Addition Game
Source: www.mathsticks.com

This game is a twist to the indian poker.  Although it's more fun and challenging with more players, for younger kids, I find that 3-4 players work out best.

Equipment: A pack of cards with face cards (J,Q,K) removed.
Here's what we do:
- Deal one card face down to each player.  When given the signal, they hold the card outward on their forehead so they cannot see their own cards but only see their friends' cards.
- The card dealer announces the sum of all the cards. 
- Each player guess his or her number.

We have 7 children in each class so they have to add up 6 cards and then subtract from the announced sum.  For children who struggled, I gave additional hints -- I told them the sum of his or her card plus two other friends' cards so they only have to add up 2 cards.  

Close to 100

Equipment: A pack of cards with 10 and face cards (J,Q,K) removed.
Procedure: 
- Deal out 6 cards to each player
- Each player picks 4 cards from the 6 cards they were dealt to form a pair of 2-digit numbers.  The goal is to get the sum of the two numbers as close to 100 as possible but cannot exceed 100.





Wednesday, November 12, 2014

Multiply my love

Who: J1 and J2
When: while not hacking minecraft on raspberry pi
where: in my home office

Recently, we found a couple of nice games and puzzles built around multiplication that I wanted to share with y'all.  The important point is that these aren't drill-in-disguise where the primary objective is reciting multiplication facts, they are games with their own goal that is facilitated by multiplication.

Bojagi 
In this puzzle, you have to cover a grid with rectangles. The trick is that the grid has numbers sprinkled throughout and every rectangle you draw has to contain exactly one number that is equal to the area of the rectangle.

Solving (left) and make-your-own (right)


Here's the game and a collection of puzzles: http://bojagi-gotmath.rhcloud.com/

For credit, the game was built by David Radcliffe (@daveinstpaul) and I originally read about this game on Moebius Noodles.

Why do I love it?
(1) Fun and challenging puzzle worth doing on its own
(2) Great reinforcement of the area model for multiplication
(3) Tremendous scope for further investigations
(4) YOU CAN MAKE YOUR OWN PUZZLES!

The last two points are related. Creating a puzzle helps stimulate thoughts about the structure of the puzzle.

Examples of things you might want to explore
a. Is there always a single solution or could there be several?
b. How many ways are there to partition a rectangle into sub-rectangles?
c. If there can sometimes be multiple solutions, can we recognize this or recognize that the solution will be unique in advance (before we solve the puzzle)?
d. If you put numbers into the square grid, will they always form a puzzle that can be solved? If not, what conditions are necessary? What conditions are sufficient?
e. Is there an algorithm that will always find the solution (when one exists)?
f. Are any game versions fun (and what mathematical structure do they have?

Times Square
This game comes from Calculation Nation. They have several good games, so it is worth taking a look at their collection. Other than this one, I particularly enjoy Nextu.

The objective here is to get 4 in a row before your opponent does. On each turn, you move one of the sliders below the playing square and capture the square that is the product of those two.


Why do I love it?
(1) The game is fun and challenging (this is the sine qua non of games, no?)
(2) Players have to use multiplication and division when planning their next move
(3) The interaction with  your opponent is not straightforward
(4) J1, J2 and I had a delightful conversation about which numbers are in the playing board, which are missing, and why.

In this case, I don't see as much scope for further investigation, but  you might have more ideas than I do. At least I will leave you with one:

Why should we have expected that the playing board would be a square, thus justifying the name?


Some other things related to multiplication
Prime Climb
A beautiful multiplication table emphasizing prime factorization, from Math4Love:


This is linked with their game Prime Climb (which I don't have, so insert unhappy smileys here!)

Factor Game
As the name suggests, a game related to factorization.  Rules here.  I will blog about this when we play the game at home or with one of the school classes.  Also, I noticed a pencilcode user that started building a program related to implement this game (Introbot's FactorGame).

An alternative algorithm
A video (here) and picture (below) are getting pushed around the web. My take:
thoughtlessly teaching/learning/applying any algorithm isn't very useful, but playfully investigating and thoughtfully considering why it works is always worthwhile.