1

Here is a coin flipping problem I thought of (this problem represents the correlated, dynamic and accelerated rates of failure in machines, e.g. each coin represents an engine - when engines in a machine fail, the overall health of the machine worsens and the remaining engines have to work harder and fail faster - thus resulting in accelerated failure of the other engines and overall machine, conditional on previous events).

In this coin flipping game:

  • Suppose there are 5 coins (coin1, coin2, coin3,coin4, coin5). Each coin has a p=0.5 of heads at turn=1.

  • When a coin is tails for the first time, we permanently stopping flipping it (i.e. the coin is eliminated)

  • Each turn, the probability of all remaining coin getting heads decreases by 0.01.

  • At the start of each turn, we see how many coins have been eliminated. If all 5 coins have not been eliminated, the probability of each coin getting heads decreases by 0.01. However, if $n$ coins have been eliminated, the probability of getting heads for each non-eliminated coin decreases by $+( 0.01 * n)$ each turn thereon, until another coin is eliminated. After that, the probabilities are again updated (i..e decrease further)

  • The game ends when all coins have seen 1 head .

I wrote an R simulation for this problem:

num_coins <- 5
prob_decrease <- 0.01
prob_heads <- rep(0.5, num_coins)
coins <- rep("Heads", num_coins)
results <- list()
turn <- 0

while(any(coins == "Heads")) { turn <- turn + 1 num_eliminated <- sum(coins == "Eliminated") for (i in 1:num_coins) { if (coins[i] == "Heads") { coins[i] <- ifelse(runif(1) < prob_heads[i], "Heads", "Eliminated") prob_heads[i] <- ifelse(coins[i] == "Heads", prob_heads[i] - prob_decrease * (num_eliminated + 1), 0) } } results[[turn]] <- data.frame(turn = turn, as.list(c(coins, prob_heads)), stringsAsFactors = FALSE) names(results[[turn]]) <- c("turn", paste0("coin_", 1:num_coins), paste0("p_heads_coin", 1:num_coins)) } results_df <- do.call(rbind, results)

The results look like this:

  turn     coin_1     coin_2     coin_3     coin_4     coin_5 p_heads_coin1 p_heads_coin2 p_heads_coin3 p_heads_coin4 p_heads_coin5
    1 Eliminated      Heads      Heads Eliminated      Heads             0          0.49          0.49             0          0.49
    2 Eliminated Eliminated Eliminated Eliminated      Heads             0             0             0             0          0.46
    3 Eliminated Eliminated Eliminated Eliminated      Heads             0             0             0             0          0.41
    4 Eliminated Eliminated Eliminated Eliminated      Heads             0             0             0             0          0.36
    5 Eliminated Eliminated Eliminated Eliminated      Heads             0             0             0             0          0.31
    6 Eliminated Eliminated Eliminated Eliminated      Heads             0             0             0             0          0.26
    7 Eliminated Eliminated Eliminated Eliminated Eliminated             0             0             0             0             0

I am interested in solving these types of general problems:

  • Suppose we start the game at turn=0. What is the expected number of turns it will take for this game to end? Is it possible to analytically derive a probability distribution for the number of turns required for this game to end?

  • If we are the $n^{th}$ turn - without any further available information, what is the expected number of coins remaining? How many more turns will the game be expected to last?

  • Suppose we have coins $k_1, k_2$ remaining - without any further available information, what is the expected number of coins remaining? What turn are we most likely on? What are the probabilities associated with coins $k_1, k_2$ at this turn?

In general, for some current game - given some set of information about the number of remaining coins OR the current turn of the game OR the probabilities of the number of remaining coins (i.e. current state of the game) : How much information can we infer about different properties of the current game? Probabilistically - given some information about the current state of the game: can we determine the most likely sequence of events that lead us to this current state (e.g. recursion)?

I know I can run multiple simulations of different game and see how many turns for each game to end, and the number of coins remaining at each turn for each game:

enter image description here

But can these types of questions be answered theoretically?

For $K = 0, 1, ... k$ coins, I tried to mathematically represent the state of this game at time = $T$ (conditional on the past):

  • State of the game at time T: The state of the game at time T as $S_T$, a vector representing the state of each coin at time T:

$$S_T = (s_{T1}, s_{T2}, ..., s_{Tk})$$ where $s_{Ti}$ is the state of coin i at time T (either "Heads" or "Eliminated").

  • Number of remaining coins at time T: The number of remaining coins at time T can be represented as;

$$N_T = \sum_{i=1}^{k} I(s_{Ti} = \text{"Heads"})$$

where $I(\cdot)$ is indicator function that equals 1 if the condition is true and 0 otherwise.

  • Probability of coin i being Heads at time T: The probability of coin i being Heads at time T, given that it has not been eliminated at all times less than T:

$$P(s_{Ti} = \text{"Heads"} | s_{ti} \neq \text{"Eliminated"} \, \forall t < T) = p_{Ti}$$ where $p_{Ti}$ is the probability of coin i being Heads at time $T$.

Conclusion: I think an Infinite State, Non-Homogenous Markov Chain might be applicable here (e.g. Discrete Time Birth Death Process) - but I am not sure how to define and analyze it.

Can someone please help me with this?

konofoso
  • 681
  • Generally speaking, nice solutions only come when the conditions are very symmetric. With your changing probability of heads I am sure simulation will be the only reasonable approach. As you have stated the rules the odds are greater than $\frac {31}{32}$ that the game will never end because any coin that is tails on the first flip is never flipped again and will therefore never show a head. – Ross Millikan Jun 02 '24 at 03:37
  • @ Ross Millikan: thank you for your comments! I am just interested in the following point: Is it ever possible to prove that a specific probability/stochastic process question can ONLY be solved using simulation? – konofoso Jun 02 '24 at 03:39
  • That is a wildly different question from what you had before. If that is what you are interested in you should ask it. Because we have computers available we are much less willing to spend time with pencil and paper. In theory, anything a computer can do can also be done by hand with pencil and paper. Note that over 700 digits of $\pi$ were calculated long before computers. You need to define (or rely on the tastes of your responders) how much calculation is possible by hand. Whatever limit that is, there are certainly some problems beyond it. – Ross Millikan Jun 02 '24 at 03:45
  • @ Ross Millikan: my apologies, I am not very articulate at communicating myself and dont have a solid grasp on these topics. Basically, as a child, I always used to be interested in imagining these coin flipping games in my home country (we were all low income and entertainment for us would involve taking coins and inventing new strategy coin flipping games) ... as I got older, I always wondered if some of these games could be solved using math, or if some of these games were fundamentally impossible to solve. My apologies - and once again, thank you for your comments! :) – konofoso Jun 02 '24 at 03:59
  • Clarification requested: in the 5 initial bullet points that you use to present the question, it looks like the 3rd and 4th bullet points contradict each other. Perhaps I am mistaken. Anyway, please clarify the situation. – user2661923 Jun 02 '24 at 04:22
  • Generally you can make a Markov chain from the game description. Those can be quite complicated to calculate by hand because they involve inverting large matrices. There is no line that divides what you can do by hand from what you cannot, so there is no answer to your question. What kind of answer are you looking for? I think we should close this one and you should think clearly about what to ask. – Ross Millikan Jun 02 '24 at 04:37
  • Going forward, with this posted question and your future posted questions, it is generally not a good idea to post computer code in your question. MathSE reviewers will generally not attempt to analyze such code for mistakes, so the code becomes meaningless clutter. If you are concerned that you might have made an analytical mistake in your code, you could consider posting Pseudocode instead. However, I would not advise it, unless your specific question is something like "is line 9 in my Pseudocode valid ?" ...see next comment – user2661923 Jun 02 '24 at 08:06
  • This implies that you are not asking anything else in the question, since there is generally only one question that should be asked per posting. Further, asking a question like "is all of my Pseudocode completely valid" is also frowned upon. It isn't really reasonable to expect a MathSE reviewer to attempt to analyze your Pseudocode line by line. – user2661923 Jun 02 '24 at 08:10
  • @ user2661923:thank you for your reply! I made changes in the bullets to clarify your points – konofoso Jun 02 '24 at 15:49
  • @ Ross Millikan: I am just confused on how to create and analyze Markov Chains with infinite state space – konofoso Jun 02 '24 at 15:50
  • @ user2661923: thank you for your comments - I am not asking anyone to review to my computer code. I just want my questions to be reproducible in case someone wants to use this in the future. I can remove all computer code (e.g. host the code on some file sharing website like Dropbox, and post a link to the code) – konofoso Jun 02 '24 at 15:51

0 Answers0