News for hackers. Stuff that matters.
Re:The Aggregate Magic Algorithms (2015) by pc86 on Monday June 19, 2017 @10:00AM (#14586992)
Maybe it's just my own neuroses around being a self-taught developer and not having much of any mathematical background, but it always bothered me that articles like this constantly use phrases like "it's clear that...", "obviously...", "it's trivial to...", etc.

> Clearly, floor of base 2 log of x is (WORDBITS-lzc(x)).

Uh, is it?

Re:The Aggregate Magic Algorithms (2015) by syphilis2 on Monday June 19, 2017 @12:50PM (#14588357)
It's poor form to describe items as clear, obvious, trivial, 'of course', easy to see, and so on. To look too much into it: if the item is clearly​ understood then there's no need to identify it as clear. Clearly it's clear. It bothers me too.
Re:The Aggregate Magic Algorithms (2015) by tinyrick2 on Monday June 19, 2017 @06:15PM (#14590858)
From the article How to Read Mathematics [0], that kind of statement "is a signal to the reader that what's involved here is perhaps tedious and even difficult, but involves no deep insights."

[0] http://web.stonehill.edu/compsci/History_Math/math-read.htm

HN discussion: https://news.ycombinator.com/item?id=14232977

Re:The Aggregate Magic Algorithms (2015) by taneq on Monday June 19, 2017 @10:21AM (#14587154)
It's a bit of a trope that mathematicians consider all knowledge to fall into two groups: 'unknown' and 'obvious/trivial'.
Re:The Aggregate Magic Algorithms (2015) by dahart on Monday June 19, 2017 @12:16PM (#14588051)
>> Clearly, floor of base 2 log of x is (WORDBITS-lzc(x)).

> Uh, is it?

Of course, that is intuitively obvious to even the most casual observer. ;)

http://www.urbandictionary.com/define.php?term=intuitively%2...

Re:The Aggregate Magic Algorithms (2015) by moomin on Monday June 19, 2017 @02:50PM (#14589369)
It is... if you're the kind of person who does bit twiddling. And for everyone else it's gobbledygook.

Basically, you're using a binary representation, so everything is in powers of two. Let's just talk integers. 2^n is just the nth bit set and a bunch of zeros. Every number between 2^n and 2^n+1 has the nth digit set and some lower digits. The log base 2 is between n and n+1. So the floor is n. So, biggest digit set=floor of log base 2.

Once you've grasped that principle, the exact details are, in fact, clear. :)

Re:The Aggregate Magic Algorithms (2015) by mikeash on Monday June 19, 2017 @02:53PM (#14589392)
To bring it into less computery terms, it's basically the binary equivalent of the statement that the floor of base 10 log of x is the number of decimal digits in x. The floor of log10 9823 is 4, the floor of log10 874323 is 6, etc. This is, I hope, clear. At least if you understand what log base 10 means.
Re:The Aggregate Magic Algorithms (2015) by moomin on Monday June 19, 2017 @03:02PM (#14589459)
I may spend too much time visualising binary representations. :)
Re:The Aggregate Magic Algorithms (2015) by mikeash on Monday June 19, 2017 @04:44PM (#14590305)
Well, your explanation is better overall, since it's describing what's actually going on. Mine is just an analogy in case that gives someone trouble.
Re:The Aggregate Magic Algorithms (2015) by raverbashing on Monday June 19, 2017 @10:30AM (#14587213)
These "filler" expressions are typical in mathematical demonstrations (as an indication that step won't be explained). But sometimes it's not obvious

> Clearly, floor of base 2 log of x is (WORDBITS-lzc(x)).

Yes. Because the 1st bit indicates the MSB of the number and the way binary works

If you have only one bit set, then WORDBITS-lzc(x) is log2(x). If you have less significant bits enabled that won't be enough to bump the floor to the next number

Re:The Aggregate Magic Algorithms (2015) by zaptheimpaler on Monday June 19, 2017 @11:39AM (#14587757)
I think anyone who has tried to teach or explain something will see why this happens. You have to make some assumptions about what readers know/can figure out otherwise you would literally be explaining everything starting from binary numbers every time.

The "clearly" stuff is just shorthand for "I assume you know this because its foundational to understanding the thing were talking about now / or I'm too lazy to explain this now / or this is so far off-topic that this isnt the place / etc. etc" . Nothing more - it can be read as arrogance on the authors part but I think thats an uncharitable interpretation.

Re:The Aggregate Magic Algorithms (2015) by andrepd on Monday June 19, 2017 @11:32AM (#14587695)
I dunno, I guess it's alright to use these phrases for things that are truly trivial and direct. But plenty of people use these phrases to introduce things that are definitely not obvious. It's quite annoying and I suspect it's either ingrained in habit, or it's just the author wanting to "show off", sort of like "wow, this is so obvious to me, isn't it to you?", nevermind that they spent a great deal of time to understand it when they first came across it.

Grrr x)

Re:The Aggregate Magic Algorithms (2015) by pkaye on Monday June 19, 2017 @11:39AM (#14587754)
I come from a firmware development background so this kind of bit manipulation tricks are familiar to me. That equation makes sense after a few seconds looking at it but I can't always run a proof in my mind to be 100% certain.