hamsterofdeath2
New member
- Joined
- Apr 30, 2018
- Messages
- 9
expected value of "optimized coin flips": i pick a coin randomly and flip it over...
i have 4 coins, 2 heads, 2 tails.
the game goes as follows:
1. i pick a coin randomly and flip it over
2. i may remove as many tails coins as i wish
3. repeat steps 1,2,3 until there are only heads or tails left
i want to maximize the number of heads that remain at the end.
in order to determine which is the best strategy, my naive approach was to just go through the options since there aren't many.
after the first flip, i can have
1 heads + 3 tails
or
3 heads + 1 tails
let's look at the second case first.
i can either remove the tails coin and end the game with 3 heads, or i can leave it in the game and hope for 4/0.
if i leave things as they are, the next situation i end up in could be 2/2 again.
this leads to end endless recursion, meaning my calculation will never finish.
how can i calculate what the expected number of heads is in this scenario despite that?
(edited here because apparently i need a moderator to approve responses but not to edit my original post that i didn't need approval for
)
for clarification:
i have 4 coins flipped like this at the beginning: HHTT
another description of same problem (but on a larger scale) is this: https://projecteuler.net/problem=339
i'm trying to solve it. my algorithm is "done", but it never ends, and that means i never get a result. if i have a solution for a simple case, i can generalize it and solve the problem even for 2*10000 sheep, which is my goal.
i found a "solution" here:
https://math.stackexchange.com/questions/2759753/the-mabinogion-sheep-problem
and the same at some other sites, but they all don't work in real life because they contain endless recursions.
my math knowledge isn't sufficient to solve this, so i asked here. either there is a way to somehow turn the calculation into a finite one or there is an alternative approach to the entire problem.
i have 4 coins, 2 heads, 2 tails.
the game goes as follows:
1. i pick a coin randomly and flip it over
2. i may remove as many tails coins as i wish
3. repeat steps 1,2,3 until there are only heads or tails left
i want to maximize the number of heads that remain at the end.
in order to determine which is the best strategy, my naive approach was to just go through the options since there aren't many.
after the first flip, i can have
1 heads + 3 tails
or
3 heads + 1 tails
let's look at the second case first.
i can either remove the tails coin and end the game with 3 heads, or i can leave it in the game and hope for 4/0.
if i leave things as they are, the next situation i end up in could be 2/2 again.
this leads to end endless recursion, meaning my calculation will never finish.
how can i calculate what the expected number of heads is in this scenario despite that?
(edited here because apparently i need a moderator to approve responses but not to edit my original post that i didn't need approval for
)
for clarification:
i have 4 coins flipped like this at the beginning: HHTT
another description of same problem (but on a larger scale) is this: https://projecteuler.net/problem=339
i'm trying to solve it. my algorithm is "done", but it never ends, and that means i never get a result. if i have a solution for a simple case, i can generalize it and solve the problem even for 2*10000 sheep, which is my goal.
i found a "solution" here:
https://math.stackexchange.com/questions/2759753/the-mabinogion-sheep-problem
and the same at some other sites, but they all don't work in real life because they contain endless recursions.
my math knowledge isn't sufficient to solve this, so i asked here. either there is a way to somehow turn the calculation into a finite one or there is an alternative approach to the entire problem.
Last edited: