Need help simplifying boolean algebra equation I have the following equation:
$$
P = y\bar{z} + \bar{x}(x + \bar{y}(y + \bar{z}(z + x))) + (x + z)(\bar{x} + y) + \overline{xy+\bar{x}\bar{z}+y\bar{z}}
$$
When simplified it comes down to $x + y + z$.
I tried, but I can't seem to get to that solution.
Can someone try to simplify it step by step? Thank you.
 A: \begin{equation}\tag{1}
P = y\bar{z} + \bar{x}(x + \bar{y}(y + \bar{z}(z + x))) + (x + z)(\bar{x} + y) + \overline{xy+\bar{x}\bar{z}+y\bar{z}}
\end{equation}
To simplify $(1)$, it helps to break it up first. The second term can be expanded and evaluated in the way of $(2)$.
\begin{equation}\tag{2}
\bar{x}(x + \bar{y}(y + \bar{z}(z + x)))\\
0 + \bar{x}\bar{y}(y + \bar{z}(z + x)))\\
0+ \bar{x}\bar{y}\bar{z}(z + x)\\
0
\end{equation}
The third term in the way of $(3)$.
\begin{equation}\tag{3}
(x+z)(\bar{x}+y)\\
0+xy+z\bar{x}+zy
\end{equation}
The forth term reduces to $(4)$, using De-Morgan's law.
\begin{equation}\tag{4}
\overline{xy+\bar{x}\bar{z}+y\bar{z}}\\
(\bar{x}+\bar{y})(x+z)(\bar{y}+z)\\
(0+\bar{x}z+\bar{y}x+\bar{y}z)(\bar{y}+z)\\
\bar{x}z\bar{y}+\bar{x}z+\bar{y}x+\bar{y}xz+\bar{y}z+\bar{y}z\\
\bar{x}z+\bar{y}x+\bar{y}z\\
\end{equation}
Bringing it all together $(1~-~4)$, we simplify $P$.
\begin{align}
P &= (y\bar{z})+0+(xy+z\bar{x}+zy)+(\bar{x}z+\bar{y}x+\bar{y}z)\\
&=(zy+z\bar{y})+(y\bar{z}+yz)+(xy+x\bar{y})\\
&=z+y+x
\end{align}
