Monday, January 23, 2023

How Coding Revealed a Decimal Misconception

An interesting thing happened in a Grade 9 class recently. I was doing a coding activity looking at so-called Fibonacci numbers where students used a Scratch code to enter two initial values which then generated ten more values. The challenge was to get the twelfth term to be as close to 1000 as possible. I know that there is at least one solution that involves whole numbers but typically students get close to 1000 with two whole numbers and then use decimals to get closer and closer. One student tried 4.5 and 8.4 like this:

A table of values starting with 4.5 and 8.4 with each proceeding term being the sum of the previous two terms.
It was too low so she then tried 4.5 and 8.5:

A table of values starting with 4.5 and 8.5 with each proceeding term being the sum of the previous two terms.

This was too big so she asked 'What do I do now?' 

'Maybe pick a number between 8.4 and 8.5,' I suggested.

'But there are no more numbers between 8.4 and 8.5,' she replied.

As soon as she said this, I recognised a classic decimal misconception: sometimes students do not understand the density of numbers and that there are an infinite number of numbers between any two values. To help her rethink this, I drew a number line between 8.4 and 8.5 and asked her if she could now give me a value between these two:

A number line starting at 8.4 and ending at 8.5
'8.04... no, wait... 8.05,' she replied.

Using some virtual manipulatives, I reminded her that since one-tenth is equivalent to ten-hundredths, and four-tenths is equivalent to forty-hundredths, then 8.4 and 8.5 are equivalent to 8.40 and 8.50 respectively:

A number line starting at 8.40 and ending at 8.50
As soon as I relabelled these on the number line, the light bulb went on.

'Oh... I could try 8.45.... or 8.46 or 8.41!' This she did:

A table of values starting with 4.5 and 8.45 with each proceeding term being the sum of the previous two terms.

Now she was suddenly willing and able to use ever more precise decimals. 

'So I could now try 8.455... and then 8.4555 and keep going like that?'

So this one coding activity did more to reveal and then help correct this particular misconception than anything that I can think of that I have used in the past and at the same time gave great insights into the density of numbers (a new expectation in Ontario's new MTH1W curriculum). This particular coding activity occurred towards the end of the semester though so what I am now thinking is that it should be moved more towards the start of the semester.

One other thing about this activity: I noticed that some pairs of values added to give a curious next value. For example, in the first case above, the seventh and eighth terms, 89.7 and 145.2, add to give 234.8999... and not 234.9. I think that this is because the two values that are inputted by the user are converted to hexadecimal values which are then added to give the next value as a hexadecimal. This is then converted back to decimal but there is sometimes a rounding error as can be seen


No comments:

Post a Comment