# Teaching Algebraic Expressions with Tracking Arithmetic

I’ll share a trick that I’ve found helpful in getting students over the hump. The idea is due to John Mason, and it can be found, for example, in his chapter of the book Algebra in the Early Grades, or in the more recent And the Rest is Just Algebra, and likely other sources, as well.

The idea is to take a student who can work out a specific *instance* of a problem, and coax them into writing a general *expression*, by first going through an example with weird enough numbers.

Here’s an example that comes from my CodeWorld curriculum. Suppose you want to draw a rectangle with rounded corners. Let’s look at how we might approach this task using tracking arithmetic.

## Step 1: Solve an easy instance.

We’ll start with a simple example. Let’s draw a rectangle that’s 8 units wide, 6 units high, and its corners have a radius of curvature of 1. First, you might sketch the result on graph paper, as in the picture above. Using CodeWorld, you can now construct this out of eight parts:

- 4 line segments — one from (-3, 3) to (3, 3) for the top; one from (-3, -3) to (3, -3) for the bottom, one from (-4, 2) to (-4, -2) for the left side, and one from (4, 2) to (4, -2) for the right side.
- Four arcs for the corners — one from 0° to 90° centered at (3, 2); one from 90° to 180° centered at (-3, 2); one from 180° to 270° centered at (-3, -2); and one from 270° to 360° centered at (3, -2). Each arc has a radius of 1 unit.

Here’s the key definition:

`pic = `**polyline**([(-3, 3), ( 3, 3)])

& **polyline**([(-3, -3), ( 3, -3)])

& **polyline**([(-4, -2), (-4, 2)])

& **polyline**([( 4, -2), ( 4, 2)])

& **translated**(**arc**( 0, 90, 1), 3, 2)

& **translated**(**arc**( 90, 180, 1), -3, 2)

& **translated**(**arc**(180, 270, 1), -3, -2)

& **translated**(**arc**(270, 360, 1), 3, -2)

If they’ve had enough practice in basic drawing primitives, most students can perform this task by making observations of the picture drawn on graph paper. If they can’t, then it’s too early to take the next steps.

## Step 2: Solve an instance with “weird” numbers.

The next step involves repeating the same process, but using weird enough numbers. Using our 8 x 6 rectangle, the same numbers often come up in multiple ways. For example, when (3, 3) is an endpoint of a line segment, one of those 3s came about because it’s half of 6; but the other came about because it’s one less than half of 8! Our goal is to choose numbers so that it’s unlikely the same number will appear for more than one reason.

This time, let’s make the rectangle 13 x 8 instead.

The code for this one uses distinct numbers each time they come up.

`pic = `**polyline**([(-5.5, 4), ( 5.5, 4)])

& **polyline**([(-5.5, -4), ( 5.5, -4)])

& **polyline**([(-6.5, -3), (-6.5, 3)])

& **polyline**([( 6.5, -3), ( 6.5, 3)])

& **translated**(**arc**( 0, 90, 1), 5.5, 3)

& **translated**(**arc**( 90, 180, 1), -5.5, 3)

& **translated**(**arc**(180, 270, 1), -5.5, -3)

& **translated**(**arc**(270, 360, 1), 5.5, -3)

Now we’re ready for to start getting some symbolism in the answer.

## Step 3: Solve the same problem without doing arithmetic.

The key in this step is to solve the same instance as before, but refuse to do any arithmetic. So instead of a single number, you end up accumulating an arithmetic expression. For example, instead of 6.5, they should write `13/2`

.

This is the key step, and students will still struggle. But you have a secret weapon: you can **prove** they know how to do it, because they’ve already solved the problem. You’re asking them to do **less** than they already did.

Teacher:6.5 is the answer, but what math operation did you do to get it?I don’t know… it’s just 6.5.

Student:Teacher:Well, where did you get the 6.5 from?Student:I just looked at the graph paper, and that’s where the line was.Teacher:You drew that on your graph paper. Why did you put it there?Student:That’s where it needed be to make a width of 13.Teacher:And why is that?Student:Because it’s half of 13.

Even more interesting is the 5.5. Once you’ve established that 6.5 is `13/2`

, you can write 5.5 as `13/2 – 1`

. It will often take some practice for students to be comfortable building up expressions in this way, but it helps that they’ve had plenty of practice doing the same thing with picture expressions.

The code they’ve written now has a lot more arithmetic in it.

`pic = `**polyline**([(-13/2 + 1, 8/2 ), ( 13/2 - 1, 8/2 )])

& **polyline**([(-13/2 + 1, -8/2 ), ( 13/2 - 1, -8/2 )])

& **polyline**([(-13/2, -8/2 + 1), (-13/2, 8/2 - 1)])

& **polyline**([( 13/2, -8/2 + 1), ( 13/2, 8/2 - 1)])

& **translated**(**arc**( 0, 90, 1), 13/2 - 1, 8/2 - 1)

& **translated**(**arc**( 90, 180, 1), -13/2 + 1, 8/2 - 1)

& **translated**(**arc**(180, 270, 1), -13/2 + 1, -8/2 + 1)

& **translated**(**arc**(270, 360, 1), 13/2 - 1, -8/2 + 1)

## Step 4: Replace the special numbers with variables.

If they’ve done their job well, all the “special” numbers, like width, height, and radius of curvature, now appear in the code directly. They can be simply replaced with arguments or variables, to get a general expression!

Here’s the result:

`roundedRect(w, h, r)`

= **polyline**([(-w/2 + r, h/2 ), ( w/2 - r, h/2 )])

& **polyline**([(-w/2 + r, -h/2 ), ( w/2 - r, -h/2 )])

& **polyline**([(-w/2, -h/2 + r), (-w/2, h/2 - r)])

& **polyline**([( w/2, -h/2 + r), ( w/2, h/2 - r)])

& **translated**(**arc**( 0, 90, r), w/2 - r, h/2 - r)

& **translated**(**arc**( 90, 180, r), -w/2 + r, h/2 - r)

& **translated**(**arc**(180, 270, r), -w/2 + r, -h/2 + r)

& **translated**(**arc**(270, 360, r), w/2 - r, -h/2 + r)

And you can now play around with different specific rounded rectangles.

This process has been helpful for me in coaxing students to express what they already know using algebra. Of course, it’s just a starting point! To become experts, students need to recognize when their example is truly general, and when they’ve made decisions that aren’t always appropriate. What happens to a rounded rectangle, for example, if the radius is greater than half of the width or height?

Good luck!