# sudoku

### simulated annealing for Sudokus [2]

March 16, 2012 |

On Tuesday, Eric Chi and Kenneth Lange arXived a paper on a comparison of numerical techniques for solving sudokus. (The very Kenneth Lange who wrote this fantastic book on numerical analysis.) One of these techniques is the simulated annealing approach I had played with a long while ago.  They seem ... [Read more...]

### Le Monde puzzle [#755?]

January 27, 2012 |

Le Monde puzzle of last weekend was about sudoku-like matrices. Consider an (n,n) matrix containing the integers from 1 to n². The matrix is “friendly” if the set of the sums of the rows is equal to the set of the sum of the columns. Find examples for n=4,5,6. Why ... [Read more...]

### 1500th, 3000th, &tc

January 7, 2012 |

As the ‘Og reached its 1500th post and 3000th comment at exactly the same time, a wee and only mildly interesting Sunday morning foray in what was posted so far and attracted the most attention (using the statistics provided by wordpress). The most visited posts: Title Views Home page 203,727 In{... [Read more...]

### The fun Package: Use R for Fun!

August 16, 2011 |

A couple of days ago we released a package named fun to CRAN, but I did not dare to send an announcement to [email protected] as usual. This package is a collection of some classical computer games (e.g. the Mine sweeper and Five in a row) as well ... [Read more...]

### Surprising sudoku

March 1, 2011 |

__ printSudoku(z) +-------+-------+-------+ |   9   |       | 7   5 | |     6 |       |   9   | | 4 5 3 | 1 7   | 2 8   | +-------+-------+-------+ |     5 |     7 |   6   | | 1   9 | 6 8   |       | |   8   |   3   |     1 | +-------+-------+-------+ | 7   2 | [...] [Read more...]

### Le Monde puzzle [#5]

February 10, 2011 |

Another Sudoku-like puzzle from the weekend edition of Le Monde. The object it starts with is a 9×9 table where each entry is an integer and where neighbours take adjacent values. (Neighbours are defined as north, west, south and east of an entry.) The question is about whether or not it ... [Read more...]

### Le Monde puzzle [52]

December 31, 2010 |

The last puzzle of the year in Le Monde reads as follows (as far as I understand its wording!): Iter(n,x,y) is the function Iter=function(n,x,y){ if (n==1){ output=trunc(y/10)+x*(y%%10) }else{ output=Iter(n-1,x,Iter(1,x,y))} return output } Find the ... [Read more...]

### Le Monde puzzle [42]

October 24, 2010 |

An interesting suduko-like puzzle for this week puzzle in Le Monde thi A 10×10 grid is filled by a random permutation of {0,…,99}. The 4 largest figures in each row are coloured in yellow and the 4 largest values in each column are coloured in red. What is the range of the number of ... [Read more...]

### Random sudokus [p-values]

May 21, 2010 |

I reran the program checking the distribution of the digits over 9 “diagonals” (obtained by acceptable permutations of rows and column) and this test again results in mostly small p-values. Over a million iterations, and the nine (dependent) diagonals, four p-values were below 0.01, three were below 0.1, and two were above (0.21 and 0.42). [...]

### Random [uniform?] sudokus [corrected]

May 19, 2010 |

As the discrepancy [from 1] in the sum of the nine probabilities seemed too blatant to be attributed to numerical error given the problem scale, I went and checked my R code for the probabilities and found a choose(9,3) instead of a choose(6,3) in the last line… The fit between the ...

### Random [uniform?] sudokus

May 19, 2010 |

A longer run of the R code of yesterday with a million sudokus produced the following qqplot. It does look ok but no perfect. Actually, it looks very much like the graph of yesterday, although based on a 100-fold increase in the number of simulations. Now, if I test the ...

### Random sudokus [test]

May 17, 2010 |

Robin Ryder pointed out to me that 3 is indeed the absolute minimum one could observe because of the block constraint (bon sang, mais c’est bien sûr !). The distribution of the series of 3 digits being independent over blocks, the theoretical distribution under uniformity can easily be simulated: #uniform distribution ...

### Sudokus more random than random!

April 18, 2010 |

Darren Wraith pointed out this column about sudokus to me. It analyses the paper by Newton and De Salvo published in the Proceedings of the Royal Academy of Sciences A that I cannot access from home. The discussion contains this absurd sentence “Sudoku matrices are actually more random than randomly-generated ... [Read more...]

### Welcome, Robin!

February 25, 2010 |

Robin Ryder started his new blog with his different solutions to Le Monde puzzle of last Saturday (about the algebraic sum of products…), solutions that are much more elegant than my pedestrian rendering. I particularly like the one based on the Jacobian of a matrix! (Robin is doing a postdoc ... [Read more...]

### Sudoku via simulated annealing

February 22, 2010 |

The Sudoku puzzle in this Sunday edition of Le Monde was horrendously difficult, so after spending one hour with only 4 entries filled, I decided to feed it to the simulated annealing R program I wrote while visiting SAMSI last year. The R program reached the exact (and only) solution in ...