Latin Squares
Mathematical precision meets visual harmony through orthogonal latin square solutions.

Concept
See the numbers.
Graeco-latin squares transforms complex mathematical solutions into striking visual art.This project solves mutually orthogonal latin squares (MOLS) of any dimension and depth, then renders them as concentric colored squares—creating mesmerizing patterns that blend mathematical precision with aesthetic beauty.
Specs.
Technical Details
The visualization engine uses D3.js for data-driven document manipulation and webGL for high-performance rendering of complex mathematical patterns.
Key mathematical concepts implemented include:
- Latin square generation using finite field operations
- Euler's construction for pairs of orthogonal latin squares
- Macneish's theorem for constructing MOLS
- Connections to projective planes and error-correcting codes
Theory
Latin Squares: Mathematical Theory and Examples
A Latin square of order n is an n×n array filled with n different symbols, where each symbol appears exactly once in each row and exactly once in each column. This concept was named after Leonhard Euler, who used Latin characters as symbols in his studies.
Mathematically, a Latin square of order n is an n×n matrix L = (Lij) where:
- Each cell contains one symbol from a set S of n distinct symbols
- Each symbol occurs exactly once in each row
- Each symbol occurs exactly once in each column
Latin Squares of Higher Depth
The concept of Latin squares can be extended to multiple dimensions or "depths":
Latin Squares (Depth 1)
This is the standard Latin square as described above. Here's a simple example of a 3×3 Latin square:
Copy
1 2 3
2 3 1
3 1 2
In this square, each of the symbols 1, 2, and 3 appears exactly once in each row and exactly once in each column.
Graeco-Latin Squares (Depth 2)
A Graeco-Latin square (also called an orthogonal Latin square or a Latin square of depth 2) consists of two superimposed Latin squares where each ordered pair of symbols appears exactly once.
If we have two Latin squares A and B of order n, they are orthogonal if, when superimposed, each ordered pair (Aij, Bij) appears exactly once in the resulting array.
Example of a Latin Square of Depth 2
Here's a simple 3×3 Graeco-Latin square:
First Latin square (using numbers 1,2,3):
Copy
1 2 3
2 3 1
3 1 2
Second Latin square (using letters A,B,C):
Copy
A B C
C A B
B C A
When superimposed, we get:
Copy
(1,A) (2,B) (3,C)
(2,C) (3,A) (1,B)
(3,B) (1,C) (2,A)
Each ordered pair (number, letter) appears exactly once in this array, making it a valid Graeco-Latin square.
Latin Squares of Higher Depths
Latin squares can be extended beyond depth 2. A Latin square of depth k consists of k superimposed Latin squares where each k-tuple of symbols appears exactly once.
Applications
Latin squares have important applications in:
Experimental Design
- Used to control multiple sources of variability in experiments
- Higher depth Latin squares allow controlling for more factors
Combinatorial Mathematics
- Central objects in design theory
- Related to finite projective planes and finite geometries
Computing and Information Theory
- Error-correcting codes
- Cryptographic algorithms
Recreational Mathematics
- Sudoku puzzles (9×9 Latin squares, depth 1, with additional constraints).
- Various other mathematical puzzles
Mathematical Significance
The existence of orthogonal Latin squares relates to important conjectures in mathematics. Notably, Euler conjectured that orthogonal Latin squares of order n exist for all n except n=2 and n=6, which was proven correct over 100 years later.