ArticleslgStudy

mathematics

Sturges's rule

Sturges's rule is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Sturges's rule rather than just read about it. In short: Sturges's rule is a method to choose the number of bins for a histogram. Given n {\displaystyle n} observations, Sturges's rule suggests using k ^ = 1 + log 2 ⁡ ( n ) {\displaystyle {\hat {k}}=1+\log _{2}(n)} bins in the histogram.

Sturges's rule — main illustration
Sturges's rule — illustration

Key takeaways

  • Sturges's rule belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Sturges's rule to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Sturges's rule from memory before moving on to harder problems.

Reference excerpt

Sturges's rule is a method to choose the number of bins for a histogram. Given n {\displaystyle n} observations, Sturges's rule suggests using

k ^ = 1 + log 2 ⁡ ( n ) {\displaystyle {\hat {k}}=1+\log _{2}(n)}

bins in the histogram. This rule is widely employed in data analysis software including Python and R, where it is the default bin selection method. Sturges's rule comes from the binomial distribution which is used as a discrete approximation to the normal distribution. If the function to be approximated f {\displaystyle f} is binomially distributed then

f ( y ) = ( m y ) p y ( 1 − p ) m − y {\displaystyle f(y)={\binom {m}{y}}p^{y}(1-p)^{m-y}}

where m {\displaystyle m} is the number of trials and p {\displaystyle p} is the probability of success and y = 0 , 1 , … , m {\displaystyle y=0,1,\ldots ,m} . Choosing p = 1 / 2 {\displaystyle p=1/2} gives

f ( y ) = ( m y ) 2 − m {\displaystyle f(y)={\binom {m}{y}}2^{-m}}

In this form we can consider 2 − m {\displaystyle 2^{-m}} as the normalisation factor and Sturges's rule is saying that the sample should result in a histogram with bin counts given by the binomial coefficients. Since the total sample size is fixed to n {\displaystyle n} we must have

n = ∑ y ( m y ) = 2 m {\displaystyle n=\sum _{y}{\binom {m}{y}}=2^{m}}

using the well-known formula for sums of the binomial coefficients. Solving this by taking logs of both sides gives m = log 2 ⁡ ( n ) {\displaystyle m=\log _{2}(n)} and finally using k = m + 1 {\displaystyle k=m+1} (due to counting the 0 outcomes) gives Sturges's rule. In general Sturges's rule does not give an integer answer so the result is rounded up.

Doane's formula Doane proposed modifying Sturges's formula to add extra bins when the data are skewed. Using the method of moments estimator

g 1 = m 3 m 2 3 / 2 = 1 n ∑ i = 1 n ( x i − x ¯ ) 3 [ 1 n ∑ i = 1 n ( x i − x ¯ ) 2 ] 3 / 2 , {\displaystyle g_{1}={\frac {m_{3}}{m_{2}^{3/2}}}={\frac {{\tfrac {1}{n}}\sum _{i=1}^{n}(x_{i}-{\overline {x}})^{3}}{\left[{\tfrac {1}{n}}\sum _{i=1}^{n}(x_{i}-{\overline {x}})^{2}\right]^{3/2}}},}

along with its variance

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Sturges's rule

Start with the simplest possible case. Write down what Sturges's rule claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Sturges's rule before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Sturges's rule ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Sturges's rule

In research
Sturges's rule appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Sturges's rule in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Sturges's rule is common in secondary-school and first-year university syllabi. It links to neighbouring topics Infographics, Rules of thumb, Statistical charts and diagrams, so understanding it makes those chapters shorter.
In everyday life
Look for Sturges's rule outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Sturges's rule” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Sturges's rule in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Sturges's rule means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Sturges's rule out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Sturges's rule in simple terms?

Sturges's rule is a method to choose the number of bins for a histogram. Given n {\displaystyle n} observations, Sturges's rule suggests using k ^ = 1 + log 2 ⁡ ( n ) {\displaystyle {\hat {k}}=1+\log _{2}(n)} bins in the histogram.

Why does Sturges's rule matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Sturges's rule?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Sturges's rule.

Tags

  • Infographics
  • Rules of thumb
  • Statistical charts and diagrams

Keep exploring