Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Generate a matrix from a list such that no row or column contains the same element twice
ResourceFunction["LatinSquare"][n] generates an n×n matrix containing the numbers 1 to n such that no row or column contains the same element twice. | |
ResourceFunction["LatinSquare"][list] generates a Latin square using the elements of list. |
Generate Latin squares containing the numerals 1 through 4:
In[1]:= | ![]() |
Out[1]= | ![]() |
Generate Latin squares containing strings:
In[2]:= | ![]() |
Out[2]= | ![]() |
Reduced-form Latin squares are Latin squares where the first row and first column are sorted in order:
In[3]:= | ![]() |
Out[3]= | ![]() |
The basis set for a Latin square cannot contain duplicate elements:
In[4]:= | ![]() |
Out[4]= | ![]() |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License