Hacker News new | past | comments | ask | show | jobs | submit login

Actually you may let the one you are showing the trick to to choose the order, you need just to notice where did the column with the card go. 2 if it is on the bottom, 1 if in the middle, 0 if on the top. When you got your three digits, reverse them and convert from ternary to decimal—that will be the number of cards above yours. In the case you are putting column with a card to the middle you'd get 111, that is 13^2+13^1+1*3^0=9+3+1=13. Hence your card is #14.

I think this was in one of the books by M. Gardner.




Corrections: bottom-2, middle-1, top-0. 1×3^2+1×3^1+1×3^0=9+3+1=13




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: