<?xml version="1.0" encoding="windows-1252"?>
<node id="1001232" title="Re^3: Send x% of the users to A, the rest to B" created="2012-10-27 17:02:37" updated="2012-10-27 17:02:37">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;Interesting to see that ... it takes a few dozen iterations to actually reach middle ground:&lt;/i&gt;&lt;/blockquote&gt;
&lt;p&gt;That is the nature of randomness. If it was exactly 50:50, it wouldn't be random. 

&lt;p&gt;But the more trials you run, the closer it will tend. This is more evident if you run this version with various different resets:&lt;code&gt;
C:\test&gt;perl 
-E"{++$t;$r=`perl -E\"say rand()\"`;$r&lt;.5?++$a:++$b; printf qq[\r%.3f : %.3f], $a*100/$t, $b*100/$t; $t&gt;$ARGV[0] and say and $t=$a=$b=0; redo}" 10
45.455 : 54.545
27.273 : 72.727
36.364 : 63.636
54.545 : 45.455
72.727 : 27.273
63.636 : 36.364
36.364 : 63.636
45.455 : 54.545
27.273 : 72.727
36.364 : 63.636
72.727 : 27.273
45.455 : 54.545
54.545 : 45.455
63.636 : 36.364

C:\test&gt;perl 
-E"{++$t;$r=`perl -E\"say rand()\"`;$r&lt;.5?++$a:++$b; printf qq[\r%.3f : %.3f], $a*100/$t, $b*100/$t; $t&gt;$ARGV[0] and say and $t=$a=$b=0; redo}" 100
52.475 : 47.525
52.475 : 47.525
52.475 : 47.525
46.535 : 53.465
45.545 : 54.455
51.485 : 48.515
41.584 : 58.416
46.535 : 53.465
42.574 : 57.426
40.594 : 59.406

C:\test&gt;perl 
-E"{++$t;$r=`perl -E\"say rand()\"`;$r&lt;.5?++$a:++$b; printf qq[\r%.3f : %.3f], $a*100/$t, $b*100/$t; $t&gt;$ARGV[0] and say and $t=$a=$b=0; redo}" 1000
49.750 : 50.250
51.349 : 48.651
48.651 : 51.349
53.047 : 46.953
&lt;/code&gt;


&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;p align=right&gt; [http://thebottomline.cpaaustralia.com.au/|RIP Neil Armstrong]&lt;/p&gt;&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;
</field>
<field name="root_node">
1001034</field>
<field name="parent_node">
1001227</field>
</data>
</node>
