Polish notation
Transcript
What if maths never needed brackets at all?

Normally we write the operator in the middle, like three plus four. That is called infix notation.


3 + 4In Polish notation, the operator goes first. Plus, three, four. The operator comes before the numbers.
+\ 3\ 4A logician named Jan Łukasiewicz invented it in 1924. He was Polish, so it is called Polish notation.
- Invented in 1924

It has other names too, like prefix notation, because the operator comes as a prefix, at the front. Now the clever part. Think about two times, open bracket, three plus four, close bracket. Brackets tell us what to do first.
2 \times (3 + 4)

In Polish notation, the same thing is times, two, plus, three, four. No brackets needed at all.
- No brackets needed!
\times\ 2\ +\ 3\ 4Why does it work? Each operator takes a fixed number of numbers, so there is only one way to read it.
Let us read it like a computer. Start from the right and work backwards. First, plus three four makes seven.
+\ 3\ 4 = 7Now the expression is times two seven. Two times seven makes fourteen. That is the answer.
\times\ 2\ 7 = 14Computers love this because the tree is easy to build. The programming language Lisp writes everything this way.
- Lisp uses prefix style


There is also reverse Polish notation, where the operator comes last. Three, four, plus.
3\ 4\ +Compare all three. Infix has the operator in the middle, prefix at the front, and postfix at the end. Quick check. How would you write four minus one in Polish notation? So, Polish notation puts the operator first, which removes brackets and makes expressions easy for computers to read.
Quick quiz
Q1. Four minus one in Polish notation is...
In Polish notation the operator comes first, so it is minus, four, one.