Hacker News new | ask | show | jobs
by chriswarbo 3602 days ago
> The complexity of the formula and the "striking features" of the graph only demonstrate that operations defined in one base (AND is nothing but multiplication in base 2) may behave in complex and non obvious ways in other bases.

I'd go a little further: the complexity of the formula only demonstrates that trying to fit a square peg (bitwise boolean algebra) into a round hole (numeric algebra) can cause things to get complicated.

In particular, the author seems to think that "math" means "numbers":

> the AND function is in fact mathematically non-trivial:

> The mathematical equivalent of AND

> Now, if you find that function dreadful — I am with you. When I first wrote it down, I found it both complicated and unhelpful; after formulating it, my mind was no closer to understanding the kind of pattern the AND function followed, if any.

> Ignoring the complex math formula above, we can still find a number of interesting properties regarding the AND function.

This implies that bitwise boolean algebra is somehow 'not math', and the complex formula somehow 'is math'. In fact math can deal with anything that's precisely defined, and includes fields like geometry, topology, logic, category theory, universal algebra, set theory, type theory, etc. which aren't particularly related to numbers. Whilst we could represent, say, logic, using a numerical formula (e.g. based on Goedel numbers) it's usually the wrong thing to do ;)

I think this may be a side-effect of the poor state of math education; i.e. we're taught to perform numerical calculations and not much else. :(

1 comments

Hello Chris, author here!

AND is not multiplication in base 2 :)

The point of the article was to make sense of the apparent complicatedness of the math formula through nice visuals that help humans understand what AND does number-wise.

I may have used the terms math vs. numbers loosely, but this seemed to be the terms most people would understand - and a vocabulary used in other places (Wikipedia, though maybe hardly a reference?). I have tried to explain my "bit string" vs "number" approach [in this other article](https://medium.com/biffures/bits-101-120f75aeb75a#.gz4ka3t7k) if you are interested.

Really not implying that boolean algebra is not math though - and I am pretty sure this has nothing to do with the 'poor state of math education'.

I still think the approach is kind of misleading. Because the (apparent) complexity of the math formula is only linked to the fact you're using a decimal formula for a binary operation.

The operation, mathematically, is extremely simple.

> The operation, mathematically, is extremely simple.

You're absolutely right, and this was my main problem; labelling the complicated version as 'math' seems to imply that the simple definitions, the wonderful patterns, etc. are somehow 'not math'.

> a decimal formula for a binary operation

It's not the base which makes it complicated; it's extracting each digit individually. Using the same approach to define a digit-wise operation in base 10 would be just as nasty, except you'd have powers of 10 instead of powers of 2, and mod 10 instead of mod 2.

In other words, just because decimal lets you write numbers like "946", it doesn't make it trivial to get the "9", "4" or "6" individually using 'highschool algebra'; you need to use mod, division, floor/subtraction, powers of ten, etc. just like that formula does for base 2.

Of course, if we don't stick to highschool algebra, it can be as trivial as we like. "The digits of 946" is a perfectly well defined mathematical/numerical operation, so we can just say that and we're done. Likewise, we can make a trivial formula for bitwise AND, like "x ^ y", by defining "^" as 'bitwise AND'.

In a way, formulas like that given in the article are only complicated because they're making assumptions about some operations being 'more fundamental' than others; but in "real" math (i.e. not highschool rote learning and number crunching), we're free to use whatever operations we want, as long as we define them precisely; "bitwise AND" is a perfectly fine definition, and just as good as "addition" or "multiplication".

You're perfectly welcome to define operators in terms of other things you consider to be 'more fundamental'; Russell and Whitehead famously did this in Principia Mathematica, considering sets to be more fundamental than arithmetic and requiring 300+ pages to reach a proof of "1 + 1 = 2".

Yet Goedel showed that no set of axioms is 'best', in which case you might as well use whichever ones make life easiest. When you're calling a formula "dreadful", it implies that you've not made your life easy ;)

Fair, changed paragraph to "While the result is easily computed and the process easily understood in base 2 (i.e., using the ‘bit strings as language’ lens), the AND function written in base-10 notation looks in fact non-trivial:"

The point of the article is to switch bases (exploring the many facets).

Per my previous thoughts, "the binary notation is a contingency, useful to understand and define specific functions that will run fast on computers given their binary architectures. However, because the notation does not convey meaning in itself, those numbers and functions are as well described in any arbitrary base, namely base 10 for humans, or base 16 (hexadecimal) for conciseness."

Yes, but and is multiplication in Z2