Skip to main content
Logo image

Just Enough Algebra

Section 0.4 Prelude: Order of operations

Remember Cole who was shocked by his credit card bill? His bill showed a previous balance of $529.16, credit for a payment of $200, finance charge of $42.78, a late fee of $30 (ouch!), a credit for $17.43 for a return he made, and $618.25 in new charges. How can we help Cole check his balance?
The most direct way to calculate Cole’s balance would be step-by-step.
\begin{align*} 529.16-200 \amp= \underline{329.16}\\ 329.16+42.78\amp=\underline{371.94}\\ 371.94+30\amp=\underline{401.94}\\ 401.94 -17.43\amp=\underline{384.51}\\ 384.51+618.25\amp=\underline{1002.76} \end{align*}
The underlined numbers are what the calculator will show. Cole doesn’t type those numbers.
We can avoid typing in answers (which can lead to errors) by continuing one big calculation instead.
\begin{align*} 529.16-200 \amp=\underline{329.16}\\ +42.78\amp=\underline{371.94}\\ +30\amp= \underline{401.94}\\ -17.43\amp=\underline{384.51}\\ +618.25\amp=\underline{1002.76} \end{align*}
Cole found an even quicker way to check the balance. He did not hit \(=\) until the very end of the calculation. He just did the calculation all in one line.
\begin{equation*} 529.16 - 200 + 42.78 + 30 - 17.43 + 618.25 = \$1002.76 \end{equation*}
Notice that there are both addition (\(+\)) and subtraction (\(-\)) operations in this one-line calculation. These two operations (\(+\) and \(-\)) are tied for priority in the order of operations, so the calculator works from left to right. This one line calculation is equivalent to doing the much slower step-by-step process!
By the way, the word priority means of higher importance and, therefore, coming before. For example, doing your math homework should be a higher priority than watching random videos online. But getting a good night’s sleep should be a higher priority than studying for a test. (You’ll have to trust me on that one.)
Earlier we heard about the Nussbaums who planted a walnut tree. The tree was 5 feet tall when the planted it. It has grown around 2 feet a year. According to this information, the tree was \(5+2=7\) feet tall after one year, \(7+2=9\) feet tall after two years, \(9+2=11\) feet tall after three years, and so on. We wanted to know how tall the tree was after 18 years.
One way to calculate the answer is to first figure out how much the tree grew in 18 years. That is
\begin{equation*} \underbrace{2+2+ \ldots + 2}_\text{18 times} \end{equation*}
which we calculate as
\begin{equation*} 18 \times 2 = 36 \end{equation*}
Next, we add the original height plus how much the tree grew to get
\begin{equation*} 36+5=41 \end{equation*}
The tree was 41 feet tall after 18 years.
Inspired by Cole’s one-line calculation, let’s do this calculation all in one line. One option is
\begin{equation*} 18 \times 2 + 5= \end{equation*}
Notice we are only hitting the \(=\) key at the end. We get 41 feet, again.
But wait! What if I wanted to enter the starting height first (5 feet) and then add on how much the tree grew (36 feet). I should be able to do that because \(5 + 36 = 41\) also. What happens when you enter
\begin{equation*} 5+18 \times 2=? \end{equation*}
You should get 41 again.
Something strange is happening. Either the calculator is reading your mind (probably not possible yet, but Artificial Intelligence is making great progress), or the calculator has a secret order of operations. The calculator is not just working from left to right because that would be
\begin{align*} 5+18\amp=\underline{23}\\ \times 2\amp=\underline{46}\text{ Oops!} \end{align*}
That is not what the calculator did. The calculator first did the multiplication (\(18 \times 2 = 36\)) and then did the addition (\(5+36=41\)). It turns out that multiplication (\(\times\)) is higher priority than addition (\(+\)) and subtraction (\(-\)) in the order of operations.
You will need to know the full order of operations so that you know when the calculator is doing what you want. Here’s the full list of the order of operations, the priority ranking for arithmetic operations.

Order of operations

  • First, calculate anything inside Parentheses.
  • Next, calculate Exponents \(\wedge\text{,}\) in order from left to right.
  • Then, Multiply \(\times\) and Divide \(\div\text{,}\) in order from left to right.
  • Last, Add \(+\) and Subtract \(-\text{,}\) in order from left to right.
We highlighted the letters PEMDAS which often helps people remember this order. (“Please Excuse My Dear Aunt Sally” is how I learned it.) Outside of the United States this rule has names such as BEDMAS, BIDMAS, BODMAS, PODMAS, PIDMAS, or even GEMDAS. Notice that multiplication (\(\times\)) and division (\(\div\)) are tied for priority just like addition (\(+\)) and subtraction (\(-\)) were.
The good news is that your calculator does the operations in exactly this order. For example, remember Jarron who was calculating his BMI? He entered
\begin{equation*} 91.625 \div 1.93 \wedge 2 = 24.7479\ldots \approx 24.8 \end{equation*}
which is in the range considered healthy. Of course, there are many more factors to health besides height and weight. Like getting enough exercise is really important. But, back to the calculation, how did that work?
According to the order of operations, the calculator did the exponent (\(\wedge\)) first and then the division (\(\div\)) second. Let’s check it out:
\begin{align*} 1.93 \wedge 2 \amp=\underline{3.7249}\\ 91.625 \div 3.7249\amp=\underline{24.7479\ldots} \end{align*}
That’s correct because exponents (\(\wedge\)) are higher priority in the order of operations than the other arithmetic operations (\(\times, \div, +, -\)).
Remember that \(1.93 \wedge 2\) is short for \(1.93\times 1.93\text{.}\) Don’t believe me? Try both on your calculator to see. Your calculator may have a key marked \(\wedge\) or it might be marked \(y^x\text{.}\) We will come back to exponents in more depth later.
What can we do if we want the calculator to work in a different order? For example, suppose in the Asian student association that there are 3 Chinese students, 15 Hmong students, 11 Vietnamese students, and 5 students who do not identify with any of these ethnicities. We’d like to report the percentage of students in the group who are Hmong.
First we need to calculate the total number of students
\begin{equation*} 3+15+11+5 = 34 \end{equation*}
There are 34 students and 15 identify as Hmong. That means the proportion of Hmong students is
\begin{equation*} 15 \div 34 = 0.4411\ldots \end{equation*}
and so the percentage of students in the group who are Hmong is
\begin{equation*} 0.4411 \times 100 = 44.11 \approx 44 \% \end{equation*}
Notice we can do these last two calculations in one line as
\begin{equation*} 15 \div 34 \times 100 = 0.4411\ldots \end{equation*}
because multiplication (\(\times\)) and division (\(\div\)) are tied for priority in the order of operations.
Can we do the entire calculation in one line? Sure, but it does not work to do
\begin{equation*} 15 \div 3 + 15 + 11 + 5 \times 100=531 \text{ Oops!} \end{equation*}
What did the calculator do? Since multiplication (\(\times\)) and division (\(\div\)) are higher priority than addition (\(+\)), the calculator first figured out that \(15\div 3 = 5\) and \(5 \times 100 = 500\) and then it calculated \(5 + 15 + 11 + 500 = 531\text{.}\) Argh.
We wanted the calculator to do the addition (\(+\)) first. That’s not the order of operations the calculator will use. What can we do to fix that? Parentheses to the rescue! Parentheses have the highest priority in the order of operations, meaning the calculator will evaluate inside the parentheses before doing any other operations. So we can do this calculation all in one line by using parentheses as
\begin{equation*} 15 \div (3 + 15 + 11 + 5) \times 100= 44.11\ldots \text{ Whew!} \end{equation*}
As you work through the exercises, challenge yourself to find one-line calculations to use. You are always welcome to do the slower step-by-step method to check.

Do you know …

  1. How a calculator will evaluate an expression that has several different operations, such as \(2.1 + 7 \times 1.1\text{?}\)
  2. What is the order of operations in general?
  3. A good way to remember PEMDAS?
  4. Why you need to know what the order of operations is?
  5. When might you need to override the order of operations?
  6. How to override the order of operations using parentheses?
If you’re not sure, work the rest of exercises and then return to these questions. Or, ask your instructor or a classmate for help.

Exercises Exercises

Exercises 1-4 are available in a separate workbook format.
On each problem, write down what you enter into your calculator and don’t forget to write the units on your final answer. Challenge yourself to use one-line calculations. You are welcome to calculate the answer step-by-step to check.

1.

(Story also appears in 1.2.4, 2.1.4, and 4.2.2)
(a)
A mug of coffee costs $3.45 at Juan’s favorite cafe. If Juan orders 25 coffees each month, how much will he pay (total) for the month?
(b)
The cafe offers a deal each month, where if you buy their $10 discount card, then you only pay $2.90 per mug of coffee during the month. If Juan buys the discount card and orders 25 coffees, how much will he pay (total) for the month?
(c)
Comparing answers to parts (a) and (b), is it worthwhile for Juan to buy the card? Explain.

2.

“Rose gold” is a mix of gold and copper.
(Story also appears in 0.7.4, 2.3.2, and 4.1.7)
(a)
If we mix 2 grams of gold with 2 grams of copper, what is the percentage of gold in the resulting alloy?
(b)
If instead we mix 2 grams of gold with 7 grams of copper, what is the percentage of gold in the resulting alloy?

3.

(Stories also appear in 0.7.1 and 4.3.3)
(a)
Vanessa’s doctor put her on a sensible diet and exercise plan to get her back to a healthy weight. She currently weighs 213 pounds. She will need to lose an average of 1.25 pounds a week to reach her goal weight in a year. What is her goal weight? Use 1 year = 52 weeks.
(b)
Since she has been pregnant, Zoe has gained the recommended \(\sfrac{1}{2}\) pound per week. She weighed 153 at the start of her pregnancy. What does she weigh now at 30 weeks pregnant?

4.

(Stories also appear in 0.7.1 and 4.3.3)
(a)
Jerome has gained weight since he took his power training to the next level ten weeks ago, at the rate of around 1 pound a week. He is now 198 pounds. What was his original weight?
(b)
After the past 6 weeks of terrible migrane headaches, Carlos is down to 158 pounds. He has lost 4 pounds a week. What did Carlos weigh 6 weeks ago before the migraines started?

5.

Recall that in the Asian student association there were 3 Chinese students, 15 Hmong students, 11 Vietnamese students, and 5 students who do not identify with any of these ethnicities. What percentage of students in the group identify as Vietnamese?

6.

Patience has been saving for a trip. She started her savings account with a deposit of $300. For the past 18 months she’s been adding $250 per month. Unfortunately she needed to withdraw $1,080 for an unexpected car repair. She has earned a total of $43 interest. How much is in Patience’s account now?

7.

Mike Powell has held the men’s long jump record since 1991. He jumped an amazing 29 feet, 4\(\frac{1}{4}\) inches. We would like to write this length as a decimal number of feet.
(a)
First, write 4\(\frac{1}{4}\) inches as a decimal number of inches. Note that this length means \(4 + \frac{1}{4}\text{.}\)
(b)
Next, convert your answer into feet by dividing by 12, since there are 12 inches in a foot.
(c)
Last, add your answer to 29 feet and round to the nearest two decimal places.
(d)
Valentina was trying to figure out the answer in one line on his calculator. He tried
\begin{equation*} 4 + 1 \div 4 \div 12+29= \end{equation*}
What answer does Valentina get? Oops!
(e)
Add one set of parentheses to correct Valentina’s work.

8.

My house gets super dry in the winter, especially if we are away not cooking or using the shower. Last January I left a 5 quart pot full of water on my living room radiator for a week and when I got home there was perhaps 1 cup of water left.
(a)
How many cups of water are in 5 quarts? There are 4 cups in every quart.
(b)
How many cups of water evaporated?
(c)
How fast was the water evaporating, measured in cups per day? (Hint: use that there are 7 days in a week.)
(d)
Cadde was trying to figure out the answer in one line on his calculator. He tried
\begin{equation*} 5 \times 4 -1 \div 7 \end{equation*}
What answer did Cadde get? Oops!
(e)
Add one set of parentheses to correct Cadde’s work.