Verify distribution uniformity/Naive: Difference between revisions

Content deleted Content added
m Simplified
Line 788: Line 788:
dice7()={
dice7()={
my(t);
my(t);
while((t=dice5()*5+dice5()) > 21,);
while((t=dice5()*5+dice5()) > 26,);
(t+2)\3
t\3-1
};
};


Line 815: Line 815:
test(()->if(random(1000),random(1000),1), 10^5)</lang>
test(()->if(random(1000),random(1000),1), 10^5)</lang>
Output:
Output:
<pre>Flat with significance 1.000000000000000000
<pre>Flat with significance 0.2931867820813680387842134664085280183


### user error: Not flat enough, significance only 5.391077606003910233 E-3500006</pre>
### user error: Not flat enough, significance only 5.391077606003910233 E-3500006</pre>