Hacker News new | ask | show | jobs
by beautifulfreak 3646 days ago
You might enjoy the Matrix Logic series of books by August Stern, which develop the idea of logic operations as vector multiplication. The NOR operator would be represented by a 2x2 matrix, [10|00], and an operation such as 1 NOR 0 would be the matrix multiplication [01]x[10|00]x[10]^T. (Scalar operand 1 is represented by [01], and 0 by [10], in both left and right hand forms.) It's simple but deep, when fully extended. Treated as linear algebra, logic is a lot more sensible. There are surprises, too. For instance, a statement like [01]x[01|11]x[01|11]x[10] makes perfect sense: 1 OR OR 0. So what is OR OR? Is it useful? This wouldn't be obvious from the usual way of computing OR as addition mod 2, and the messiness of carrying the extra digit in 1 OR 1. Determining the truth value of statements by direct computation, without reference to an external truth table, gives mathematical certainty to the outcome. Multiple statements can be compounded with tensors, giving operators that are 2^n in dimension. Complementarity plays a huge role in showing coherence of the matrix system of logic. There's much more, but that's the general idea. I was reminded of Matrix Logic, because Stern shows a computation done strictly with NAND, plus NOT, to illustrate how many operations must be done, where using different operators would have been much more efficient.