All gamesiPhone calculatorBlog

Home › iPhone calculator › Order of operations

Math Rules and PEMDAS: The Order of Operations on the iPhone Calculator

A Phoney’s Calculator Class tutorial

Order of operations15 minutes

Try this puzzle on a friend. What is 3 + 4 × 2? One friend will say 14, because 3 plus 4 is 7, and 7 times 2 is 14. Another will say 11, because 4 times 2 is 8, and 3 plus 8 is 11. They cannot both be right, and in mathematics there is an agreed answer: 11. The reason is a set of rules, a kind of traffic code for calculations, that tells everybody which operation to do first.

Without such a code, the same sum could have many different answers, and engineers, bankers and scientists would never agree on anything. With it, a calculation means exactly the same thing in London, Tokyo and Nairobi. These rules are called the order of operations, and the most popular way to remember them is the word PEMDAS.

This is the final tutorial in the series, and it ties everything together. In this lesson you will learn what PEMDAS stands for, how each part works, how the iPhone Calculator follows the rules, how its behavior can differ between versions, and, most important, how to type any calculation so that you always get the right answer. Open your Calculator, and let us bring order to the numbers.

Watch the video

What PEMDAS stands for

PEMDAS is a memory aid. Each letter is a type of operation, listed in the order you should do them:

A popular sentence to remember it is “Please Excuse My Dear Aunt Sally.” In some countries the same rules go by other names, such as BODMAS (Brackets, Orders, Division, Multiplication, Addition, Subtraction) or BEDMAS. They are the same rules in a different outfit.

Here is the single most important thing to understand, and where most mistakes begin: multiplication and division share one level, and addition and subtraction share one level. The letters are in the word in a certain order, but M does not beat D, and A does not beat S. Within a level, you simply go from left to right.

Why we need rules at all

Imagine a recipe that says “add 3 cups of flour and 4 cups of sugar times 2.” Do you double only the sugar, or the whole mixture? In mathematics, the rule says multiplication comes before addition, so only the 4 is doubled: 3 + (4 × 2) = 11. If you wanted to double the mixture, you would put brackets around it: (3 + 4) × 2 = 14.

The rules also explain why shopping and money calculations come out consistently. A cashier who adds the tax to the total before multiplying by the quantity would give a different price than a cashier who followed the rules.

Step 1: Parentheses first

Brackets are the boss of every calculation. Anything inside them is done before anything outside.

Compare:

On the iPhone, brackets are on the scientific keypad. Turn your phone sideways, and you will see ( and ) at the top left. To enter the second example, tap (, type 3, tap +, type 4, tap ), tap ×, type 2, tap =. The screen shows 14.

Brackets can be nested, one inside another. Work from the innermost pair outwards. For 2 × (3 + (4 − 1)), first do 4 − 1 = 3. Then 3 + 3 = 6. Then 2 × 6 = 12.

Step 2: Exponents

Powers and roots come next. In 2 + 3², the exponent is done first: 3² = 9, then 2 + 9 = 11. In (2 + 3)², the brackets come first: 5² = 25.

This is the same idea you met in Part 2, and it connects to roots from Part 3, since a root is a fractional power.

On your calculator, try 2 + 3 x². If you type it in the usual order, you might expect 11. But remember that the x² key acts on the number on the screen immediately. When you type 3 and tap x², the screen shows 9, and then you add 2 with + ... =. The result is the same, 11. For longer expressions, use brackets to be safe.

A special case: a negative number raised to a power. −3² means −(3²) = −9, but (−3)² = 9. Brackets make the difference.

Step 3: Multiplication and division, left to right

These two share a level. When both appear in a calculation, work through them in the order they appear, from the left.

Consider 12 ÷ 3 × 2. Many people think the multiplication should come first, giving 12 ÷ 6 = 2. That is wrong. Left to right, 12 ÷ 3 = 4, and then 4 × 2 = 8.

And 100 ÷ 5 × 2 is 20 × 2 = 40, not 100 ÷ 10 = 10.

The same rule applies to 8 ÷ 2 × 4. Left to right, it is 4 × 4 = 16.

Step 4: Addition and subtraction, left to right

The last level also goes left to right. 8 − 3 + 2 is 5 + 2 = 7. If you added first, you would get 8 − 5 = 3, which is wrong.

In a long sum such as 20 − 5 + 3 − 2, work from the left: 15, then 18, then 16.

Putting all the steps together

Let us work a longer example slowly: 6 + 2 × (5 − 3)² ÷ 4.

  1. Parentheses: 5 − 3 = 2. The problem becomes 6 + 2 × 2² ÷ 4.
  2. Exponents: 2² = 4. Now it is 6 + 2 × 4 ÷ 4.
  3. Multiplication and division, left to right: 2 × 4 = 8, then 8 ÷ 4 = 2. Now it is 6 + 2.
  4. Addition: 6 + 2 = 8.

Going through the steps one at a time is the best habit. Write down the problem after each step, until a single number remains.

How the iPhone Calculator follows the rules

Here is the part that surprises many people. The iPhone Calculator has not always followed the order of operations in the same way.

In older versions of the simple portrait calculator, the numbers were processed as you typed them, one operation at a time, from left to right. That meant typing 3 + 4 × 2 gave 14: the calculator added 3 and 4 as soon as you pressed ×. Recent versions follow the proper order of operations when you press equals, so the same keystrokes give 11. The scientific keypad, with its brackets, is built around the proper rules.

Because versions differ, do not guess. Test your own calculator with this two-second check:

  1. Type 2 + 3 × 4 =.
  2. If the screen shows 14, your calculator follows PEMDAS.
  3. If it shows 20, it is working strictly left to right, as it types.

Here are two more tests:

Four safe ways to calculate correctly on any version

You do not need to know which version you have. These four methods give the right answer every time.

Method 1: use brackets. Put any part you want done first inside ( ) on the scientific keypad. ( 80 + 90 + 100 ) ÷ 3 = gives 90.

Method 2: press equals after each stage. Instead of one long chain, do each small step and press equals so the answer sits on the screen. For the same average: type 80 + 90 + 100 = (270), then ÷ 3 = (90). This works on every calculator, with or without brackets.

Method 3: use the memory keys. Work out one part, store it with m+, work out the other part, and combine with mr. You practised this in Part 1.

Method 4: write the steps on paper. Number each operation in the order PEMDAS tells you, and perform them one at a time.

Phoney’s tip: when two methods give you the same answer, you can be very confident.

Fractions need brackets

One of the most common mistakes involves fractions. Suppose you want to work out (3 + 5) ÷ (2 + 2). That is 8 ÷ 4 = 2.

If you type 3 + 5 ÷ 2 + 2 = without brackets, you get 3 + 2.5 + 2 = 7.5, which is completely different. The division only grabbed the 5 and the 2.

The rule is simple: when a fraction has more than one term on top or bottom, put brackets around each part. The correct entry is ( 3 + 5 ) ÷ ( 2 + 2 ) =, which gives 2. Or use equals after the top: 3 + 5 = (8), then ÷, then compute the bottom separately.

Formulas from real life

Most real-world formulas are really order-of-operations puzzles. Here are some you can try.

Fahrenheit to Celsius. The formula is (F − 32) × 5 ÷ 9. For body temperature of 98.6°F, type ( 98.6 − 32 ) × 5 ÷ 9 =. The answer is 37°C. Without the brackets, the calculator would subtract 32 after multiplying, giving nonsense.

Celsius to Fahrenheit. The formula is C × 9 ÷ 5 + 32. For 25°C, type 25 × 9 ÷ 5 + 32 =. The answer is 77°F. Here no brackets are needed, because multiplication and division come first, then the addition.

Average of three scores. Add the scores, then divide. ( 80 + 90 + 100 ) ÷ 3 = gives 90. Without brackets, you would get 80 + 90 + 33.3, which is 203.3.

Area of a trapezoid. The formula is (a + b) ÷ 2 × h. For parallel sides 6 and 10 and a height of 5, type ( 6 + 10 ) ÷ 2 × 5 =. The answer is 40.

Compound interest. The formula is P × (1 + r) to the power of t. For $1,000 at 5% for 3 years, type 1000 × ( 1 + 0.05 ) xʸ 3 =. The answer is 1,157.625, so about $1,157.63. You saw this in Part 2. The brackets make the 1 + 0.05 happen first.

Total with tax and tip. A meal costs $40, with 8% tax and a 15% tip on the pre-tax price. Total = 40 + 40 × 0.08 + 40 × 0.15 = 40 + 3.2 + 6 = 49.2. With PEMDAS, the multiplications happen before the additions, which is exactly what we want.

The famous viral problems

Every few months a puzzle goes viral that splits the internet, such as 8 ÷ 2(2 + 2) or 6 ÷ 2(1 + 2). Most of the argument comes from one thing: the missing multiplication sign. If you read it strictly left to right, with multiplication and division on one level, then 6 ÷ 2 × 3 = 9. Some people instead treat 2(1 + 2) as a single unit, which gives 6 ÷ 6 = 1. The honest answer is that the way it was written is ambiguous, and good mathematicians avoid writing it that way.

The lesson for you is easy: never write an expression that could be read two ways. Add brackets to say exactly what you mean. If you want the 9, write (6 ÷ 2) × 3. If you want the 1, write 6 ÷ (2 × 3).

Common mistakes and how to avoid them

Mistake 1: working strictly left to right. That only works if the calculator, and the expression, have no multiplication or exponents mixed in with additions.

Mistake 2: thinking multiplication beats division. They share a level. 12 ÷ 3 × 2 is 8, not 2.

Mistake 3: thinking addition beats subtraction. They share a level. 8 − 3 + 2 is 7, not 3.

Mistake 4: forgetting brackets on fractions. (3 + 5) ÷ (2 + 2) needs brackets, or you get a wrong answer.

Mistake 5: mismatched brackets. Every open bracket needs a close bracket. Count them before you press equals.

Mistake 6: forgetting that −3² and (−3)² differ. Brackets decide whether the minus sign is squared.

Mistake 7: assuming every iPhone behaves the same. Test your own with 2 + 3 × 4, or use the safe methods.

Practice questions

Try these before you look at the answers. Use brackets or equals after each stage if you are unsure about your version.

Question 1. What is 3 + 4 × 2?

Question 2. What is (3 + 4) × 2?

Question 3. What is 12 ÷ 3 × 2?

Question 4. What is 8 − 3 + 2?

Question 5. What is 2 + 3²?

Question 6. What is 6 + 2 × (5 − 3)² ÷ 4?

Question 7. Convert 98.6°F to Celsius with the formula (F − 32) × 5 ÷ 9.

Question 8. What is (3 + 5) ÷ (2 + 2)?

Answers

Quick reference

Frequently asked questions

Is PEMDAS the same as BODMAS? Yes. They describe the same rules with different words and a slightly different letter order.

Why do mathematicians all agree on these rules? They are a convention, like driving on one side of the road. They keep everyone’s calculations consistent.

Does the scientific keypad always follow PEMDAS? It is designed around brackets and proper order, but always test and use brackets when in doubt.

What if my calculator and my teacher disagree? Check the expression for ambiguity, add brackets, and follow your teacher’s instructions. When both agree after brackets, you have the right answer.

Your journey: all fifteen parts

Congratulations. You have reached the end of the whole series. Take a moment to look at how far you have come:

  1. Memory storage gave you a sticky note for numbers.
  2. Exponents let you build numbers up with powers.
  3. Roots undid powers, from square roots to fourth roots.
  4. Factorials counted the ways to arrange things.
  5. Sin, cos and tan unlocked heights and distances.
  6. Sinh, cosh and tanh described hanging cables and smooth curves.
  7. Rad and Deg controlled how angles are read.
  8. Scientific notation tamed the biggest and smallest numbers.
  9. Fractions turned division into a pizza.
  10. Pi measured every circle.
  11. Decimals handled the money and measurements of daily life.
  12. Percentages drove discounts, tips and growth.
  13. Large numbers stretched your sense of scale.
  14. Types of numbers sorted the whole family.
  15. PEMDAS put every calculation in the right order.

The best way to keep these skills sharp is to use them. Next time you are shopping, cooking, measuring or reading the news, reach for your calculator and ask a question. Check the order of operations, estimate first, and press equals with confidence.

Thank you for learning with Phoney’s Calculator Class. Keep your curiosity switched on, and keep pressing keys.

← All iPhone calculator lessons