Hacker News new | ask | show | jobs
by sltkr 337 days ago
Pet peeve: the blog post mentions _decimal_ and _denary_ several times, but in reality, there are no decimal numbers involved in any part of the computation.

This is a common mistake made by people who haven't fully internalized the distinction between numbers (which have no intrinsic representation) and _numerals_ which are the encodings of numbers.

When you are converting a permutation to its index, you are not converting to _decimal_, you are converting it to an integer. That integer has no intrinsic base. In Python (and the linked C++ code) that integer will be internally represented in binary (or a base that is a higher power of 2) and the corresponding decimal representation is generated only when printing.

So functions like decimalToFactoradic() should really be named integerToFactoradic(), etc.

3 comments

> people who haven't fully internalized the distinction between numbers

Or people whose first intuition is that the space measured by 52! permutations, which are painfully obviously based on taking the suit and rank of each card which makes it unique, can be covered with even remote adequacy by considering only the card color, which only narrows down the card to one of two sets of 26.

Pet Peeve: Pointless Pedantry.

Always Adore: Amazing Alliteration.

> This is a common mistake made by people who haven't fully internalized the distinction between numbers (which have no intrinsic representation) and _numerals_ which are the encodings of numbers.

Counterpoint: it doesn’t matter.