Questions tagged [polish-notation]

For questions on Polish notation. Polish notation, named for the Polish logician Jan Łukasiewicz, is a mathematical notation in which operators precede their operands.

Polish notation is a prefix notation in which operators precede their operands. The notation allows mathematical expressions to be written unambiguously without the use of parentheses. For example

$$ \begin{matrix} + & 4 & \times & 3 & 5 \end{matrix} $$

can be written in the usual (infix) notation as

$$ 4+(3\times 5). $$

Polish logician Jan Łukasiewicz introduced the notation in 1924 and used it extensively in his own work. It has fallen out of use in logic, but still finds application in computer science.

Source: https://en.wikipedia.org/wiki/Polish_notation

33 questions
11
votes
3 answers

Reverse Polish notation in (abstract) algebra

If I have something like $\phi\circ \psi(x)$ this means first apply $\psi$ and then $\phi$. Going right to left is pretty contrary to my intuition. In computer science some programming languages (and many compilers) use reverse Polish notation,…
4
votes
3 answers

Converting from standard to functional, Polish and Reverse Polish notation

I wanted to convert the following expression to Functional, Polish and Reverse Polish notation. $$Y =A + \frac{B+ \dfrac{BA}{B+CA}}{A - \dfrac{BC}{B-C+A}}$$ I know how to do Standard -> Functional -> Polish. But I'm kind of stuck on the RPN. Could…
n4869
  • 143
4
votes
1 answer

Represent unary and functions in postfix notation

I'm currently working on a math evaluator, which works by converting the infix notation to postfix notation and then evaluating the postfix expression. It was going pretty good, until I ran into the problem of unary operations and having functions…
vallentin
  • 207
3
votes
1 answer

An exercise on first order logic formulas, terms and Polish notation

This is part of my homework (not mandatory and not accredited). Please comment/answer if my reasoning for the exercises is correct, because I'd like to see if I understand the material. I will start with the axioms to show what I am working…
Spaced
  • 3,599
3
votes
2 answers

Ambiguity in Reverse Polish notation

Given the infix form: 1 * 2 * 3 What is the Reverse Polish notation? As I see things, two valid answers are: A. 1 2 3 * * B. 1 2 * 3 * I believe there is a subtle difference between these two forms, as, mathematically, they both yield the same…
Razvan
  • 289
3
votes
3 answers

Practicing Polish/Prefix notation

- * / 15 - 7 + 1 1 3 + 2 + 1 1 = - * / 15 - 7 2 3 + 2 + 1 1 = - * / 15 5 3 + 2 + 1 1 = - * 3 3 + 2 + 1 1 = - 9 + 2 + 1 1 = - 9 + 2 2 = - 9 4 = …
Karl
  • 895
2
votes
1 answer

Abstract Algebra Math notation, kernel

So I defined $$\theta:R \rightarrow R\backslash I$$ by $$\theta(x) = [x]_I$$ and $$\phi: R[x]\rightarrow (R\backslash I)[x]$$ by $$\phi(a_nx^n +\dotsb+a_1x+a_0) = \theta(a_n)x^n+\dotsb+\theta(a_1)x+\theta(a_0)$$ I know that $\ker\phi= I[x]$ but I…
abe
  • 1,017
2
votes
1 answer

Reverse Polish Notation with power

Perhaps I'm just not understanding RPN correctly, but whenever I translate something like 2^2^3 then I get 22^3^ But if I try to execute that it's wrong! Because that will result in 64 (4^3), but what I need it to do is result in 256 (2^8) How do I…
Meshach
  • 217
2
votes
1 answer

Polish notation, rooted tree

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?
Erika
  • 387
2
votes
2 answers

Reverse Polish Notation and numbers $>9$

Excuse me for the newbish question in advance but how should I make sure I don't make a mistake converting from RPN to infix notation when I don't know if some of the numbers aren't two-digit ones or when I do that some are but I don't know which…
2
votes
0 answers

Representing operations in reverse Polish notation/postfix that return multiple values

I'm working on a recipe definition language which uses operands ("milk", "eggs"), unary operators ("slice", "chop"), and binary operators ("combine", "fold in"). To avoid ambiguity, I've decided to use postfix/reverse Polish notation, so an example…
2
votes
1 answer

How to transform expressions in polish-notation

Here is an example of a De Morgan transformation of a logic expression: $ \neg ({a} \wedge {b}) $ becomes $ (\neg {a} \vee \neg {b}) $ My intuitive view of this operation is that I'm "moving the negation" into the parenthesis and changing the…
1
vote
2 answers

Well Formed Expression (Polish Notation)

In Kunen's book Foundation of Mathematics the definition of a well formed expression (wfe) of a lexicon for Polish notation $\langle W, \alpha \rangle$ ($W$ is a set and $\alpha:W\to\omega$ is a function) is given by If $s\in W_n$ and…
user34870
  • 1,181
1
vote
3 answers

distributive law in polish notation

On page 18 "Logic as Algebra" Halmos&Givant wrote the distributive law in Polish notation as $$ = \times a + bc + \times ab \times ac $$ I fail to see anything remarkable here, is there a combinatorial pattern that I'm missing?
1
vote
1 answer

PEDMAS in RPN needed?

In RPN do we still have to take into note the PEDMAS rules? For example these questions: 3 – 4 * 2 3 * 4 – 2 3 * (4 – 2) (3 – 4) * 2 3 – 4 + 2 Answers 342*- 34*2- ---dont know this one 34-2* 342+- Thanks.
orange
  • 373
1
2 3