[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sorting NaNs

On Fri, Jun 8, 2018 at 9:37 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Fri, 08 Jun 2018 12:23:40 +1000, Chris Angelico wrote:
>> On Fri, Jun 8, 2018 at 12:15 PM, Steven D'Aprano
>> <steve+comp.lang.python at pearwood.info> wrote:
>>> If you truly were limited to 2**32 different values (we're not), then
>>> it would be exactly right and proper to expect a collision in 2**16
>>> samples. Actually, a lot less than that: more like 78000.
>>> https://en.wikipedia.org/wiki/Birthday_problem
>> 2**16 is 65536, so the figure you give is pretty close to the
>> rule-of-thumb estimate that the square root of your pool is where you're
>> likely to have collisions.
> D'oh!
> I mean, I knew that, I was just testing to see if anyone was paying
> attention.

Plus, you were making another very clear point: Humans are *terrible*
at estimating exponentiation. Unless you've memorized specific values
(2**16 and 2**32 are fairly common and familiar), it's really hard to
estimate the value of x**y. Want to hazard a guess as to what
0.99**100 is? (That's the chances that a one-in-a-hundred event won't
happen after a hundred opportunities.) What about 85**8? (Theoretical
password entropy if you have uppercase, lowercase, digit, symbol.)
What is the smallest n such that 26**n > 85**8? (That's the length of
monocase password required for equivalent theoretical entropy.)

Thank you for that elegant demonstration of an important fact about humans. :-)