GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • Fundamentals & OOPs
  • Data structures and algorithms
  • Aptitude
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 27 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
AptitudeQuantitative aptitude · Algebra

Logarithms

Logarithms as inverse exponents: reading them from the definition, the product, quotient, power and change-of-base laws, common logs and digit counts, and solving logarithmic equations.

5 min read 45 questions
Practice questions
log₂ 8= 3

On this page

1/10
  1. 011. What a logarithm is
  2. 022. Reading a log straight from the definition
  3. 033. The laws
  4. 044. Common logs and the number of digits
  5. 055. Evaluating a log from log 2 and log 3
  6. 066. Solving logarithmic equations
  7. 077. Shortcuts and mental maths
  8. 088. Common traps
  9. 099. Revision sheet
  10. 10Practice
Back to top

1. What a logarithm is

A logarithm is the exponent hiding inside a power. The sentence braised to the power y equals x can be read the other way round: the power you need is y = log_b x. So log and "raise to a power" are inverse operations — one undoes the other. "log_b x" answers one question: *to what power must b be raised to give x?*

Two ways to say the same thinglog_b x = y ⇔ by = x2⁵ = 32 ⇔ log₂ 32 = 5
The exponent form and the logarithm form carry exactly the same information.

Tests ask about logarithms because they turn multiplication into addition and powers into multiplication, which makes otherwise ugly arithmetic (how many digits in 2⁵⁰, say) quick. The base b must be positive and not 1, and you can only take the log of a positive number — there is no real log of 0 or of a negative value.

2. Reading a log straight from the definition

If the number is a clean power of the base, you can read the logarithm off by eye. Write the number as a power and copy the exponent: 32 = 2⁵ so log₂ 32 = 5; 81 = 3⁴ so log₃ 81 = 4. A reciprocal flips the sign: 1/9 = 3⁻² so log₃(1/9) = −2.

Two special values come up again and again. Any base to the power 0 is 1, so log_b 1 = 0. Any base to the power 1 is itself, so log_b b = 1. Together with the reciprocal rule these settle most one-step questions without any working.

log_b 1 = 0 and log_b b = 1 for every valid base. "Base ten" logs are written log₁₀ or just log; so log₁₀ 1000 = 3 because 1000 = 10³.

3. The laws

Four laws do almost all the work. Each turns a hard operation into an easier one.

The log lawsLawWith numbersProductlog 6 = log 2 + log 3Quotientlog 1.5 = log 3 − log 2Powerlog 2⁵ = 5 log 2Change of baselog₄ 8 = (log 8)/(log 4)Reciprocallog₂ 3 · log₃ 2 = 1
The product, quotient, power, change-of-base and reciprocal laws, each shown on real numbers.
  • Product: log(m·n) = log m + log n.
  • Quotient: log(m/n) = log m − log n.
  • Power: log(mⁿ) = n · log m — the exponent comes down in front.
  • Change of base: log_b a = (log a)/(log b), to any convenient base.
  • Reciprocal: log_b a · log_a b = 1, so 1/log_b a = log_a b.

The commonest slip is to multiply when the law says add: log(m·n) is log m + log n, never log m · log n. The second commonest is to drop the coefficient in the power law — log 2⁵ is 5 log 2, not log 2.

4. Common logs and the number of digits

Base-ten logs split into a whole-number part (the characteristic) and a decimal part (the mantissa). The characteristic is what fixes the size of a number, and that gives a neat trick: a positive integer M has exactly ⌊log₁₀ M⌋ + 1 digits.

So the number of digits in a power b^N is ⌊N · log₁₀ b⌋ + 1. For 2⁵⁰, with log₁₀ 2 = 0.3010, that is ⌊50 × 0.3010⌋ + 1 = ⌊15.05⌋ + 1 = 16 digits. You never compute the 16-digit number itself.

Counting digitsdigits in bN = ⌊N · log₁₀ b⌋ + 12⁵⁰: ⌊50 × 0.3010⌋ + 1 = 16
The characteristic ⌊N·log₁₀ b⌋ is one less than the digit count.

5. Evaluating a log from log 2 and log 3

Exams hand you log₁₀ 2 = 0.3010 and log₁₀ 3 = 0.4771 and ask for the log of some composite number. Factorise the number, then apply the laws. Remember log₁₀ 5 = log₁₀(10/2) = 1 − log₁₀ 2 = 0.6990 and log₁₀ 10 = 1.

  1. log₁₀ 6 = log₁₀ 2 + log₁₀ 3 = 0.3010 + 0.4771 = 0.7781.
  2. log₁₀ 12 = 2 log₁₀ 2 + log₁₀ 3 = 2(0.3010) + 0.4771 = 1.0791.
  3. log₁₀ 72 = 3 log₁₀ 2 + 2 log₁₀ 3 = 3(0.3010) + 2(0.4771) = 1.8572.

The pattern is always the same: break the number into 2s, 3s and 10s, bring exponents down with the power law, and add or subtract the quoted values. A number like 15 needs the 10: 15 = 3 × 10 ÷ 2, so log₁₀ 15 = 0.4771 + 1 − 0.3010.

6. Solving logarithmic equations

To solve an equation, collect the logs into a single log, then undo it. log_b x = k becomes x = b^k directly. When two logs are added, use the product law first:

  1. log₃ x + log₃(x + 6) = 3.
  2. Combine: log₃[x(x + 6)] = 3, so x(x + 6) = 3³ = 27.
  3. Solve x² + 6x − 27 = 0 = (x − 3)(x + 9): x = 3 or x = −9.
  4. Reject x = −9 (a log needs a positive argument), so x = 3.
Sum of logs to a quadraticlog₃ x + log₃(x + 6) = 3x(x + 6) = 27 ⇒ x = 3
Always check each root keeps every logarithm defined; discard any that does not.

7. Shortcuts and mental maths

  • Clean power? Read the log off by eye: 125 = 5³ so log₅ 125 = 3.
  • Reciprocal flips the sign: log_b(1/x) = − log_b x.
  • Change of base to the smallest prime makes a fraction fall out: log₄ 8 = log₂ 8 / log₂ 4 = 3/2.
  • Chained change-of-base telescopes: log₂ 3 · log₃ 8 = log₂ 8 = 3.
  • 1/log_b a = log_a b, so sums like 1/log₂ 10 + 1/log₅ 10 collapse to log₁₀ 2 + log₁₀ 5 = 1.
  • Digits: ⌊N · log₁₀ b⌋ + 1, never the actual power.

8. Common traps

  • Writing log(m·n) as log m · log n — it is log m + log n.
  • Dropping the coefficient: log m³ is 3 log m, not log m.
  • Forgetting the minus sign on a reciprocal: log₃(1/9) = −2, not 2.
  • Reading log_b b as 0 instead of 1, or log_b 1 as 1 instead of 0.
  • Keeping a root that makes a log argument zero or negative when solving an equation.
  • Off-by-one on digits: it is ⌊N log₁₀ b⌋ + 1, so remember the + 1.

9. Revision sheet

  • log_b x = y ⇔ bʸ = x; log and power are inverses.
  • log_b 1 = 0 and log_b b = 1, always.
  • Product → add, quotient → subtract, power → coefficient in front.
  • Change of base: log_b a = (log a)/(log b); reciprocal: log_b a · log_a b = 1.
  • From log₁₀ 2 = 0.3010, log₁₀ 3 = 0.4771: factorise, bring down exponents, add or subtract.
  • Digits in b^N = ⌊N · log₁₀ b⌋ + 1; solving equations, reject non-positive arguments.

Practice

45 questions in 3 sets. Every answer comes with its explanation, and each question you get right earns XP.

  • Easy · 15
  • Medium · 15
  • Hard · 15
Start practising
PreviousAlgebra and EquationsNextGeometry
Log inStart free