Mathematical Foundations of Find Fractal Patterns in Text
Find Fractal Patterns in Text quantifies long-range self-similarity, memory persistence, and recursive symbolic hierarchy inside natural language prose, DNA nucleotide sequences, source code, and formal L-System strings. It combines Harold Edwin Hurst's Rescaled-Range (R/S) analysis with Shannon information entropy, Prefix-Suffix border detection, and multi-scale n-gram motif mining.
Self-similar fractals exhibit recurring geometric structure across scales, governed by Iterated Function Systems (IFS), Lindenmayer L-System rewriting rules, or recursive spatial subdivisions. Every geometry calculation, 2× HiDPI canvas pass, progressive animation frame, and lossless SVG vector export executes natively inside your browser at 60 FPS with zero server latency.
Rescaled-Range (R/S) Hurst Analysis & Prefix-Suffix Borders
Map text S[0..N-1] to numerical signal x_t = charCodeAt(t).
For window lengths w ∈ {4, 8, 12, 16, 24, 32, 48, 64}:
1. Compute window mean μ_w and standard deviation S(w)
2. Compute cumulative deviation Y_k = Σ_{t=1..k} (x_t - μ_w)
3. Compute range R(w) = max(Y_k) - min(Y_k)
4. Fit log_2(E[R(w)/S(w)]) = H · log_2(w) + c ⇒ Fractal Dimension D = 2 - H
Notice the Prefix==Suffix Self-Borders metric: self-similar L-System strings (such as the Cantor string `ABABBBABA...` of length 81) exhibit exact power-of-3 border matches at lengths 3, 9, and 27 — immediately distinguishing formal fractal grammars from random text!
Iteration Scaling & Complexity Table
| Iteration / Setting | Elements / Size | Geometric Property |
|---|---|---|
| Cantor L-System (81 chars) | Borders at 3, 9, 27 | Exact 3^k recursive prefix-suffix identity |
| DNA Repeat Sequence | H > 0.65 (Persistent) | Strong periodic codon n-gram clustering |
| Literary English Prose | H ≈ 0.58 – 0.68 | Long-range thematic & syntactic memory |
| Alternating Paper-Fold | H < 0.45 (Anti-Persistent) | Balanced R/L turn-reversal suppression |
Applications in Science, Graphics & Engineering
Quantitative Linguistics & Stylometry
Ausloos and Montemurro showed that literary texts exhibit Hurst exponents H > 0.6 due to hierarchical sentence, paragraph, and chapter structure.
Genomic DNA Walk Analysis
Peng et al. (1992) discovered long-range fractal correlations (H > 0.6) in non-coding intron DNA sequences.
L-System & Automaton Detection
Prefix-suffix border scanning identifies recursive D0L substitutions like Cantor, Fibonacci, and Thue-Morse words immediately.
Dual Signal & Log-Log Scaling Canvas
Inspect the symbolic signal trace on the left and the log-log R/S regression slope H on the right.
Interactive Controls, Pan/Zoom & Vector Export
Paste any paragraph, poem, DNA sequence, or fractal string into the input box to measure its Hurst Exponent H, Fractal Dimension D = 2 − H, Shannon entropy, and multi-scale repeating motifs.
Export crisp 2× Retina PNG renders for presentations or scalable infinite-resolution SVG files directly into Illustrator, Figma, Inkscape, LaTeX, or laser-cutting workflows.