Visualizing formulae
By making use of colors and stacking

See below to experiment with the different visualizations of the formulae.

This page can be used to teach how different operators (or operations) can have different precedences, for a more interesting exploration using this fact, I recommend checking out this page:
Visualizing formulae 2, Using a specialized graphical notation.

Used formulae

4*3+8:
5*6+10^2/4-1:
3+4*2/(1-5)^2^3:
3*22*22*22+3*22*22+2*22+10:
3+4*2/(4+3*(3+4)-5)+2^3:
3+4*2/(4+3*2*(3-3^2)^(4-5))+2^3:
π/4 = 1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + ...:

Visual

Take a look at the above example. Notice how the numbers all reside on the same “height” above the red colored layer?

Try to see how only addition (+) and subtraction (-) operations (e.g. something + 8, 12 + 5, but also 12 - 5) are surrounded by a colored layer. Operations with * and / are not (those are called terms), because they're always one step up. Exponents are again one step up from terms.

In the above example you can find a yellow colored layer. Remember what you can find inside colored layers? — Yes, just terms! So they always have either + or - operations inside.

It's intuitive to realize in what “order” things must be calculated!

Now in the example above you can see for yourself that even factors inside parentheses won't lie directly on top of a colored layer. Instead they're one step up again! (And they're colored white!)

This (last) one is the Taylor expansion way of calculating Pi, though you need to continue the pattern much longer to get more accurate digits.

Try it yourself

The rules

Found out the rules of the layers yet? Here comes a quick explanation.

The first layer (which is colored) can have a + or - sign on it, but not always, but there is always a second layer on top of it!
Operators * and / are always on the second layer.
The power operator ^ is always on the third layer.
The fourth layer can only be a value, no sign this time.

Further exploring

Last updated on 2017/07/01 at 07:16:33