Reading an expression left-to-right like a sentence is how you get 3 + 4 \times 2^2 = 14 \times 1 = 14 through guesswork and 28 through panic. Neither reading is how a computer, a calculator, or a working mathematician sees the expression. They see a tree. The top of the tree is the last operation to perform. The bottom of the tree is the first. BODMAS is not a priority list you memorise — it is the rule that tells you which operator sits higher and which sits lower. Once you can draw the tree, you never misread an expression again.
Build the tree for 3 + 4 \times 2^2
The operators in this expression are +, \times, and the exponent. Their precedence, from lowest to highest, is + < \times < \;\wedge (where \wedge means "raise to the power").
That means the exponent binds tightest, so it sits at the bottom. \times sits above it. + sits on top. Each internal node has two children — its left and right operands.
Read it aloud: "take 3, plus (take 4 times (take 2 to the power 2))." Every pair of parentheses in that sentence is an internal node of the tree.
The collapse: bottom-up evaluation
To evaluate, you do not start at the top. You start at the leaves and work your way up. Each internal node waits until both of its children are numbers, then collapses itself into one number. The tree shrinks, one node at a time.
The interactive below walks through all four collapse stages. Drag the slider to advance. At step 0 you see the full tree. At step 1 the exponent \wedge has eaten its two children and become 4. At step 2 the \times node has eaten 4 and 4 and become 16. At step 3 the + has eaten 3 and 16 and become 19.
The text rendering of each stage:
| stage | remaining expression | just collapsed |
|---|---|---|
| 0 | 3 + 4 \times 2^2 | (start) |
| 1 | 3 + 4 \times 4 | 2^2 \to 4 |
| 2 | 3 + 16 | 4 \times 4 \to 16 |
| 3 | 19 | 3 + 16 \to 19 |
Each stage is a real arithmetic step your hand could write on paper. There is no invisible algebra. All that changed between stage 0 and stage 3 is that three nodes of the tree collapsed, in order of depth.
Why deepest-first? Because an operator needs its operands to be numbers before it can fire. The deepest operator is the one whose operands are already numbers (leaves). Higher operators have to wait.
Why left-to-right reading fails
If you read 3 + 4 \times 2^2 left-to-right as a sentence, you get
That is not an arithmetic answer — it is the grammar of English applied to a non-English object. The expression is not a sentence. It is a tree, and trees evaluate bottom-up.
The reason BODMAS exists as a convention is precisely to tell you how to build the tree from the written line. The "B" puts brackets at the bottom. The "O" puts powers next. "DM" goes above that. "AS" goes on top. Once the tree is built, the evaluation order is forced — there is nothing to decide.
A more tangled example
Consider 24 \div 4 + 2 \times (5 - 3)^2. Same idea, bigger tree.
- The innermost thing is 5 - 3, because it is inside the brackets. It is a leaf of the tree's bracket subtree.
- Above that is the \wedge 2 — the power operator — acting on the bracket.
- Above that, on the right side of the tree, is 2 \times (\ldots).
- On the left side is 24 \div 4.
- At the root is the + that joins the left and right sides.
Collapse sequence:
- 5 - 3 \to 2.
- 2^2 \to 4.
- 2 \times 4 \to 8 (right branch done) and simultaneously 24 \div 4 \to 6 (left branch done).
- 6 + 8 \to 14.
You can run the two branches in either order at step 3 — they are independent. That is another thing the tree view makes obvious: two nodes at the same depth on different branches do not care about each other.
The reflex, in one line
When an expression looks ambiguous, draw the tree — or imagine it. The operator you write last is the operator that fires last. The operator you write deepest is the one that fires first. BODMAS is the manual for building the tree; evaluation is then automatic.
Related: Operations and Properties · Number Systems · Algebraic Expressions · Exponents and Powers