**Xi'an's Og » R**, and kindly contributed to R-bloggers)

**A** longer run of the R code of yesterday with a million sudokus produced the following qqplot.

**I**t 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 adequation with a basic chi-square test (!), the result is highly negative:

> chisq.test(obs,p=pdiag/sum(pdiag)) #numerical error in pdiag

Chi-squared test for given probabilities

data: obs

X-squared = 6978.503, df = 6, p-value < 2.2e-16

(there are seven entries for both *obs* and *pdiag*, hence the six degrees of freedom). So this casts a doubt upon the uniformity of the random generator suggested in the paper by Newton and DeSalvo or rather on my programming abilities, see next post!

Filed under: R, Statistics Tagged: combinatorics, entropy, Kullback, Monte Carlo, simulation, sudoku, uniformity

**leave a comment**for the author, please follow the link and comment on his blog:

**Xi'an's Og » R**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

Twitter CommentRandom [uniform?] sudokus [link to post] #rstats

– Posted using Chat Catcher