Variables and terms
It is often helpful to use letters that stand for numbers. These letters are called Variables (or placeholders). With the help of variables, calculation rules (from now on called terms, algebraic expressions, or formulas) can be written down briefly and precisely using the basic operations (). In fact, without variables we would have to write out these calculation rules as a sentence, which is rather complicated and cumbersome. Here are a few examples:
Write as a term using variables:
-
"A number is multiplied by , and subtracted from another number"
-
"Multiply one number by another, subtract half of the first number, and add to the result three times the second number."
Solution
- Let's call one number , the other . We then have .
- Let's call the first number , the second one . We have .
Write the following terms as a sentence without using the letters , , and .
Solution
- Multiply the first number by three, and add to the result the value which is obtained by subtracting the third number from the second number.
- Increase the first number by , and divide the result by the value you get if subtract from twice the second number.
Evaluating terms
If a term is given, we can evaluate it as soon as we know which numerical values the variables should have. It often helps to think of the variables as containers that can be filled with numbers.
For example: The term
contains two containers and , which do not have to hold the same numbers. But the containers with the same letter always must contain the same number. Perhaps it helps to actually draw containers, say a blue circle for and a red circle for . We have then
If and , we have to put the into and the into and thus get
For and we get
Order of operations and brackets (or parentheses)
Generally speaking, if we add several variables or numbers, or if multiply several variables or numbers, we do this from left to right. For example, say we have the term
and use and . Then we start on the left and calculate
and then
However, if there is a mixture of operations, this left to right pattern is not always correct. Often we have small groups (let's call them atomic terms) within a term which must be evaluated first. Basically, there are two cases:
-
Multiplication and division binds stronger than addition or subtraction. That is, we must evaluate the atomic terms with the dot operators first. For example, consider the term . Here we have to evaluate the atomic term first, because it is separated from the by a plus, which binds weaker. Thus, for and , we have
and
Note the a power, e.g. binds stronger than multiplication. So, we have
So we have the following oder (from binding strongest to weakest):
-
Brackets form atomic terms which must be evaluated first. For example, take the term . Now, because there is a bracket, we first have to evaluate the atomic term . Thus, for and we have
and
You can also think like this: Power binds stronger than multiplication, and multiplication binds stronger than addition (and subtraction). But brackets bind the strongest!
Of course, atomic terms can also contain other atomic terms, as indicated below in colors:
Here, red and green are atomic terms, and the green atomic term consists of two other atomic terms ST1 and ST2.
Evaluate the terms:
-
for
-
, for
-
, for
-
, for
-
, for
-
, for
-
, for ,
-
, for ,
-
, for , ,
-
, for
-
, for
-
, for , ,
-
, for ,
Solution
- , for