Polish notation, rooted tree

130 Views Asked by At

Hi im suppost to write the expression

(w+x - y)/(pi * z^3) in Polish notation.

My answer was / - + w x y * pi ^ z 3

But the solution is / + w - x y * pi ^ z 3

Is my answer the same as the solution and if not what am I doing wrong?

1

There are 1 best solutions below

2
On

You've translated the potentially ambiguous formula $w + x - y$ that appears as the numerator of the fraction as if it read $(w + x) - y$, the other solution has taken it as $w + (x - y)$. The two readings are algebraically equivalent, but I think your reading agrees with the BODMAS rules (by working left to right given a sequence of additions and subtractions) - so I would challenge the other solution if I were you. (Note that if it were $w - x + y$, then reading it as $w - (x + y)$ rather than $(w - x) + y$ is definitely wrong.)