February 27, 2017
Here's a little calculator that converts rational numbers into their \(\beta\)-nary plus representations.
Individual digits are represented in base 10 and separated by spaces.
For repeating numerals, an apostrophe is inserted just to the left of the repetend.
Theoretically, every rational number should have either a terminating or repeating representation, either of which implies that the algorithm should stop after finitely many steps. Still, on the off chance something bad happens, I've included the option to put a cap on the number of computed digits.
As an additional caveat, be aware that certain calculations may result in overflow errors.
Evaluate \(\frac{1}{\beta+1}\) for various values of \(\beta\) where \(b_1 = \beta\) and \(b_n = a_{n-1}+ \beta\). Do you notice a pattern? Can you prove it?
Evaluate fractions with large repetends and examine the relative frequencies of each digit in the repetend. This can be done by evaluating fractions with denominators that are large, (but not so large as to introduce computational errors). How well does this fit the distribution you would expect from a random number generated in your chosen base? Moreover, what distribution of digits would you expect from a random number generated in your chosen base?
\(b_1 = \)
\(b_n = a_{n-1}+\)
Limit computation to digits.
/ = output
March 3, 2017
Answer to suggestion 1
\(b_1 = \beta\), \(r_1 = \frac{1}{\beta+1}\), \(b_1r_1 = \frac{\beta}{\beta+1}\), \(a_1 = 0\)
\(b_2 = \beta\), \(r_2 = \frac{\beta}{\beta+1}\), \(b_2r_2 = \frac{\beta^2}{\beta+1} = \frac{(\beta^2-1)+1}{\beta+1}\), \(a_2 = \beta-1\)
\(b_3 = 2\beta-1\), \(r_3 = \frac{1}{\beta+1}\), \(b_3r_3 = \frac{2\beta-1}{\beta+1} = \frac{(\beta+1)+\beta-2}{\beta+1}\), \(a_3 = 1\)
\(b_4 = \beta+1\), \(r_4 = \frac{\beta-2}{\beta+1}\), \(b_4r_4 = \beta-2\), \(a_4= \beta-2\)
\(\frac{1}{\beta+1}\) = 0 . 0 \((\beta-1)\) 1 \((\beta-2)\)
Pretty neat, wouldn't you say?
The answer to suggestion 2 will probably be a post on its own.