Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: (off topic) Is my math right?

Author: Angrim

Date: 09:36:51 08/09/03

Go up one level in this thread


On August 08, 2003 at 15:38:59, George Tsavdaris wrote:

>On August 08, 2003 at 13:42:57, Angrim wrote:
>
<snip>
>>out of 10000000 trials, 17 scored 70
>>out of 10000000 trials, 6 scored 71
>>out of 10000000 trials, 2 scored 72
>>out of 10000000 trials, 1 scored 74
>>
>What the: 50 51 52 ... 74  means?   Is it 50% 51%... score for appearance
>of heads or something else?
>As last weak i've started learning programming, can you copy your code
>for this program, it's too difficult for me to imagine how to do it.

Each trial consisted of 100 simulated coin flips, the "score" is
how many turned up heads.  I am currently on vacation and don't have
the code with me, so typing from memory. The basic outline is

array[100] filled with 0,
for counter=1 to 10000000
{
  total=0;
  for count2=1 to 100
    if(flip()==heads) total++;
  array[total]++
}
for count=50 to 100
  if(array[count]>0)
   print "out of 10000000 trials, " array[count] " scored " count

Angrim



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.