6
$\begingroup$

I am wondering, what would happen to the representation of a number like 2 in base pi? I know that things like $π^2$ would simply be 100, but what about numbers that are not of the form $π^n$ ? I think it ought to get tricky!

$\endgroup$
  • 1
    $\begingroup$ Wouldn't $\pi^2=100$? $4=2^2=100$ in base 2 $\endgroup$ – Eleven-Eleven Feb 16 '14 at 17:37
  • 2
    $\begingroup$ Also I don't think our integers, base 10 could be represented in base $\pi$ since the integers are rational and $\pi^n, n \in \mathbb{Z}$ are irrational... $\endgroup$ – Eleven-Eleven Feb 16 '14 at 17:39
  • $\begingroup$ Yes Eleven-Eleven you are right! I will edit it. $\endgroup$ – Just_a_fool Feb 16 '14 at 17:42
  • $\begingroup$ Just a blind shot: 2 would be irrational in base π $\endgroup$ – Francisco Presencia Feb 17 '14 at 0:12
7
$\begingroup$

See here for formal definition of representation in a non integral base. With such a definition $2$ in base $\pi$ is simply... $2$. This because $2<\pi$ hence it can be represented by itself.

In any base $\beta$ most numbers (all but a countable set) have an infinite representation. Only sums of powers of $\beta$ have a finite representation.

Here is an algorithm (written in python) to compute the representation in any base:

from math import *
import string

def repr(x,b,digits=30):
    """ represent @x in base @b """
    DIGITS = string.digits + string.ascii_uppercase
    n = int(floor(log(x) / log(b)))
    r = ''
    while n>0 or (len(r)<digits and x != 0.0):
        d = int(x/b**n)
        if n==-1:
            r += '.'
        r += DIGITS[d]
        x = x - d * b**n
        n -= 1
    if r=='':
        r= DIGITS[0]
    return r

for x,b in [(1973.0,10), (8.0,2), (10.0,pi)]:
    print x, 'in base', b, 'is written:', repr(x,b)

The output is:

1973.0 in base 10 is written: 1973
8.0 in base 2 is written: 100
10.0 in base 3.14159265359 is written: 100.01022122221121122001111210
$\endgroup$
  • $\begingroup$ Interesting, could I ask if changing the base has been used to solve a math problem that can't be solved in base 10 (or not easy to solve)? Thx. $\endgroup$ – NoChance Jan 7 '16 at 5:15
  • 1
    $\begingroup$ I don't know. But here en.wikipedia.org/wiki/Non-integer_representation you find some references. $\endgroup$ – Emanuele Paolini Jan 7 '16 at 5:21
5
$\begingroup$

It's not enough to just say "base $\pi$" - the concept isn't really defined until you specify what the digits are allowed to be. What seems to me to be the only reasonable option is to say that digits can be anything within $[0,\pi)$, but this then makes representing anything trivial, because for any $a>0$, $$\Large \begin{align*} a&=\pi^{\log_\pi(a)}=\pi^{\lfloor\log_\pi(a)\rfloor}\underbrace{\pi^{\log_\pi(a)-\lfloor\log_\pi(a)\rfloor}}_{\text{between 0 and }\pi}\\\\\\ &=\pi^{\log_\pi(a)-\lfloor\log_\pi(a)\rfloor}\underbrace{00\ldots0}_{\lfloor\log_\pi(a)-1\rfloor}\text{ in base }\pi \end{align*}$$ So the representation of $2$ in base $\pi$ under this approach would just be $2$ (because $1<2<\pi$), while the representation of $4$ would be $\frac{4}{\pi}0$ (because $\pi<4<\pi^2$).

$\endgroup$
  • $\begingroup$ You're right, when you take the concept to its logical conclusion it makes no sense at all! $\endgroup$ – TooTone Feb 16 '14 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.