|
|
|
|
|
by thiht
308 days ago
|
|
> I don’t see how either of those exhibits demonstrate your point. Natural language is easy to do for a human and a hard computing problem. Polish notation is extremely simple to implement, but relatively "hard" for a human, even knowing the rules and how to read it. See: `+ * - 15 6 / 20 4 ^ 2 3 - + 7 8 * 3 2` |
|
You ever see someone learning a new language? They struggle hard on more complex sentences.
It’s easy for us because we’ve practised it so much.
> + * - 15 6 / 20 4 ^ 2 3 - + 7 8 * 3 2
To begin with, you’re missing an operator. I’ll assume another leading +.
Now, if you use infix, you have to have at least some of the parentheses, in this case actually only one pair, given rules of operator precedence, associativity and commutativity: But you may well just parenthesise everything, it makes solving easier: And you know how you go about solving it? Calculating chunks from the inside out, and replacing them with their values: Coming back to Polish notation—you know what? It’s exactly the same: For arithmetic at least, it’s not hard. You’re just not accustomed to it.