# E051: Semiprimes: balanced vs. unbalanced factorization timing ```{figure} ../_static/experiments/e051_hero.png :width: 80% :alt: Preview figure for E051 ``` ```{figure} ../_static/experiments/e051_hero_2.png :width: 80% :alt: Preview figure for E051 ``` **Tags:** `number-theory`, `quantitative-exploration`, `visualization`, `factorization`, `semiprime` See: {doc}`../tags`. ## Highlights - Generates small semiprimes $n=pq$ in balanced and unbalanced regimes. - Factors them using trial division + Pollard’s rho and records timings. - Visualizes time distributions to make “balanced is harder” tangible. ## Goal Compare how factorization difficulty changes when one prime factor is much smaller than the other. ## Background (quick refresher) - {doc}`../background/semiprimes` - {doc}`../background/prime-numbers` ## Research question For semiprimes of similar overall size, how does Pollard-rho timing differ between balanced $(p\approx q)$ and unbalanced $(p\ll q)$ cases? ## Experiment design - Generate balanced semiprimes with roughly equal factor bit lengths. - Generate unbalanced semiprimes with a fixed small factor size. - Factor each using trial division pre-pass + Pollard’s rho, measuring wall-clock time. - Plot boxplots and a size-vs-time scatter. ## Reproducibility - `params.json` records the run settings. - `report.md` summarizes the key findings. - `figures/*.png` contains the plots for the run. ## Interpreting the results - Timings are noisy: random instance structure matters a lot at this size range. - The trend should still show unbalanced instances often factoring faster (small factor is easier to find). - This is an educational-scale experiment, not a cryptographic benchmark. ## Published run snapshot If this experiment is included in the docs gallery, include the published snapshot (report + params). ```{include} ../reports/e051.md :start-after: "" :end-before: "" ``` ::: {dropdown} params.json (snapshot) :open: ```{literalinclude} ../params/e051.json :language: json ``` ::: ## References See {cite:t}`RivestShamirAdleman1978RSA`, {cite:t}`OEISFoundationInc2025A001358Semiprimes`. ## Related experiments - {doc}`e004` (Computing $\sigma(n)$ at Scale — Sieve vs. Factorization) - {doc}`e002` (Even Perfect Numbers — Generator and Growth) - {doc}`e003` (Abundancy Index Landscape) - {doc}`e007` (Mersenne growth (bits and digits)) - {doc}`e008` (Lucas–Lehmer scan (prime exponents))