Lately, I was becoming skeptical of XOR's rank among the 16 realizable Boolean operators as owing to anything other than its direct parity application to mathematics. In short, I wanted a different way of visualizing it as being in the same tier as its (N)AND/(N)OR constituents; last night, I found enough reason to respect it as such.
P and Q are two lists of equal but arbitrary length, with their elements equaling one or zero in base ten (for simplicity's sake).
S = P+Q = {p1,p2,…,pn}+{q1,q2,…,qn} = {p1+q1,p2+q2,…,pn+qn}
That gives 0, 1, or 2 for each element.
Relating S with a number r using = or ≠ returns a list where each element has been simultaneously compared to r and replaced by either 1 or 0 according to the truth of the relation.
With this, we have six possible arrangements. Not four, not sixteen, but six. Here is what it looks like:
Code:
The outputs, ordering from left to right, are the same outputs that would be produced by the NOR, XOR, AND, OR, XNOR, and NAND operations on P and Q. XOR certainly doesn't look like it's on the outskirts anymore; I am happy!
Another illustration, which opposes logical complements:
Code:
P and Q are two lists of equal but arbitrary length, with their elements equaling one or zero in base ten (for simplicity's sake).
S = P+Q = {p1,p2,…,pn}+{q1,q2,…,qn} = {p1+q1,p2+q2,…,pn+qn}
That gives 0, 1, or 2 for each element.
Relating S with a number r using = or ≠ returns a list where each element has been simultaneously compared to r and replaced by either 1 or 0 according to the truth of the relation.
With this, we have six possible arrangements. Not four, not sixteen, but six. Here is what it looks like:
Code:
(S=P+Q)
/ \
(=) (≠)
/ | \ / | \
(0)(1)(2) (0)(1)(2)
The outputs, ordering from left to right, are the same outputs that would be produced by the NOR, XOR, AND, OR, XNOR, and NAND operations on P and Q. XOR certainly doesn't look like it's on the outskirts anymore; I am happy!
Another illustration, which opposes logical complements:
Code:
P AND Q P OR Q
(2) (0)
↑ ↑
P XOR Q (1) ← (=) ← (P+Q) → (≠) → (1) P XNOR Q
↓ ↓
(0) (2)
P NOR Q P NAND Q