Given $x\ y\ +\ x\ z\ +\ *\ y\ z\ *\ +$ recover the tree, write it in usual notation and simplify

98 Views Asked by At

Given the boolean expression given in reverse Polish notation $$x\ y\ +\ x\ z\ +\ *\ y\ z\ *\ +$$ recover the tree, write it in usual notation and simplify.


The usual notation is

$$\begin{array}{ll} &x\ y\ +\ x\ z\ +\ *\ y\ z\ *\ +\\ \iff&(x+y)\ x\ z\ +\ *\ y\ z\ *\ +\\ \iff&((x+y)+x)\ z\ *\ y\ z\ *\ +\\ \iff&(((x+y)+x)*z)\ y\ z\ *\ +\\ \iff&(((x+y)+x)*z)\ (y*z)\ +\\ \iff&(((x+y)+x)*z)+(y*z)\\ \end{array}$$

The recovery tree is

Recovery tree

Finally, the simplification is

$$\begin{array}{ll} &(((x+y)+x)*z)+(y*z)\\ \iff&(2*x+y)*z+y*z\\ \iff&2*x*z+y*z+y*z\\ \iff&2*z*(x+y) \end{array}$$

Is that correct? Is it possible to write $2*x\equiv2x$ and so on?

Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

No, it is not correct. As @FabioSomenzi said in comments, the expression must be $(x+y)*(x+z)+(y*z)$, which has as a tree

Tree

and after applying some properties ends up with $x\vee(y\wedge z)$.