BBO Discussion Forums: BBO's random number generator - BBO Discussion Forums

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

BBO's random number generator

#21 User is offline   barmar 

  • PipPipPipPipPipPipPipPipPipPipPipPip
  • Group: Admin
  • Posts: 21,600
  • Joined: 2004-August-21
  • Gender:Male

Posted 2019-March-16, 10:45

View Posthrothgar, on 2019-March-16, 10:43, said:

If your dataset include both the private tables and best hand tournaments (and you can't differentiate between the two) then any comparison between E/W and N/S is pretty much meaningless

I can differentiate between MBC tables and tournaments, but I can't easily distinguish BH tournaments from non-BH tournaments.

#22 User is online   hrothgar 

  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 15,495
  • Joined: 2003-February-13
  • Gender:Male
  • Location:Natick, MA
  • Interests:Travel
    Cooking
    Brewing
    Hiking

Posted 2019-March-16, 13:00

View Postbarmar, on 2019-March-16, 10:11, said:

With one batch of 10K hands, I got NS higher 4515 times, average NS HCP = 19.8788. With a different batch, NS higher = 4630, avg = 20.0443.


IGNORE ALL THIS...



Hi Barry,

There is something VERY VERY wrong with those numbers. I'm not sure what's up, but it seems like one of the following must be true

1. There is an error in the code that you are using to scrape stuff
2. The database that you are drawing from is biased in some way (perhaps people are doing training tables with artificially weak hands being dealt to N/S???)
3. Your hand dealer is borked

<In reality, I screwed the pooch>

From what I can tell, you dealt a total of 20,000 hands.

If everything is working right, I'd expect that there would be approximately 10K hands where N/S had more HCP and 10K hands where E/W had more. However, in this case, E/W had more HCP on 10,855 hands. This is REALLY far removed from the expected value.

A binomial distribution has a mean of n*P and a standard deviation of (n*p*(1-p))^.5
When we're looking at 20000 samples with a 50/50 split,

The expected mean is 10,000 with a standard deviation of about 70
your data set is 855 away from the mean, which is roughly a 12 sigma event.

I also set up a very simple sim in R, which came up with the same basic results

sim_length = 20000

counter <- matrix(0, sim_length)

for (i in 1:sim_length){

counter[i] <- sum(rbinom(10000,1,.5))

}

mean(counter)
sd(counter)


[I'd appreciate it if Helene or some such could double check my reasoning]
Alderaan delenda est
0

#23 User is offline   smerriman 

  • PipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 4,049
  • Joined: 2014-March-15
  • Gender:Male

Posted 2019-March-16, 14:52

Barry's numbers are correct and to be expected.

Out of 20000 deals, 1644 are expected to have the HCP split 20-20. N/S should have more 9178 times. In his sample, N/S had more 9145 times. This is less than half a SD away from the mean.
1

#24 User is online   hrothgar 

  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 15,495
  • Joined: 2003-February-13
  • Gender:Male
  • Location:Natick, MA
  • Interests:Travel
    Cooking
    Brewing
    Hiking

Posted 2019-March-16, 15:44

View Postsmerriman, on 2019-March-16, 14:52, said:

Barry's numbers are correct and to be expected.

Out of 20000 deals, 1644 are expected to have the HCP split 20-20. N/S should have more 9178 times. In his sample, N/S had more 9145 times. This is less than half a SD away from the mean.


URK...

Forgot about the damn ties...

Thanks!
Alderaan delenda est
0

#25 User is offline   barmar 

  • PipPipPipPipPipPipPipPipPipPipPipPip
  • Group: Admin
  • Posts: 21,600
  • Joined: 2004-August-21
  • Gender:Male

Posted 2019-March-17, 15:25

View Postsmerriman, on 2019-March-16, 14:52, said:

Barry's numbers are correct and to be expected.

Out of 20000 deals, 1644 are expected to have the HCP split 20-20. N/S should have more 9178 times. In his sample, N/S had more 9145 times. This is less than half a SD away from the mean.

And that's what I got. In the two batches of 10K, I got 852 and 805 ties, so the total is 1652, very close to that.

#26 User is online   hrothgar 

  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 15,495
  • Joined: 2003-February-13
  • Gender:Male
  • Location:Natick, MA
  • Interests:Travel
    Cooking
    Brewing
    Hiking

Posted 2019-March-17, 16:03

View Postbarmar, on 2019-March-17, 15:25, said:

And that's what I got. In the two batches of 10K, I got 852 and 805 ties, so the total is 1652, very close to that.


Was bored (and wanted to convince myself that my brain hadn't turned completely to swiss cheese) so I threw together a new improved R script for HCP simulation

I generated 4000 simulations of 5000 deals, counted how many ties there were, and calculated the mean

The mean was 410.7493 which is also precisely 1644/4


sim_length = 5000

foo <- c(4,4,4,4,3,3,3,3,2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

counter <- matrix(0, 2, sim_length)

counter_two <- matrix(0, 1, 4000)

for (j in 1:4000){

for (i in 1:sim_length){

bar <- sample(foo)

counter[1,i] <- sum(bar[1:26])
counter[2,i] <- sum(bar[27:52])

}

the_same <- ifelse(counter[1,] == counter[2,], 1, 0)
counter_two[j] <- sum(the_same)

}

mean(counter_two)

Alderaan delenda est
0

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users