题目
设 M 是一个 n × n 矩阵,每个元素属于 {−1, +1},其中 n = 23(problem.toml 中的 [params] order)。找出这样一个矩阵,使 |det M| 尽可能大。得分为 |det M|,是一个整数。
置换行或列、把行或列取负、转置,都不改变 |det M|。
每个 n × n 的 ±1 行列式都是 2^(n−1) 的倍数:把若干列取负、使第一行全为 +1,只改变行列式的符号;再把其余每一行减去第一行,剩下的 n − 1 行的元素都是 0 或 −2。OEIS A003433 的公式 a(n) = 2^(n−1)·A003432(n−1) 中也出现同一个因子。因此对 n = 23,每个得分都是 2^22 = 4,194,304 的倍数,这就是 ε。基线为 662,671,875 · 2^22,所以高于基线的下一个可能得分是 662,671,876 · 2^22 = 2,779,447,300,194,304。这个值或任何高于基线的值能否取到,目前未知。
上界。对 n ≡ 3 (mod 4) 适用 Ehlich 界(H. Ehlich,Math. Z. 83 (1964) 123–132;其表述见 Browne、Egan、Hegarty 和 Ó Catháin,A survey of the Hadamard maximal determinant problem,Electron. J. Combin. 28(4) (2021) #P4.41,§7 中定理 28 之前的公式和定理 28)。对 n = 23,极值分块为 4 + 4 + 4 + 4 + 4 + 3,由此得到
det(M Mᵀ) ≤ 20^17 · 36^5 · 32 · (1 − 5·4/36 − 3/32) = (2^22 · 3 · 5^6 · 675)^2 · 505,
所以 |det M| ≤ 2^22 · 3 · 5^6 · 675 · √505 ≈ 2.98230 × 10^15。这个界不是整数,小于它的最大的 2^22 的倍数是 711,034,613 · 2^22 = 2,982,295,321,444,352。基线约为 Ehlich 界的 0.93198;存档的纪录页面给出的比值是 0.931983。n = 23 时 |det M| 的最大可能值未知。这个界与计分无关。
为什么重要
Hadamard 证明了对元素模不超过 1 的复矩阵有 |det M| ≤ n^(n/2),并在论文结尾建议研究 ±1 矩阵的最大行列式(J. Hadamard,Résolution d'une question relative aux déterminants,Bull. Sci. Math. 17 (1893) 240–246,Zenodo 上的扫描件;Browne 等 2021,摘要)。这就是 Hadamard 最大行列式问题。在统计学中,同样的矩阵就是饱和 D-最优设计;例如 22 阶已在 "The D-optimal saturated designs of order 22" 中解决(Chasiotis、Kounias 和 Farmakis,Discrete Math. 341 (2018) 380–387,该综述的参考文献 [13])。
OEIS A003433 列出了 n = 1, …, 22 的最大行列式;其中 R. P. Brent(2021)的注释记录了 n = 22 已由 Chasiotis 等人证明为最优。在 n ≡ 3 (mod 4) 的阶中,该综述(§7)列出最大值已确定的有 n = 3、7 和 11,n = 15 由 Orrick 确定(Metrika 62 (2005)),n = 19 由 Brent、Osborn、Orrick 和 Zimmermann 确定。对 n = 23,只有来自构造的下界。
n = 23 的值 2,779,447,296,000,000 出现在 Orrick 和 Solomon 维护的最大行列式表的 23 阶页面上(存档的 d23.html,页面创建于 2002 年,最后修改于 2003 年)。该页面把这一下界归于 Dowdeswell、Neubauer、Solomon 和 Tumer [DNST],并注明 "This form has not been proved to be optimal"(这个形式尚未被证明是最优的)。Orrick、Solomon、Dowdeswell 和 Smith,New lower bounds for the maximal determinant problem,arXiv:math/0304410 (2003) 在摘要中报告,他们打破了 n = 22、23、27、… 的已有纪录,并给出了这些矩阵。Browne 等(2021)的表 1 对 n = 23 列出与 Barba 界 √45 · 22^11 的比值 0.7091,取自 Orrick 的表;基线给出 0.70909。|det M| ≥ 2,779,447,300,194,304 的 23×23 ±1 矩阵,其行列式大于这些来源中所有 23 阶矩阵。
Few Shots 上的推进
从预设基线开始,每一行是一次经验证器复算的有效突破
- #02,779,447,296,000,000预设基线
- #1?等待挑战者
证书格式
- 文件名为
certificate.json,形如 {"matrix": [[1, -1, …], …]},不含其他键。 matrix 是恰好由 23 行组成的列表;每行是恰好由 23 个元素组成的列表;每个元素是 JSON 整数 1 或 -1。布尔值、字符串、0、-0、小数、指数形式(1.0、1e0)、NaN 和 Infinity 都会被拒绝。- 奇异矩阵是有效的,得分为
0。 - 验证器用整数运算精确计算 det M(带行选主元的无除法 Bareiss 消元)。得分为十进制整数字符串形式的 |det M|,例如
"2779447296000000"。 - 文件为 UTF-8 编码的 JSON,不带字节顺序标记,大小不超过 65,536 字节,嵌套不超过 8 层,整数不超过 18 位,不含重复键(键在 JSON 反转义之后比较)。
- 规范形式。设 r_1, …, r_23 为各行。
- 把第一个元素为 −1 的每一行换成它的相反数,使每一行都以 +1 开头。
- 把 23 行按字典序递增排序:两行从第一个元素起逐个比较,−1 < +1。(这就是 Python 对整数列表的排序。)
- 规范对象为
{"matrix": C},C 为排好序的行列表。 canonical_hash 是该对象写成 JSON 后的小写十六进制 SHA-256:没有任何空白,元素写作 1 和 -1,ASCII 字节,末尾没有换行;在 Python 中为 json.dumps(obj, sort_keys=True, separators=(",", ":"), ensure_ascii=True).encode("ascii")。
因此,两个证书哈希相同,当且仅当其中一个可以通过置换行和把行取负由另一个得到。置换或取负列、转置都保持得分,但不会被识别;与纪录打平,无论哪种情况都不算改进。
算例(3 阶,只用来演示计算):行 [-1,1,1]、[1,1,-1]、[1,-1,1] 经第 1 步变为 [1,-1,-1]、[1,1,-1]、[1,-1,1],经第 2 步变为 [1,-1,-1]、[1,-1,1]、[1,1,-1];被哈希的字节为 {"matrix":[[1,-1,-1],[1,-1,1],[1,1,-1]]},SHA-256 为 46472a7336ecc2317e522d315d86dca3f959157b2efc98d132cc54d408dcde26。对基线,第 1 步取负了 9 行,被哈希的字节以 {"matrix":[[1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,-1,1,1,1,-1,-1,-1,-1,1,1], 开头,共 1,368 字节,canonical_hash 为 1ce81e628d6dc36c015673ac9b8dbb911b6f7d6fa4c04d5af35bef38cc942075。
基线
baseline/certificate.json 是该页面上 "R:" 下方印出的 23 × 23 符号图样,行按印出的顺序排列,+ → 1,- → -1。按印出的样子,det R = −2,779,447,296,000,000。页面还印出了 Gram 矩阵 M = R Rᵀ = Rᵀ R;对这个证书,两个乘积都与印出的 M 逐项相等,且 det M = (det R)^2。页面没有说明矩阵的许可;证书只包含它的 529 个元素,并注明了上述来源。
复现方法:
python3 problems/p012-maxdet-23/verify/verify.py problems/p012-maxdet-23/baseline
Problem
Let M be an n × n matrix with every entry in {−1, +1}, where n = 23 ([params] order in problem.toml). Find such a matrix with |det M| as large as possible. The score is |det M|, an integer.
Permuting rows or columns, negating rows or columns, and transposing do not change |det M|.
Every n × n ±1 determinant is a multiple of 2^(n−1): negating columns so that the first row is all +1 changes only the sign of the determinant, and subtracting the first row from each other row leaves n − 1 rows whose entries are 0 or −2. The same factor appears in the formula a(n) = 2^(n−1)·A003432(n−1) of OEIS A003433. For n = 23 every score is therefore a multiple of 2^22 = 4,194,304, which is ε. The baseline is 662,671,875 · 2^22, so the next possible score above it is 662,671,876 · 2^22 = 2,779,447,300,194,304. Whether that value, or any value above the baseline, is attained is not known.
Upper bound. For n ≡ 3 (mod 4) the Ehlich bound applies (H. Ehlich, Math. Z. 83 (1964) 123–132; stated as the formula before Theorem 28 and Theorem 28 in Browne, Egan, Hegarty and Ó Catháin, A survey of the Hadamard maximal determinant problem, Electron. J. Combin. 28(4) (2021) #P4.41, §7). For n = 23 the extremal block partition is 4 + 4 + 4 + 4 + 4 + 3, which gives
det(M Mᵀ) ≤ 20^17 · 36^5 · 32 · (1 − 5·4/36 − 3/32) = (2^22 · 3 · 5^6 · 675)^2 · 505,
so |det M| ≤ 2^22 · 3 · 5^6 · 675 · √505 ≈ 2.98230 × 10^15. The bound is not an integer, and the largest multiple of 2^22 below it is 711,034,613 · 2^22 = 2,982,295,321,444,352. The baseline is about 0.93198 of the Ehlich bound; the archived record page gives the ratio 0.931983. The largest possible |det M| for n = 23 is not known. The bound plays no part in scoring.
Why it matters
Hadamard proved |det M| ≤ n^(n/2) for complex matrices with entries of modulus at most 1 and ended his paper by suggesting the study of the largest determinant of ±1 matrices (J. Hadamard, Résolution d'une question relative aux déterminants, Bull. Sci. Math. 17 (1893) 240–246, scan on Zenodo; Browne et al. 2021, abstract). This is the Hadamard maximal determinant problem. In statistics the same matrices are saturated D-optimal designs; for example, order 22 was settled in "The D-optimal saturated designs of order 22" (Chasiotis, Kounias and Farmakis, Discrete Math. 341 (2018) 380–387, reference [13] of the survey).
OEIS A003433 lists the maximal determinant for n = 1, …, 22; its comment by R. P. Brent (2021) records that n = 22 was proved optimal by Chasiotis et al. Among orders n ≡ 3 (mod 4), the survey (§7) lists the maximum as determined for n = 3, 7 and 11, for n = 15 by Orrick (Metrika 62 (2005)) and for n = 19 by Brent, Osborn, Orrick and Zimmermann. For n = 23 only lower bounds from constructions are known.
The value 2,779,447,296,000,000 for n = 23 is on the order-23 page of the maximal determinant tables maintained by Orrick and Solomon (archived d23.html, page created 26 January 2002, last modified 11 April 2003), which credits the lower bound to Dowdeswell, Neubauer, Solomon and Tumer [DNST] and notes "This form has not been proved to be optimal". Orrick, Solomon, Dowdeswell and Smith, New lower bounds for the maximal determinant problem, arXiv:math/0304410 (2003) report in the abstract that they beat the existing records for n = 22, 23, 27, … and present the matrices. Table 1 of Browne et al. (2021) lists for n = 23 the ratio 0.7091 to the Barba bound √45 · 22^11, taken from Orrick's tables; the baseline gives 0.70909. A 23×23 ±1 matrix with |det M| ≥ 2,779,447,300,194,304 has a larger determinant than every order-23 matrix in these sources.
Progress on Few Shots
From the preset baseline, one row per valid breakthrough recomputed by the verifier
- #02,779,447,296,000,000Preset baseline
- #1?Awaiting a challenger
Certificate
- File name
certificate.json, shaped like {"matrix": [[1, -1, …], …]}, with no other keys. matrix is a list of exactly 23 rows; each row is a list of exactly 23 entries; each entry is the JSON integer 1 or -1. Booleans, strings, 0, -0, fractions, exponents (1.0, 1e0), NaN and Infinity are rejected.- Singular matrices are valid and score
0. - The verifier computes det M exactly in integer arithmetic (fraction-free Bareiss elimination with row pivoting). The score is |det M| as a decimal integer string, for example
"2779447296000000". - The file is UTF-8 JSON without a byte order mark, at most 65,536 bytes, nested at most 8 levels, with integers of at most 18 digits and no duplicate keys (keys are compared after JSON unescaping).
- Canonical form. Let r_1, …, r_23 be the rows.
- Replace every row whose first entry is −1 by its negation, so every row starts with +1.
- Sort the 23 rows in increasing lexicographic order: compare two rows entry by entry from the first, with −1 < +1. (This is Python's ordering of lists of integers.)
- The canonical object is
{"matrix": C} with C the sorted list of rows. canonical_hash is the lowercase hex SHA-256 of that object written as JSON with no whitespace at all, entries as 1 and -1, ASCII bytes, no trailing newline; in Python, json.dumps(obj, sort_keys=True, separators=(",", ":"), ensure_ascii=True).encode("ascii").
So two certificates have the same hash exactly when one is obtained from the other by permuting rows and negating rows. Permuting or negating columns and transposing keep the score but are not detected; a tie with the record is not an improvement either way.
Worked example (order 3, only to show the computation): the rows [-1,1,1], [1,1,-1], [1,-1,1] become [1,-1,-1], [1,1,-1], [1,-1,1] after step 1 and [1,-1,-1], [1,-1,1], [1,1,-1] after step 2; the hashed bytes are {"matrix":[[1,-1,-1],[1,-1,1],[1,1,-1]]}, with SHA-256 46472a7336ecc2317e522d315d86dca3f959157b2efc98d132cc54d408dcde26. For the baseline, 9 rows are negated in step 1, the hashed bytes begin {"matrix":[[1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,-1,1,1,1,-1,-1,-1,-1,1,1], and are 1,368 bytes long, and canonical_hash is 1ce81e628d6dc36c015673ac9b8dbb911b6f7d6fa4c04d5af35bef38cc942075.
Baseline
| det R | = 2,779,447,296,000,000 = 662,671,875 · 2^22 = 3 · 67 · 211 · 5^6 · 2^22, for the matrix R on the order-23 page of the Orrick–Solomon maximal determinant tables (Wayback Machine snapshot of 28 December 2019; the proposal's link web.archive.org/web/20200219170713/…/d23.html serves this snapshot). The page credits the bound to Dowdeswell, Neubauer, Solomon and Tumer [DNST]; the same order appears among the new records of arXiv:math/0304410 (Orrick, Solomon, Dowdeswell, Smith, submitted 25 April 2003). Whether the two sources report the same matrix, and who found it first, is not confirmed here: only the abstract of the paper was checked. |
|---|
baseline/certificate.json is the 23 × 23 sign pattern printed under "R:" on that page, rows in the printed order, with + → 1 and - → -1. As printed, det R = −2,779,447,296,000,000. The page also prints the Gram matrix M = R Rᵀ = Rᵀ R; for the certificate both products equal the printed M entry by entry, and det M = (det R)^2. The page states no licence for the matrix; the certificate holds only its 529 entries, cited to the sources above.
To reproduce:
python3 problems/p012-maxdet-23/verify/verify.py problems/p012-maxdet-23/baseline