• #### (1 Extra coin) --- (2 dice, 3 dice)

From henhanna@gmail.com@21:1/5 to All on Sat Oct 1 14:33:04 2022
(via CotPi) 2012 --------- (One) Extra coin -------- Akio has one more coin than Bansi. They throw all of their coins and count the number of heads. If all the coins are fair, what is the probability that Akio obtains more

omg... this is a Great Problem!

___________________________________

------ pls wait 3+ days (Longer if you find it easy or trivial) before posting answers or hints to the following.

i throw 2 dice, (let P = Product of the numbers i get)
What is the probability that...
--- P is a multiple of 5 ?
--- P is a multiple of 10 ?

(the same thing with 3 dice)

--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
• From duncan smith@21:1/5 to henh...@gmail.com on Sun Oct 2 17:10:47 2022
On 01/10/2022 22:33, henh...@gmail.com wrote:

(via CotPi) 2012 --------- (One) Extra coin -------- Akio has one more coin than Bansi. They throw all of their coins and count the number of heads. If all the coins are fair, what is the probability that Akio obtains

omg... this is a Great Problem!

[snip]

Spoiler space
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

1/2

Assume the first coin thrown by Akio is a head. Then the probability
that Akio throws more heads than Bansi is the probability, P, that Akio
throws at least as many heads as Bansi in the remaining n throws each.

Assume the first coin thrown by Akio is a tail. Then the probability
that Akio throws more heads than Bansi is the probability that Bansi
does not throw at least as many heads as Akio in the remaining n throws
each. As the coins are fair this equals 1-P.

1/2 * P + 1/2 * (1-P) = 1/2

A little Python to illustrate,

import random

def sim(n, its):
tot = 0
for _ in range(its):
A = bin(random.getrandbits(n+1)).count('1')
B = bin(random.getrandbits(n)).count('1')
tot += A > B

sim(1, 1000000)
0.500135
sim(40, 1000000)
0.499144

Duncan

--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
• From henhanna@gmail.com@21:1/5 to duncan smith on Sun Oct 2 16:08:25 2022
On Sunday, October 2, 2022 at 9:10:50 AM UTC-7, duncan smith wrote:
On 01/10/2022 22:33, henh...@gmail.com wrote:

(via CotPi) 2012 --------- (One) Extra coin -------- Akio has one more coin than Bansi. They throw all of their coins and count the number of heads. If all the coins are fair, what is the probability that Akio obtains more heads than Bansi?

omg... this is a Great Problem!

[snip]

Spoiler space
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

1/2

Assume the first coin thrown by Akio is a head. Then the probability
that Akio throws more heads than Bansi is the probability, P, that Akio throws at least as many heads as Bansi in the remaining n throws each.

Assume the first coin thrown by Akio is a tail. Then the probability
that Akio throws more heads than Bansi is the probability that Bansi
does not throw at least as many heads as Akio in the remaining n throws
each. As the coins are fair this equals 1-P.

1/2 * P + 1/2 * (1-P) = 1/2

A little Python to illustrate,

import random

def sim(n, its):
tot = 0
for _ in range(its):
A = bin(random.getrandbits(n+1)).count('1')
B = bin(random.getrandbits(n)).count('1')
tot += A > B

sim(1, 1000000)
0.500135
sim(40, 1000000)
0.499144

Duncan

(does [its] stand for something ?)

thanks.... i 'll study your Proof later....
----------------- ( i 'd never seen getrandbits before.)

for 3-sided and 6-sided Dice, i wonder if there's a similar invariant.

-------------- waht if Akio had to beat B by a margin of 1 ?

def dice(N, Sides, simN):
tot = 0
for _ in range(simN):
A,B= 0,0
for __ in range(N+1): A += random.randrange(Sides)
for ___ in range(N): B += random.randrange(Sides)
# tot += A > B
tot += A-1 > B

Nsim=100000
for n in range(1,11): print('\t', "(2-sided)", n, ": ", dice(n, 2, Nsim))
print()
for n in range(1,11): print('\t', "(3-sided)", n, ": ", dice(n, 3, Nsim))
print()
for n in range(1,11): print('\t', "(6-sided)", n, ": ", dice(n, 6, Nsim))

--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
• From Jonathan Dushoff@21:1/5 to duncan smith on Mon Oct 3 09:13:38 2022
On Sunday, October 2, 2022 at 12:10:50 PM UTC-4, duncan smith wrote:
On 01/10/2022 22:33, henh...@gmail.com wrote:

(via CotPi) 2012 --------- (One) Extra coin -------- Akio has one more coin than Bansi. They throw all of their coins and count the number of heads. If all the coins are fair, what is the probability that Akio obtains more heads than Bansi?

Nice. Here is another argument (below the space)

Spoiler space
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

1/2

Just flip all of Bansi's coins and ask whether the majority of coins now show heads. This is the same as the answer to the original question (if a=b, then a+(n-b)=n); and the probability is clearly 1/2 (the majority must be either heads or tails, and the
post-flip distribution is just as random as the pre-flip).

Jonathan

--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
• From duncan smith@21:1/5 to henh...@gmail.com on Mon Oct 3 17:19:21 2022
On 03/10/2022 00:08, henh...@gmail.com wrote:
On Sunday, October 2, 2022 at 9:10:50 AM UTC-7, duncan smith wrote:
On 01/10/2022 22:33, henh...@gmail.com wrote:

(via CotPi) 2012 --------- (One) Extra coin -------- Akio has one more coin than Bansi. They throw all of their coins and count the number of heads. If all the coins are fair, what is the probability that Akio obtains more heads than Bansi?

omg... this is a Great Problem!

[snip]

Spoiler space
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

1/2

Assume the first coin thrown by Akio is a head. Then the probability
that Akio throws more heads than Bansi is the probability, P, that Akio
throws at least as many heads as Bansi in the remaining n throws each.

Assume the first coin thrown by Akio is a tail. Then the probability
that Akio throws more heads than Bansi is the probability that Bansi
does not throw at least as many heads as Akio in the remaining n throws
each. As the coins are fair this equals 1-P.

1/2 * P + 1/2 * (1-P) = 1/2

A little Python to illustrate,

import random

def sim(n, its):
tot = 0
for _ in range(its):
A = bin(random.getrandbits(n+1)).count('1')
B = bin(random.getrandbits(n)).count('1')
tot += A > B

sim(1, 1000000)
0.500135
sim(40, 1000000)
0.499144

Duncan

(does [its] stand for something ?)

Iterations.

thanks.... i 'll study your Proof later....
----------------- ( i 'd never seen getrandbits before.)

for 3-sided and 6-sided Dice, i wonder if there's a similar invariant.

-------------- waht if Akio had to beat B by a margin of 1 ?

def dice(N, Sides, simN):
tot = 0
for _ in range(simN):
A,B= 0,0
for __ in range(N+1): A += random.randrange(Sides)
for ___ in range(N): B += random.randrange(Sides)
# tot += A > B
tot += A-1 > B

Nsim=100000
for n in range(1,11): print('\t', "(2-sided)", n, ": ", dice(n, 2, Nsim))
print()
for n in range(1,11): print('\t', "(3-sided)", n, ": ", dice(n, 3, Nsim))
print()
for n in range(1,11): print('\t', "(6-sided)", n, ": ", dice(n, 6, Nsim))

The original question is set up so that things cancel out nicely. There
are two possible outcomes for Akio's extra coin throw, and the relevant probabilities conditional on those outcomes involve a probability P that subsequently cancels.

Looking at your code for the dice example it appears that you're
interested in the sum of the throws (and for dice numbered starting at
zero). So there are six possible outcomes (for the six sided die) which
are equiprobable. So the answer is,

1/6 * P(A_sum > B_sum) +
1/6 * P(A_sum -1 > B_sum) +
1/6 * P(A_sum -2 > B_sum) +
1/6 * P(A_sum -3 > B_sum) +
1/6 * P(A_sum -4 > B_sum) +
1/6 * P(A_sum -5 > B_sum)

where the probabilities are for the sums over N dice rolls.

I don't see any obvious simplifications (apart from with a 2-sided die).

Duncan

--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
• From Gareth Taylor@21:1/5 to duncan@invalid.invalid on Mon Oct 3 23:18:13 2022
duncan smith <duncan@invalid.invalid> wrote:
On 01/10/2022 22:33, henh...@gmail.com wrote:

(via CotPi) 2012 --------- (One) Extra
coin -------- Akio has one more coin than Bansi. They throw all of
their coins and count the number of heads. If all the coins are fair,
what is the probability that Akio obtains more heads than Bansi?

omg... this is a Great Problem!

[snip]

Spoiler space
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

1/2

Assume the first coin thrown by Akio is a head. Then the probability
that Akio throws more heads than Bansi is the probability, P, that Akio throws at least as many heads as Bansi in the remaining n throws each.

Assume the first coin thrown by Akio is a tail. Then the probability
that Akio throws more heads than Bansi is the probability that Bansi
does not throw at least as many heads as Akio in the remaining n throws
each. As the coins are fair this equals 1-P.

1/2 * P + 1/2 * (1-P) = 1/2

We can omit P. By symmetry, the probability A wins on heads equals the probability A wins on tails. And A must win on one because a tie is impossible. So both probabilities are 1/2.

Gareth

--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)