--- license: apache-2.0 tags: - mathematics - pi - hexadecimal - synthetic-data - pseudorandomness - sequence-modeling - transformers task_categories: - text-generation - tabular-to-text size_categories: - 1M **Core Hypothesis:** > Can an ML model or LLM detect patterns in an arbitrary sequence of hexadecimal numerals of Ο€ and predict the subsequent digits? > Modern mathematics defines Ο€ as an irrational constant (~3.14159…), and its exact value cannot be expressed as a simple fraction like 22/7. The 22/7 approximation is a practical fraction used in some contexts, but it is less accurate than 355/113. Because Ο€ is conjectured to be a normal number in Base 16, its fractional expansion exhibits statistical properties virtually indistinguishable from an ideal pseudorandom sequence. Evaluating models on this data serves several key machine learning and data science purposes: 1. **Synthetic Sequence Probing:** Testing the inductive biases and context-window dynamics of Transformers on truly non-periodic streams. 2. **Memorization vs. Generalization:** Evaluating whether models are merely memorizing known chunks of Ο€ or attempting to synthesize algorithmic computation. 3. **Entropy & Compressibility:** Verifying that substring repetition frequencies conform to expected random walk and birthday-problem bounds rather than compressible tokens. --- ## πŸš€ Key Features of `Pi_Hex_DataScience_V1.0.py` The repository includes a self-contained, high-performance Python engine designed to generate and audit Base 16 digits of Ο€: - **Fast Chudnovsky Binary-Splitting Engine:** Pure Python arbitrary-precision integer arithmetic optimized for standard CPUs (zero external dependencies like `gmpy2` required). - **Exhaustive Substring Collision Engine:** Scans for exact sequence repetitions across configurable length horizons ($L \in [4, 64]$). - **Exponential Horizon Doubling:** Automatically doubles the search horizon $N$ when no collisions are detected for target sequence lengths. - **Detailed Telemetry:** Tracks incident coordinates ($i_1, i_2$), distances ($\Delta$), and generates `0–F` digit distribution histograms for repeating sequences. - **Safety & Persistence:** Checkpoints progress every 30 minutes, supports auto-download within Google Colab, and enforces an optional hard runtime ceiling (default: 3 hours). --- ## πŸ“ Repository Structure ```plaintext β”œβ”€β”€ Pi_Hex_DataScience_V1.0.py # Core generation & collision engine β”œβ”€β”€ pi_datascience_checkpoint.json # Saved state & intermediate analysis β”œβ”€β”€ pi_repetition_report.txt # Plaintext summary table β”œβ”€β”€ pi_repetition_report.md # Markdown report with collision coordinates β”œβ”€β”€ pi_repetition_report.html # Interactive HTML report with mini histograms └── README.md # Dataset card & documentation ``` --- ## πŸ› οΈ Usage Quickstart ### 1. Requirements The script uses standard library modules only: ```bash python --version # Python 3.8+ recommended ``` ### 2. Run the Analysis ```bash python Pi_Hex_DataScience_V1.0.py ``` ### 3. Google Colab Support The script includes built-in detection for Google Colab environments (`sys.modules["google.colab"]`). When run in Colab, intermediate checkpoints and reports (`.json`, `.txt`, `.md`, `.html`) are automatically downloaded to your local machine every 30 minutes. --- ## βš™οΈ Configuration Parameters The generation horizon and substring lengths can be modified directly inside `CONFIG`: ```python CONFIG = { "min_length": 4, # Smallest substring length to inspect "max_length": 64, # Longest substring length to inspect "initial_n": 2000, # Initial digit search horizon (N) "max_n_limit": 2000000, # Safety limit (2 million hex digits) "checkpoint_interval_sec": 1800, # 30-minute state checkpointing "max_runtime_sec": 10800, # 3-hour runtime budget ceiling "checkpoint_file": "pi_datascience_checkpoint.json", "report_txt": "pi_repetition_report.txt", "report_md": "pi_repetition_report.md", "report_html": "pi_repetition_report.html", } ``` --- ## πŸ“Š Sample Report Output When executed, the engine outputs structured reports summarizing whether sequences of length $L$ have repeated within the search window: | Length ($L$) | Repeat Detected? | Unique Repeats | First Repeated Sequence | First Index ($i_1$) | Repeat Index ($i_2$) | Distance ($\Delta$) | | :---: | :---: | :---: | :--- | :---: | :---: | :---: | | **4** | **YES** | 12 | `2B4C` | 148 | 892 | 744 | | **5** | **YES** | 1 | `A0E18` | 420 | 1850 | 1430 | | **6** | **NO** | 0 | β€” | β€” | β€” | β€” | *(If repeats are absent, the engine automatically doubles the search window $N \to 2N$ and re-evaluates until collision thresholds are met or limits are reached).* --- ## πŸ”¬ Use Cases in Machine Learning - **Next-Token Prediction Baselines:** Use hex sequences of Ο€ as a negative control benchmark against autoregressive sequence models. - **Tokenizer Stress Testing:** Evaluate how Byte-Pair Encoding (BPE) and subword tokenizers partition high-entropy, non-repeating alphanumeric series. - **Synthetic Pretraining Experiments:** Measure whether exposure to algorithmic number-theoretic streams affects transformer attention entropy. --- ## πŸ“œ License This Pi-Hex dataset is distributed under the [Apache 2.0 License](LICENSE).