1

The equation for the number of digits required to express some number (N) given some base (b) is the following

$\lceil{\log_{b}(N+1)}\rceil$

If we want to see the difference in number of digits required for varying bases then then our general formula would be

$\lceil{\log_{b_{1}}(N+1)}\rceil - \lceil{\log_{b_{2}}(N+1)}\rceil$

But I'm not sure how to solve this for some number in terms of N since they have different bases.

This is for a Computer Science algorithms class so approximate answers are fine.

  • "But I'm not sure how to solve this for some number in terms of N since they have different bases." Not sure how to solve what? So far as I can tell $\lceil{\log_{b_{1}}(N+1)}\rceil - \lceil{\log_{b_{2}}(N+1)}\rceil$ is the answer. If it's not, what is your question? – fleablood Sep 11 '19 at 22:26
  • The difference in the number of digits required. I just found the solution reading in my textbook so I'll answer my own question in a comment right now – financial_physician Sep 11 '19 at 22:33

1 Answers1

2

To convert from one logarithmic base to another we have the equation

$\log_b(N) = \log_a(N)/\log_a(b)$

Thus the size of the integer is always different by log_a(b) which is a constant.

  • 1
    You want :"differ by a factor of", not just "different by". Since $2^{10} \approx 10^3$ the base $2$ logarithm of $10$ is just over $3$ so numbers have just over $3$ times as many binary as decimal digits. +1 for answering your own question. You have asked several questions here. When you get answers that help you should upvote them, and accept one. – Ethan Bolker Sep 11 '19 at 22:40
  • ahhhh, there's the difference that I was neglecting that I should have understood better. Thank you! – financial_physician Sep 11 '19 at 22:44