Archive for March, 2010

My eldest daughter has been getting maths homework for a year or two now. We try and do the homework together and I try and make it fun but it’s hard. It’s hard because if she doesn’t understand something by the second time I explain it, then to her I become like the teacher in Charlie Brown. Blah Blah Blah. This is especially true if when I’m explaining elementary mathematics, I make a mistake in my explanation. This happens often and only causes to confuse her royally.

And so it was with the topic of number bonds. My wife discovered, by attending a parent’s maths workshop at the school, that the children were learning that certain numbers in base 10 arithmetic are bonded. The bonds are simply as follows:

  • 1->9
  • 2->8
  • 3->7
  • 4->6
  • 5->5

It’s fairly trivial but also fairly powerful in that once you know these bonds it’s a shortcut for mental arithmetic. We, as adults, know these ‘bonds’ so well that we probably don’t even recognise that we use them. The challenge then is to teach children this trick and thereby speed up their arithmetic ability.

One of the techniques that my daughter’s school uses is to send home ‘games’ that try and reinforce the learning they have done in the class. These games usually consist of a laminated sheet of instructions, a dice or two or other simple props. Usually these games are quite good and instructive. Some times they are totally confusing because they are meant to reinforce what was learnt in class and that doesn’t come across in the instructions. You’d think that I could ask my daughter to explain ‘how’ they should be doing it. It doesn’t work. Kids just aren’t that ‘meta’, that’s why they’re so much fun.

Now I have observed both my children playing on friv and Club Penguin. They are totally immersed in the most crappy Flash apps (although I have to say that most of them are actually quite fun!). So I thought I’d try and see if I could make a Flash game that would teach a little mathematics.

A while ago an ex-colleague posted about a super-cool Flash application he’d made. From that I figured out I could download the SDK and most of what I needed for free. However I thought I’d try the 60-day trial of Flex Builder. The added comfort of Flex builder is that it’s a pre-configured Eclipse for building Flash apps, so progress is pretty smooth-and-fast. Not sure I’d spend the $299 for a personal license though. It’s not that good.

I had always thought that Flash development was complex but it turns out that it really isn’t. If you can program Javascript, then there really isn’t that much extra to learn to make it work because you can use ActionScript (which is a derivative of ECMAscript as Javascript is). The biggest difficulty I found was with laying out text. Something that HTML laps up, but turns out to be really cumbersome in Flex. I’m probably just doing it wrong.

And so the unimaginatively titled ‘Number Bonds’ was born. Enjoy.

If you’re interested in the code it’s here. It’s pretty messy though. I’ve also made a back-story-free page about ‘Number Bonds’ here.

This week a colleague pointed out this comment from an Ask Reddit:

danceswithwolves 62 points 4 days ago* [-]

I went to a job interview and the interviewer told me I would get the job (my first full time job ever) if I could answer this math question which is supposedly a middle school grade question. I had no clue how to solve it so I’m jobless now and suffering. To this day I never figured out the answer. http://img691.imageshack.us/img691/2192/mathv.png (The lines are curved if that makes a difference)

Basically the problem asks you to find the area of a sort-of-square, inside a square of side 4. Each corner of the outer-square is joined to the adjacent one by an arc of angle pi/2 radians (90 degrees) of radius 4. The sort-of-inner-square is outlined by the four crossing arcs. See the link above, or the picture below for a diagram.

Normally when faced with puzzles of this sort I try and pretend I’m too busy to figure them out. Partly because I’m belligerent, bordering rude, and partly because I know I’m a bit dumb. If my life depended on getting the answer I’d be dead already. So it was a strange thing indeed that I found myself working on and actually enjoying this particular puzzle. I did, of course, out of all of my colleagues get to the answer last.

It then occurred to me that I could regain some cool by trying to draw a better diagram (than the one in the comment) using the Common Lisp vector drawing package Vecto. It was actually a lot easier than I thought it was going to be and came out quite nice, the result is here: Area of shape the code is here.

After arriving at our respective numerical answers some bright-spark said that it should be possible to verify our results using Monte-Carlo methods. I thought about this for a bit and then concluded that it would actually be quite easy to do, especially in Lisp where functions are first class objects. You can see the code here.

As fun as it was to find the answer by Monte-Carlo it was a bit of a waste of time since I could have just as easily subdivided the area into a grid of tiny squares and then counted the ones that were inside and outside the shape. This would have been simpler to code and it would have been more accurate too.

Pythagoras would probably have known that of course.