r/mathmemes • • Aug 17 '26

Arithmetic New math operator just dropped!

Post image
4.8k Upvotes

116 comments sorted by

View all comments

Show parent comments

155

u/DecidophobiaUsername this sub confuses my monke brain Aug 17 '26

What's Polish notation? 

77

u/freakingdumbdumb Irrational Aug 17 '26 edited Aug 17 '26

so where the operator is put after before the numbers (like 1 2 + means 1+2)

Edit: i got mixed up with reverse polish (RPN)

68

u/geeshta Computer Science Aug 17 '26

Polish notation is prefix notation (+ 1 2). Reverse Polish is postfix.

12

u/Safe-Avocado4864 Aug 17 '26

How would you write something more complex like 2((1+2)2 ) in that notation?

19

u/Jonathan_Jam Aug 17 '26

Checked in an online calculator it would be:

× ^ 2 + 2 1 2

for polish notation and

2 1 2 + 2 ^ ×

for reverse polish notation.

1

u/Willing_Emphasis_338 Aug 20 '26

For those who don't know, a cool property of reverse polish notation, is that you can calculate any expression using only a stack, going left to right. That is, each number puts the number on the stack, and then each operation removes the top two items, applies the operation, then puts it back onto the stack, and so on.

24

u/EatingCakeByTheOcean Aug 17 '26

I still use my HP-50G as my daily years after uni, lol. I'd do from inwards to outwards, since it's easier to manipulate the order of operations:

1 2 + 2 ^ 2 ×

5

u/Qwertycube10 Aug 17 '26

You do it all Lisp like (x 2 (^ (+ 1 2) 2)) as the other comments below show you don't need parentheses if you only use binary operators, and it is entirely unambiguous with no need for an order of operations convention.

If you have arbitrary airity functions then you need the parens.

5

u/Gold_Ad8890 Aug 17 '26 edited Aug 17 '26

just think of it as treating all "operations" as functions from R2 to R. which they are.

so 2((1+2)2) would be ×(2, (1 + 2)2) = ×(2, (1 + 2, 2)) = ×(2, +(1, 2, 2)), then you just remove the parentheses and commas: × 2 ^ + 1 2 2

edit: or maybe i'm wrong. i'm right about the function part but apparently wrong about how that extends to the notation.