P
Pascal Bourguignon
Willem said:(e-mail address removed) wrote:
) Proginoskes wrote:
)> Oh, really?
)>
)> log 1 = 0
)> log 2 = 0.3010299957
)> log 3 = 0.4771212547
)> log 4 = 0.6020599914
)> log 5 = 0.6989700043
)> log 6 = 0.7781512504
)> log 7 = 0.8450980400
)> log 8 = 0.9030899871
)> log 9 = 0.9542425094
)> log 10 = 1.0
)>
)> (All are accurate except for possibly to the last digit.)
)>
)> The sum is 6.559763033 (last 2 digits possibly wrong, but the rest are
)> correct).
)>
)> The answer is 7.
)>
)> Where did I use the fact that 10! = 3,628,800?
)
) this post is dejavu.
) what's the difference, one still has to compute log(x) somehow. it is
) even easier to ocmpute factorial itself.
Let's change that calculation slightly then.
log 1 ~= 0.0
log 2 ~= 0.3
log 3 ~= 0.5
log 4 ~= 0.6
log 5 ~= 0.7
log 6 ~= 0.8
log 7 ~= 0.8
log 8 ~= 0.9
log 9 ~= 1.0
log 10 ~= 1.0
The sum is 6.6, so the answer is 7.
That sounds more convincing.
The more so if the way you compute these approximations of log doesn't
involves all the algorithmic complexity of computing the log function...
After all, computing factorial n only involves n multiplications,
while computing only log(i) involves several additions,
multiplications and divisions.