The Erdős minimum overlap problem
Pin down the constant c ≈ 0.38 such that every split of {1,…,2N} into equal halves has a difference occurring cN times.

Reproduce Haugland 2016 minimum-overlap bound
Browse files+23 −7 routes/zhihuxunyouren/haugland-2016/README.md View file
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | --- |
| 2 | 2 | issue: 3 |
| 3 | -status: working | |
| 3 | +status: done | |
| 4 | 4 | --- |
| 5 | 5 | # Haugland (2016) 0.380926… step function |
| 6 | 6 | |
| @@ -10,8 +10,9 @@ that gives the published upper bound 0.3809268534330870. | ||
| 10 | 10 | |
| 11 | 11 | The paper states the function on `[0,2]` by giving `[0,1]` and `f(x)=f(2-x)`. |
| 12 | 12 | `make_haugland.py` writes the symmetric `102`-cell construction expected here: |
| 13 | -the `51` paper cells, then their mirror. Heights are copied from the paper's | |
| 14 | -displayed decimals; the exact binary64 values are what the JSON carries. | |
| 13 | +the `51` paper cells, then their mirror. Heights are read as exact decimal | |
| 14 | +fractions; the JSON carries exact `p/q` values, so the sum is exactly `51` | |
| 15 | +and no floating-point rescaling is involved. | |
| 15 | 16 | |
| 16 | 17 | ## Command |
| 17 | 18 | |
| @@ -19,13 +20,28 @@ From the repository root: | ||
| 19 | 20 | |
| 20 | 21 | ```sh |
| 21 | 22 | python3 routes/zhihuxunyouren/haugland-2016/make_haugland.py |
| 23 | +python3 tools/check_format.py routes/zhihuxunyouren/haugland-2016 | |
| 22 | 24 | python3 checks/judge/check.py routes/zhihuxunyouren/haugland-2016 |
| 23 | 25 | ``` |
| 24 | 26 | |
| 25 | -`python3 tools/check_format.py routes/zhihuxunyouren/haugland-2016` also | |
| 26 | -validates the file shape. | |
| 27 | +## Result | |
| 28 | + | |
| 29 | +The local judge prints: | |
| 30 | + | |
| 31 | +```text | |
| 32 | +haugland.json: n=102, mu <= 0.3809268534330869746401250 | |
| 33 | +best upper bound 0.3809268534330869746401250 (haugland.json) | |
| 34 | +``` | |
| 35 | + | |
| 36 | +That is below the issue's closing threshold `0.380927`. | |
| 37 | + | |
| 38 | +## What this shows | |
| 39 | + | |
| 40 | +This is a reproduction of Haugland's displayed step function, not a new bound. | |
| 41 | +The exact value is `0.3809268534330869746401250`; the paper's rounded | |
| 42 | +`0.3809268534330870` is the same number to its displayed precision. | |
| 27 | 43 | |
| 28 | 44 | ## Next |
| 29 | 45 | |
| 30 | -Run the judge and record its bound; if it is at or below 0.380927, the | |
| 31 | -reproduction is done and the job is the record. | |
| 46 | +A second reader can rerun the three commands above and compare the exact | |
| 47 | +`mu` line. The site's `verify` check on this route's commit is the record. | |
+106 −0 routes/zhihuxunyouren/haugland-2016/haugland.json added View file
| @@ -0,0 +1,106 @@ | ||
| 1 | +{ | |
| 2 | + "values": [ | |
| 3 | + "0", | |
| 4 | + "0", | |
| 5 | + "0", | |
| 6 | + "0", | |
| 7 | + "0", | |
| 8 | + "0", | |
| 9 | + "0", | |
| 10 | + "0", | |
| 11 | + "0", | |
| 12 | + "0", | |
| 13 | + "2938681556273/10000000000000000", | |
| 14 | + "2938681556273/10000000000000000", | |
| 15 | + "5952882223921177/10000000000000000", | |
| 16 | + "5952882223921177/10000000000000000", | |
| 17 | + "7844530825484313/10000000000000000", | |
| 18 | + "7844530825484313/10000000000000000", | |
| 19 | + "4475017169006921/5000000000000000", | |
| 20 | + "4475017169006921/5000000000000000", | |
| 21 | + "149491019001687/2500000000000000", | |
| 22 | + "149491019001687/2500000000000000", | |
| 23 | + "23700354808699/1250000000000000", | |
| 24 | + "23700354808699/1250000000000000", | |
| 25 | + "371025081408649/500000000000000", | |
| 26 | + "371025081408649/500000000000000", | |
| 27 | + "6444559588500921/10000000000000000", | |
| 28 | + "6444559588500921/10000000000000000", | |
| 29 | + "887260204461191/2500000000000000", | |
| 30 | + "887260204461191/2500000000000000", | |
| 31 | + "4381221192536739/5000000000000000", | |
| 32 | + "4381221192536739/5000000000000000", | |
| 33 | + "5437907313675501/10000000000000000", | |
| 34 | + "5437907313675501/10000000000000000", | |
| 35 | + "167477503062331/625000000000000", | |
| 36 | + "167477503062331/625000000000000", | |
| 37 | + "8518954615823791/10000000000000000", | |
| 38 | + "8518954615823791/10000000000000000", | |
| 39 | + "651396394614359/1250000000000000", | |
| 40 | + "651396394614359/1250000000000000", | |
| 41 | + "1", | |
| 42 | + "1", | |
| 43 | + "5506146790047043/10000000000000000", | |
| 44 | + "5506146790047043/10000000000000000", | |
| 45 | + "9007715390796991/10000000000000000", | |
| 46 | + "9007715390796991/10000000000000000", | |
| 47 | + "4114500345970543/5000000000000000", | |
| 48 | + "4114500345970543/5000000000000000", | |
| 49 | + "8879541710440111/10000000000000000", | |
| 50 | + "8879541710440111/10000000000000000", | |
| 51 | + "9315424878319221/10000000000000000", | |
| 52 | + "9315424878319221/10000000000000000", | |
| 53 | + "1", | |
| 54 | + "1", | |
| 55 | + "9315424878319221/10000000000000000", | |
| 56 | + "9315424878319221/10000000000000000", | |
| 57 | + "8879541710440111/10000000000000000", | |
| 58 | + "8879541710440111/10000000000000000", | |
| 59 | + "4114500345970543/5000000000000000", | |
| 60 | + "4114500345970543/5000000000000000", | |
| 61 | + "9007715390796991/10000000000000000", | |
| 62 | + "9007715390796991/10000000000000000", | |
| 63 | + "5506146790047043/10000000000000000", | |
| 64 | + "5506146790047043/10000000000000000", | |
| 65 | + "1", | |
| 66 | + "1", | |
| 67 | + "651396394614359/1250000000000000", | |
| 68 | + "651396394614359/1250000000000000", | |
| 69 | + "8518954615823791/10000000000000000", | |
| 70 | + "8518954615823791/10000000000000000", | |
| 71 | + "167477503062331/625000000000000", | |
| 72 | + "167477503062331/625000000000000", | |
| 73 | + "5437907313675501/10000000000000000", | |
| 74 | + "5437907313675501/10000000000000000", | |
| 75 | + "4381221192536739/5000000000000000", | |
| 76 | + "4381221192536739/5000000000000000", | |
| 77 | + "887260204461191/2500000000000000", | |
| 78 | + "887260204461191/2500000000000000", | |
| 79 | + "6444559588500921/10000000000000000", | |
| 80 | + "6444559588500921/10000000000000000", | |
| 81 | + "371025081408649/500000000000000", | |
| 82 | + "371025081408649/500000000000000", | |
| 83 | + "23700354808699/1250000000000000", | |
| 84 | + "23700354808699/1250000000000000", | |
| 85 | + "149491019001687/2500000000000000", | |
| 86 | + "149491019001687/2500000000000000", | |
| 87 | + "4475017169006921/5000000000000000", | |
| 88 | + "4475017169006921/5000000000000000", | |
| 89 | + "7844530825484313/10000000000000000", | |
| 90 | + "7844530825484313/10000000000000000", | |
| 91 | + "5952882223921177/10000000000000000", | |
| 92 | + "5952882223921177/10000000000000000", | |
| 93 | + "2938681556273/10000000000000000", | |
| 94 | + "2938681556273/10000000000000000", | |
| 95 | + "0", | |
| 96 | + "0", | |
| 97 | + "0", | |
| 98 | + "0", | |
| 99 | + "0", | |
| 100 | + "0", | |
| 101 | + "0", | |
| 102 | + "0", | |
| 103 | + "0", | |
| 104 | + "0" | |
| 105 | + ] | |
| 106 | +} | |
+68 −0 routes/zhihuxunyouren/haugland-2016/make_haugland.py added View file
| @@ -0,0 +1,68 @@ | ||
| 1 | +"""Build the 102-cell form of Haugland's displayed 2016 step function. | |
| 2 | + | |
| 3 | +Source: J. K. Haugland, "The minimum overlap problem revisited", | |
| 4 | +arXiv:1609.08000, September 2016, the function said to have 51 steps and | |
| 5 | +value 0.3809268534330870. The paper gives the heights on [0,1] and extends | |
| 6 | +by f(x) = f(2-x); this route's judge wants equal cells on [-1,1], so the | |
| 7 | +51-cell half is mirrored to 102 cells. | |
| 8 | +""" | |
| 9 | + | |
| 10 | +import json | |
| 11 | +from fractions import Fraction | |
| 12 | +from pathlib import Path | |
| 13 | + | |
| 14 | +# First ten cells [0,10/51) are zero. | |
| 15 | +ZERO_CELLS = 10 | |
| 16 | + | |
| 17 | +# Each of these heights covers two of the 51 cells of [0,1]. The paper's | |
| 18 | +# displayed decimals are read as exact decimal fractions, so the sum is | |
| 19 | +# exactly 51 after mirroring; no floating-point rescaling is needed. | |
| 20 | +TWO_CELL_HEIGHTS = [ | |
| 21 | + "0.0002938681556273", | |
| 22 | + "0.5952882223921177", | |
| 23 | + "0.7844530825484313", | |
| 24 | + "0.8950034338013842", | |
| 25 | + "0.0597964076006748", | |
| 26 | + "0.0189602838469592", | |
| 27 | + "0.7420501628172980", | |
| 28 | + "0.6444559588500921", | |
| 29 | + "0.3549040817844764", | |
| 30 | + "0.8762442385073478", | |
| 31 | + "0.5437907313675501", | |
| 32 | + "0.2679640048997296", | |
| 33 | + "0.8518954615823791", | |
| 34 | + "0.5211171156914872", | |
| 35 | + "1", | |
| 36 | + "0.5506146790047043", | |
| 37 | + "0.9007715390796991", | |
| 38 | + "0.8229000691941086", | |
| 39 | + "0.8879541710440111", | |
| 40 | + "0.9315424878319221", | |
| 41 | +] | |
| 42 | + | |
| 43 | +# The last cell of [0,1], [50/51,1], is one cell high. | |
| 44 | +LAST_CELL_HEIGHT = "1" | |
| 45 | + | |
| 46 | +half = [Fraction(0)] * ZERO_CELLS | |
| 47 | +for height in TWO_CELL_HEIGHTS: | |
| 48 | + half.extend([Fraction(height), Fraction(height)]) | |
| 49 | +half.append(Fraction(LAST_CELL_HEIGHT)) | |
| 50 | + | |
| 51 | +if len(half) != 51: | |
| 52 | + raise SystemExit(f"expected 51 half-cells, got {len(half)}") | |
| 53 | + | |
| 54 | +values = half + half[::-1] | |
| 55 | +if len(values) != 102: | |
| 56 | + raise SystemExit(f"expected 102 cells, got {len(values)}") | |
| 57 | +if sum(values) != Fraction(51, 1): | |
| 58 | + raise SystemExit(f"exact sum is {sum(values)}, expected 51") | |
| 59 | + | |
| 60 | +def encode(height): | |
| 61 | + if height.denominator == 1: | |
| 62 | + return str(height.numerator) | |
| 63 | + return f"{height.numerator}/{height.denominator}" | |
| 64 | + | |
| 65 | +out = Path(__file__).with_name("haugland.json") | |
| 66 | +out.write_text(json.dumps({"values": [encode(height) for height in values]}, indent=2) + "\n") | |
| 67 | +print(f"wrote {out} with {len(values)} cells; exact sum={sum(values)}") | |
| 68 | + | |