## Poll

 I'm stumped too. 2 votes (16.66%) This is easy, Wiz. 3 votes (25%) Just accept the simulation and move on. 2 votes (16.66%) I have some ideas, let me work on it. 3 votes (25%) I don't understand the question No votes (0%) How do I convert HEIC files to JPEG? 1 vote (8.33%) I recommend the International Car Forest 1 vote (8.33%) When are you going to analyze River Hold 'Em? 1 vote (8.33%) Total eclipse reminder 04/08/2024 4 votes (33.33%) I liked the Big Bang Theory ending. 2 votes (16.66%)

12 members have voted

Wizard
Joined: Oct 14, 2009
• Posts: 24900
May 21st, 2019 at 2:29:50 PM permalink
I didn't get very far with the code above. My C++ compiler didn't like this statement and I don't understand what it is supposed to:

typedef uint64_t num_t;

However, I can't ask anyone to teach me a new computer language. I was half finished doing it this way anyway, so will try to complete it with my own code.

“Extraordinary claims require extraordinary evidence.” -- Carl Sagan
ThatDonGuy
Joined: Jun 22, 2011
• Posts: 5542
May 21st, 2019 at 3:43:53 PM permalink
Quote: ThatDonGuy

I think I sort of do.
The formula is the product of:
1 + x y
1 + x y2
1 + x y3
1 + x y4
...
1 + x y79
1 + x y80

If you draw 20 particular balls, multiply the product of the left sides of the terms of the balls you did not draw and the right sides of the balls you did draw together; you will get x20 and ysum of the numbers.
To determine how many times 20 balls add up to some number N, count the number of times x20 yN is such a product.

How to get such a count without having to go through all 280 products, I don't know, and presumably, that's why things like Mathematica exist.

HOUSE LIGHTBULB MOMENT - this may be similar to ZPP's solution

Instead of treating those as 80 different sums, do the products from top to bottom - i.e.
Multiply that by (1 + x y3)
Multiply that result by (1 + x y4)
and so on through (1 + x y80)

This can be done with an array, where each row is one of the y exponents (from 0 to 1410) and each column is one of the x exponents (from 0 to 20)
Cell (a, b) is the current number of times xa yb appears in the solution so far
Start with all cells 0, except for 1s in (0,0) and (1,1); this is 1 + xy
Each step multiplies the existing value by x yn n for some n from 1 to 80, then adding it to the existing result. This is done by making a copy of the array, shifting it one column to the right and n rows down, and adding those values to the existing values.
Once all 80 steps are done, cell (20, N) will contain the number of combinations of 20 balls that add up to N.
This took 1/2 second to calculate in C#.
rsactuary
Joined: Sep 6, 2014
• Posts: 2103
May 21st, 2019 at 6:36:32 PM permalink
In your WOO post, you don't define rain, cloud, lightning, fire and sprout.

I find it odd that small vs big has a different payout, given the symmetrical distribution. Any sense as to why they might do that?
Wizard
Joined: Oct 14, 2009
• Posts: 24900
May 21st, 2019 at 7:19:41 PM permalink
Quote: rsactuary

In your WOO post, you don't define rain, cloud, lightning, fire and sprout.

I find it odd that small vs big has a different payout, given the symmetrical distribution. Any sense as to why they might do that?

Good catches, thanks. The big had a typo in the win. I just added a description of the ranges covered by the bets you asked about.

For everyone else, here is my new page on the game with the prop bets on the total off all balls: Blitz Bingo.
“Extraordinary claims require extraordinary evidence.” -- Carl Sagan
7craps
Joined: Jan 23, 2010
• Posts: 1977
May 21st, 2019 at 7:36:37 PM permalink
Quote: Wizard

For everyone else, here is my new page on the game with the prop bets on the total off all balls: Blitz Bingo.

3,535,316,142,212,170,000
should be
3,535,316,142,212,174,320
Combin(80,20) on Wolfram Alpha
winsome johnny (not Win some johnny)
DogHand
Joined: Sep 24, 2011
• Posts: 792
May 21st, 2019 at 8:37:45 PM permalink
Wizard,

Rule 5 has a typo on the payout for Big: it says 1.91, but on your EV table you have 1.95.

Dog Hand
Wizard
Joined: Oct 14, 2009
• Posts: 24900
May 21st, 2019 at 9:15:09 PM permalink
I'm happy to report my program worked and it runs in under a second. I'll include the code here, not that anyone will care.

#include <iostream>
#include <stdlib.h>
using namespace std;

void fast(void);

__int64 a[81][21][1601];

int main(void)
{
int i;
fast();
cerr << "Enter any number\t";
cin >> i;
return 1;
}

void fast(void)
{
int k,m,n,t;

for (k=0; k<=80; k++) // lowest available ball
{
for (m=0; m<=20; m++)
{
for (n=0; n<=1600; n++)
a[k][m][n]=0;
}
}
for (k=20; k<=80; k++)
{
for (m=k; m<=80; m++) // 20th ball
a[k][20][m]=1;
}
for (k=19; k<=79; k++) // lowest available ball
{
for (m=k; m<=79; m++) // 19th ball
{
for (t=0; t<=80; t++)
{
a[k][19][m+t]+=a[m+1][20][t];
}
}
}
for (k=18; k<=78; k++) // lowest available ball
{
for (m=k; m<=78; m++) // 18th ball
{
for (t=0; t<=160; t++)
{
a[k][18][m+t]+=a[m+1][19][t];
}
}
}
int level;
for (level=17; level>=1; level--)
{
for (k=level; k<=60+level; k++) // lowest available ball
{
for (m=k; m<=60+level; m++) // level-th ball
{
for (t=0; t<=1410; t++)
{
a[k][level][m+t]+=a[m+1][level+1][t];
}
}
}
}

printf("Raw totals\n");
for (n=0; n<=1410; n++)
{
if (a[1][1][n]>0)
printf("%i\t%I64i\n",n,a[1][1][n]);
}

printf("formatted totals\n");
for (n=0; n<=1410; n++)
{
if (a[1][1][n]>0)
printf("<tr><td>%i</td><td>%I64i</td></tr>\n",n,a[1][1][n]);
}
return;
}

I'd like to thank all who participated! This a great example of why I love this forum. I hope others have learned something as well.

Quote: 7craps

Quote: Wizard

For everyone else, here is my new page on the game with the prop bets on the total off all balls: Blitz Bingo.

3,535,316,142,212,170,000
should be
3,535,316,142,212,174,320
Combin(80,20) on Wolfram Alpha

Damn Microsoft! Excel allows for only so many significant digits (usually 15). I wish I had a dollar for every time I've had similar corrections.

Quote: DogHand

Wizard,

Rule 5 has a typo on the payout for Big: it says 1.91, but on your EV table you have 1.95.

Dog Hand

Thanks, got it.
“Extraordinary claims require extraordinary evidence.” -- Carl Sagan
Ace2

Joined: Oct 2, 2017
• Posts: 2095
May 22nd, 2019 at 12:17:04 AM permalink
Quote: Wizard

I get the theory about finding the generating function, but to actually do it would be the equal amount of work as just cycling through all combin(80,20) balls by brute force.
.

Exactly. This is why I’ve never spent much time studying generating functions.

I prefer slick, formulaic solutions and would be much more impressed by an estimate accurate within .1% to an exact solution that was so voluminous that it required programming.

You can probably just use the expectation (810) and standard deviation (90) to get decent estimates for values within 2 or 3 SDs of expectation.
Last edited by: Ace2 on May 22, 2019
It’s all about making that GTA
ZPP
Joined: Feb 7, 2010
• Posts: 31
May 22nd, 2019 at 1:17:58 AM permalink
Quote: Wizard

I didn't get very far with the code above. My C++ compiler didn't like this statement and I don't understand what it is supposed to:

typedef uint64_t num_t;

However, I can't ask anyone to teach me a new computer language. I was half finished doing it this way anyway, so will try to complete it with my own code.

You're welcome.
The typedef defines num_t as uint64_t. The point is that (80 choose 20) is near the limit of 64-bit int, so if I want to switch to double, for larger values, I only have to change that one typedef (and the printfs). Also, if I wanted to use an old version of MSVC that doesn't support uint64_t, I would only have to change the one typedef (and the printfs) to usigned __int64... :)

Quote: Wizard

Damn Microsoft! Excel allows for only so many significant digits (usually 15).

I'm pretty sure Excel is just using "double" for everything internally.
Wizard
Joined: Oct 14, 2009
• Posts: 24900
May 22nd, 2019 at 6:25:48 AM permalink
Somehow I think there is an elegant pattern to this problem somewhere. Some variant of Pascal's Triangle. However, if it were easy to find, I'm sure somebody would have by now.
“Extraordinary claims require extraordinary evidence.” -- Carl Sagan