Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Irrational Base Number System (2000) (everything2.com)
49 points by vector_spaces on Aug 31, 2022 | hide | past | favorite | 38 comments


Better articles (IMO) at Wikipedia:

https://en.wikipedia.org/wiki/Non-integer_base_of_numeration

Example: https://en.wikipedia.org/wiki/Golden_ratio_base

https://en.wikipedia.org/wiki/Non-standard_positional_numera... has a long list.

An interesting one: base 2i https://en.wikipedia.org/wiki/Quater-imaginary_base -- this was introduced in one of the papers Donald Knuth wrote in college.


The most efficient number system is base e, ie ratio of number of digits that exist to placeholders needed to represent certain numbers.

The most efficient integer is actually base 3, which also explains why ternary logic puzzles are so elegant.


> which also explains why ternary logic puzzles are so elegant.

Could you elaborate on that?


There’s an island of 100 people who are incapable of communicating with each other, besides what they can see with their own eyes. No one can see their own eye color. Everyone knows that there are only blue or brown eyes. One day a fairy appears before the islanders and says that at noon each day, islanders will be given a chance to leave if they know their own eye color. The fairy concludes the rules at 11am and also adds that at least one islander has brown eyes. That is Day 1.

On what day, in the longest case scenario, have all the islanders left? You can assume they are perfectly logical, and no guessing is allowed obviously.

There are also no tricks like mirrors or water or anything like that. It’s a logic puzzle not a lateral thinking one.

The solution demonstrates ternary logic.


I recall reading this somewhere else, but I for the life of me can't find the source. Do you happen to know where I can read more about this?



The bigger issue seems to be what a digit is. In a "traditional" base system the digits represent a linear spread between base^n and base^{n+1}.


Yeah, from this I think any irrational base is going to be either (uncountably) redundant or incomplete.


You can just stick with 0, 1, 2, and 3 for base pi. If you need a number between 3pi and pi^2 you can build to it after the decimal place.


I don't think that is true.

If it were then

$$\pi=3\sum^\inf_{n=1} pi^{-n}$$

I don't think it does. As it does not then uniqueness fails.


You don't even have uniqueness with base 10! But yeah, with base pi you can have numbers with both finite and infinite nonrepeating decimal expansions. But with only the digits 0, 1, 2, and 3, you can represent every number in base pi. Just not uniquely, which is of course why we stick with bases 10, 2, 16, 8, 12, and sometimes 60


Please can you provide an example of non uniqueness base 10? The only one I'm aware of is that

$$0.999... = 1$$

But that's more of a tautology.


Well it's basically just that one, but the same principle works for each rational number. So 1.4999...=1.5. But of course that's like the least bad redundancy you could have. I believe that this is the only redundancy you have in any integral (and possibly any rational, but don't quote me) base. You can't get much less than it though- in any base, numbers without a unique representation are dense in R.


I agree that numbers without a unique representation are dense in R but I believe it is only in so far at the trivial case of the n999... bijection <=> n+1 and the case of numbers which have no representation.

I do not think that there are any numbers that have multiple representations outside the n9999... <=> n+1 bijection.

There is an argument to be made that 0.9999... is not a valid representation of 1 since it is only convergent to 1 in the limit, where as 1 is 1 all the time.


I came up with a slightly different take on irrational radices is to give a finite closed form representation of integers in an irrational base, code and write up here:

https://github.com/crisdosyago/irradix


Basically my ideas is:

  N = kb + r

  N - integer
  k - divisor
  r - remainder
  b - base
So N can be written has a multiple of b plus the remainder.

Now, iterate with k.

  k = k_2b + r_2
And so on, as every number can be written like this.

You end up with a polynomial in b

  N = b^j.r_j + b^(j-1).r_{j-1} + ... + b.r_1 + r_0
Which is represented as a "numeral" by its coefficients (r_j..r_0)

One interesting property of this rep, is that for base phi (Golden Ratio ~ 1.618: (1+5^(0.5)/2)) no rep has a "101" subsequence. So basically then integers coded into base-phi get like a multipart/form-data or MIME encoding for free with the "boundary" being, the nonexistant sequence: 101.

I really loved to discover this! :) ;p xx ;p


I’m so glad someone finally worked on something like this. I’ve been compiling research in this direction for years. I have various ideas but haven’t had the motivation to see it through lately.

It’d be interesting to optimize hardware on this direction.

Have you seen this? https://neuraloutlet.wordpress.com/tag/ternary-tau-system/

The properties of such a system are remarkable.


I wrote something like this also in 2000:

"Way Off Base" https://dwheeler.com/essays/bases.html


So for instance, in a base pi, pi =1 or pi=10? Does 1 always equal 1? That can’t be right…

(Aside, Leibniz invented binary based on inspiration from I Ching. Cool!)


1 and 0 are still 1 and 0 regardless of the base. Pi=10_pi since it's the base. 2 and 3 are still 2_pi and 3_pi since they are less than pi. Things get weird when you start going above pi. For example, the number 4 would be written 10.220122021..._pi because

    1*pi^1 + 0*pi^0 + 2*pi^-1 + 2*pi^-2 + 0*pi^-3 + 1*pi^-4 + 2*pi^-5 + 2*pi^-6 + 0*pi^-7 + 2*pi^-8 + 1*pi^-9 + ... = 4
Kind of weird having integers that have to be written as infinite series.


Yes because the 1s place will be base⁰ which is 1.


Having multiple representations of the same number isn’t the problem one of the commenters thought. In decimal, for example, 1=0.99999999...


Luckily that's the only kind of ambiguous number you can have. Any given number can be represented at most two ways, and you never get rationals hopping over to the irrational side of the pond. Other bases aren't as kind.


(And I’m not sure his claimed alternate representation of 12 adds up (so to speak)).


It's irrational! Or rather has an infinite and non-repeating expansion, it's still the same 12 we know and love. That got me at first too.


here's my first question (I have enough math background to cogitate or research this and find out the answer, but it'll just be another rabbithole, so let me just ask):

if anything to the zero power is 1, what does that mean for pi? pi to the 0 is 1? or pi to the 0 is "base ten 1 represented in base pi"?

asking because that page starts out stating that 0 is always 0 and 1 is always 1.


Let’s say we are in base 3. Typically the symbols used to construct representations for numbers using the standard positional notation would be the numerals {0, 1, 2}. We could use any 3 symbols but these three work well since most people are comfortable with standard base 10 notation. When one says 0 is 0 in base 3 (or any other base) what the mean is precisely this:

To represent the number 0 in base 3 we just write: 0.

To represent the number 1 in base 3 we just write: 1.

To represent the number 3 in base 3 we must write: 10.

In general, for any positive number n the symbols used to construct representations for number will be {0, 1, 2,. . ., 9,. . ., n-1}. In base n the number 0 is represented as: 0. In base n the number 1 is represented as 1. The number n is represented as: 10.

Thus it makes sense to always use the symbol 0 and 1 as part of the set of numerals in whatever base you are in and if one does this then 0 is 0 and 1 is 1.


Semantically aren’t we saying position? It’s closer to an abacus no?

The symbol 0 doesn’t mean anything rather than like it’s etymology it’s the absence of anything.

1__

Is the same as

100

So it’s the position more than anything right?

Depends on the base of the position

1_

Could mean 2 for example

1__

Could mean 4 or 100 for example

11_ as 4 in Gray code :p


I know you said you have a math background, but I'm gonna write as though you don't because I think this is a super interesting question which gets at the heart of something that confused me for a while, and it deserves a discussion a layman can understand.

So the best way to think about numbers (in this situation. in this situation. obviously there are other ways to think about them. i'm not a platonist. nobody is a platonist enough to justify the amount of pedantry this take would normally inspire) is as abstract objects which exist in and of themselves. A particular base is just a way to write these abstract objects in a particular way. You can write numbers in a way which doesn't require a base, or is so annoying to describe as a base that you honestly shouldn't, such as the Roman system.

This is important because there's a really fundamental sense in which 3 (decimal) and 10 (binary) are the same thing. When I write '3' I'm pointing you towards the abstract object |||. But that's just convention! Here on HN, I could write '1A' and expect many readers to see it as the same as '26' or '10011010'. With the naturals (and 0) you can think of 3 as fundamentally those three tallies, or three apples, or whatever. For the reals, algebraicists picture an element of a complete ordered field (my brain paints these, like all objects viewed abstractly, as pale tan circles) and analysts picture a point on a line. This representation, of course, doesn't scale, which is why we pick some number of symbols (usually 10, sometimes 16, 8, or 2, and in my very favorite dreams 12) and just agree to map them onto specific abstract objects. Then we can make all the other numbers in a super compact notation without making up any new symbols.

So what about 0 and 1? Well 0 is the number which, when added to any x, gives x. And 1 is the number which, when multiplied with any x, gives x. Now I know what you're saying; "Ok, why do I care? 3 is the number of legs a table needs so it won't fall down, but it's not special". We see for any sane base that (so long as we're not just making up symbols) we'll write 0 just as 0 (since it's 0n^0 + 0n^1 + 0n^2...). What base is that expansion written in? I did it in decimal, but it doesn't matter! You can just as easily write (0n^zero + 0n^one + 0n^two...). Similarly, since it is just a fact about numbers that x^0=1 (or, if you like, x^zero=one), we'll write 1 as 1 (from 1n^0+0n^1...). If you trust that that relation holds up for irrational x, which I can't make you do but you definitely should, then you see that we'll also be writing 0 and 1 as 0 and 1 in base pi too.

So what is pi^0? It's one! One in what base you ask? All of them! It's equal to the number which '1' represents. In a way that's because 0 is always 0 and 1 is always 1, but really it's the other way around. 0 is 0 and 1 is 1 regardless of base because pi^0, and 10^0, and any other number to the 0th power, is 1.

Basically this exact issue is what made Tensor algebra so difficult for me, and I suspect a stumbling block for many people at some point. There you're talking about the basis of a vectorspace, rather than the base of a number system, but it's basically exactly the same thing. The key comes from thinking of objects floating in space with symbols pointing to them. We can operate on the symbols in all sorts of ways, and note cool patterns, but if you confuse them with the objects they point to you'll eventually be in for a bad time.


As a layman, thank you for this write-up! And I share your longing for a dozenal base system.


seximal is um, sexier, IMHO.

Times-table is very compact, and it's a natural fit for hand-counting up to 2 digits - 1's on one hand, 6's on the other, so you can count up to 35 (base 10) on two hands not just 10.

And IMHO to avoid confusion with decimal, alternate bases need completely different glyphs to represent the digits, and completely different naming. Fewer digits makes that easier.


You can actually count to twelve on one hand by using knuckles. There aren't any cultures which are base 12 today, but there are cultures which count to 12 a hand and were in base 12 back in the day, giving us our 24 hour days.

Seximal is IMO the sad middle child of the bases. Sure it's small, but if I wanted small I'd stick with binary. Oh, the expansion is too large? Ternary has the best radix economy. If you're gonna have a number system divisible only by two numbers, you might as well stick with base 10!


Think of the keyboard though. Duodecimal needs an extra 2 keys, 12 in all just for the digits. Seximal can do it with six; easily managed with just one hand on a home row.


You can also count to twelve on one hand by counting the segments of your digits by pointing to them with your thumb. (Thumb points at one of the three segments of a digit on each digit).


That's actually the one I was talking about, though yeah I guess you could use the actual knuckles too. But yeah, the segments are what I learned as a kid.


A bad idea that still merits discussion about the ways in which it is bad...


It's literally equivalent to the evaluation of a polynomial in a point. It's not even an idea, it's just notation. There isn't even any meaningful sense in which it's "good" or "bad".


is the problem essentially not just that if you make irrational numbers the bases, then you make [a significant number of] rational numbers irrational?




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

Search: