# 拉丁方

n 阶拉丁方是一个 n × n 的阵列，其中填入 n 个互不相同的符号，使得每个符号在每一行中恰好出现一次，在每一列中也恰好出现一次。<sup>[1](https://www.whitman.edu/mathematics/cgt_online/book/section04.03.html)</sup> 这一名称源于欧拉（Euler）在 18 世纪 80 年代研究幻方时用拉丁字母充当符号。<sup>[2](https://arxiv.org/abs/math/0408230)</sup> 拉丁方是最基本的组合对象之一，在代数（作为拟群的凯莱（Cayley）表）、几何、统计学与计算机科学中都有等价的表述。<sup>[3](https://arxiv.org/abs/0909.3402)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 在 n 个符号上的 n × n 阵列，每个符号在每一行和每一列中各恰好出现一次<sup>[1](https://www.whitman.edu/mathematics/cgt_online/book/section04.03.html)</sup> |
| 约化形式 | 首行与首列均按自然顺序排列的拉丁方；对行和列作置换可把任何拉丁方化为约化形式<sup>[1](https://www.whitman.edu/mathematics/cgt_online/book/section04.03.html)</sup><sup> • </sup><sup>[4](https://cse.unl.edu/~citportal/citportal/loadTutorial?page=latinSquareTutorial&start=1)</sup> |
| 计数 | 拉丁方的确切数目目前只对 n ≤ 11 已知；11 阶的计数由麦凯（McKay）与万利斯（Wanless）于 2005 年解决<sup>[3](https://arxiv.org/abs/0909.3402)</sup> |
| 正交性 | n 阶互正交拉丁方（MOLS）最多只能有 n − 1 个；素数幂阶的完全组已知<sup>[5](https://encyclopediaofmath.org/wiki/Orthogonal_Latin_squares)</sup> |
| 欧拉猜想 | 1959—1960 年被玻色（Bose）、什里坎德（Shrikhande）与帕克（Parker）推翻：除 2 阶与 6 阶外，任何阶都存在正交对<sup>[6](https://old.maa.org/press/periodicals/convergence/euler-squares-eulers-officer-problem)</sup> |
| 试验设计 | 拉丁方设计可对两个干扰因子作区组化，行、列与处理的水平数相同<sup>[7](https://www.itl.nist.gov/div898/handbook/pri/section3/pri3321.htm)</sup> |
| 代数角色 | 有限拟群的乘法表（凯莱表）就是一个拉丁方<sup>[8](https://encyclopediaofmath.org/wiki/Quasi-group)</sup> |

## 定义与基本结构

n 阶拉丁方是一个 n × n 的方格，其中填入 n 个符号（通常为 1 到 n 的整数），使得每个符号在每一行中出现一次、在每一列中出现一次。<sup>[1](https://www.whitman.edu/mathematics/cgt_online/book/section04.03.html)</sup> 行与列的顺序对这一概念并不重要：重排行或列所得的方格被视为本质上相同的拉丁方。<sup>[1](https://www.whitman.edu/mathematics/cgt_online/book/section04.03.html)</sup> 首行与首列均按自然顺序排列的拉丁方称为约化的，而任何拉丁方都可以通过对行和列作置换化为约化形式。<sup>[4](https://cse.unl.edu/~citportal/citportal/loadTutorial?page=latinSquareTutorial&start=1)</sup>

对每个阶 n，拉丁方都存在。<sup>[3](https://arxiv.org/abs/0909.3402)</sup> 最简单的构造是循环拉丁方：每一行都是上一行平移一个位置得到的；当 n 为素数时，这一构造的若干变体能生成完整的互正交拉丁方组。<sup>[4](https://cse.unl.edu/~citportal/citportal/loadTutorial?page=latinSquareTutorial&start=1)</sup>

在代数中，有限拟群的乘法表即其凯莱表，是一个拉丁方；拟群是带有一个二元运算的集合，其中方程 A(x, y) = a 与 B(x, y) = b 都有唯一解。<sup>[8](https://encyclopediaofmath.org/wiki/Quasi-group)</sup> 反过来，每个拉丁方都编码了一个拟群；按同痕与同构这两种等价关系统计拉丁方，就等于统计同阶的拟群与圈。<sup>[3](https://arxiv.org/abs/0909.3402)</sup>

## 计数

统计拉丁方的数目远比构造它们困难。约化拉丁方的数目在 5 阶以下已为欧拉与凯莱所知；6 阶由弗罗洛夫（Frolov）与塔里（Tarry）在 1890—1900 年间数出；7 阶由诺顿（Norton）与萨德（Sade）在 1939—1951 年前后完成；8 阶由韦尔斯（Wells，1967）完成；9 阶由巴梅尔（Bammel）与罗思坦（Rothstein，1975）完成。<sup>[9](https://arxiv.org/abs/0909.2101)</sup> 10 阶的计数在 1990—1991 年间得到；目前拉丁方的确切数目只对 n ≤ 11 已知，最后一个情形由澳大利亚国立大学的组合学家布伦丹·D. 麦凯（Brendan D. McKay）与莫纳什大学的数学家伊恩·M. 万利斯（Ian M. Wanless）在 2005 年发表于《组合学年鉴》（*Annals of Combinatorics*）的论文中解决。<sup>[9](https://arxiv.org/abs/0909.2101)</sup><sup> • </sup><sup>[3](https://arxiv.org/abs/0909.3402)</sup>

11 阶的计数给出 776966836171770144107444346734230682311065600000 个互不相同的拉丁方、2036029552582883134196099 个主类以及 12216177315369229261482540 个同痕类。<sup>[3](https://arxiv.org/abs/0909.3402)</sup> 按主类计，n ≤ 3 时只有一个拉丁方，n = 4 与 5 时有两个，n = 6 时有十二个，n = 7 时有 147 个。<sup>[3](https://arxiv.org/abs/0909.3402)</sup> 数目的增长如此之快，以至于连约化拉丁方数目的渐近值都尚不清楚。<sup>[9](https://arxiv.org/abs/0909.2101)</sup>

## 正交性与欧拉的 36 名军官问题

若把两个 n 阶拉丁方叠合时，每一对有序符号都恰好出现一次，则称这两个拉丁方正交；叠合所得的阵称为希腊拉丁方或欧拉方。<sup>[5](https://encyclopediaofmath.org/wiki/Orthogonal_Latin_squares)</sup> 若一个拉丁方集合中任意两个都正交，则称该集合互正交，此类集合可能的最大规模为 n − 1；达到这一上界的集合称为完全组。<sup>[5](https://encyclopediaofmath.org/wiki/Orthogonal_Latin_squares)</sup> 对每个素数幂阶 n = p<sup>k</sup>，都可借助有限域 GF(p<sup>k</sup>) 的算术构造出完全组；而对其他任何阶，都还不知道有完全组存在。<sup>[5](https://encyclopediaofmath.org/wiki/Orthogonal_Latin_squares)</sup>

1779 年，欧拉研究了这样一个问题：把来自六个团、六个军阶的 36 名军官排成一个方阵，使每一行、每一列中各含每个军阶的军官一名、每个团的军官一名——这相当于一对 6 阶正交拉丁方。<sup>[6](https://old.maa.org/press/periodicals/convergence/euler-squares-eulers-officer-problem)</sup> 欧拉猜想，对任何形如 4n + 2 的阶都不存在解。法国数学家加斯东·塔里（Gaston Tarry）于 1901 年用手工穷举所有排法证明了 6 阶的情形。<sup>[6](https://old.maa.org/press/periodicals/convergence/euler-squares-eulers-officer-problem)</sup> 1959—1960 年，拉杰·钱德拉·玻色（Raj Chandra Bose）、沙拉德钱德拉·香卡尔·什里坎德（Sharadchandra Shankar Shrikhande）与欧内斯特·蒂尔登·帕克（Ernest Tilden Parker）推翻了猜想的其余部分：他们用计算机构造出 10 阶的欧拉方，并证明除 2 阶与 6 阶外，任何阶都存在正交对。<sup>[6](https://old.maa.org/press/periodicals/convergence/euler-squares-eulers-officer-problem)</sup><sup> • </sup><sup>[10](https://www.dcs.gla.ac.uk/~pat/cpM/choco4/latinSquares/papers/p1054-mandl.pdf)</sup>

一个拉丁方存在正交配偶（orthogonal mate）当且仅当它含有 n 条两两不相交的横截，即 n 个格子的集合，每行取一格、每列取一格，且所有符号互不相同。<sup>[5](https://encyclopediaofmath.org/wiki/Orthogonal_Latin_squares)</sup> 互正交拉丁方组等价于正交阵列，等价于有限几何中的网，而当该组是完全组时还等价于有限射影平面。<sup>[5](https://encyclopediaofmath.org/wiki/Orthogonal_Latin_squares)</sup>

## 部分拉丁方与补全

部分拉丁方是一个 n × n 阵列，其中每个符号在每一行、每一列中至多出现一次，且有一些格子为空。<sup>[11](https://doc.sagemath.org/html/en/reference/combinat/sage/combinat/matrices/latin.html)</sup> 1960 年，特雷弗·埃文斯（Trevor Evans）猜想：任何阶为 n、填入格子至多 n − 1 个的部分拉丁方都能补全为一个完整的拉丁方。<sup>[12](https://faculty.ksu.edu.sa/sites/default/files/proofs_in_the_book.pdf)</sup> 这一界是紧的：某些含 n 个填入格子的构形无法补全，其中某一行与某一列中已填入的符号使它们交叉处的格子没有合法符号可用。<sup>[13](https://citeseerx.ist.psu.edu/document?doi=81b6662ac04982c050eb6e7949fb53ab8d5509a0&repid=rep1&type=pdf)</sup> 该猜想由博赫丹·斯梅塔纽克（Bohdan Smetaniuk）于 1981 年证明，其证明是构造性的，能从任何可容许的部分构形出发显式地完成补全。<sup>[12](https://faculty.ksu.edu.sa/sites/default/files/proofs_in_the_book.pdf)</sup> 相关的工作更早地确立了 n ≤ 8 时的猜想，而更强的结果还表明，在许多情形下甚至可以预先指定 n 个填入格子。<sup>[14](https://www.sciencedirect.com/science/article/pii/009731657790005X)</sup><sup> • </sup><sup>[13](https://citeseerx.ist.psu.edu/document?doi=81b6662ac04982c050eb6e7949fb53ab8d5509a0&repid=rep1&type=pdf)</sup>

## 试验设计中的拉丁方

在统计学中，拉丁方设计把区组化——即为控制变异而将试验单元分组——一次扩展到两个方向。它适用于这样的情形：有两个干扰因子，各自恰在 k 个水平上考察，另有一个具 k 个水平的处理因子，使得 k × k 方阵的每一行与每一列都恰好接受每个处理一次。<sup>[15](https://www.statsref.com/HTML/latin_sqaures.html)</sup> 在农业田间试验中，行与列通常就是田块中的小区位置，从而把肥力梯度之类的空间变异与处理效应分离开来。<sup>[15](https://www.statsref.com/HTML/latin_sqaures.html)</sup>

一个经典例子由门茨勒（Menzler）在 D. R. 考克斯（D. R. Cox）1958 年的著作《试验的设计》（*Planning of Experiments*）中引用：用四辆公共汽车在四天里检验四种轮胎气压对公共汽车油耗的影响，以汽车和天数作为两个区组因子；这个 4 × 4 设计只需 16 次试验，而全因子设计需要 64 次，它保留了全部主效应，代价是牺牲了区组因子之间交互作用的信息。<sup>[15](https://www.statsref.com/HTML/latin_sqaures.html)</sup> 统计模型为

\[ Y_{ijk} = \mu + R_{i} + C_{j} + T_{k} + \text{随机误差} \]

其中 \( R_i \)、\( C_j \) 与 \( T_k \) 分别是行效应、列效应与处理效应。<sup>[7](https://www.itl.nist.gov/div898/handbook/pri/section3/pri3321.htm)</sup>

这一设计带有结构性的假定：模型假定区组变量之间、以及处理与区组变量之间都不存在交互作用。<sup>[7](https://www.itl.nist.gov/div898/handbook/pri/section3/pri3321.htm)</sup> 当存在显著的交互作用时，它们会被并入误差项，从而可能扭曲结果；已有一些程序利用试验数据本身来检验可加性假定。<sup>[16](https://business.columbia.edu/faculty/research/assessing-interaction-effects-latin-square-type-designs)</sup> 1991 年的综述文献还记载，教科书对拉丁方的强调曾使一些农业试验者偏爱拉丁方设计而不用随机完全区组设计，其错误理由是两套区组系统必定优于一套。<sup>[17](https://www.sciencedirect.com/science/chapter/bookseries/pii/S0167506008709701)</sup> 区组化第三个干扰因子的希腊拉丁方在许多教科书中都有介绍，但似乎很少真正被用作试验设计。<sup>[17](https://www.sciencedirect.com/science/chapter/bookseries/pii/S0167506008709701)</sup>

## 其他应用

**软件测试。** 罗伯特·曼德尔（Robert Mandl）1985 年的论文把正交拉丁方用于编译器测试：对于 k 个变量、每个变量取 n 个值的情形，选取 k − 2 个正交的 n × n 拉丁方，只运行与叠合方阵各格对应的 n² 种组合，就能覆盖选定的交互作用，但在信息上并不等价于穷举测试；更高阶的交互作用可能被漏掉，但代价只是穷举的一小部分，例如当 n = 4、k = 4 时只需 16 个测试用例而不是 256 个。<sup>[10](https://www.dcs.gla.ac.uk/~pat/cpM/choco4/latinSquares/papers/p1054-mandl.pdf)</sup><sup> • </sup><sup>[18](https://www.sciencedirect.com/topics/mathematics/mutually-orthogonal-latin-square)</sup><sup> • </sup><sup>[22](https://csrc.nist.gov/projects/automated-combinatorial-testing-for-software/combinatorial-methods-in-testing/interactions-involved-in-software-failures)</sup>

**编码、密码学与调度。** 互正交拉丁方组可产生最优密度的纠错码，拉丁方还出现在调度、试验设计与组合设计以及密码学中。<sup>[19](https://shop.elsevier.com/books/latin-squares-and-their-applications/keedwell/978-0-444-63555-6)</sup><sup> • </sup><sup>[20](https://www.sciencedirect.com/science/article/pii/S030505482300148X)</sup> 近期的工作从元胞自动机构造互正交拉丁方，并将其应用于密码学原语。<sup>[21](https://www.sciencedirect.com/science/article/pii/S0166218X25005761)</sup>

**趣味数学。** 拉丁方是数独谜题的模板，可为游戏竞赛提供高效的赛程设计，也可用于构造幻方。<sup>[19](https://shop.elsevier.com/books/latin-squares-and-their-applications/keedwell/978-0-444-63555-6)</sup> 本主题的标准参考书是约瑟夫·德内什（József Dénes）与 A. 唐纳德·基德韦尔（A. Donald Keedwell）所著的《拉丁方及其应用》（*Latin Squares and Their Applications*），该书初版于 1974 年，2015 年出版了修订的第二版。<sup>[19](https://shop.elsevier.com/books/latin-squares-and-their-applications/keedwell/978-0-444-63555-6)</sup>

## References

1. [Latin Squares, Section 4.3, Whitman College Combinatorics text](https://www.whitman.edu/mathematics/cgt_online/book/section04.03.html)
2. [On magic squares (arXiv:math/0408230)](https://arxiv.org/abs/math/0408230)
3. [The number of Latin squares of order 11 (arXiv:0909.3402)](https://arxiv.org/abs/0909.3402)
4. [Latin Square Tutorial, University of Nebraska–Lincoln](https://cse.unl.edu/~citportal/citportal/loadTutorial?page=latinSquareTutorial&start=1)
5. [Orthogonal Latin squares, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Orthogonal_Latin_squares)
6. [Euler Squares – Euler's Officer Problem, Convergence (MAA)](https://old.maa.org/press/periodicals/convergence/euler-squares-eulers-officer-problem)
7. [NIST/SEMATECH e-Handbook of Statistical Methods, 5.3.3.2.1 Latin square and related designs](https://www.itl.nist.gov/div898/handbook/pri/section3/pri3321.htm)
8. [Quasi-group, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Quasi-group)
9. [McKay, B. D., Wanless, I. M. On the number of Latin squares (arXiv:0909.2101)](https://arxiv.org/abs/0909.2101)
10. [Mandl, R. (1985). Orthogonal Latin squares: an application of experiment design to compiler testing, Communications of the ACM](https://www.dcs.gla.ac.uk/~pat/cpM/choco4/latinSquares/papers/p1054-mandl.pdf)
11. [Latin squares, SageMath Combinatorics documentation](https://doc.sagemath.org/html/en/reference/combinat/sage/combinat/matrices/latin.html)
12. [Completing Latin squares, in Proofs from THE BOOK](https://faculty.ksu.edu.sa/sites/default/files/proofs_in_the_book.pdf)
13. [Andersen, L. D., Hilton, A. J. W. Thank Evans!, Proc. London Math. Soc. (1983)](https://citeseerx.ist.psu.edu/document?doi=81b6662ac04982c050eb6e7949fb53ab8d5509a0&repid=rep1&type=pdf)
14. [On the completion of partial latin squares, Journal of Combinatorial Theory A (1977)](https://www.sciencedirect.com/science/article/pii/009731657790005X)
15. [Latin squares, StatsRef: Design of experiments](https://www.statsref.com/HTML/latin_sqaures.html)
16. [Kohli, R. Assessing Interaction Effects in Latin Square-Type Designs, Columbia Business School](https://business.columbia.edu/faculty/research/assessing-interaction-effects-latin-square-type-designs)
17. [Latin Squares as Experimental Designs, Annals of Discrete Mathematics vol. 46 (1991)](https://www.sciencedirect.com/science/chapter/bookseries/pii/S0167506008709701)
18. [Mutually Orthogonal Latin Square, ScienceDirect Topics overview](https://www.sciencedirect.com/topics/mathematics/mutually-orthogonal-latin-square)
19. [Latin Squares and their Applications, 2nd edition, Keedwell & Dénes, Elsevier](https://shop.elsevier.com/books/latin-squares-and-their-applications/keedwell/978-0-444-63555-6)
20. [A massively parallel evolutionary algorithm for the partial Latin square extension problem, Computers & Operations Research](https://www.sciencedirect.com/science/article/pii/S030505482300148X)
21. [Combinatorial Designs and Cellular Automata: A Survey, Discrete Applied Mathematics (2025)](https://www.sciencedirect.com/science/article/pii/S0166218X25005761)
22. [Combinatorial Methods for Trust and Assurance, CSRC](https://csrc.nist.gov/projects/automated-combinatorial-testing-for-software/combinatorial-methods-in-testing/interactions-involved-in-software-failures)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › General discrete mathematics and discrete structures › Combinatorics › Combinatorial design theory

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/latin-square

English original: https://www.edgepedia.org/latin-square
