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

Nice corner case. It's pretty much useless, it would contain just a single value. Is it even valid base?



It can actually represent all integers just fine. It works like any other base, except whereas for example in base 10, positions are multiplied by 10^0 = 1, 10^1 = 10, 10^2 = 100 and so on, in base 1 they are multiplied by 1^0 = 1, 1^1 = 1, 1^2 = 1, and so on. The result is that each digit adds 1 to the number, like tally marks. So we have, for example

111 = 3

11 = 2

1 = 1

= 0

-1 = -1

-11 = -2

-111 = -3


That is wierd. Base k includes numbers 0,...,k-1. For example 101 is a valid number in base 2 which is 2^2 + 2^1.

Using that logic, base 1 would only contain 0, hence it should not be able to expresss more values that 0.

Is your example actually a valid base 1?




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

Search: