Talk:Generate Chess960 starting position: Difference between revisions

m
→‎random starting position: added comments regarding the obvious bias of rook placement random placement.
m (→‎random starting position: added comments regarding the obvious bias of rook placement random placement.)
Line 30:
 
:Gerard, I did a similar test (for Ruby) and it usually generates all 960 poisitions in about 7500 tries. I suspect the REXX code is biased towards rooks on the right side, but I could very well be wrong...--[[User:Steenslag|Steenslag]] ([[User talk:Steenslag|talk]]) 14:20, 12 May 2014 (UTC)
 
:: Yes, the placement is biased to the right because of the requirement (rule) that the king has to be placed between the two rooks, which necessitated (in the REXX code) the shifting of the placement of the 2<sup>nd</sup> rook to be placed at least two positions to the right. &nbsp; I don't know if the addition of more code which would allow the placement of the 2<sup>nd</sup> rook to be also placed two positions the left of the 1<sup>st</sup> rook would provide better randomness of rook placement. I'll be looking into that possibility. &nbsp; Here is a histogram of one million random placements (of both rooks):
<pre>
(1st trial)
file 1=166381 ========================
file 2=166437 ========================
file 3=194882 ============================
file 4=227628 =================================
file 5=269865 =======================================
file 6=324213 ===============================================
file 7=243282 ===================================
file 8=407312 ============================================================
 
(2nd trial)
 
file 1=166404 ========================
file 2=166747 ========================
file 3=194618 ============================
file 4=227543 =================================
file 5=269279 =======================================
file 6=325874 ===============================================
file 7=240176 ===================================
file 8=409359 ============================================================
</pre>
 
-----