Stern-Brocot Depth Statistics in Rational Numbers

Stern-Brocot Depth Statistics in Rational Numbers

ISEF Category: Mathematics

Ready to Turn This Idea Into a Real Project?

This guide was put together with the help of AI research tools to give you a solid starting point. But a competitive science fair project lives in the details: refining your research question, fine-tuning your variables, analyzing your data, and presenting your findings like a seasoned scientist.

For next steps tailored to your interests, skill level, and timeline, work one-on-one with a MehtA+ mentor. Learn more about MehtA+ Science & Engineering Research Mentorship →

Subcategory: Number Theory  ·  Difficulty: Advanced  ·  Setup: University Lab  ·  Time: Full Year

The Hook

Some fraction lists hide a surprising pattern. If you sort rationals by the Stern-Brocot tree, the depth of each fraction acts like a hidden score. That score starts to obey a bell-curve-style law when you look at enough numbers. You can study that pattern with real data, then test how fast its spread grows.

What Is It?

The Stern-Brocot tree is a way to list every positive rational number exactly once. You start with 0/1 and 1/0, then keep taking mediants, which are fractions made by adding the top numbers and the bottom numbers. The depth of a rational means how many steps it takes to reach that fraction in the tree.

Think of it like a family tree for fractions. Some rationals sit close to the top, while others hide much deeper down. This project asks how those depths are distributed when you look at all fractions p/q with q ≤ N. You are not just counting fractions. You are looking for a pattern in how the depth spreads out, then checking whether that spread follows a central-limit-theorem-style shape, which means the values cluster around a mean with a predictable variance.

Why This Is a Good Topic

This topic works well for a science fair because it has a clear question, real data you can generate, and a strong math story behind it. You can compute depths for many rational numbers, graph the distribution, and compare the results to a normal-curve style model. The project connects to number theory, discrete structures, and probability, so you can learn how deep math ideas create measurable patterns. A strong student can also explore how fast the variance grows and whether the data fits a more precise theoretical prediction.

Research Questions

  • How does the mean Stern-Brocot depth change as the maximum denominator N increases? ?
  • What is the effect of restricting to reduced fractions only on the depth distribution? ?
  • Does the variance of Stern-Brocot depth grow like a logarithmic function of N? ?
  • To what extent does the standardized depth distribution resemble a normal distribution for large N? ?
  • Which denominator ranges produce the largest deviations from the predicted depth curve? ?
  • How does the depth distribution differ between fractions near 1/2, 1/3, and 2/3? ?

Basic Materials

  • Laptop or desktop computer with enough memory to store fraction lists.
  • Spreadsheet software or a coding environment such as Python.
  • Basic number theory reference for reduced fractions and the Stern-Brocot tree.
  • Notebook for tracking conjectures, plots, and definitions.
  • Access to a calculator or computer algebra system for checking small cases.
  • Internet access for reading papers and downloading open math references.

Advanced Materials

  • Laptop or desktop computer with Python, SageMath, or Mathematica.
  • Symbolic math software for checking recurrences and transfer-operator formulas.
  • Access to arXiv and journal articles on continued fractions, transfer operators, and distribution statistics.
  • A database or scripted workflow for generating large sets of reduced fractions.
  • High-quality plotting software for histogram, QQ, and residual analysis.
  • Reference texts on analytic number theory and dynamical systems.

Software & Tools

  • Python: Generates rational lists, computes Stern-Brocot depth, and runs distribution tests.
  • SageMath: Helps with exact rational arithmetic, symbolic checks, and number theory experiments.
  • Jupyter Notebook: Keeps code, plots, and written observations in one place.
  • NumPy and SciPy: Support numerical summaries, histograms, and goodness-of-fit tests.
  • Matplotlib: Draws depth histograms, density plots, and variance growth graphs.

Experiment Steps

  1. Define the exact version of Stern-Brocot depth you will measure, then write down a formula that a computer can apply consistently.
  2. Decide how you will enumerate rationals with q ≤ N, and make sure you count each reduced fraction once.
  3. Build a script that computes depth values for many N values, then stores summary statistics for each batch.
  4. Choose the distribution tests that match your question, such as histograms, z-scores, and normality checks.
  5. Compare the observed variance growth against candidate models, then test whether the data favors a logarithmic or different asymptotic trend.
  6. Plan a control analysis that checks whether your results change when you alter the fraction range or sampling rule.

Common Pitfalls

  • Using nonreduced fractions, which inflates counts and distorts the depth distribution.
  • Mixing different definitions of depth, which makes results from separate runs impossible to compare.
  • Stopping at small N, which can hide the central-limit-theorem-style behavior and make the variance look noisy.
  • Forgetting to standardize the data before testing normality, which makes the histogram hard to interpret.
  • Trusting a single plot without checking convergence across several denominator cutoffs, which can turn a weak pattern into a fake trend.

What Makes This Competitive

A stronger project goes beyond making a histogram. You would compare several denominator ranges, test multiple distribution metrics, and explain why one asymptotic model fits better than another. You could also separate rationals by location in the unit interval or by continued-fraction structure to see whether the depth law changes in a meaningful way. Clear definitions, careful computation, and honest error checks matter a lot here.

Project Variations

  • Study only fractions in a narrow interval, such as near 1/2, and compare their depth statistics to the full set.
  • Replace the Stern-Brocot depth with continued-fraction length and test whether the same variance pattern appears.
  • Analyze how depth changes under different sampling rules, such as by denominator shells or Farey intervals.

Learn More

  • MIT OpenCourseWare: Search the open course materials for number theory, dynamical systems, and probability courses that explain the math tools behind this project.
  • arXiv: Search for papers on Stern-Brocot trees, transfer operators, and rational distribution statistics.
  • PubMed: Not relevant for this topic, but useful only if you pivot to a math and medicine project later.
  • An Introduction to the Theory of Numbers by Hardy and Wright: A classic reference for rational numbers and number theory, available in many libraries.
  • Analytic Number Theory by Apostol: A standard textbook for asymptotic methods, often found through school or public libraries.
  • SageMath documentation: Free documentation for exact rational arithmetic and symbolic experiments, found on the SageMath site.

For next steps tailored to your interests, skill level, and timeline, work one-on-one with a MehtA+ mentor. Learn more about MehtA+ Science & Engineering Research Mentorship →

To discover more projects, visit the MehtA+ Science Fair Project Discovery Hub​ →

Shopping Cart