The lonely runner conjecture
Find integer speeds for which no moment leaves every runner at least 1/(n+1) from the start, or prove the conjecture, now proved for n ≤ 14.

Update the checks and the files they read from shoal-catalog cfb093e61504
Browse files+1 −0 cover.svg added View file
| @@ -0,0 +1 @@ | ||
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 304" role="img"><title>speeds 1,3,4,9 · all ≥ 1/5 lap from the still one</title><style>svg{--ink:#1f1f1f;--ink2:#3c4043;--faint:#9aa0a6;--line:#dadce0;--sand:#b8862c;--bg:#ffffff;--muted:#5f6368;--f:#4f6bed}@media (prefers-color-scheme: dark){svg{--ink:#e8eaed;--ink2:#c4c7c5;--faint:#6f7479;--line:#3c4043;--sand:#d9b26a;--bg:#1f2023;--muted:#9aa0a6;--f:#93a6ff}}.ink{fill:var(--ink)}.ink-s{stroke:var(--ink);fill:none}.ink2-s{stroke:var(--ink2);fill:none}.f{fill:var(--f)}.f-s{stroke:var(--f);fill:none}.f-soft{fill:var(--f);fill-opacity:.14}.sand{fill:var(--sand)}.sand-s{stroke:var(--sand);fill:none}.faint{fill:var(--faint)}.faint-s{stroke:var(--faint);fill:none}.ring{stroke:var(--bg);stroke-width:3}.bg{fill:var(--bg)}.soft{fill-opacity:.16}.lbl{fill:var(--muted);font:400 19px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}line,path,polyline{stroke-linecap:round;stroke-linejoin:round}</style><circle class="faint-s" cx="320" cy="136" r="108" stroke-width="2"/><polyline class="f-s" points="217.3,102.6 219.6,96.2 222.3,90 225.4,84 228.8,78.1 232.6,72.5 236.8,67.2 241.3,62.1 246.1,57.3 251.2,52.8 256.5,48.6 262.1,44.8 268,41.4 274,38.3 280.2,35.6 286.6,33.3 293.1,31.4 299.8,29.9 306.5,28.9 313.2,28.2 320,28 326.8,28.2 333.5,28.9 340.2,29.9 346.9,31.4 353.4,33.3 359.8,35.6 366,38.3 372,41.4 377.9,44.8 383.5,48.6 388.8,52.8 393.9,57.3 398.7,62.1 403.2,67.2 407.4,72.5 411.2,78.1 414.6,84 417.7,90 420.4,96.2 422.7,102.6" stroke-width="7"/><polyline class="faint-s" points="385.3,222 385,222.2 384.8,222.4 384.5,222.6 384.2,222.8 383.9,223 383.7,223.2 383.4,223.4 383.1,223.6 382.8,223.8 382.6,224 382.3,224.2 382,224.4 381.7,224.6 381.5,224.8 381.2,225 380.9,225.2 380.6,225.4 380.3,225.6 380,225.8 379.8,226 379.5,226.1 379.2,226.3 378.9,226.5 378.6,226.7 378.3,226.9 378.1,227.1 377.8,227.2 377.5,227.4 377.2,227.6 376.9,227.8 376.6,228 376.3,228.1 376,228.3 375.8,228.5 375.5,228.7 375.2,228.8 374.9,229 374.6,229.2 374.3,229.4 374,229.5" stroke-width="6"/><polyline class="faint-s" points="420.4,96.2 420.8,97.2 421.1,98.1 421.5,99.1 421.8,100.1 422.2,101 422.5,102 422.8,102.9 423.1,103.9 423.4,104.9 423.7,105.9 424,106.8 424.3,107.8 424.5,108.8 424.8,109.8 425,110.8 425.2,111.8 425.5,112.8 425.7,113.8 425.9,114.8 426.1,115.8 426.3,116.8 426.4,117.8 426.6,118.8 426.8,119.8 426.9,120.8 427.1,121.8 427.2,122.8 427.3,123.8 427.4,124.8 427.5,125.8 427.6,126.9 427.7,127.9 427.8,128.9 427.8,129.9 427.9,130.9 427.9,131.9 428,132.9 428,134 428,135 428,136" stroke-width="6"/><polyline class="faint-s" points="264.1,228.4 262.9,227.7 261.7,226.9 260.6,226.2 259.5,225.5 258.4,224.7 257.3,223.9 256.2,223.1 255.1,222.3 254,221.5 252.9,220.6 251.9,219.8 250.8,218.9 249.8,218.1 248.7,217.2 247.7,216.3 246.7,215.3 245.7,214.4 244.8,213.5 243.8,212.5 242.8,211.6 241.9,210.6 241,209.6 240,208.6 239.1,207.6 238.2,206.6 237.4,205.5 236.5,204.5 235.6,203.4 234.8,202.4 234,201.3 233.2,200.2 232.4,199.1 231.6,198 230.8,196.9 230,195.8 229.3,194.6 228.6,193.5 227.9,192.3 227.2,191.2 226.5,190" stroke-width="6"/><polyline class="faint-s" points="274,233.7 271.3,232.4 268.6,231 265.9,229.5 263.3,227.9 260.7,226.3 258.2,224.6 255.7,222.8 253.3,220.9 250.9,219 248.6,217 246.3,215 244.1,212.8 242,210.7 239.9,208.4 237.9,206.1 235.9,203.8 234,201.4 232.2,198.9 230.5,196.4 228.8,193.9 227.2,191.3 225.7,188.6 224.2,185.9 222.9,183.2 221.6,180.4 220.4,177.6 219.2,174.8 218.2,171.9 217.2,169.1 216.3,166.1 215.5,163.2 214.8,160.2 214.1,157.2 213.6,154.2 213.1,151.2 212.7,148.2 212.4,145.1 212.2,142.1 212,139.1 212,136" stroke-width="6"/><circle class="ink ring" cx="374" cy="229.5" r="9"/><circle class="ink ring" cx="428" cy="136" r="9"/><circle class="ink ring" cx="226.5" cy="190" r="9"/><circle class="ink ring" cx="212" cy="136" r="9"/><circle class="f ring" cx="320" cy="28" r="10"/><text class="lbl" x="320" y="288" text-anchor="middle">speeds 1,3,4,9 · all ≥ 1/5 lap from the still one</text></svg> | |
+24 −0 figure.py added View file
| @@ -0,0 +1,24 @@ | ||
| 1 | +"""A lonely moment, checked exactly: four runners with speeds 1, 3, 4, 9 laps per unit time leave 0 together, where a | |
| 2 | +fifth runner stands still. At t = 5/12 every moving runner is at least 1/5 = 1/(n+1) of a lap from 0, so the stretch the | |
| 3 | +conjecture promises to empty is empty (the field's colour). Faint trails show the last 0.02 time units of each run, so | |
| 4 | +their lengths are the speeds.""" | |
| 5 | +import math | |
| 6 | +from fractions import Fraction | |
| 7 | +from pathlib import Path | |
| 8 | + | |
| 9 | +import kit | |
| 10 | + | |
| 11 | +V, t = (1, 3, 4, 9), Fraction(5, 12) | |
| 12 | +n = len(V) | |
| 13 | +gap = lambda t: min(abs(t * v - round(t * v)) for v in V) # distance of the nearest runner to 0, in laps | |
| 14 | +assert gap(t) >= Fraction(1, n + 1), gap(t) # 1/4 here | |
| 15 | + | |
| 16 | +cx, cy, r = kit.W / 2, 136, 108 | |
| 17 | +P = lambda u: (cx + r * math.sin(2 * math.pi * u), cy - r * math.cos(2 * math.pi * u)) # 0 at the top, clockwise | |
| 18 | +arc = lambda a, b: [P(a + (b - a) * i / 40) for i in range(41)] | |
| 19 | +body = kit.circle(cx, cy, r, 'faint-s', ' stroke-width="2"') | |
| 20 | +body += kit.polyline(arc(-1 / (n + 1), 1 / (n + 1)), 'f-s', 7) # within 1/(n+1) of 0: empty at this moment | |
| 21 | +body += ''.join(kit.polyline(arc(float(t * v) - 0.02 * v, float(t * v)), 'faint-s', 6) for v in V) | |
| 22 | +body += ''.join(kit.dot(*P(float(t * v)), 9) for v in V) | |
| 23 | +body += kit.dot(*P(0), 10, 'f') | |
| 24 | +kit.write(__file__, 'mathematics', body, label=f'speeds 1,3,4,9 · all ≥ 1/{n + 1} lap from the still one') | |
+124 −0 kit.py added View file
| @@ -0,0 +1,124 @@ | ||
| 1 | +"""The drawing kit for problem cards: one canvas, one palette, light and dark built in. | |
| 2 | + | |
| 3 | +It lives here only: tools/cards/kit.py in the catalog, which each problem folder links as kit.py. The Shoal site | |
| 4 | +serves no copy of it: a card's cover is the problem's poster (tools/cards/posters.py), and what this kit draws is kept | |
| 5 | +for the problem's own page. | |
| 6 | + | |
| 7 | +A figure.py at a problem's root, with this file beside it, imports it, draws the problem's object and writes cover.svg | |
| 8 | +next to itself (docs/cards.md says what a figure must be): | |
| 9 | + | |
| 10 | + import kit | |
| 11 | + body = kit.circle(320, 152, 40, 'f') | |
| 12 | + kit.write(__file__, 'mathematics', body, label='what is drawn') | |
| 13 | + | |
| 14 | +Classes (each colour means one thing on a figure; pick the meaning, then the class): | |
| 15 | + ink, ink-s the object itself (fill / stroke) | |
| 16 | + ink2-s secondary structure (edges, outlines) | |
| 17 | + f, f-s, f-soft the field's colour: the part the question is about (fill / stroke / pale fill) | |
| 18 | + sand, sand-s the one accent: a second colour class, an open or contested part | |
| 19 | + faint, faint-s context: grids, axes, ghosts | |
| 20 | + ring a halo in the page's colour, so dots read on top of lines | |
| 21 | + bg a fill in the page's colour, to hide what lies behind (front faces, occluding balls) | |
| 22 | + soft a pale fill of any class's colour: add it next to f, sand or ink (class="sand soft") | |
| 23 | + lbl the one label line | |
| 24 | +""" | |
| 25 | +import math | |
| 26 | +from pathlib import Path | |
| 27 | + | |
| 28 | +W, H = 640, 304 # shown at 320 x 152 on a card, larger on a featured card | |
| 29 | + | |
| 30 | +# the site's field colours (public/app.css, --f-*), light and dark | |
| 31 | +FIELD = { | |
| 32 | + 'mathematics': ('#4f6bed', '#93a6ff'), 'computer-science': ('#9b59d0', '#c9a2f3'), | |
| 33 | + 'physics-astronomy': ('#129d96', '#5fd0c8'), 'chemistry-materials': ('#d08a17', '#f2c063'), | |
| 34 | + 'life-health': ('#5a9e2c', '#a3d47a'), 'earth-environment': ('#2a8ccf', '#7cc4f2'), | |
| 35 | + 'engineering-energy': ('#d4533f', '#f29484'), 'social-economics': ('#c2448f', '#f09ac8'), | |
| 36 | +} | |
| 37 | +LIGHT = dict(ink='#1f1f1f', ink2='#3c4043', faint='#9aa0a6', line='#dadce0', sand='#b8862c', bg='#ffffff', muted='#5f6368') | |
| 38 | +DARK = dict(ink='#e8eaed', ink2='#c4c7c5', faint='#6f7479', line='#3c4043', sand='#d9b26a', bg='#1f2023', muted='#9aa0a6') | |
| 39 | + | |
| 40 | + | |
| 41 | +def _vars(c, f): | |
| 42 | + return (f'--ink:{c["ink"]};--ink2:{c["ink2"]};--faint:{c["faint"]};--line:{c["line"]};--sand:{c["sand"]};' | |
| 43 | + f'--bg:{c["bg"]};--muted:{c["muted"]};--f:{f}') | |
| 44 | + | |
| 45 | + | |
| 46 | +def style(field): | |
| 47 | + light, dark = FIELD[field] | |
| 48 | + return (f'<style>svg{{{_vars(LIGHT, light)}}}@media (prefers-color-scheme: dark){{svg{{{_vars(DARK, dark)}}}}}' | |
| 49 | + '.ink{fill:var(--ink)}.ink-s{stroke:var(--ink);fill:none}.ink2-s{stroke:var(--ink2);fill:none}' | |
| 50 | + '.f{fill:var(--f)}.f-s{stroke:var(--f);fill:none}.f-soft{fill:var(--f);fill-opacity:.14}' | |
| 51 | + '.sand{fill:var(--sand)}.sand-s{stroke:var(--sand);fill:none}.faint{fill:var(--faint)}.faint-s{stroke:var(--faint);fill:none}' | |
| 52 | + '.ring{stroke:var(--bg);stroke-width:3}.bg{fill:var(--bg)}.soft{fill-opacity:.16}' | |
| 53 | + '.lbl{fill:var(--muted);font:400 19px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}' | |
| 54 | + 'line,path,polyline{stroke-linecap:round;stroke-linejoin:round}</style>') | |
| 55 | + | |
| 56 | + | |
| 57 | +def f1(n): | |
| 58 | + return f'{round(n, 1):g}' | |
| 59 | + | |
| 60 | + | |
| 61 | +def circle(x, y, r, cls, extra=''): | |
| 62 | + return f'<circle class="{cls}" cx="{f1(x)}" cy="{f1(y)}" r="{f1(r)}"{extra}/>' | |
| 63 | + | |
| 64 | + | |
| 65 | +def dot(x, y, r=6, cls='ink'): | |
| 66 | + """A point that stays readable on top of lines: filled, with a halo in the page's colour.""" | |
| 67 | + return circle(x, y, r, f'{cls} ring') | |
| 68 | + | |
| 69 | + | |
| 70 | +def line(x1, y1, x2, y2, cls='ink2-s', w=2, extra=''): | |
| 71 | + return f'<line class="{cls}" x1="{f1(x1)}" y1="{f1(y1)}" x2="{f1(x2)}" y2="{f1(y2)}" stroke-width="{w}"{extra}/>' | |
| 72 | + | |
| 73 | + | |
| 74 | +def path(d, cls='ink2-s', w=2, extra=''): | |
| 75 | + return f'<path class="{cls}" d="{d}" stroke-width="{w}"{extra}/>' | |
| 76 | + | |
| 77 | + | |
| 78 | +def polygon(pts, cls='f-soft', extra=''): | |
| 79 | + return f'<polygon class="{cls}" points="{" ".join(f"{f1(x)},{f1(y)}" for x, y in pts)}"{extra}/>' | |
| 80 | + | |
| 81 | + | |
| 82 | +def polyline(pts, cls='ink2-s', w=2, extra=''): | |
| 83 | + return f'<polyline class="{cls}" points="{" ".join(f"{f1(x)},{f1(y)}" for x, y in pts)}" stroke-width="{w}"{extra}/>' | |
| 84 | + | |
| 85 | + | |
| 86 | +DASH = ' stroke-dasharray="7 6"' # pass as `extra` for a dashed stroke | |
| 87 | + | |
| 88 | + | |
| 89 | +def polypath(pts, cls='ink2-s', w=2, closed=False, extra=''): | |
| 90 | + """Many points as one relative path: the same line as polyline, a fraction of the bytes.""" | |
| 91 | + (x0, y0), d, px, py = pts[0], [], pts[0][0], pts[0][1] | |
| 92 | + for x, y in pts[1:]: | |
| 93 | + d.append(f'{f1(x - px)} {f1(y - py)}'); px, py = x, y | |
| 94 | + return path(f'M{f1(x0)} {f1(y0)}l' + ' '.join(d) + ('z' if closed else ''), cls, w, extra) | |
| 95 | + | |
| 96 | + | |
| 97 | +def arrow(x1, y1, x2, y2, cls='ink2-s', w=2, head=10): | |
| 98 | + """A line ending in an open arrowhead at (x2, y2).""" | |
| 99 | + a = math.atan2(y2 - y1, x2 - x1) | |
| 100 | + tips = [(x2 - head * math.cos(a - s), y2 - head * math.sin(a - s)) for s in (0.45, -0.45)] | |
| 101 | + return line(x1, y1, x2, y2, cls, w) + polyline([tips[0], (x2, y2), tips[1]], cls, w) | |
| 102 | + | |
| 103 | + | |
| 104 | +def text(x, y, s, cls='lbl', anchor='middle'): | |
| 105 | + s = s.replace('&', '&').replace('<', '<').replace('>', '>') | |
| 106 | + return f'<text class="{cls}" x="{f1(x)}" y="{f1(y)}" text-anchor="{anchor}">{s}</text>' | |
| 107 | + | |
| 108 | + | |
| 109 | +def svg(field, body, label=None, title=''): | |
| 110 | + """The whole figure. `label` is the one line naming what is drawn, at the bottom; leave room for it (y < 262).""" | |
| 111 | + if field not in FIELD: | |
| 112 | + raise ValueError(f'unknown field {field!r}') | |
| 113 | + if label and len(label) > 50: | |
| 114 | + raise ValueError(f'label over 50 characters (more does not fit at card size): {label!r}') | |
| 115 | + t = f'<title>{title or label or ""}</title>' | |
| 116 | + tail = text(W / 2, H - 16, label) if label else '' | |
| 117 | + return f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {W} {H}" role="img">{t}{style(field)}{body}{tail}</svg>\n' | |
| 118 | + | |
| 119 | + | |
| 120 | +def write(figure_py, field, body, label=None, title=''): | |
| 121 | + """Writes cover.svg next to the figure.py that calls it.""" | |
| 122 | + out = Path(figure_py).resolve().parent / 'cover.svg' | |
| 123 | + out.write_text(svg(field, body, label, title)) | |
| 124 | + return out | |
+0 −0 poster.webp added View file
+6 −0 posters.json added View file
| @@ -0,0 +1,6 @@ | ||
| 1 | +{ | |
| 2 | + "poster.webp": { | |
| 3 | + "style": "poster", | |
| 4 | + "idea": "A brass runner stands alone at the center of a cobalt circular track while differently colored runners orbit at unequal distances." | |
| 5 | + } | |
| 6 | +} | |