What’s An “Expression” ?

< Back >

 

An expression is a set of one or more values
that can be operated upon to obtain a single value.

 

In other words, an expression is a series of values separated by math operators,
like add, subtract, multiply and divide, etc.

 

The number 1  is an expression, although it is a simple expression.
 

A slightly more complex expression might be  5 + 2  or  5 + 2 * 3 .

 

“5 times 2 plus 3 divided by 6” is an expression :

5 * 2 + 3 / 6

 

Question :

Do we want to multiply 5 times the sum of “2 plus 3” or …
do we want to multiply 5 times 2 first, then add the 3 ?

 

As expressions get more complicated, some rules have to be used to work them out.

One rule is that multiplication is normally done before addition.

 

So, there is really only one answer, according to the “rule of precedence,”

that specifies that multiplication and division are calculated first

as shown here :

 

(5 * 2) + (3 / 6)

 

 

Using the example of  5 + 2 * 3,

      

      The order that the calculations are done can be controlled by using parentheses :

 

               a) If we want to multiply 2 times 3, and then add 5 :

                           we don’t have to change anything to get that answer : 7.

 

                                       This follows the rule that multiplication is done first,
                                    since parentheses have not been used to specify otherwise.

 

          Or


b) If we want to add 5 + 2 before multiplying that sum by 3 :
            In order to get the right answer here, we have to use parentheses

                                to specify that (5 + 2) is to be calculated first.

               The rule is to do exponents, first, then multiplication and division followed by addition and subtraction.

              

               However, whatever is inside parentheses MUST be done first, to be able to change the order of operations.