1
$\begingroup$

The premise is this, you have two containers one is red and the other is blue. The red container has 1000 marbles, and the blue container is empty. You can easily split the marbles in any container in half (truncated if odd) and dump them into the other container, yet you want the red container to end up with 800 marbles, and the blue one to contain 200 marbles (5:1 ratio). However, since doing it manually (one by one) would be too time consuming you want to know how to achieve that ratio just transferring halves from one container to another back and forth.

The way I found to achieve this is by following the binary expansion of $\frac{1}{5}$. In practice it also worked for $\frac{1}{3}$, $\frac{1}{7}$, $\frac{1}{11}$, and even $\frac{1}{17}$.

$\frac{1}{3} = 0.\overline3 = 0.\overline{01}_2 \\ \frac{1}{5} = 0.2 = 0.\overline{0011}_2 \\ \frac{1}{7} = 0.\overline{142857} = 0.\overline{001}_2 \\ \frac{1}{11} = 0.\overline{09} = 0.\overline{0001011101}_2 \\ ...$

After the decimal point the 'zeroes' would mean pull halves from red to blue, and 'ones' would, likewise, mean pulling halves from blue to red. Doing this will eventually arrive to the ratio the number itself represents.

The following is the pattern the values of the containers in the previous problem would follow as you go moving splits back and forth eventually arriving to 800 in the red container and 200 in blue one, and continuing would give all the other multiples of 5. That is 800, 600, 400, and 200.

$$ \begin{array}{c|lcr} n & \text{Red} & \text{Blue} \\ \hline 1 & 1000 & 0 \\ 2 & 500 & 500 \\ 3 & 250 & 750 \\ 4 & 625 & 375 \\ 5 & 812 & 188 \\ 6 & 406 & 594 \\ 7 & 203 & 797 \\ 8 & 601 & 399 \\ 9 & 800 & 200 \\ 10 & 400 & 600 \\ 11 & 200 & 800 \\ \end{array} $$

However here is where my problem begins. As I said earlier I was able to work out this method for any number when I needed any ratio using the prime numbers 3, 5, 7, 11, and 17, but for some reason this DOES NOT work at all for 13. Moreover, that is not the only prime for which it doesn't work, it doesn't seem to work either for 19 and 23. It worked partially for 29.

It is also important to note that the method is also effective to approximate the desired ratio even if you work with fractions or an arbitrary number of decimal places.

So is there any theorem for this? If so, what is it called? Do anyone know of a working solution for this specific problem?

Edit: I wrote all fractions as 0.3

  • 0
    The _"exactly in half"_ part stops working when you have an odd number of marbles in a container. This requires some clarification, I think.2017-01-24
  • 0
    Good observation, in practice I would truncate the quantity and leave one marble more in the container I'm moving marbles away from.2017-01-24

1 Answers 1

0

Let us write $\alpha \in (0, 1)$ as $ \alpha = \sum_{k=1}^{\infty} a_k 2^{-k}$ for $a_k \in \{0, 1\}$ for all $k = 1, 2, \cdots$. If $(x_0, x_1, x_2, \cdots) $ denotes the fraction of balls in the red container, ignoring the rounding-up issue, we have the following recursive formula:

$$ x_0 = 1, \qquad x_{n+1} = \frac{1}{2}(x_n + a_{n+1}) = \begin{cases} \frac{1}{2}x_n, &\text{if } a_{n+1} = 0 \\ x_n + \frac{1}{2}(1-x_n), &\text{if } a_{n+1} = 1 \end{cases} $$

In other words, this processes writes down the binary digits of $\alpha$ in reverse order:

$$ x_n = \frac{1}{2^n} + 0.(a_n)(a_{n-1})\cdots(a_1)_2$$

So your procedure works if the repeating digits of $\alpha$ is a palindrome up to shift. For instance, for the repeating digits of $\frac{1}{11} = 0.\overline{0001011101}_2$, we have

\begin{align*} 0001011101 & \rightarrow 1011101000 \qquad (\text{reversed}) \\ & \rightarrow 0001011101 \qquad (\text{shifted to the right by 3}) \end{align*}

The same is true for other examples you mentioned. On the other hand, $\frac{1}{13} = 0.\overline{000100111011}_2$ does not satisfy this property:

\begin{align*} 000100111011 & \rightarrow 110111001000 \qquad (\text{reversed}) \end{align*}

and no shift of $110111001000$ equals the original repeating digits $000100111011$.

  • 0
    This is awesome thank you. I just solved it for 13 with your comment. I just re-arranged two digits I used 000110111001 instead of 000100111011. I based the change in the three shift you said that returns to the original value.2017-01-24
  • 1
    Also works for 19, and I will make the educated guess that it will work to all others for now (I will test later). Basically all you have to do for the ones that do not satisfy the property is to reverse the repeating mantissa, offset the all the leading zeroes and that is the pattern to use.2017-01-24