E
E
Elick2022-02-06 19:52:10
Probability theory
Elick, 2022-02-06 19:52:10

How to win by tossing a coin, knowing that the coin can be skewed, but not knowing which one and in which direction?

Asked the theoretical question of the game of tossing a coin.
The essence of the game is probably already clear to everyone. Let's say we have a set of different coins, we can distinguish each of them. We come to the organizer of the game, he gives us to choose a coin. To simplify, we can only bet on heads, and the organizer gives the odds for winning always only 2 (ie, in the case of heads, we double).
Suppose we know that coins can quite possibly be magnetized, asymmetrical, etc., i.e. the probabilities can significantly deviate from 50/50 in one direction, but we do not know for which coin and in which direction.
How to understand how to determine the probability that a certain coin will be "curve" (let's say heads falls more often, i.e. betting on this coin constantly, we will get a positive mathematical expectation), if we have a history of N flips for a coin?

UPD: We have training attempts to toss each coin, how to find the probability that the coin is skewed?

from scipy.stats import beta
import pandas as pd
import numpy as np

p = 0.6

monet = pd.DataFrame([np.random.binomial(1,p) for i in range(100)])[0]
print(f'Выборочная вероятность орла: {monet.mean()}')

a = monet.sum() 
b = len(monet) - monet.sum()
apost = beta(a,b)
x = np.linspace(0,1,10000)

fig, ax = plt.subplots(figsize=(18,10)) 
mean = apost.mean()
std = apost.std()
ax.plot(x, apost.pdf(x), linewidth=2)
ax.grid()
ax.fill_between([mean - 3*std, mean + 3*std], 0, apost.pdf(x).max(), alpha = 0.3)
ax.fill_between([mean - 2*std, mean + 2*std], 0, apost.pdf(x).max(), alpha = 0.3)
ax.fill_between([mean - std, mean + std], 0, apost.pdf(x).max(), alpha = 0.3)
plt.xlim([mean - 4*std,mean + 4*std])
ax.vlines(1/2, 0, apost.pdf(x).max(), color = 'r', linewidth=2) 
ax.vlines(monet.mean(), 0, apost.pdf(x).max(), color = 'black', linewidth=2)


62010ae75a345138292106.png

I wrote some python code here that builds a beta distribution for a 100 coin toss experiment with a 60% chance of coming up on side 1 (heads). The shaded areas are 1,2,3 sigma (in fact, confidence intervals with certain probabilities, I don’t remember exactly which ones). The red line is essentially the organizer's probability, if he always gives a coefficient of 2, the black one is the selective probability (~ 63% with a true one of 60%).
In fact, if we take the area to the right of the red line, then we will measure the probability that the probability of getting heads is more than 50%, right? And in general, how correct is this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hint000, 2022-02-07
@hint000

To simplify, we can only bet on heads
This is not a simplification, but a complication. Maybe all coins fall tails more often, then your chances of winning in a short series of tosses will be small, and in a long series they will tend to zero.
If you do not set such a restriction, then you can offer the simplest strategy: to bet on the side that fell out in the last throw.
A more complicated strategy is to fix an odd N before the start of the game, and after N tosses, calculate the next bet as a fashion over N previous tosses (or a rounded moving average , the essence is the same). In the particular case N=1, we have the simplest strategy mentioned above.

M
Michael, 2022-02-07
@Akela_wolf

This is already a statistic. You take a sample for each coin, calculate the "chi-square" , you get an answer with a given level of confidence: is it by chance that it falls like this or there is a deviation from a uniform distribution. If there is a deviation, then look in which direction the sample gives you a bias. Actually, you need to bet on this side, doubling each time you lose.
For example: with a probability of 60% heads, 40% tails. I put the ruble on the eagle. Lost. I bet 2 rubles. Lost. I bet 4 rubles. Lost. I bet 8 rubles. Won. Total profit 1 ruble. Since the probability of getting heads is greater, the player will end up winning more than losing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question