Quote:
Originally Posted by pfapfap
Or maybe we just misunderstand the problem, since now he's saying outside bets.
Typo. He meant "inside" bets. The problem is impossible without inside bets since 20 wagers ain't gonna get you back 500 at 2:1.
It ain't rocket science. It's computer science. It's only 3.2 million possibilities.
% cat roulette.c
#include <stdio.h>
main() {
int a,b,c,d,e,sum,tot;
for (a = 0; a < 21; a++ )
for (b = 0; b < 21; b++ )
for (c = 0; c < 21; c++ )
for (d = 0; d < 21; d++ )
for (e = 0; e < 21; e++ ) {
sum = a + b + c + d + e;
tot = 35*a+17*b+8*c+11*d+5*e;
if ( sum == 20 && tot > 495 && tot < 504 )
printf("%d %d %d %d %d %d\n",tot,a,b,c,d,e);
}
}
% gcc -O3 roulette.c
% ./a.out |& sort
496 10 6 0 4 0
496 10 7 0 2 1
496 10 7 2 1 0
496 10 8 0 0 2
496 11 2 0 7 0
496 11 3 0 5 1
496 11 3 2 4 0
496 11 4 0 3 2
496 11 4 2 2 1
496 11 4 4 1 0
496 11 5 0 1 3
496 11 5 2 0 2
496 12 0 0 6 2
496 12 0 2 5 1
496 12 0 4 4 0
496 12 1 0 4 3
496 12 1 2 3 2
496 12 1 4 2 1
496 12 1 6 1 0
496 12 2 0 2 4
496 12 2 2 1 3
496 12 2 4 0 2
496 12 3 0 0 5
496 13 0 0 1 6
496 13 0 2 0 5
496 9 10 0 1 0
499 10 7 1 2 0
499 10 8 1 0 1
499 11 3 1 5 0
499 11 4 1 3 1
499 11 4 3 2 0
499 11 5 1 1 2
499 11 5 3 0 1
499 12 0 1 6 1
499 12 0 3 5 0
499 12 1 1 4 2
499 12 1 3 3 1
499 12 1 5 2 0
499 12 2 1 2 3
499 12 2 3 1 2
499 12 2 5 0 1
499 12 3 1 0 4
499 13 0 1 1 5
499 13 0 3 0 4
502 10 7 0 3 0
502 10 8 0 1 1
502 10 8 2 0 0
502 11 3 0 6 0
502 11 4 0 4 1
502 11 4 2 3 0
502 11 5 0 2 2
502 11 5 2 1 1
502 11 5 4 0 0
502 11 6 0 0 3
502 12 0 0 7 1
502 12 0 2 6 0
502 12 1 0 5 2
502 12 1 2 4 1
502 12 1 4 3 0
502 12 2 0 3 3
502 12 2 2 2 2
502 12 2 4 1 1
502 12 2 6 0 0
502 12 3 0 1 4
502 12 3 2 0 3
502 13 0 0 2 5
502 13 0 2 1 4
502 13 0 4 0 3
502 13 1 0 0 6
502 9 11 0 0 0
Took 0.008 seconds to determine it's not possible.