Talk:Random Latin squares: Difference between revisions

function/routine/procedure/method must be capable of producing all solutions
(function/routine/procedure/method must be capable of producing all solutions)
Line 1:
I think the task description needs to require and demonstrate that the algorithm must be capable of producing all valid latin squares of size n. As it stands starting from a valid latin square, which is easy to generate say:
 
0 1 2 3 4
1 2 3 4 0
2 3 4 0 1
3 4 0 1 2
4 0 1 2 3
 
there are 5! ways to arrange the columns and 5! ways to arrange the rows each of which is a valid random latin square. From the task description I see no reason why this would not be a valid solution as the task stands. I have added a reference to A002860 which is the number of latin squares of size n. For n>4 this simple solution produces random valid latin squares but can not produce all solutions. Nor does the Python algorithm which is just obfuscation which reduces to the above.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 18:38, 10 June 2019 (UTC)
==Python Algorithm==
I got the mention of Latin squares from a stack-overflow question and a [https://www.academia.edu/29890346/Comparison_of_Seven_Techniques_for_Generating_Random_Latin_Squares link] to some solution methods that I did not read (and so did not add to the task as a reference).
2,172

edits