LiberLai
LiberLai
  • Threads: 2
  • Posts: 3
Joined: Jul 9, 2012
July 9th, 2012 at 1:29:18 AM permalink
ODD: The last digit from the total sum of the 20 numbered balls drawn resulting to an odd number.
EVEN: The last digit from the total sum of the 20 numbered balls drawn resulting to an even number.

I guess the probability is not 50%-50%.

But them both odds 1.95.

what are the house edges then?
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6679
Joined: Jun 22, 2011
July 9th, 2012 at 7:22:31 AM permalink
Anybody have a calculator that can do bignum calculations of combinations?

Let C(a,b) be the number of combinations of a elements taken b at a time.
If you color the even numbers red and the odd numbers blue, then, if you draw an odd number of blue balls (and, since the total number of balls drawn is even, an odd number of red balls), then the sum is odd (since the sum of an odd number of odd numbers is odd, the sum of any number of even numbers is even, and odd + even = odd), and if you draw an even number of blue balls, the sum is even.
The probability that the sum is odd is:
( C(40,1) C(40,19) + C(40,3) C(40,17) + C(40,5) C(40,15) + C(40,7) C(40,13) + C(40,9) C(40,11) + C(40,11) C(40,9) + C(40,13) C(40,7) + C(40,15) C(40,5) + C(40,17) C(40,3) + C(40,19) C(40,1) ) / C(80,20)

Since the first five terms of the numerator are the same as the last five terms, this becomes:
2 ( C(40,1) C(40,19) + C(40,3) C(40,17) + C(40,5) C(40,15) + C(40,7) C(40,13) + C(40,9) C(40,11) ) / C(80,20)

Both Excel and my calculator, while lacking exact precision, come up with even being very slightly more likely than odd, but not by enough to make the house edge noticeably less than 2.5% either way.

Bonus math lesson: if, instead of 20 out of 80, it is 2 out of 2N (where there are N even numbers and N odd numbers), the probability of one being odd and the other being even (the only way the sum can be odd) is N2 / ( 2N (2N-1) / 2 ), which is N / (2N - 1), which is always > 1/2 for N > 0 (since 1/2 = (N - 1/2) / (2N - 1) < N / (2N - 1)), but it approaches 1/2 as N approaches infinity.
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27040
Joined: Oct 14, 2009
July 9th, 2012 at 8:24:58 AM permalink
Quote: LiberLai

I guess the probability is not 50%-50%.



The odds barely favor the evens. Here is the probability for each number of 0 to 20 evens.


Evens Combinations Probability
0 137,846,528,820 0.000000039
1 5,251,296,336,000 0.000001485
2 88,436,604,204,000 0.000025015
3 876,675,902,544,001 0.000247977
4 5,744,053,569,793,500 0.001624764
5 26,468,598,849,608,400 0.007486911
6 89,077,015,359,259,200 0.025196337
7 224,342,112,756,653,000 0.063457440
8 429,655,207,020,554,000 0.121532330
9 632,136,396,535,987,000 0.178806186
10 718,528,370,729,238,000 0.203243032
11 632,136,396,535,987,000 0.178806186
12 429,655,207,020,554,000 0.121532330
13 224,342,112,756,653,000 0.063457440
14 89,077,015,359,259,200 0.025196337
15 26,468,598,849,608,400 0.007486911
16 5,744,053,569,793,500 0.001624764
17 876,675,902,544,001 0.000247977
18 88,436,604,204,000 0.000025015
19 5,251,296,336,000 0.000001485
20 137,846,528,820 0.000000039
Total 3,535,316,142,212,170,000 1.000000000


Here it for just the evens. Note that if there are an even number of evens the total of all balls will be even. Otherwise it will be odd.

Evens Combinations Probability
0 137,846,528,820 0.00000003899
2 88,436,604,204,000 0.00002501519
4 5,744,053,569,793,500 0.00162476377
6 89,077,015,359,259,200 0.02519633656
8 429,655,207,020,554,000 0.12153232971
10 718,528,370,729,238,000 0.20324303169
12 429,655,207,020,554,000 0.12153232971
14 89,077,015,359,259,200 0.02519633656
16 5,744,053,569,793,500 0.00162476377
18 88,436,604,204,000 0.00002501519
20 137,846,528,820 0.00000003899
Total 1,767,658,071,529,920,000 0.50000000012


What is interesting is that if just two balls were drawn the odds would favor an odd total with a probability of 40/79=50.63%.

The question for the reader is at what point do the odds start favoring an even total, and can you show this by any method other than brute force?
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6679
Joined: Jun 22, 2011
July 9th, 2012 at 9:23:20 AM permalink
Quote: Wizard

The question for the reader is at what point do the odds start favoring an even total, and can you show this by any method other than brute force?


Either I am doing something wrong, or the answer oscillates between odd and even.

For 4 numbers, 1 even has 395,200 combinations, as does 3 evens, so the probability of an odd total is 790,400 out of 1,581,580, which is 0.49975341.

For 6 numbers, 1 even has 26,320,320 combinations, as does 5 evens, and 3 evens 97,614,400 combinations, for an odd total probability of 150,255,040 out of 300,600,200, which is 0.50001644.

Of course, if all 80 numbers are drawn, the sum is always even.
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27040
Joined: Oct 14, 2009
July 9th, 2012 at 9:39:41 AM permalink
Quote: ThatDonGuy

Either I am doing something wrong, or the answer oscillates between odd and even.



You seem to be right. Here are my probabilities of an even total by number of balls drawn.

Balls Probability
2 0.49367088608
4 0.50024658885
6 0.49998356074
8 0.50000157637
10 0.49999980018
12 0.50000003186
14 0.49999999382
16 0.50000000143
18 0.49999999962
20 0.50000000012


For an odd number of balls the odds are exactly 50%.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6679
Joined: Jun 22, 2011
July 9th, 2012 at 10:38:41 AM permalink
Quote: Wizard

For an odd number of balls the odds are exactly 50%.


If there are an odd number of balls, the sets of drawn balls can be put into pairs, where ball N is replaced with ball N+1 if N is odd and with ball N-1 if N is even. (For example, (7, 16, 30) is paired with (8, 15, 29).) In each pair, one has an even number of odd-numbered balls, so the sum is even, and the other has an odd number of odd-numbered balls, so the sum is odd.
  • Jump to: