Настроение: | contemplative |
Музыка: | Pilotpriest - Xanadu |
Entry tags: | computing |
Mathematics Considered Harmful
The introduction course into mathematics starts with the so called first order
logic. It is similar to the CPU logic, but deals with natural language
statements and doesn't have any temporal components, introduced by CPU cycles.
These statements are joined by connectives.
For conveniences we will use `+`, `*`, `~` for `or`, `and` and `not`.
But there are additional connectives defined using these.
For example, the unidirectional implication:
A + ~B # A or not B
The macro form for that is `A -> B` (A implies B)
Math macros are like ARM assembler macros, not the Lisp macros,
although they do have the so called axiom schemas, which
are defined using ebonics like prose.
The entirety of math has that ghetto rap battle feel to it.
Lets use it to produce the formula for bidirectional implication:
A -> B
B -> A
-------------------- # Expand these into components
A + ~B
B + ~A
--------------------
(A + ~B) * (B + ~A) # Combine both expressions into one
--------------------
A*B + ~B*B + A*~A + ~B*~A # Perform multiplication
--------------------
A*B + ~B*~A # Eliminate the cancelled items
--------------------
A*B + ~(A+B) # Move `~` out
The macro form for that is `A <-> B`
Lets check it by assuming A=1
A <-> B # Base theorem in a macro form
---------------
A*B + ~(A+B) # Expand the sugar
---------------
1*B + ~(1+B) # A=1
---------------
B + ~(1) # Constant elimination (* advances, + shortcircuits)
---------------
B + 0 # ~1 = 0 (by definition)
---------------
B # B=1 too!
These `->` and `<->` are a bit similar to the `if/else` and for loops in C/C++,
but, again, they have no temporal component, and therefore just simple boring,
connectives.
Note also that in computing we start with a single `&` operation, instead of
`*`, `+`, and `~`, defined in that above notation as
~(A * B)
-----------
A & B
That is called NAND (not and). And can be used to implement `*`, `+` and ~`,
even in the 1st order logic.
And that my friends is basically what the math is all about. In other words, low
level bit twiddling, but with a layer for pretentious snobbism.
Of course mathematicians also introduce the so called Set Theory, also called
second order logic. Which is a pseudo-philosphibcal paperwork, using bombastic
star-trek names like `the axiom of infinity` or `universal quantification`.
Mathematicians use these to produce a lot of nonsense statements, completely
detached from reality. Pure existentialist schzobabble.
So if you want to be a decent human being, stay away from math as you would stay
away from the OOP crowd and the Uncle Bob's religion. Math is even more useless
than an infinite set of unit tests.
Cheers!