Talk:Random Latin squares: Difference between revisions

no edit summary
(function/routine/procedure/method must be capable of producing all solutions)
No edit summary
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:
<pre>
 
0 1 2 3 4
1 2 3 4 0
Line 6:
3 4 0 1 2
4 0 1 2 3
</pre>
 
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==
2,172

edits