Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't understand this. 999 is less than 3^7, so you can represent any number up to 999 with just seven base-3 digits. Where does the 19 come from?



999 is 1101000. So, for MSB, you only need 1 (when it's zero, you just don't put anything there). All the other positions can be 0, 1, or 2. So you would need 1 + 6*3 digits for your scoreboard. You can't not have 6 2s, for example, because your score might be 222222.


I see what you mean now. That's 19 with additive Roman numerals only, right? And for good measure, you don't even have to rearrange the digits, you can just order them as DCCCCLXXXXVIIII and cover the unused ones with a cloth.

With subtractive Roman numerals, you can get away with just 17 digits, but you lose the feature of not having to rearrange them.

Edit: actually, how did we get 19 here? I agreed at first, but my number above is just 15 digits.


I play village cricket, and the scoreboard has cards with numbers on, then hooks to hang them up depending on the score.

The problem is: Given the full range of possible (or at least plausible) scores, how many of the cards do we need for a full set?

So let's simplify it to just a run tally. You could be 111, so you'd need at least 3 of the 1 cards etc. Allow for scoring up to 999 (unlikely) and that's 29 cards to keep somewhere (only 2 zeros needed)

In base 3, you need 7 digits, but only 3 cards per, so we are doing better with 19 cards needed (21=3*7, but don't need all zeros, and that gets you to 1093 so for 999 you could save another)

In roman numerals, You'd need an M, a D, 3 Cs, 3 Ls, 3 Xs, 1 V and 3 Is. Total is 15 cards.

Can we do better? Good question.


Of course we can do better. Every card that is an identical copy of another in the set loses you some flexibility in picking different sequences.

6 different cards give you

  - 1 zero-card sequence
  - 6 different 1-card sequences
  - 30 different 2-card sequences
  - 120 different 3-card sequences
  - 360 different 4-card sequences
  - 720 different 5-card sequences
  - 720 different 6-card sequences
That’s enough to almost get you up to 2000. And I don’t think the resulting encoding is objectively weirder than Roman digits.


The answer is: It reduces to a question of permutations. 7! > 999, so we could do it with different arrangements of just 7 cards.

Can we do better? Good question...


Now if we arranged them on a 2d grid, could use 4 cards, then the different shapes (even discounting the similar looking shapes) would get you to >1000. You'd have to allow more than just the standard tetrominoes.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: