1
$\begingroup$

Okay, that title is awkward, but hopefully the question won't be. See my earlier question for some context, if interested.

So if if I'm trying to get 1/3 of a number (let's say 99) with only the option of multiplying the target number by .(3), is there an equation or function to know how many repetitions is enough such that "tying off" the number with the next highest number (in this case, .34 or .334, etc), will equal 1/3 of the target number if rounding down eg

< 1/3 target number + .44

.44 to account for any ceiling-happy rounders out there.

I know it's not a set number for repetitions, but with following test:

9   *  .4 =   3.6   |   9 *   .34 =   3.06 99  * .34 =  33.66  |  99 *  .334 =  33.066 999 *.334 = 333.666 | 999 * .3334 = 333.0666 

there is a clear correlation between the size of the target number and the number of repetitions. But I know that this isn't the most definitive test, obviously.

1 Answers 1

1

A first best guess would be that if your number contains $n$ decimal digits before the decimal point, your multiplication factor should have $n$ 3s followed by a 4.
Imagine performing the long multiplication of your number and a string of 3s.
For example:
$\begin{align} & 12345 \times\\ & .33333\\ & 333330000\\ & \space\space 66666000\\ & \space\space\space\space9999900\\ & \space\space\space\space1333320\\ & \space\space\space\space\space\space166665\\ & 4114.95885\\ \end{align} $ is not quite enough to produce your intended result of 4115. Replacing the 33333 with 333334 gives a product of 4115.008230 which does give the desired result.
Just adding more 3s will never make a product greater than the desired result and having too few 3s (and so the 4 too soon) will make a product too big.
As to a formula for the number of 3s, $\lfloor{log(n)+1}\rfloor$ should do (where log is of the base 10 variety).

  • 0
    It is the number of digits in your first number that determines how many digits you need in your multiplying factor. Say that you want to divide 123 by 7 (and hence multiply by .(142857)). There are 3 digits in 123 so you need to take the first 3 digits of 142857 and round up the fourth, to get $\lfloor 123 * .1429 \rfloor = 17.$2012-03-08