TITLE: Find DNF and CNF of an expression
QUESTION [16 upvotes]: I want to find the DNF and CNF of the following expression
$$ x \oplus y \oplus z $$ 
I tried by using
$$x \oplus y = (\neg x\wedge y) \vee (x\wedge \neg y)$$ 
but it got all messy. 
I also plotted it in Wolfram Alpha, and of course it showed them, but not the steps you need to make to get there. 
Any ideas to how this could be done?

REPLY [2 votes]: For DNF:

look at each row where $p = 1$
encode a proposition from the atoms $p_i$ for row $i$ (that gives $p$ is 1) that has $a_i$ if that atom is 1 in the truth table and $\neg a_i$ if it's 0. You are using an and to combine the atoms so that only this terms is 1 when you are on that row. You can think of this conjunction as a product.
take the OR of all such proposition corresponding to the rows being 1
since this proposition is a disjunction (think of it as an addition) that are only 1s for unique rows, you get the whole thing is only 1 when you need it to be 1.

For CNF:

Look at the rows where $p=0$
encode a proposition from the atoms $p_i$ for row $i$ (that gives p being zero) that has $a_i$ if that atom is 1 in the truth table and $\neg a_i$ if it's 0. Now conjunct them. This is not the form you actually want so negate $p_i$ to get $\neg p_i$. By Demorgans all disjunctions became conjunctions.
now take the AND of all such disjunctive propositions.
This is correct because whenever you choose a row, the proposition you built returns 1 IFF you are not in that row. Since you are not in that row, all those rows return 1 simultaneously indicating your not in any of the rows that gives a zero. Thus you get the whole thing giving a 1.


If you need more help check this video:
https://www.youtube.com/watch?v=tpdDlsg4Cws