nand(x,y,z) = nand(and(x,y),z):
nor(x,y,z) = nor(or(x,y),z):
Couldn’t figure out xor(x,y,z) so I read ahead. I didn’t know actually that an odd number of inputs are true. So three true inputs means the output is true for xor.
I read ahead for more clues and saw this question:
yeah with and(x,y)
I read ahead further and found this:
I was thinking phrasing xor(x,y,z) in english: At least one or three inputs are true.
checking if 0 inputs are true: using only two inputs per operator, it’s nor(or(x,y),z). expression returns true if 0 inputs are true.
checking if 3 inputs are true: and(and(x,y),z). Returns true if 3 of the inputs are true.
I see @Eternity got something similar:
I like how nand and or are used to say the same thing. It’s like a way to check the answer twice.
checking if 1 input is true: or(and(x,not(y), not(z)), and(not(x), not(y), z), and(not(x), y, not(z)).
Truth table:
checking if 2 inputs are true: or(and(x, y, not(z), and(not(x), y, z), and(x, not(y, z))
xor(x,y,z)
I think I see what we’re trying to do. If we break down how we find if 1 input is true and 3 inputs are true, then maybe we can find an odd number of inputs being true for xor(x,y,z).