Skip to content

jconorgrogan/Stern-Brocot-Tree-exploration

Repository files navigation

Stern-Brocot Trees

These magical things are underappreciated in math and number theory, see https://en.wikipedia.org/wiki/Stern%E2%80%93Brocot_tree

Couldnt find any code that generated them so I did it myself. The tree is zoomable; double click to zoom out.

image

I also try a number of different/ unique approaches to evaluating stern brocot trees. image

Some interesting observations about Stern Brocot trees:

  1. Stern-Brocot trees allow you to visualize numbers that do not relate to Khinchin's constant; see https://en.wikipedia.org/wiki/Khinchin%27s_constant#:~:text=In%20number%20theory%2C%20Aleksandr%20Yakovlevich,is%20known%20as%20Khinchin's%20constant. Recall, among the numbers x whose continued fraction expansions are known NOT to have this property are rational numbers, roots of quadratic equations (including the golden ratio Φ and the square roots of integers), and the base of the natural logarithm e.---- in other words, all numbers that are defined by repeatable or expiring patterns in stern brocot tree transversals. Said diffrently, numbers that adhere to Khinchin's constant would "zig zag" through this tree in a path that doesn't reveal predictable or repeating patterns, unlike the periodic and terminating paths of quadratic irrationals and rational numbers.

  2. You can translate the "transversal of the stern brocot tree" into visualizations, like the below graph.This is what im calling the "operation space" of e^2; essentially converts the continued fraction into Up or Down, for every other numbres in the continued fraction. e^2 does NOT fit in with Khinchin's constant (I didn't even look it up if this is true, but am able to have confidence in this visually).Here, knowledge of one slice could perfectly predict knowledge of future slices.

Pasted Graphic 35
  1. Stern-Brocot Tree Coverage: After an infinite number of steps, the entire interval from 0 to 1 will be densely covered by the fractions generated by all the branches of the Stern-Brocot tree.

  2. Number of Slices at Step n: At the nth step in both the geometric series for 1 and a branch of the Stern-Brocot tree, there will be 2^n slices or intervals.

  3. Geometric Series and Stern-Brocot Parallel: Both the geometric series for 1 and a single branch of the Stern-Brocot tree involve doubling the number of slices or intervals at each step, resulting in 2^n slices by the nth step.

  4. Slices at Step n vs. Total Prior Slices: The number of slices at step n is nearly equal to the total number of slices from all prior steps combined. Specifically, at step n, the slices added almost match the cumulative sum of slices from all previous steps.

  5. Infinite Step Coverage: At the infinite step, the points generated by the Stern-Brocot tree densely cover the interval from 0 to 1. While these points don't cover a positive measure of the interval (in the Lebesgue sense), they effectively "fill" the space in a dense manner.

  6. First Step (Area-Focused): The first step covers a large "area" or interval (half of the interval from 0 to 1) with a minimal number of slices (just one or two significant divisions).

  7. Final Step (Slices-Focused): The final step, at infinity, adds an infinite number of slices, covering the smallest possible "area" in the traditional sense, but completing the dense coverage of the interval.

About

Coding interesting visualizations of Stern-Brocot trees

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published