Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
AutransValence, seemingly in agreement with this conclusion.
partz=matrix(1,n,n) partz[,1:(n/3)]=2;partz[((n/2)+1):n,((n/3)+1):n]=3 #counting adjacent units of same colour nood=hood=matrix(4,n,n) for (v in 1:n2) hood[v]=bourz(v,partz) minz=el=sum(4-hood) for (t in 1:T){ colz=sample(1:3,2) #picks colours a=sample((1:n2)[(partz==colz[1])&(hood<4)],1) b=sample((1:n2)[(partz==colz[2])&(hood<4)],1) partt=partz;partt[b]=colz[1];partt[a]=colz[2] #collection of squares impacted by switch nood=hood voiz=unique(c(a,a-1,a+1,a+n,a-n,b-1,b,b+1,b+n,b-n)) voiz=voiz[(voiz>0)&(voiz<n2)] for (v in voiz) nood[v]=bourz(v,partt) if (nood[a]*nood[b]>0){ difz=sum(nood)-sum(hood) if (log(runif(1))<difz^3/(n^3)*(1+log(10*rep*t)^3)){ el=el-difz;partz=partt;hood=nood if (el<minz){ minz=el;cool=partz} }}}
(where bourz computes the number of neighbours), which produces completely random patterns at high temperatures (low t) and which returns to the T configuration (more or less):
Filed under: Kids, pictures, R, Statistics Tagged: Autrans, Luxembourg, mathematical puzzle, Palais Ducal, R, random walk, simulated annealing, The Riddler, Vercors
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.