Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ ¹ ² ³ °
 

You are not logged in.
Post a replyTopic review (newest first)
And the third approach which always work: Code:take a Latin Square randomly exchange two columns or two rows in it repeat several times This would generate almost random Latin Square, but it would be isomorphic to the original, so not a really random.
Here is another approach: Code:for each Row make a String of all numbers make a random permutation of the String attempt to apply the randomized String to a Row if there is a conflict with some of previously filled rows  make a new permutation and repeat applying process next Row It looks like this algorithm works always, for example if we filled two first rows with 1234 and 4123, then there is no way to put in the third row a string with "2.1." pattern.
Here is one promising algorithm which does not work: Code:for each Number for each Row take a random Column with an empty cell in the Row check that all cells above it do not contain Number if this column already occupied by this Number  find a new Column and repeat. once nonoccupied row is found write Number in the cell next Row next Number Problem here is that in some cases this algorithm can stuck: Code:12.. .12. 2.1. ...1 Any ideas why this promising algorithm fails and how to improve it to prevent blocks like this?
For the purpose of number puzzles like Sudoku or KenKen first we need to generate a randomized Latin Square. Code:1234 2341 3412 4321 are obviously no good. 