ARITHMETIC WORKSHEETS

Checking a logarithm by raising its base

A logarithm gives the exponent, and raising the base to that exponent returns the original number. This worksheet runs the check with base 2 and the value 1024, and explains when the round trip is exact.

A logarithm asks for an exponent

The logarithm of x to base b is the exponent to which b must be raised to produce x. Asking for log base 2 of 1024 means asking: how many times must 2 be multiplied by itself to reach 1024. The answer is 10, since 2 to the tenth power is 1024. The logarithm calculator reports 10 for a value of 1024 and a base of 2. The power calculator, given base 2 and exponent 10, returns 1024. Running the two tools in turn is a round trip, and a successful round trip is a strong check that the logarithm was read correctly and that the base used in each step was the same. Another way to say it is that the logarithm undoes the power: if the power calculator turns 10 into 1024 with base 2, the logarithm turns 1024 back into 10.

The base is part of the question

The same number has a different logarithm in each base. For 1024, the base 2 logarithm is 10, the base 10 logarithm is about 3.0103, and the natural logarithm, with base e, is about 6.9315. Reading a result without knowing its base can mislead badly. Natural logarithms appear in calculus and growth models, base 10 logarithms in scales such as decibels and pH, and base 2 logarithms in computing, where they count bits and halvings. Always carry the base with the answer, and use that same base in the power step to recover the original value. Calculators often label base 10 as log and base e as ln, while programming languages frequently use log for the natural logarithm, so the same word can mean different bases. Converting between bases is a multiplication by a constant. Multiplying a base 2 logarithm by about 0.30103 gives the base 10 logarithm of the same number, so 10 becomes 3.0103 for 1024.

The identity behind the check

The round trip works because of the identity b raised to the power of log base b of x equals x, valid whenever the base is positive and not equal to 1, and x is positive. The restrictions are real. A base of 1 raised to any power is 1, so it cannot produce other values, and a logarithm to that base is undefined. A base of 0 or a negative base fails for similar reasons. A nonpositive x has no real logarithm because no real exponent turns a positive base into zero or a negative number. The calculator rejects such input with a message that the value and base must be positive and the base must not equal 1. The identity is also why a logarithm can serve as an inverse function: it maps the positive numbers one to one onto all real numbers. A quick consequence is that the logarithm of 1 is 0 for every valid base, since any base to the power 0 is 1, and the logarithm of the base itself is 1, since the base to the power 1 is the base.

How the calculator computes it

The logarithm calculator uses the change-of-base formula: log base b of x equals ln x divided by ln b, where ln is the natural logarithm. For 1024 and 2, ln 1024 is about 6.9315 and ln 2 is about 0.6931, and their ratio is 10. Because both logarithms are computed in floating point, the ratio can differ from the exact answer in the last digits. For this example the displayed result is 10. In general, the final digits of a logarithm should not be trusted beyond about 15 significant figures. The mathematical value is exact only when the inputs are exact powers of the base. A familiar example of floating-point behavior is that this calculator returns 2.9999999999999996 for a value of 1000 and a base of 10, so values that should be whole numbers sometimes appear a hair off.

Exact controls and approximate cases

The worksheet uses integer controls where the output happens to be exact: 1024 is a power of 2, and the logarithm is a whole number. With values that are not powers of the base, the result is irrational in most cases and gets rounded. The base 10 logarithm of 2 is about 0.30103, and raising 10 to that rounded value gives about 1.99999 or 2.00001 depending on the digits kept. The round trip then recovers the original number only approximately. When comparing, use a tolerance, such as a relative difference below one part in a billion, not exact equality. A good way to set a tolerance is to ask how many digits the input has. A value typed with four significant figures cannot support a reconstruction claim beyond about four figures, whatever the display shows.

Where the logarithm was born

John Napier published his table of logarithms in 1614, and Henry Briggs soon after developed base 10 tables that became standard for calculation. Before electronic calculators, multiplication of large numbers was done by adding logarithms and looking up the antilogarithm, which is exactly the power step in this worksheet. The slide rule is a physical form of the same idea. The principle that logarithms turn products into sums remains the basis for many methods today, including the logarithm form of the geometric mean and the decibel scale. Euler later tied the logarithm to the number e and to exponential functions, which is the form that most mathematics courses use today.

Logarithms in everyday scales

Several familiar scales are logarithmic. The decibel is ten times the base 10 logarithm of a power ratio, so a ratio of 100 corresponds to 20 dB. The pH scale is the negative base 10 logarithm of hydrogen ion concentration in moles per liter, so a concentration of 0.001 corresponds to pH 3. Moment magnitude for earthquakes and older Richter-style scales are logarithmic too, so each whole step corresponds to a large multiple in amplitude. In each case the power step converts a scale reading back to the underlying quantity, and the round trip confirms the conversion. Because these scales compress huge ranges, a small change in the reading can hide a large change in the underlying quantity, and the round trip is the way to see it.

Counting doublings

A base 2 logarithm answers how many doublings it takes to reach a value. Starting from 1, reaching 1,024 takes 10 doublings. Reaching one million takes about 19.93 doublings, since the base 2 logarithm of 1,000,000 is about 19.93, so 20 whole doublings would be needed to pass it. The same idea sets the number of bits needed to label a quantity of distinct items: 1,024 items need 10 bits, because 2 to the tenth is 1,024. The fractional part tells you the last doubling is incomplete. Halvings work the same way in reverse. Dividing 1,024 by 2 ten times reaches 1, which is the same count of 10 in the other direction. The ceiling of the logarithm gives the number of whole doublings needed to reach or pass a target, which is how storage and capacity planning often uses the idea.

Logarithms below one

A value smaller than 1 has a negative logarithm when the base is greater than 1. The base 2 logarithm of 0.25 is negative 2, since 2 raised to negative 2 is one over 2 squared, which is 0.25. The power step with exponent negative 2 returns 0.25 again. Negative exponents are reciprocals, and that fact keeps the round trip consistent across the whole positive axis. A base between 0 and 1 reverses the sign pattern, so values above 1 then have negative logarithms. Such bases are legal but uncommon in practice. The sign of the logarithm therefore tells you at a glance whether a value is below the base to the zero power, which is 1, or above it. Ratios work the same way. A halving of a quantity contributes negative 1 to a base 2 logarithm, and a quartering contributes negative 2.

Reporting a checked result

When you report a logarithm, state the base, the input and the number of significant digits. If a round trip was used as verification, say so and give the tolerance. For example, a value reconstructed within a relative error of 1e-12 supports the claim that the logarithm was computed correctly to about 12 digits. Reporting the check makes the result easier to trust and repeat. If the check fails by more than the tolerance, look first for a base mismatch, then for a value that was rounded before the power step, and last for a mistyped number.

Exponent rules that the round trip relies on

Three rules explain why logarithms and powers fit together. A product of powers with the same base adds the exponents, so 2 to the 3 times 2 to the 4 is 2 to the 7. A power of a power multiplies exponents, so the square of 2 to the 5 is 2 to the 10. A negative exponent is a reciprocal, so 2 to the negative 3 is 1/8, or 0.125. Each rule has a mirror image for logarithms: the logarithm of a product is the sum of logarithms, the logarithm of a power brings the exponent in front, and the logarithm of a reciprocal is the negative of the logarithm. The power calculator can confirm each of these with small integer inputs.

A value that is not a power of the base

Take the number 10 with base 2. The logarithm is about 3.3219, since 2 to the 3 is 8 and 2 to the 4 is 16, and 10 lies between them. Raising 2 to 3.3219 gives about 10.000, and the small difference from 10 depends on how many digits of the exponent are kept. The fractional part, 0.3219, tells you that the number is about 25 percent above 8, because 2 to the 0.3219 is about 1.25. This kind of reading is useful for estimation. The integer part says which power of the base the value has passed, and the fraction says how far into the next doubling it sits.

Reproduce the checks

Find the exponent

Open the Logarithm calculator and enter:

Positive value
1024
Logarithm base
2

Expected output:

Logarithm

10

The supplied base is two.

Reconstruct the value

Open the Power calculator and enter:

Base
2
Exponent
10

Expected output:

Power

1024

Use the same base in the reverse step.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Related tasks