Programming in math classes

Leave a comment

Starting next year, the new Swedish course plan will require the inclusion of programming in math classes. I know not all math teachers, especially for younger years, have a lot of experience with this and so I thought I would blog about three good tools.

All the tools I will talk about share two important features:

  1. They are free to use
  2. They can be used directly in any web browser

Scratch

  • Recommended uses in Sweden: lågstadiet and mellanstadiet
  • Available in Swedish and other languages

The first, and probably the most important, is Scratch, a tool developed at MIT and the best introduction to programming out there.

Instead of writing code, students drag and drop ready commands. It is incredibly easy to use and get started with. They recommend a starting age of 8, but younger kids have used it as well (with more guidance). It is also available in Swedish (as well as something like 40 other languages).

Even if it is easy to get start with, Scratch is quite versatile and it is possible to do quit complicated programs.

I recommend moving away from Scratch in högstadiet, since it will be easier to integrate into your math teaching. However, I did want to give a good example of how it is possible to use Scratch even in 9th grade.

The following is an example of a possible assignment. A 9th grade student was asked to create a Scratch project that showed found the equation of a line from two points. This is what he came up with.

Note that this is also an excellent way to assess math skills outside of standard testing. This project required good knowledge of linear equations, basic algebra, fractions, scaling and Euclid’s algorithm for reducing fractions.

However, this would have been much easier using something like JavaScript instead (e.g. using jsFiddle).

Khan Academy Programming Course

  • Recommended uses in Sweden: högstadiet and gymnasiet
  • English only

Khan Academy has their own online programming course. They have created their own language that seems to be roughly based on JavaScript, but is optimized for graphics.

The advantage here is that they have ready made videos and instructions for students, so even inexperienced teachers can let the students work through the material at their own pace. The focus on graphics and animation tends to make it more fun for students to learn, however it can make some math class applications more annoying to implement. Likely easiest (at least initially) for geometry projects.

A nice feature of their online programming editor is that the code is run as you type it. This gives instant feedback on any changes, which can be helpful for students. Another nice feature is that a teacher can create a sample or template program in the editor and then give a link to it to the students. This can be really nice for specific programming/math projects you want them to work with.

jsFiddle

  • Recommended uses in Sweden: högstadiet and gymnasiet
  • English only (as much as JavaScript and HTML are based on English)

jsFiddle is an online JavaScript editor. This allows you to create JavaScript programs without needing a website to host them on. Instructions in JavaScript (and basic HTML) will need to come from elsewhere. But this is a great site for trying out programs.

Another nice feature is that, like with Khan Academy, the teacher can create sample or template programs for the students to study or modify.

Once students have some proficiency in JavaScript, this is likely the most versatile for using in math related programming assignments.

Here is a simple example of using the Newton-Raphon method to find the square root of a number.

 

 

Bad math in society

Leave a comment

I have always had a low tolerance for bad math out in society – if you can’t do your (often simple) job then let someone else do it. Since becoming a math teacher I find I have even less tolerance. So to the student whine of “why do I need to know this?” I would really like to answer “so you don’t look like a total moron doing the low-skilled job you thought didn’t require even basic math skills to do“.

True story number one:

A few years ago my wife was shopping at a jewelry store. They were having a necklace sale: buy 3 and get the cheapest one for free. The woman in line in front of my wife bought 6 necklaces. The cashier tried to give her the cheapest two for free. The customer argued and said that she should get a more expensive one for free. The cashier didn’t understand. The customer was quite frustrated at the stupidity and incompetence of the cashier who clearly could not do her job because she could handle the incredibly simple logical thinking required in this situation.

To illustrate for those having trouble picturing this, imaging the following size prices (in Swedish kronor):

2000, 1800, 1600, 1400, 1200, 1000

The cashier wanted to give her the 1000 SEK and the 1200 SEK necklace for free. The woman wanted the 1000 SEK and the 1600 SEK necklace for free instead. I’ll let you figure it out if you haven’t already (I even arranged the numbers nicely for you).

True story number two:

The following picture is from our local supermarket.

Image

In case you are having trouble reading the blurry text. These are 50g packages of yeast. They cost 7.90 SEK each. The price in yellow is what is the called the “comparison price”, which is given in cost per kg. Listed in this case as 15.80 SEK. Seeing the problem yet?

My favorite algebra problem

3 Comments

I gave my 7th graders a quiz today on solving equations. It was fun (admittedly in a slightly evil way, but not really) to see their frustration with the final problem, which over the years has quickly become my favorite algebra problem. Of course I don’t put it on the quiz to be mean, but to teach important lesson about reasoning and life. Here is the question, always coming after a series of much more complicated ones that they usually have no trouble with:

x + 1 = x -1

 

Group discussion with post-it notes

Leave a comment

I tried a new idea today that I borrowed from Andrew Knauft, found vid Dan Meyer’s blogg.

I divided my 7th graders into groups of 4 and asked each group to decide which of the number in the set {9, 16, 25, 43} didn’t belong and why. They stuck the post-it on the whiteboard when done and then took another group’s note. They then had to say whether or not they agreed with the reason the other group gave for their decision.

At least that was the plan. The reality was that three of the groups had exactly the same number and reason (43 because it is the only prime number), a fourth group had 43 because it is the only not perfect square. Only the fifth group had anything different.

So then I pulled out another harder problem and set them to work on it. I showed the following picture with this question

“Each of the four cards below has a solid color on one side and a number on the other side. What is the smallest number of cards you need to turn over to decide whether or not the following statement is true: if a card has an even number on one side then the other side is red?”

colorcards

That gave rise to a lot more lively discussion and a lot of disagreement between the different groups on what the right answer was. It was a very fun lesson.

Practice rate problems program

Leave a comment

I just finished my most ambitious basic skill practice app – for practicing rate problems (hastighet). It has everything from very simple problems to very hard problems. However, I have not tests all the different problem types yet, so anyone reading this who wants to test them and get back to me with any errors they find would be very appreciated. Here is the link:

 

http://hem.bredband.net/taub/rate.html

Math video prompts

Leave a comment

In case any of you don’t already follow Dan Meyer, I highly recommend his math teacher blog – best around: http://blog.mrmeyer.com/

In line with his theories about trying to create video or picture prompts to stimulate natural questions that require math to really answer, I have a couple ideas. The problem is I’m not really good at video editing and suspect I might not get around to actually making them.

So this post is a request for anyone interested in seeing if they can/want to produce one or two short videos.

  1. This one is of two people running around a track. I think it should be a standard 400 meter running track so that distances are known, though the 100 meter marks should maybe be added to the videos. Two runners/joggers start facing each other a short distance from each other. When they pass each other they smack hands and at that moment a timer starts on the screen. The video is stopped after a short time (before they meet on the other half). The question you are hoping for is where will they pass each other again? The timing information and known distances on the track should provide enough information for estimates. The rest of the video is then shown afterwards to show the answer.
  2. In this one you need a full class of students to help out. The students are standing in a line outside a room, each is holding a big bag of presents. One student is in the room. The first student in line walks in and shakes hands with the student there, and they give each other a present from their bags. They put their presents on a big table maybe (or maybe just keep them in a pile at their feet). The next student comes in and does the same (shakes hands and exchanges gifts) with EVERY student already in the room. The video would show the first two or three students doing this, then pan down the line of students. The exact number in line should be a bit unclear. The questions to answer here are how many presents total (which is why they should maybe be on a big table) and how many handshakes total (for those who don’t know, this is showing an easy connection between these ideas and which later is used to easily motivate the Gauss formula for adding up sequences of integers easily).

Any takers?

A fun little problem

Leave a comment

Lilly is working on a classic math problem:

A hot tub can be filled with one of two water faucets. The first alone would fill the tub in 2 hours and the second one alone would fill the tub in 4 hours. How long does it take to fill the tub with both of them turned on at the same time?

Lilly thinks this problem is a little too easy and so starts to play around with different ways of solving it. Being a big fan of geometry, she draws a right triangle, with one leg being 2 and the other leg being 4 to represent the time for each faucet.

triangle 1

She then inscribes a square in the triangle so that two sides align with the legs and one corner lies on the hypotenuse:

triangle2

Lilly then notices that the length of the side of the square is actually the solution to the problem!

  1. Is she right?
  2. Does this work for other numbers? (different times for the faucets to fill the tub)
  3. Does this work for all numbers?

Older Entries