Abt. KAR-85: Statistischer Nachweis der obigen Lösung
==================================
Code
WindowTitle "KAR-85 Statistisch"
windowstyle 24:font 2:randomize
declare s&,n&, i&,j&,k&,l&
Nochma:
cls $a0a0a0
print "\n KAR-84: 1 Mio Zufallsexperimente gestartet ..."
n&=0:s&=0
whileloop 1000000
inc n&
case rnd()<.00015:WindowTitle format$("###.### %",100*s&/n&)
i&=rnd(3)+1
j&=rnd(3)+1
k&=rnd(3)+1
l&=rnd(3)+1
if (i&+j&)=4:inc s&:continue:endif
if (i&+j&+k&)=4:inc s&:continue:endif
if (i&+j&+k&+l&)=4:inc s&:continue:endif
endwhile
CLS $00FFFF
print "\n\n ";s&;"/";n&;" =~ ";format$("###.## %",100*s&/n&),
print "gegenüber theoretisch",format$("###.## %",100*37/81)
beep
waitinput 10000
Goto "Nochma"
Alles anzeigen