# How do I do log to the base 2?

Tags:
1. Jul 21, 2010

### joebloggs

On my calculator I have a log button which is log to the base 10 and I also have a natural log button. How do I input log to the base 2 on a calculator?

So far the only way I know is to go log(x)/log2 = y

for instance if I'm trying to find log to the base 2 of the number 24
I go log24/log2 = 4.58

But this is time consuming when you have a long equation with lots of log to the base to 2's in it.

My calculator is a Casio fx-9750G Plus.

2. Jul 21, 2010

### Mentallic

Well one could ask the same question for log of any reasonable base. I'm sure they didn't bother adding a button to allow for any log base because it's really not that much extra effort to divide by log2 in my opinion.

And when you say you have lots of log base 2's in the equation, what form do they usually come in?

$$log_2a+log_2b+log_2c$$ etc.? In this case just factorize out the $$\frac{1}{log2}$$

or

$$log_2a*log_2b*log_2c$$, in this case factorize out $$\frac{1}{(log2)^3}$$

It might come in handy to try simplify some things on paper first before punching it into the calculator.

3. Jul 21, 2010

### HallsofIvy

If $y= log_a(x)$, then
$$x= a^y= e^{ln(a^y)}= e^{y ln(a)}$$

Now take ln of both sides of that: $ln(x)= y ln(a)$ so
$$y= \frac{ln(x)}{ln(a)}$$.

In particular,
$$log_2(x)= \frac{ln(x)}{ln(2)}$$

4. Jul 21, 2010

### Bohrok

What about storing log(2) in the calculator's memory and using the memory key, perhaps that's less time consuming than hitting log and 2?

5. Jul 22, 2010

### joebloggs

So if I have an equation which is say -0.5log0.5 - 0.5log0.5 (where the logs are to the base 2)
I would type this into my calculator as log0.5/log2 * -0.5 - log0.5/log2*0.5 = 1 ?

Is this how everyone else does it on their calculators?

6. Jul 22, 2010

### Mentallic

Well, like I said, you should simplify on paper first. I don't know about you but I'm much more prone to making arithmetic mistakes punching things into a calculator than I would simplifying the question first on paper.

You must've given a bad example, because $$-0.5log_20.5 - 0.5log_20.5=-log_20.5=log_22=1$$ which you can see can be easily done on paper. But let's say it wasn't this easy and it wasn't immediately obvious how to simplify.

First factorize the constants: $$-0.5(log_20.5-log_20.5)$$

Then factorize the $$1/log2$$: $$\frac{-0.5}{log2}(log0.5-log0.5)$$

Now, since the part in the parenthesis isn't immediately obvious to solve from our assumption that this example is harder, you can now start plugging it into the calculator.

7. Jul 22, 2010

### Dickfore

use the property of logarithms:

$$\log_{a}{c} = \frac{\log_{b}{c}}{\log_{b}{a}}$$

Proof:

Using the fundamental property of logarithms:

$$a^{\log_{a}{c}} = c$$

and taking the logarithm with base $b$ on both sides, we get:

$$\log_{b}{a^{\log_{a}{c}}} = \log_{b}{c}$$

Using the rule for logarithms of exponents, the left hand side can be transformed to:

$$\log_{a}{c} \, \log_{b}{a} = \log_{b}{c}$$

which, after solving for $\log_{a}{c}$, yields the quoted formula. Q.E.D.

In your case you use $a = 2$ and for $b$ you use one of the standard bases for logarithms (10 or $e$).

8. Jul 22, 2010

### Mentallic

Is it just me or is it becoming a habit for PF'ers to stop reading after the first line in the OP's post and avoid reading any other responses thereon?

9. Jul 22, 2010

### HallsofIvy

Yeah, it saves time! (Well, not for others of course!)

Now, my great failing is that I just can't resist putting in my oar!