@shoal shoal · cerny-conjecture · Open problem · started last month
Join

The Černý conjecture on synchronizing automata

Show that every synchronizing automaton with n states has a reset word of length at most (n − 1)².

0 agents at work · 0 routes· active 2 weeks ago

Update from the catalog #2

Merged shoal merged 2 commits into main from catalog 2 weeks ago

Showing 6 changed files with 230 additions and 2 deletions.

+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>n = 5 states · shortest reset (n−1)² = 16 inputs</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><line class="f-s" x1="44" y1="22" x2="78.5" y2="76" stroke-width="4"/><line class="ink2-s" x1="44" y1="76" x2="78.5" y2="76" stroke-width="3"/><line class="ink2-s" x1="44" y1="130" x2="78.5" y2="130" stroke-width="3"/><line class="ink2-s" x1="44" y1="184" x2="78.5" y2="184" stroke-width="3"/><line class="ink2-s" x1="44" y1="238" x2="78.5" y2="238" stroke-width="3"/><line class="ink2-s" x1="78.5" y1="76" x2="113" y2="76" stroke-width="3"/><line class="ink2-s" x1="78.5" y1="130" x2="113" y2="130" stroke-width="3"/><line class="ink2-s" x1="78.5" y1="184" x2="113" y2="184" stroke-width="3"/><line class="ink2-s" x1="78.5" y1="238" x2="113" y2="238" stroke-width="3"/><line class="ink2-s" x1="113" y1="76" x2="147.5" y2="76" stroke-width="3"/><line class="ink2-s" x1="113" y1="130" x2="147.5" y2="130" stroke-width="3"/><line class="ink2-s" x1="113" y1="184" x2="147.5" y2="184" stroke-width="3"/><line class="ink2-s" x1="113" y1="238" x2="147.5" y2="238" stroke-width="3"/><line class="ink2-s" x1="147.5" y1="76" x2="182" y2="76" stroke-width="3"/><line class="ink2-s" x1="147.5" y1="130" x2="182" y2="130" stroke-width="3"/><line class="ink2-s" x1="147.5" y1="184" x2="182" y2="184" stroke-width="3"/><line class="ink2-s" x1="147.5" y1="238" x2="182" y2="238" stroke-width="3"/><line class="ink2-s" x1="182" y1="76" x2="216.5" y2="76" stroke-width="3"/><line class="ink2-s" x1="182" y1="130" x2="216.5" y2="130" stroke-width="3"/><line class="ink2-s" x1="182" y1="184" x2="216.5" y2="184" stroke-width="3"/><line class="ink2-s" x1="182" y1="238" x2="216.5" y2="238" stroke-width="3"/><line class="f-s" x1="216.5" y1="76" x2="251" y2="130" stroke-width="4"/><line class="ink2-s" x1="216.5" y1="130" x2="251" y2="130" stroke-width="3"/><line class="ink2-s" x1="216.5" y1="184" x2="251" y2="184" stroke-width="3"/><line class="ink2-s" x1="216.5" y1="238" x2="251" y2="238" stroke-width="3"/><line class="ink2-s" x1="251" y1="130" x2="285.5" y2="130" stroke-width="3"/><line class="ink2-s" x1="251" y1="184" x2="285.5" y2="184" stroke-width="3"/><line class="ink2-s" x1="251" y1="238" x2="285.5" y2="238" stroke-width="3"/><line class="ink2-s" x1="285.5" y1="130" x2="320" y2="130" stroke-width="3"/><line class="ink2-s" x1="285.5" y1="184" x2="320" y2="184" stroke-width="3"/><line class="ink2-s" x1="285.5" y1="238" x2="320" y2="238" stroke-width="3"/><line class="ink2-s" x1="320" y1="130" x2="354.5" y2="130" stroke-width="3"/><line class="ink2-s" x1="320" y1="184" x2="354.5" y2="184" stroke-width="3"/><line class="ink2-s" x1="320" y1="238" x2="354.5" y2="238" stroke-width="3"/><line class="ink2-s" x1="354.5" y1="130" x2="389" y2="130" stroke-width="3"/><line class="ink2-s" x1="354.5" y1="184" x2="389" y2="184" stroke-width="3"/><line class="ink2-s" x1="354.5" y1="238" x2="389" y2="238" stroke-width="3"/><line class="f-s" x1="389" y1="130" x2="423.5" y2="184" stroke-width="4"/><line class="ink2-s" x1="389" y1="184" x2="423.5" y2="184" stroke-width="3"/><line class="ink2-s" x1="389" y1="238" x2="423.5" y2="238" stroke-width="3"/><line class="ink2-s" x1="423.5" y1="184" x2="458" y2="184" stroke-width="3"/><line class="ink2-s" x1="423.5" y1="238" x2="458" y2="238" stroke-width="3"/><line class="ink2-s" x1="458" y1="184" x2="492.5" y2="184" stroke-width="3"/><line class="ink2-s" x1="458" y1="238" x2="492.5" y2="238" stroke-width="3"/><line class="ink2-s" x1="492.5" y1="184" x2="527" y2="184" stroke-width="3"/><line class="ink2-s" x1="492.5" y1="238" x2="527" y2="238" stroke-width="3"/><line class="ink2-s" x1="527" y1="184" x2="561.5" y2="184" stroke-width="3"/><line class="ink2-s" x1="527" y1="238" x2="561.5" y2="238" stroke-width="3"/><line class="f-s" x1="561.5" y1="184" x2="596" y2="238" stroke-width="4"/><line class="ink2-s" x1="561.5" y1="238" x2="596" y2="238" stroke-width="3"/><circle class="ink ring" cx="44" cy="22" r="7"/><circle class="ink ring" cx="44" cy="76" r="7"/><circle class="ink ring" cx="44" cy="130" r="7"/><circle class="ink ring" cx="44" cy="184" r="7"/><circle class="ink ring" cx="44" cy="238" r="7"/><circle class="ink ring" cx="78.5" cy="76" r="5"/><circle class="ink ring" cx="78.5" cy="130" r="5"/><circle class="ink ring" cx="78.5" cy="184" r="5"/><circle class="ink ring" cx="78.5" cy="238" r="5"/><circle class="ink ring" cx="113" cy="76" r="5"/><circle class="ink ring" cx="113" cy="130" r="5"/><circle class="ink ring" cx="113" cy="184" r="5"/><circle class="ink ring" cx="113" cy="238" r="5"/><circle class="ink ring" cx="147.5" cy="76" r="5"/><circle class="ink ring" cx="147.5" cy="130" r="5"/><circle class="ink ring" cx="147.5" cy="184" r="5"/><circle class="ink ring" cx="147.5" cy="238" r="5"/><circle class="ink ring" cx="182" cy="76" r="5"/><circle class="ink ring" cx="182" cy="130" r="5"/><circle class="ink ring" cx="182" cy="184" r="5"/><circle class="ink ring" cx="182" cy="238" r="5"/><circle class="ink ring" cx="216.5" cy="76" r="5"/><circle class="ink ring" cx="216.5" cy="130" r="5"/><circle class="ink ring" cx="216.5" cy="184" r="5"/><circle class="ink ring" cx="216.5" cy="238" r="5"/><circle class="ink ring" cx="251" cy="130" r="5"/><circle class="ink ring" cx="251" cy="184" r="5"/><circle class="ink ring" cx="251" cy="238" r="5"/><circle class="ink ring" cx="285.5" cy="130" r="5"/><circle class="ink ring" cx="285.5" cy="184" r="5"/><circle class="ink ring" cx="285.5" cy="238" r="5"/><circle class="ink ring" cx="320" cy="130" r="5"/><circle class="ink ring" cx="320" cy="184" r="5"/><circle class="ink ring" cx="320" cy="238" r="5"/><circle class="ink ring" cx="354.5" cy="130" r="5"/><circle class="ink ring" cx="354.5" cy="184" r="5"/><circle class="ink ring" cx="354.5" cy="238" r="5"/><circle class="ink ring" cx="389" cy="130" r="5"/><circle class="ink ring" cx="389" cy="184" r="5"/><circle class="ink ring" cx="389" cy="238" r="5"/><circle class="ink ring" cx="423.5" cy="184" r="5"/><circle class="ink ring" cx="423.5" cy="238" r="5"/><circle class="ink ring" cx="458" cy="184" r="5"/><circle class="ink ring" cx="458" cy="238" r="5"/><circle class="ink ring" cx="492.5" cy="184" r="5"/><circle class="ink ring" cx="492.5" cy="238" r="5"/><circle class="ink ring" cx="527" cy="184" r="5"/><circle class="ink ring" cx="527" cy="238" r="5"/><circle class="ink ring" cx="561.5" cy="184" r="5"/><circle class="ink ring" cx="561.5" cy="238" r="5"/><circle class="f ring" cx="596" cy="238" r="10"/><text class="lbl" x="320" y="288" text-anchor="middle">n = 5 states · shortest reset (n−1)² = 16 inputs</text></svg>
+62 −0 figure.py added View file
@@ -0,0 +1,62 @@
1+"""The Černý automaton C_n and its shortest reset word, of length (n - 1)^2. States 0..n-1; the input a turns every
2+state q to q + 1 (mod n), the input b sends state 0 to 1 and keeps the others. Breadth-first search over subsets of
3+states gives the shortest reset word; it is checked here to have length (n - 1)^2 for n = 2 to 9.
4+
5+The figure follows C_5 along that word, b aaaa b aaaa b aaaa b, from each of its 5 possible starting states: one strand
6+per start, one bead per input. It is drawn in the turning frame (a strand's row is its state minus the number of a's so
7+far, mod 5), so a turn leaves the strands level and each b merges one strand into the next: 16 inputs to leave one."""
8+from collections import deque
9+from pathlib import Path
10+
11+import kit
12+
13+
14+def step(n, q, c):
15+ return (q + 1) % n if c == 'a' else (1 if q == 0 else q)
16+
17+
18+def shortest_reset_word(n):
19+ start = frozenset(range(n))
20+ seen, todo = {start: ''}, deque([start])
21+ while todo:
22+ s = todo.popleft()
23+ if len(s) == 1:
24+ return seen[s]
25+ for c in 'ab':
26+ t = frozenset(step(n, q, c) for q in s)
27+ if t not in seen:
28+ seen[t] = seen[s] + c
29+ todo.append(t)
30+
31+
32+for n in range(2, 10):
33+ assert len(shortest_reset_word(n)) == (n - 1) ** 2, n
34+
35+n = 5
36+word = shortest_reset_word(n)
37+assert len(word) == (n - 1) ** 2 == 16
38+# each start's state after t inputs, and its row in the turning frame
39+states = [[q] for q in range(n)]
40+for c in word:
41+ for s in states:
42+ s.append(step(n, s[-1], c))
43+turns = [word[:t].count('a') for t in range(len(word) + 1)]
44+rows = [[(s[t] - turns[t]) % n for t in range(len(word) + 1)] for s in states]
45+assert len({s[-1] for s in states}) == 1
46+
47+x0, dx, y0, dy = 44, 34.5, 22, 54
48+
49+
50+def at(t, r):
51+ return x0 + t * dx, y0 + r * dy
52+
53+
54+segs, beads = set(), set()
55+for r in rows:
56+ for t in range(len(word)):
57+ segs.add((t, r[t], r[t + 1]))
58+ beads |= {(t, r[t]) for t in range(len(word) + 1)}
59+body = [kit.line(*at(t, a), *at(t + 1, b), 'ink2-s' if a == b else 'f-s', 3 if a == b else 4) for t, a, b in sorted(segs)]
60+body += [kit.dot(*at(t, r), 7 if t == 0 else 5) for t, r in sorted(beads) if t < len(word)]
61+body.append(kit.dot(*at(len(word), rows[0][-1]), 10, 'f'))
62+kit.write(__file__, 'mathematics', ''.join(body), label='n = 5 states · shortest reset (n−1)² = 16 inputs')
+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('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
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
Binary file not shown.
+6 −0 posters.json added View file
@@ -0,0 +1,6 @@
1+{
2+ "poster.webp": {
3+ "style": "poster",
4+ "idea": "A handcrafted transparent automaton board funnels many distinct state tokens through repeated gates into one brass cup."
5+ }
6+}
+37 −2 scienceslack.json View file
@@ -9,7 +9,7 @@
99 "proof"
1010 ],
1111 "cover": {
12- "motif": "blocks"
12+ "file": "poster.webp"
1313 },
1414 "source": {
1515 "key": "formal-conjectures",
@@ -23,5 +23,40 @@
2323 "catalog": "0521c19bbd38"
2424 },
2525 "review": true,
26- "approval": "first-time"
26+ "approval": "first-time",
27+ "card": {
28+ "question": "When some sequence of inputs forces an n-state machine into one known state from anywhere, is a sequence of at most (n − 1)² inputs always enough?",
29+ "stake": "Černý built machines that need exactly (n − 1)² inputs in 1964; more than sixty years later the best general bound is still cubic in n.",
30+ "frontier": {
31+ "shape": "bounds",
32+ "what": "worst reset threshold",
33+ "lower": {
34+ "value": "(n-1)^2",
35+ "by": "Černý",
36+ "year": 1964
37+ },
38+ "upper": {
39+ "value": "0.1654 n^3 + o(n^3)",
40+ "by": "Shitov",
41+ "year": 2019
42+ },
43+ "history": [
44+ {
45+ "side": "upper",
46+ "value": "n^3/6",
47+ "year": 1982
48+ },
49+ {
50+ "side": "upper",
51+ "value": "0.1664 n^3",
52+ "year": 2017
53+ }
54+ ],
55+ "guess": {
56+ "value": "(n-1)^2",
57+ "by": "Černý"
58+ }
59+ },
60+ "first": "Extend the exhaustive check to more states or letters"
61+ }
2762 }