Heilbronn's triangle problem
Heilbronn's triangle problem in the unit square: configurations of 11 to 16 points, every one checked in exact arithmetic

Reproduction: n = 12 at 0.0325988586 from the Comellas-Yebra closed form #31
Merged
+48 −0 routes/zcode-kepler/n12-closed-form/README.md added View file
| @@ -0,0 +1,48 @@ | ||
| 1 | +--- | |
| 2 | +issue: 2 | |
| 3 | +status: done | |
| 4 | +--- | |
| 5 | + | |
| 6 | +# n = 12 复现:Comellas–Yebra (2002) 闭式 | |
| 7 | + | |
| 8 | +Issue #2 的独立复现。用 CY2002 第 7 页的闭式以 60 位十进制算出 12 个点,本地与站点 | |
| 9 | +检查都打出 `n = 12: 0.0325988586`,与最优已知值(64x³+80x²+28x−1 的最小正根)在 | |
| 10 | +检查的十位小数上完全一致。**这是复现,不是纪录**;此前 codex-bo1-2 已复现过一次 | |
| 11 | +(`codex/n12-reproduction`),mcmga 中途放弃过(`mcmga-n12-closed-form`)。 | |
| 12 | + | |
| 13 | +## 命令 | |
| 14 | + | |
| 15 | +```sh | |
| 16 | +python3 routes/zcode-kepler/n12-closed-form/solve.py > routes/zcode-kepler/n12-closed-form/n12.txt | |
| 17 | +python3 verify.py routes/zcode-kepler/n12-closed-form/ | |
| 18 | +``` | |
| 19 | + | |
| 20 | +## 闭式的来源与确认 | |
| 21 | + | |
| 22 | +论文 PDF:<https://www.combinatorics.org/ojs/index.php/eljc/article/view/v9i1r6/pdf> | |
| 23 | +(第 7 页 "Twelve points")。页面图像分辨率下分数排版难读,用 `pdftotext` 抽文本层 | |
| 24 | +后确定为: | |
| 25 | + | |
| 26 | +- `x = 1 − (A^(2/3) + 6) / (6·A^(1/3))`,其中 `A = 27 + 3√57`(注意:没有 /4); | |
| 27 | +- `y = 2x² − 3x + 1/2`; | |
| 28 | +- 论文打印的 `H12 ≥ 14x + 12xy − 12x2` 实为 **`x/4 + xy/2 − x²/2`**("14" 是被压扁 | |
| 29 | + 的 1/4,余类推)。 | |
| 30 | + | |
| 31 | +两个数值锚点确认读法无误:x = 0.1153538228…(论文打印 0.115354);x/4 + xy/2 − x²/2 | |
| 32 | += 0.032598858691…(脚本内同时用牛顿迭代求 64t³+80t²+28t−1 的最小正根并断言两者在 | |
| 33 | +1e-50 内相等)。十二个点为 (x,0), (1−x,0), (0,x), (1,x), (½,y), (y,½), (1−y,½), | |
| 34 | +(½,1−y), (0,1−x), (1,1−x), (x,1), (1−x,1)。 | |
| 35 | + | |
| 36 | +脚本用 `decimal` 60 位精度、牛顿迭代开立方,每坐标打印 45 位(议题要求 ≥30 位)。 | |
| 37 | +检查是精确算术:45 位小数下最小三角形的值离真值约 1e-45,十位截断稳定给出 | |
| 38 | +0.0325988586。 | |
| 39 | + | |
| 40 | +## 结果 | |
| 41 | + | |
| 42 | +- 本地 `verify.py`:`n = 12: 0.0325988586`(exit 0;最小三角形在第 1、5、7 行上)。 | |
| 43 | +- 站点判定:见本提交的 verify status(应在推送后数秒内给出同一行)。 | |
| 44 | + | |
| 45 | +## Next | |
| 46 | + | |
| 47 | +无。n = 12 的 KNOWN.md 行如需指向第二次独立复现,可用本路线;想更进一步需要打破 | |
| 48 | +0.0325988586 的新构造(issue #8 的方向),那需要真正的搜索而不是复现。 | |
+12 −0 routes/zcode-kepler/n12-closed-form/n12.txt added View file
| @@ -0,0 +1,12 @@ | ||
| 1 | +0.115353822880684292379795267832483253664723477 0.000000000000000000000000000000000000000000000 | |
| 2 | +0.884646177119315707620204732167516746335276523 0.000000000000000000000000000000000000000000000 | |
| 3 | +0.000000000000000000000000000000000000000000000 0.115353822880684292379795267832483253664723477 | |
| 4 | +1.000000000000000000000000000000000000000000000 0.115353822880684292379795267832483253664723477 | |
| 5 | +0.500000000000000000000000000000000000000000000 0.180551540264323688817323281079514069763207454 | |
| 6 | +0.180551540264323688817323281079514069763207454 0.500000000000000000000000000000000000000000000 | |
| 7 | +0.819448459735676311182676718920485930236792546 0.500000000000000000000000000000000000000000000 | |
| 8 | +0.500000000000000000000000000000000000000000000 0.819448459735676311182676718920485930236792546 | |
| 9 | +0.000000000000000000000000000000000000000000000 0.884646177119315707620204732167516746335276523 | |
| 10 | +1.000000000000000000000000000000000000000000000 0.884646177119315707620204732167516746335276523 | |
| 11 | +0.115353822880684292379795267832483253664723477 1.000000000000000000000000000000000000000000000 | |
| 12 | +0.884646177119315707620204732167516746335276523 1.000000000000000000000000000000000000000000000 | |
+68 −0 routes/zcode-kepler/n12-closed-form/solve.py added View file
| @@ -0,0 +1,68 @@ | ||
| 1 | +#!/usr/bin/env python3 | |
| 2 | +"""The twelve points of Comellas and Yebra (2002), page 7, from their closed form. | |
| 3 | + | |
| 4 | +x = 1 - (A**(2/3) + 6) / (6 * A**(1/3)), A = 27 + 3*sqrt(57), | |
| 5 | +y = 2*x**2 - 3*x + 1/2. | |
| 6 | + | |
| 7 | +The paper states H12 >= x/4 + x*y/2 - x**2/2 = 0.032599, the smallest positive | |
| 8 | +root of 64*t**3 + 80*t**2 + 28*t - 1 = 0 (0.0325988586... to ten decimals). | |
| 9 | + | |
| 10 | +Prints the twelve points `x y` with PRINT_DIGITS significant digits each. | |
| 11 | +""" | |
| 12 | + | |
| 13 | +import sys | |
| 14 | +from decimal import Decimal, getcontext | |
| 15 | + | |
| 16 | +getcontext().prec = 60 | |
| 17 | +PRINT_DIGITS = 45 | |
| 18 | + | |
| 19 | + | |
| 20 | +def cbrt(v): | |
| 21 | + """Cube root of a nonnegative Decimal, Newton's method.""" | |
| 22 | + if v == 0: | |
| 23 | + return Decimal(0) | |
| 24 | + guess = Decimal(repr(round(float(v) ** (1 / 3), 12))) | |
| 25 | + three = Decimal(3) | |
| 26 | + for _ in range(200): | |
| 27 | + nxt = (2 * guess + v / (guess * guess)) / three | |
| 28 | + if nxt == guess: | |
| 29 | + return guess | |
| 30 | + guess = nxt | |
| 31 | + return guess | |
| 32 | + | |
| 33 | + | |
| 34 | +def main(): | |
| 35 | + sqrt57 = Decimal(57).sqrt() | |
| 36 | + a = 27 + 3 * sqrt57 | |
| 37 | + a13 = cbrt(a) | |
| 38 | + a23 = a13 * a13 | |
| 39 | + x = 1 - (a23 + 6) / (6 * a13) | |
| 40 | + y = 2 * x * x - 3 * x + Decimal(1) / 2 | |
| 41 | + | |
| 42 | + # The paper's bound, and the cubic it should equal; assert both. | |
| 43 | + h = x / 4 + x * y / 2 - x * x / 2 | |
| 44 | + t = Decimal(1) | |
| 45 | + for _ in range(200): # Newton on 64 t^3 + 80 t^2 + 28 t - 1 | |
| 46 | + f = 64 * t**3 + 80 * t**2 + 28 * t - 1 | |
| 47 | + fp = 192 * t**2 + 160 * t + 28 | |
| 48 | + nxt = t - f / fp | |
| 49 | + if nxt == t: | |
| 50 | + break | |
| 51 | + t = nxt | |
| 52 | + assert abs(h - t) < Decimal("1e-50"), f"closed form mismatch: {h} vs {t}" | |
| 53 | + | |
| 54 | + points = [ | |
| 55 | + (x, Decimal(0)), (1 - x, Decimal(0)), (Decimal(0), x), (Decimal(1), x), | |
| 56 | + (Decimal(1) / 2, y), (y, Decimal(1) / 2), (1 - y, Decimal(1) / 2), | |
| 57 | + (Decimal(1) / 2, 1 - y), (Decimal(0), 1 - x), (Decimal(1), 1 - x), | |
| 58 | + (x, Decimal(1)), (1 - x, Decimal(1)), | |
| 59 | + ] | |
| 60 | + for px, py in points: | |
| 61 | + print(f"{px:.{PRINT_DIGITS}f} {py:.{PRINT_DIGITS}f}") | |
| 62 | + print(f"# x = {x}", file=sys.stderr) | |
| 63 | + print(f"# y = {y}", file=sys.stderr) | |
| 64 | + print(f"# x/4 + xy/2 - x^2/2 = {h}", file=sys.stderr) | |
| 65 | + | |
| 66 | + | |
| 67 | +if __name__ == "__main__": | |
| 68 | + main() | |