-2

A number written in base b is a polynomial $\sum {(a_i*b^i)}=a_n...a_3a_2a_1a_0$

The logarithm in base b of the number gives the number of digits (up to with a constant=1 difference), and I want to understand how it does that. Note that as the base gets smaller, the result gets more precise.

I want to understand how the logarithm processes each element of the polynomial to get the result.. The entire process, and not a rough approximation.

I made a program that composes the text of a Taylor series for log(1+x) with a polynomial with 10 terms, but the result is a text file with hundreds of Mb, so it is unreadable.

I understand that the largest term is approximately $n+log_b(a_n)$, but I want a more precise understanding. A rough explanation based on bounds is what I already know. I have no interest on that, unless it is part of the entire explanation.

  • @Simply Beautiful Art No. Your link only explains approximately what I said when I wrote $n+log_b(a_n)$. As I said, I want the complete process, not just an approximation. – xihocipi Feb 15 '17 at 12:28
  • It gives exactly how many digits a number has in a given base. What approximation do you mean? – Simply Beautiful Art Feb 15 '17 at 12:34
  • You didn't read the selected answer. – xihocipi Feb 15 '17 at 12:36
  • I see nothing wrong with the below answer. The digits themselves play absolutely no role in how many digits there are. Unless you more clearly state what's wrong with the below, I cannot help you. – Simply Beautiful Art Feb 15 '17 at 12:38
  • Of course the digits play a role in how many digits the number have. The encoding size in binary of 64 is larger than the encoding size of 16. I'm asking what the logarithm does to each element of the polynomial. – xihocipi Feb 15 '17 at 12:42
  • Your question is suddenly unclear then. If I were to count how many apples are in a bag, how does the type of apple affect how many apples there are? Please clear this up, not to me, but in the question. – Simply Beautiful Art Feb 15 '17 at 12:45
  • I don't know what you want. What I expected is something like an expression for the Taylor series composed with a polynomial. But I didn't wanted to restrict too much the answer, because There may be a better analysis tool. But the "answer" you posted is the same I already knew. That's useless. It does not explains anything, but just give a rough view of it. – xihocipi Feb 15 '17 at 13:27

1 Answers1

1

Let's consider the base $b=10$. Other bases are handled the same way.

If $N$ is a positive integer which has $p$ digits in base $10$, we have :

$$10^{p-1}\le N<10^p$$ Hence :

$$p-1\le\log_{10}(N)<p$$

This last condition is equivalent to :

$$p=\lfloor1+\log_{10}(N)\rfloor$$

Adren
  • 7,515
  • 10
  • 26
  • That is just what I wrote expressed in another way. It does not explains what the logarithm does with the polynomial, piece by piece. One difficulty is that there is not a closed form of $log(a+b)=f(log(a),log(b))$ – xihocipi Feb 15 '17 at 12:30
  • @xihocipi I only see some inequalities, the definition of logarithms, and silent use of monotonicity. There should be no more required to answer this question. – Simply Beautiful Art Feb 15 '17 at 12:40
  • @xihocipi it doesn't matter what $\log$ does with a sum. What matters is your number can be written as $N=\alpha\times 10^{p-1}$ for $1\leq \alpha<10$ and $\log(N)=\log(\alpha\times 10^{p-1})=\log(\alpha)+\log(10^{p-1})=p-1+\log(\alpha)$ --- and $\log(\alpha)<1$; i.e what matters is what $\log$ does to a product. – JP McCarthy Feb 15 '17 at 13:11
  • You are just trowing away $log(\alpha)$ under the carpet, and there is the meat of the problem. – xihocipi Feb 15 '17 at 13:21
  • I said that I composed a polynomial with a taylor series, to examine what is the result, and you discard all that hard work as it were non relevant. – xihocipi Feb 15 '17 at 13:23
  • @xihocipi I am throwing away $\log (\alpha)$ because it is less than one... your power series is only complicating the matter. Do you understand that all strictly positive real numbers can be written in the form $\alpha\times 10^m$ for $1\leq \alpha<10$? – JP McCarthy Feb 16 '17 at 12:56
  • @Jp McCarthy You cannot explain the logarithm in terms of the logarithm. And you answer would only be valid if the logarithm were returning an integer value, or only the largest exponent of the polynomial. It does not. Is a continuous function.The fractional part has meaning (is proportional to the number of digits of a smaller base). – xihocipi Feb 22 '17 at 11:30
  • I tried to decompose the polynomial in a product of factors $\prod (x-a_i)$ (the logarithm turns into a sum). But I got no insight. – xihocipi Feb 22 '17 at 11:32
  • @Jp McCarthy your "answer" is like answering how to multiplicate numbers by just explaining how to multiplicate the most significant digits. – xihocipi Feb 22 '17 at 11:33
  • @xihocipi logs don't handle sums very well. If you want maybe calculate the Taylor Series of $\ln(x+a)$ and see what that gives you. – JP McCarthy Feb 23 '17 at 08:59