Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Mathematics for Framing Questions  ›  Capstone Project

Logarithms for Skew and Growth

Mathematics 12 minA logarithm turns multiplication into addition, so skewed values spread out evenly, steady percentage growth becomes a straight line, and ratios become differences.

Logarithms for Skew and Growth

Most Pantry baskets cost between ₹300 and ₹800. A handful of office pantries order ₹40,000 of snacks at once. Plot order values on an ordinary axis and you get one tall spike near zero and a long, empty tail. Plot the monthly orders of a fast-growing new delivery zone and the early months look flat. Both pictures are fixed by the same tool.

The rule

Logs turn multiplying into adding: equal ratios become equal steps.

The base-10 logarithm asks "10 to what power gives this number?"

Value ₹40 ₹400 ₹4,000 ₹40,000
log10 1.6 2.6 3.6 4.6

Each step of ×10 in value is a step of +1 in the log. On a log axis, ₹400 and ₹4,000 sit as far apart as ₹4,000 and ₹40,000, so both ordinary baskets and office orders become visible on one chart.

Three reasons data scientists reach for logs:

  • Skewed data such as order values, incomes and page views spreads out evenly.
  • Growth at a steady percentage rate draws a straight line on a log scale, so a bend means the growth rate itself changed.
  • Ratios become differences: log⁡(a/b)=log⁡a−log⁡b\log(a/b) = \log a - \log b. Doubling is always +0.301 in log10 and halving is always −0.301, which makes rises and falls symmetric, unlike percentages.

The natural log (written ln, base ee) has a handy extra: for small changes, a rise of 0.05 in ln is close to a 5% rise in the value. That is why models often predict the log of spend, and why their coefficients read as percentages.

One catch: the log of zero does not exist. For a column with zeros, such as spend in a week with no orders, use log⁡(1+x)\log(1 + x), which keeps zeros at zero.

The shortcut

Count the zeros, then add the log of what is left. For 4,000: three zeros give 3, and log10(4) is about 0.6, so the answer is about 3.6. To compare two values, subtract their logs, because a difference of logs is the log of their ratio.

Is the new Wakad zone growing steadily?Step 1 of 4
  1. The raw counts

    Monthly orders: 1,000, then 2,000, 4,000 and 8,000. On a normal axis the line curves sharply upward.

Drills

Answer fast — trust the rule.

What is the base-10 log of 10,000?
log10(10000)= ?log10(10000) = \,?
What is log10(4000) minus log10(400)?
log10(4000)−log10(400)= ?log10(4000) - log10(400) = \,?
quick drill

Pantry's orders grow by 20% every month. On a log-scale chart, the line looks:

quick drill

Which Pantry column is the best candidate for a log transform?

quick drill

A column of weekly spend has many zeros. Why use log(1 + x) instead of log(x)?

Remember

  • Logs turn ratios into steps: each ×10 is +1 in log10.
  • Count the zeros, add the log of the rest; subtract logs to compare values.
  • Trap: the log of zero. Use log(1 + x) for columns that contain zeros.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainDefend the log axis

You showed a chart of Pantry's order values on a log10 axis, and a teammate says it 'distorts the data'. Explain why you chose the log scale, what a step of 1 on the axis means, and one thing a reader must keep in mind when reading it.