Multi-part algebra

From arithmetic to algebra

In the previous section, you saw how to define a solution model for multi-part arithmetic exercises. We will now extend this to questions that involve algebra. The difference between algebra and arithmetic questions is that the solution uses variables and equations. Here are two examples of multi-part problems that involve algebra:

  1. "Find the formula of the linear line intersecting (1,3)(1,3) and (3,1)(3,-1)."
  2. "A rectangular piece of land has an area of 2400m22400 m^2. The length of the land is 20m20 m longer than the width. What is the total length LL of a fence surrounding this land?"

We will create both examples using the Multistep question type. You can try them in the live examples below:

Live example: The multi-part algebra problems.

Example 1: The formula of a line

Consider the first example.

Example problem 1

Find the formula y=mx+by=mx+b for the line intersecting (1,3)(1,3) and (3,1)(3,-1).

The solution to this problem requires the following parts:

  1. Calculate the slope, mm
  2. Find the yy-offset, bb, by substituting one of the given points
  3. Write the formula for yy.

We turn this into a solution model as follows:

Part Description Calculation Marks
yy the requested formula y=mx+by=m\cdot x+b 1
mm the slope 1331\frac{-1-3}{3-1} 1
bb the yy-intercept Solve 3=m1+b3=m\cdot 1+b for bb 1
Note

Note that we did not define the part for yy as y=52xy=5-2x, which is the answer to the problem. Instead, we keep variables mm and bb to let Algebrakit know these are required to find the solution. You can also see that the slope mm is needed to calculate the yy-offset. Algebrakit will first calculate the slope, then the yy-intercept, and finally the solution.

Now, let's create this question in Multistep.

  • Add two new intermediate parts and name them mm and bb.
  • Add the variables yy, mm and bb.
  • Add the descriptions to the parts as given in the solution model.
  • Set the tasks corresponding to the calculations in the solution model.
  • Click on the part named mm and choose task Solve equations in the dropdown labelled "Task".

Overview of a multistep exercise with variables Figure: Overview of a multistep exercise with variables.

Variables

An important step is adding the variables to exercise parts yy, mm and bb. Names of exercise parts are just references to other parts for authoring purposes. Students never see the names and cannot use them in their work. However, students can use variables in their work.

The names of parts and their variables do not need to be the same. If you renamed the parts to "solution", "slope" and "offset", the exercise would still work identically, as long as the variables stay the same.

If you do not add variables to parts mm and bb, Algebrakit will not correctly interpret expressions that involve these variables. Here are some examples.

Student input Evaluation with student variables Evaluation without student variables
y=mx+by=mx+b Correct intermediate step. Algebrakit understands mm and bb still need to be calculated. Incorrect. Algebrakit does not allow using mm or bb.
2-2 Correct intermediate step. The input is assumed to correspond to the slope. Same
m=2m=-2 Correct intermediate step. Algebrakit understands that mm is the slope, which equals -2. Incorrect. Algebrakit does not interpret mm as the slope.
m3+b=1m\cdot 3+b=-1 Correct intermediate step. Algebrakit knows that m=2m=-2 and b=5b=5, so the relation is valid. Incorrect. Algebrakit does not allow using mm or bb.

This is a significant improvement. Students can now build their solutions by writing formulas and equations first and solving them later. From a didactical point of view, we transitioned from arithmetic to algebraic thinking.

Example 2: An algebra word problem

We will now create the second example question:

Example problem 2

A rectangular piece of land has an area of 2400m22400 m^2. The length of the land is 20m20 m longer than the width.

What is the total length LL of a fence that surrounds this land?

You can solve this problem in two ways:

  1. Calculating the width first:
    • Find the width ww by solving equation w(w+20)=2400w(w+20)=2400
    • Find the circumference as 2w+2(w+20)2w+2(w+20).
  2. Calculating the length first:
    • Find the height ll by solving equation l(l20)=2400l(l-20)=2400
    • Find the circumference as 2l+2(l20)2l+2(l-20).

Which results in the following solution models:

Part Description Calculation Marks
ww the width of the land Solve w(w+20)=2400w(w+20)=2400 1
LL the length of the fence 2w+2(w+20)2w+2(w+20) 1
Part Description Calculation Marks
ll the length of the land Solve l(l20)=2400l(l-20)=2400 1
LL the length of the fence 2l+2(l20)2l+2(l-20) 1

You add these to Multistep as follows:

  • Add two new exercise parts with names ww and ll.
  • Add the variable LL to the solution part.
  • Add variables ww and ll to their respective intermediate parts.
  • Add the descriptions to all exercise parts
  • Set the tasks. Use the Simplify task for LL and the Solve equations task for ww and ll.

If you test the exercise, you will see that Algebrakit complains about the variable ww.

Error message when a variable does not have a single value

The issue is that the equation w(w+20)=2400w(w+20)=2400 has two solutions: w=60w=-60 and w=40w=40. To not complicate things, Algebrakit only allows using ww as a variable if it has a single result. You can solve this problem by adding the domain w>0w>0 to the equation, as shown below:

Adding a domain to enforce a single result Figure: Adding a domain to enforce a single result.

Add a domain to exercise part ll as well. You should now be able to run the question.

Free variables

The exercise already works well. You can apply algebraic thinking, using formulas and equations for variables LL, ww, and ll, and Algebrakit will understand. But we can go even further.

The instruction does not mention variables ww and ll. Moreover, the question does not indicate that you should use variables at all. It is up to the student to come up with that approach. Learning that you should use variables here is an example of modelling, an important mathematical skill.

So now we have the problem that the solution model assumes students use variables ww or ll, but we don't want to include that information in the instruction. The solution is to declare ww and ll as free variables. Using a free variable means students do not have to use the same variable name. Instead, they are free to choose their own name.

You declare a free variable in the symbols tab on the top bar.

Defining free variables Figure: Defining free variables.

The example below shows an example of a correct solution to this problem.

Choosing custom variable names when solving the question Figure: Choosing custom variable names when solving the question.

Note

A free variable must be a single symbol. So students cannot use a variable name like 'widthwidth'.

Restrictions when using variables

These examples show how variables are a powerful concept that helps students apply algebraic thinking. However, there are a few limitations when using this technique.

  • Variables must have exactly one solution. We saw this already in the second example. If an equation defines the variable, you might have to add a domain. Note that it is also not ok if the equation has no solutions.
  • Variables cannot refer to each other. Assume aa and bb are variables. We can define aa to be dependent on bb or bb to be dependent on aa, but not both. If the task for aa depends on bb and the task for bb depends on aa, then Algebrakit will show an error message if you try to run the exercise. The reason is that no order exists to calculate the results for each part. Algebrakit currently does not support exercises with this type of circular definition.