Monday, October 05, 2009

Reverse Polish sausage

I'm not enough of a logician to laugh at the latest xkcd, though I did manage to figure out the joke without looking anything up.

4 comments:

Fraser said...

well, that makes one of us. Any chance you can explain it?

Neil Sinhababu said...

There's a kind of mathematical notation called polish notation where instead of writing 3+2 you write + 3 2. I guess in reverse polish notation you write 3 2 +. I don't know how you do parentheses in these notations, but the order is going to be all weird in a way that parallels the situation with the buns and sausage.

I once asked some Polish people whether their language put the connectives before the terms being connected, like in Polish Notation. They said no.

berislav.lopac said...

Actually, it's called Polish because it was invented by the Polish logician Jan Łukasiewicz back in 1920. See http://en.wikipedia.org/wiki/Prefix_notation

Anonymous said...

>I don't know how you do
> parentheses in these notations

You don't need to. That is the main point of these notations.

(3+4)*2 == * + 2 3 4 == 2 4 3 + *

In addition to removing the need for parentheses, RPN also allows for calculations to be done in a simple stack. http://en.wikipedia.org/wiki/Reverse_Polish_notation#Example