## [Makeover] These Tragic “Write An Expression” Problems

We need to do something about these problems, which recur all throughout school Algebra.

The original title of this post called them “horrible,” but they’re truly “tragic” — the math education equal to Julius Caesar, Othello, and Hamlet — full of potential but overwhelmed by their nature.

Here’s the thing about variable expressions: they’re used by programmers and students both, but those two groups hold variables in very different regard.

Ask programmers what their work life would be like without variables and they’ll likely respond that their work life would be impossible. Variables enable every single function of whatever device you’re reading this post on.

But ask students what their school life would be like without variables and they’ll likely respond that their school life would be great.

What can we do?

The moral of this story isn’t “teach Algebra 1 through programming” or “teach computational thinking.” At least I don’t think so. I’ve been down that road and it’s winding.

But in some way, however small, we should draw closer together the wildly diverging opinions students and programmers have about variables. Ideas? I’ll offer one on Monday.

2014 Jul 25. I appreciate how Evan Weinberg has thought through this makeover (now and earlier).

Featured Comment

Dylan Kane restates our task here in a useful way:

In terms of making these problems a little better, students should feel a need for the expression. I think this question stinks in part because the expression it’s asking for is so trivial – it’s extra work, compared to just multiplying by 3/4 or doing some simple proportional thinking.

Jennifer offers an example of that kind of need:

I like to introduce the idea of expressions by having the students playing the game of 31 with a deck of cards!their goal- play until they can predict how they can win every time! This will take less than 15 minutes, and a whole class summary of verbal descriptions on ‘how to win’ are shared. Verbal descriptions become cumbersome to write on the board, so ‘shorthand’ in the form of clearly named and defined symbols are used to make the summarising more efficient. the beauty of this is that the idea of equivalent expressions presents itself.

i think the ability to generalize and write a rule with variables is really important, but you can come to that through lots of nice activities and investigations as well.

for example, i did dan’s “taco cart” with my students with a few notable changes. instead of telling the students how fast dan and ben walked, i had each group decide on the speed of the two men themselves and list that along with other assumptions they made in the problem.

when we did the whole class summary, i told them that i had written down a formula on my paper that would allow me to check if their answers were correct and that i needed that since everyone used their own speed. i should’ve asked them all to take a minute to try to come up with the formula i used, but instead i elicited it at that moment and one student gave me the correct formula. the need for two variables (speed on sand and speed on pavement) was obvious.

in part two of taco cart, when the students were trying to figure out where the taco cart should be so that the two men reached it at the same time, one group did seemingly endless guess and checks. i suggested to them that this wasn’t a good method and asked if maybe it wasn’t better to write an equation with a variable. again, they could see the need. once they started with a variable, the rest of the problem started to fall into place.

here’s the thing: these “write an expression” problem want to train students to learn to generalize and write a rule. they want them to be able to see a situation that would best be tackled with a formula of some sort, write said formula with various variables, and use their formula to solve complex problems. but the issue is that these problems don’t actually train students in that way because they’re so artificial and one-dimensional. what they do is teach students to “translate” from english to math (an important step along the way, i do believe), but not to recognize a situation in which a formula would be helpful or necessary or how powerful it can be.

Two thoughts from a computer science teacher’s point of view:
1) When introducing programming to 15 yrs olds for the first time, we use Python interactive prompt as a calculator first. And the first point is to show the advantages. Variables and funstions (one-liner formulas) simply save work. That is it, that is one of the goals of the whole programming topic anyway. When they do quadratic equations in maths at that time, we are headed that way. And students realize pretty fast: aha, I have to understand how to solve them, but once I do and I describe it properly, I never have to do it by hand anymore. Their understanding of q.e. deepened, they interest in programming increased, and I could naturally introduce a load of important CS concepts on the way. In younger age we do simpler formulas, also like BMI calculation (not only the “area of the circle” kind of stuff, which they, um, do not prefer), but the point is the same: the kids need to see at least some hypothetical benefit for themselves. Having to introduce variables in maths, I would in principle search for a similar approach. (Note: for even younger kids, fun and creativity achieved with Scratch, turtle etc. overweigh the “practical benefits”; but when practicality leads to more fun — win-win!).

2) A good and often forgotten tool between calculation on paper and programming is a spreadsheet. It can store lots of numbers in a structured way and perform basic calculations, what is well understood by kids. And when we want to do anything more complex without getting beards grown, we absolutely need formulas and “variables”. Their advantages are imminent. And the whole time, everything is in plain sight, the level of abstraction is way lower than with programming, making it very accessible for kids. I am of course interested in it “from the other side” — after some decent work in spreadsheets, many more advanced concepts are a step away (for-loop, data type, input-output, function, incremental work on more complicated calculations, debugging etc. etc.). But I believe that thoughtful use of spreadsheets can improve understanding in appropriate topics in maths.

I'm Dan and this is my blog. I'm a former high school math teacher and current head of teaching at Desmos. He / him. More here.

1. #### josh g.

July 24, 2014 - 1:39 pm -

I should probably have a lot of opinions here. But for now all I want to do is emphasize that variables in programming do not quite serve the same purpose as variables in algebra. In programming, a variable is usually a place to store data, not just an abstract placeholder representing a range of values.

One thing programming does better with variables than algebra: bigger, more expressive variable names. Single letters are concise but harder to understand.

July 24, 2014 - 2:00 pm -

From my little understanding of programming, code is written to predict or react based on user input (variables). For example, if the user does x, then react like this. If the user does y, then react like that. I’m oversimplifying this for my own sake at this juncture.
This predictive and anticipatory world can be vast, yet still have boundaries and limitations. For example, on my mouse trackpad, I’m curious what will happen to a picture if I pinch with two fingers, and in what direction the pinching is done. Then I get to mess around with other trackpad gestures. What happens if I use three fingers, four fingers, five fingers? Then I question the limitation of one hand having five fingers. How many gestures could a programmer write for a mouse trackpad on a laptop?

From my somewhat better understanding of students, specifically math students, is that students traditionally have boundaries and limitations placed on their learning and the messing around is not as vast. A student could be told what to solve, what variable (or formula) to use, and that there’s only one answer: high limitations and minimal messing around. Per your example, students are told that 75% of dreams are about people we know. Another hinderance is that the question (or directions) have been formulated for the student, limiting them from choice, curiosity, and messing around with mathematical thinking. Tragic, for sure.

I think we draw these two worlds closer together by creating more variables for our students without labeling them x, y, z, etc. We follow the mathematical modeling process and pose a simple question or series of questions to students. We keep the questions simple so that more (student) questions can be derived from the initial question. Here is a teacher prompt off the top of my head:

How often you guys dream?
How many of you remember your dreams?
Do your dreams sometimes have other people in them?
Do you know these people?
Show of hands, who has dreams with someone they know in them?
[Count the hands. Write the number on the board.]
Help me find the percentage of the class who dream about someone they know. Okay, I wonder if Mr. Meyer’s class has the same percentage? I think Mr. Meyer has about 35 students in his class right now. If I call him and ask his students the same question, how many students would have to raise their hand to have the same percentage as us?
And so on…

Concerns, some teachers might be scared or concerned with this modeling format. They’re juggling too much or they don’t know the answer to all these questions and might fear that they appear inferior as a teacher. Drawing these two worlds closer together requires more open-beginning, open-middle, and open-ended type questions, tasks, and activities in a math classroom.

• #### Clara Maxcy

July 25, 2014 - 1:40 am -

Programmers are curious about their world, pushing boundaries. Students have not been allowed to question so deeply – they don’t know all they don’t know! I use a lot of questions in my math class, my own and generated by my students. If I am not sure of the answers, I use it as think-aloud time: here’s what I think I need to know or find out, here’s what this problem suggests, here’s something I am going to do/try/look up to solve this problem. I want kids to mimic good sound thought processes. I love your questioning pattern ideas here.

3. #### Joshua Zucker

July 24, 2014 - 2:40 pm -

How about switching the two prompts here? That’s what I do in introductory algebra classes. Let’s do some examples, and then generalize/abstract to an expression with a variable that summarizes all our work in one concise way. I think that fits better with students on the ladder of abstraction.

Then the mathematics world will match the programming world better, too. Things that are programmed to be done once don’t necessarily use a lot of variables. When you’re going to be reusing the code in new situations, you need more variables to adjust to the new situations as they come.

4. #### Mark James

July 24, 2014 - 2:44 pm -

Andrew – I love your modeling idea. It would be a great way to set the stage for establishing the equal ratios idea that the original problem was about (aside from “writing an expression”). I can easily see where it could build from there.

Dan – I showed your “Pick a Point” Vimeo to a group of teachers today at a tech summit. They loved it (as they always do). That idea comes to mind here: Pick a Point makes it clear why mathematicians make things way easier for themselves by naming points. Can we find a parallel situation here that shows how programmers use variables to make things way easier? I think that’s what we’re after here. I only wish I knew enough about programming to offer up an idea.

5. #### Howard Phillips

July 24, 2014 - 3:24 pm -

Times have changed indeed, and for the worse!
This would have been
“What is the formula for the number of dreams involving people you know, if we write n for the total number of dreams”

That isn’t a lot better, but at least it’s not forcing algebra down peoples throats. A formula is strictly a rule for calculating something.

There is far too much of this “Aren’t we clever, look! we’ve turned arithmetic into algebra”.

In the CCSS document the word “formula” in k-8 is almost totally used for geometric formulae (a plural that has apparently gone out of fashion’).

May I reblog this post?

6. #### josh g.

July 24, 2014 - 5:22 pm -

Andrew, Joshua, I love your ideas as far as good pedagogy, but I can’t for the life of me see how they relate to programming-variables-vs-algebra-variables.

FWIW Andrew, I think you’re imagining variables as being much more high-level than they really are in practice. If someone is programming a gesture-based app, they might have one variable that stores a Gesture data object. But that Gesture object will likely also contain other, lower-abstraction variables, like x-y co-ordinates of where the finger swiped on the screen. And if you drill down the layers of abstraction enough, every programming variable is holding some set of numbers (because that’s all computers know at a hardware level).

I wonder whether this comparison is even fair to begin with. Why are we comparing programmer attitudes to math student attitudes? I’d be more interested to see how programming student attitudes compare to math student attitudes.

7. #### Evan Weinberg

July 24, 2014 - 5:43 pm -

Programmers use variables because they want to build a program that produces a correct output for every possible input that might be used to solve a given problem or design. Mathematicians also want to have the same level of universality, and have a syntax and structure that allows for efficient communication of that universality. Computers are really good at calculating. The human brain is really good at managing the abstraction of designing those calculations. This, ultimately, is what we want students to be able to do, but they often get lost in both the design stage and the calculation stage, especially because these get divorced from the actual problem students are trying to solve.

If we can have students spend more time in the design stage and get feedback on whether their calculations are correct, that’s the sweet spot for making the jump to using mathematical variables.

I expand on this in a blog post at http://evanweinberg.com/2014/07/25/the-nature-of-variables-for-students-vs-programmers/ .

8. #### Dylan Kane

July 24, 2014 - 7:36 pm -

In terms of making these problems a little better, students should feel a need for the expression. I think this question stinks in part because the expression it’s asking for is so trivial — it’s extra work, compared to just multiplying by 3/4 or doing some simple proportional thinking.

That said, I think the best tool here is to ask students to answer the question, without requiring an expression, a few times for small or simple to calculate numbers, and then ask them to make predictions for much bigger numbers (dreams in a year? dreams in a lifetime?). Expressions have value because they are reusable for different values of the variable; that’s why a student should be using them.

I also think it’s worth comparing and contrasting expressions with a table of values/graphs/written explanations depending on the grade and having students compare and evaluate the usefulness of each.

July 24, 2014 - 9:08 pm -

Josh G,

Yes, I definitely angled my comment toward pedagogy, and for a few reasons. Someone can create (or makeover) the best textbook problem in the world. Dan could makeover a problem into the best 3 Act task in the world. However, it’s only as good as the teacher who delivers it. You mention the attitudes of programming students and math students. Who’s the first line of defense in nurturing the attitudes of students? The teacher. I’d like to think that a teacher, with strong pedagogy, delivers the best lesson or the most mundane lesson in way that sparks curiosity with students. They deliver it in a way where students don’t mind variables in their school life. I’m all about creating a classroom of curiosity where a task like this can come alive because that’s the classroom climate and the teacher is equipped with prompts. Maybe, making over textbook problems isn’t at the top of my list right now. Maybe I’ve turned it into, making over teacher instructional strategies, because I’m focusing on mathematical modeling so much. I digress.

It’s probably safe to say you know more about programming than me and I’m not arguing that. However, my initial comment was to illustrate the predictive purpose of programming. If numbers are stored in a program, they were put there to predict possible behaviors of the user. That makes sense to me. Translate that to a math classroom. If that translates to a math classroom or textbook, textbooks are full of stored problems to predict how a student could learn mathematics. However, I understand Dan’s post to say that a student would probably be happy if those were subtracted from their life. And I wouldn’t blame them. I think there in lies the question (to me): how do we support students in having a need for variables?

That’s where I fall back to providing the teacher and students with questions or a series of questions that are more open in parts such as the beginning, middle, and end and they create a curiosity. This curiosity could be considered the variable. The answer to the unknown part of the question. An expression does not NEED to be written to move this task forward. Maybe I’m completely off topic.

To make over this question, I’d ask students a question or two that collects data about the prompt (people we know in dreams). Use that data in my class to make a conjecture. Use the conjecture to predict or compare to other classes at school. I would bet money that I’d have a higher percentage of students retain information from that activity a week or month later, than recall anything from this textbook question. To me, when students remember those experiences, those are moments where students don’t mind variables in their life.

This is a great discussion. Thanks!

10. #### Jennifer Poitier

July 25, 2014 - 4:45 am -

I see “write an expression” problems more as a lesson in grammatically interpreting sentence structure than in understanding the purpose of the algebraic expression in the first place. That being said, however, it is this very exercise that enables me to identify in one session those students whose literacy will interfere with their understanding of algebra.

I like to introduce the idea of expressions by having the students playing the game of 31 with a deck of cards!their goal- play until they can predict how they can win every time! This will take less than 15 minutes, and a whole class summary of verbal descriptions on ‘how to win’ are shared. Verbal descriptions become cumbersome to write on the board, so ‘shorthand’ in the form of clearly named and defined symbols are used to make the summarising more efficient. the beauty of this is that the idea of equivalent expressions presents itself.

And, even before algebra is introduced, we use symbols to support the simplification of fractions using cancelling down. Also works when explaining prime decomposition!

As for programming, yes, a wonderful but winding platform for teaching maths, but, isn’t algebra itself the original program language for code that explains our world, and everything in it?
I’d love to go back to encouraging more of our students to go back to studying pure maths to support more of the scientific research into unravelling the mysteries of our universe!

11. #### Elaine Watson

July 25, 2014 - 6:44 am -

I have to wait until MONDAY? You have me on tenterhooks and I shall not be able to sleep until I find out the answer!

Let me see…if today is Friday, which we’ll call F, then Monday, which we’ll call M, is F + 3. Or we could also say that F + 3 = M, in which case M is a function of F. M = f(F) and f(F) = F + 3.

If we’d rather have F as a function of M, or F = f(M), we could say F = M – 3 or f(M) = M – 3.

Now that I have created expressions in which to park my angst, I shall hopefully sleep better!

12. #### Josh Bobbitt

July 25, 2014 - 7:27 am -

Programming variables are rooted in need, right?

There is some function that this program does, and we need that program to do that thing under a wide range of conditions and user inputs. The function is the decisions about what’s actually being done, the variable holds the thing/quantity/position/whatever it’s done in relation to.

The thing I find myself struggling with as I look at this problem is how in the world we create some kind of need to recognize that 3 out of every 4 dreams we have involve people we know, and how in the world you compel any kid to figure out how many dreams out of 300 would contain people they know.

Think, I will.

13. #### Pam Rickard

July 25, 2014 - 8:31 am -

Looking forward to Monday’s post.

I want to hear more on your thoughts on Computational Thinking. The link to your post that you included had me wanting more!

New to your blog so sorry if you’ve written about it elsewhere if I missed it.

Thanks!

14. #### Andrew Gael

July 25, 2014 - 11:23 am -

I had my students doing the hour of code in math class this year. The problem solving and algebraic thinking involved in “if/then” statements is immense and then they got to see if their work was successful or not successful.

Can’t we just take the program from Hour of Code and mathematize it in other ways, maybe so the situations are more “real life” than a zombie eating flowers or whatever. Just an idea.

15. #### Irma Fiametta

July 25, 2014 - 12:23 pm -

5 days before we will go over this lesson
1- I ask my students how many of them remember a dream from last night?
2 Now that I have their attention, I ask how many of them dreamt with people that they know? Write that down on the board and figure a ratio that represents our classroom,

3-in addition to homework, the next 5 days students keep a journal and figure out how many dreams include people they know. Builds suspense

4- Lesson on Variables: students share their findings, and then I share that some “XYZ study shows that 3/4 of our dreams involve people we know ” and with our data we prove if this is true

5- Then we talk about using a variable to represent our findings and we can talk about how programmers use variables

16. #### Garrett S

July 25, 2014 - 2:09 pm -

@joshg

I wonder if teaching slope intercept form with more descriptive variables for some length of time initially would help lead to some better understanding:

y_coord = slope * x_coord + y_intercept

Still, without a conceptual understanding of slope, just writing out the whole word won’t magically bring about any more meaning than the letter “m.”

@everyone

Any thoughts on Bootstrap? A cursory look through the materials seems to promote mathematical understanding through a fun, computational framework.

http://www.bootstrapworld.org/

17. #### Joshua Zucker

July 25, 2014 - 2:44 pm -

@Garret S, I am a huge fan of Bootstrap. I used a related curriculum for a computer programming/design elective and loved it. I learned a ton there too. I think they do a great job of identifying the areas that will be difficult for people newly learning them and providing good support there to help people develop useful thinking skills of their own.

18. #### Dan Meyer

July 25, 2014 - 6:21 pm -

@Josh G., thanks for helping focus us on the differences in uses. To clarify myself, though, I’m not saying I think that the use of variables should be the same in both disciplines. I’m saying I’d like students to regard variables as powerful, sensible structures like programmers do.

@Andrew, I’m not sure how your proposed makeover does anything different with the variable, though it certainly does involve students in more interesting aspects of modeling.

@Joshua Zucker, “reuse” seems like a potent theme to explore here. But if we do a ton of the same problem, writing down a variable expression to summarize that work just seems like The Next Problem here. For programmers, that expression carries with it some power that I’d like students to experience also.

@Mark James, exactly. You’ve restated the problem nicely. We’re looking for a scenario where students experience the ease and power of variables.

@Howard, go for it. Cheers.

@Dylan Kane, “extra work.” Right, that’s exactly what I was trying to convey to Joshua above. Thanks.

@Jennifer, nice introduction to the concept of a variable. Added to the post above.

FWIW, I’ll throw my chips towards Evan’s post on the matter. (Be sure to click through to his earlier one also.)

Here’s Evan:

Programmers use variables because they want to build a program that produces a correct output for every possible input that might be used to solve a given problem or design.

And the value of that variable expression grows the more times the programmer runs it. In the textbook original here, the student runs the expression once. That seems like a major shortcoming of this kind of problem to me.

@Pam, the biggest trouble was that the intersection of school Algebra and programming isn’t as large as we thought.

19. #### Jeanette S

July 25, 2014 - 9:18 pm -

I may be off the programming vs algebraic variables track, but have been working on building understanding of variables using ‘Think of a number’ problems with teachers of Grades 6 and 7.

For example: Think of a number, multiply by 2, add 10, divide by 2, subtract the number you thought of. What is your answer?
What if you start with a different number? I wonder why this happens?
Can you change the instructions to end with a different number?

Using a variable (and I prefer not to use x)
n –> 2n –> 2n + 10 –> n + 5 –> 5.

}I would love to have more such puzzles if any one can supply them.]

The other introduction to variables I use is through patterns in a calendar month: What patterns can you find and why do they work?

It seems to me that if variables are necessary for understanding a situation, then students are more likely to appreciate them as valuable in solving problems.

The issue with Dan’s textbook problem is that it is not a problem, but a series of instructions! I wonder how Dan will make it into a problem that is rich enough to need solving with a variable? I look forward to Monday’s post.

20. #### katenerdypoo

July 25, 2014 - 11:48 pm -

i think the ability to generalize and write a rule with variables is really important, but you can come to that through lots of nice activities and investigations as well.

for example, i did dan’s “taco cart” with my students with a few notable changes. instead of telling the students how fast dan and ben walked, i had each group decide on the speed of the two men themselves and list that along with other assumptions they made in the problem.

when we did the whole class summary, i told them that i had written down a formula on my paper that would allow me to check if their answers were correct and that i needed that since everyone used their own speed. i should’ve asked them all to take a minute to try to come up with the formula i used, but instead i elicited it at that moment and one student gave me the correct formula. the need for two variables (speed on sand and speed on pavement) was obvious.

in part two of taco cart, when the students were trying to figure out where the taco cart should be so that the two men reached it at the same time, one group did seemingly endless guess and checks. i suggested to them that this wasn’t a good method and asked if maybe it wasn’t better to write an equation with a variable. again, they could see the need. once they started with a variable, the rest of the problem started to fall into place.

here’s the thing: these “write an expression” problem want to train students to learn to generalize and write a rule. they want them to be able to see a situation that would best be tackled with a formula of some sort, write said formula with various variables, and use their formula to solve complex problems. but the issue is that these problems don’t actually train students in that way because they’re so artificial and one-dimensional. what they do is teach students to “translate” from english to math (an important step along the way, i do believe), but not to recognize a situation in which a formula would be helpful or necessary or how powerful it can be.

21. #### Xavier

July 26, 2014 - 12:44 am -

@Irma Fiametta: perfect. Sublime!. You pass from a boring task to interesting

@all:

why not represent the data? “Can we plot the data of number of remembered dreams….”

what about hidden equations: how many dream we dreamt if we remember just 370?

Here is what variables matter. The rest is pure mechanic illusion.

22. #### Dan L

July 26, 2014 - 1:10 am -

Two thoughts from a computer science teacher’s point of view:
1) When introducing programming to 15 yrs olds for the first time, we use Python interactive prompt as a calculator first. And the first point is to show the advantages. Variables and funstions (one-liner formulas) simply save work. That is it, that is one of the goals of the whole programming topic anyway. When they do quadratic equations in maths at that time, we are headed that way. And students realize pretty fast: aha, I have to understand how to solve them, but once I do and I describe it properly, I never have to do it by hand anymore. Their understanding of q.e. deepened, they interest in programming increased, and I could naturally introduce a load of important CS concepts on the way. In younger age we do simpler formulas, also like BMI calculation (not only the “area of the circle” kind of stuff, which they, um, do not prefer), but the point is the same: the kids need to see at least some hypothetical benefit for themselves. Having to introduce variables in maths, I would in principle search for a similar approach. (Note: for even younger kids, fun and creativity achieved with Scratch, turtle etc. overweigh the “practical benefits”; but when practicality leads to more fun – win-win!).

2) A good and often forgotten tool between calculation on paper and programming is a spreadsheet. It can store lots of numbers in a structured way and perform basic calculations, what is well understood by kids. And when we want to do anything more complex without getting beards grown, we absolutely need formulas and “variables”. Their advantages are imminent. And the whole time, everything is in plain sight, the level of abstraction is way lower than with programming, making it very accessible for kids. I am of course interested in it “from the other side” – after some decent work in spreadsheets, many more advanced concepts are a step away (for-loop, data type, input-output, function, incremental work on more complicated calculations, debugging etc. etc.). But I believe that thoughtful use of spreadsheets can improve understanding in appropriate topics in maths.

23. #### Dan Meyer

July 26, 2014 - 7:43 am -

Super helpful strategies from both Kate and Dan. Thanks, team. Added to the main post.

Dan, you should check out Evan’s comments above. Evan’s a spreadsheet fan also for similar purposes.

24. #### Don

July 30, 2014 - 11:32 am -

I wonder if we get kids thinking about variables/placeholders soon enough. Seems to me that a prime point to do it would be operator precedence – it would work well visually and it’s conceptually similar. You need the student to view that line of numbers and operators as discrete items that match up in more than a left to right manner.

So why not write 4 + 9 * 3 / 2 on your board and rather than subbing in 21 you write A, with a note off to the side, rather than circling it or erasing it and replacing it with 21. It can be a stealth exposure – oh, let’s just make this easier to think about by putting this A in here rather than the parenthesis. Then we can do the same for the next one, and write it over on the next line saying that B is equal to A / 2. May as well say C = 4 + B then.

Now you’ve created representations and created a nice little shorthanded list to the right of one-operation things to do to get your answer. Building it worked on teaching precedence and you make it easier than visualizing the line and doing mental or on-board “stacks,” which is how my distant memory of it being taught was done.

25. #### Gail C

August 1, 2014 - 8:35 am -

Here’s a slightly different perspective on variables coming from someone who teaches undergrads how to program for the first time. I use Processing, which produces all visual output. We start by drawing static pictures and do more interactive programs as time goes on.

I usually offer the following reasons for using variables:

(1) To avoid repetition. If we write the same number many times throughout our code, but later change our mind, we have to go and update every instance. Annoying and error-prone.

(2) To improve readability. When you give your variable a meaningful and descriptive name, you can more easily understand your calculations, etc. This was mentioned above along with the suggestion to use a better name than “x”.

(3) To deal with the fact you have no idea what the value will be. At first, this doesn’t come up, as we are only drawing static images, but once we introduce user input, we need a way to store that input somewhere so we can do something with it.

Maybe these points offer some clues to the question at hand.