Is this obvious, or am I cool?
Moderator: Jon O'Neill
Is this obvious, or am I cool?
Everybody seems to come to me at work with mathsy stuff, even though I'm not really that maths-educated (fell out with the subject at A-Level).
Anyway, they wanted to know what advantage it gave you if you were taking turns to toss a coin until someone got a head, if you went first. They said they couldn't figure it out accurately as they couldn't work out how to neatly sum it all, as they were getting an infinite series (half, plus half^3, plus half^5 and so on)
I realised that, if p is your probability of winning the game overall, you can self-reference the value in your formula thus:
p = 0.5 (winning on your first go)
+ 0.5 (not winning on your first go) * 0.5 (them not winning on their first go) * p (as you're back where you started, so it must be the same value).
This then solves as p = 2/3.
(And of course, you can change both the 0.5's, so for example if you want to play the same game shooting hoops with someone who scores 80% of the time while you score 60%, it becomes p = 0.6 + (0.4 * 0.2 * p) which solves to p = 0.652174.)
I've done loads of probability puzzles, I did Maths with stats at A-Level, and I don't ever recall seeing anything like this. Have I just discovered something amazing? Or was it so obvious that it didn't need saying and I'm a retard for not realising it sooner?
Anyway, they wanted to know what advantage it gave you if you were taking turns to toss a coin until someone got a head, if you went first. They said they couldn't figure it out accurately as they couldn't work out how to neatly sum it all, as they were getting an infinite series (half, plus half^3, plus half^5 and so on)
I realised that, if p is your probability of winning the game overall, you can self-reference the value in your formula thus:
p = 0.5 (winning on your first go)
+ 0.5 (not winning on your first go) * 0.5 (them not winning on their first go) * p (as you're back where you started, so it must be the same value).
This then solves as p = 2/3.
(And of course, you can change both the 0.5's, so for example if you want to play the same game shooting hoops with someone who scores 80% of the time while you score 60%, it becomes p = 0.6 + (0.4 * 0.2 * p) which solves to p = 0.652174.)
I've done loads of probability puzzles, I did Maths with stats at A-Level, and I don't ever recall seeing anything like this. Have I just discovered something amazing? Or was it so obvious that it didn't need saying and I'm a retard for not realising it sooner?
- Michael Wallace
- Racoonteur
- Posts: 5458
- Joined: Mon Jan 21, 2008 5:01 am
- Location: London
Re: Is this obvious, or am I cool?
This reminds me of one of the early examples they tend to give in courses on Markov Chains. The basic idea of a Markov Chain is that where you move next depends only on where you are at the moment, so in this example if you being the tosser is state A, them being the tosser is state B, you winning is state Aw and them winning is state Bw then in state A you move to state B with probability 0.5 and to state Aw with probability 0.5, and similarly for when you're in state B.
Basically, a lot of it ended up just being a seemingly really complicated way of explaining stuff you could do from first principles/intuition pretty easily (it's why I liked the course at least), and one of the things it does it make it more obvious how to construct these probability equations about your chances of ending up in a particular state, or how long it takes to get there, or whatever.
Dunno if that made any sense, but there you go.
Edit: Oh, and I'd say it's pretty cool to work that out just off the top of your head - you'd probably get a few marks in second year Cambridge Tripos exams for it, at any rate.
Basically, a lot of it ended up just being a seemingly really complicated way of explaining stuff you could do from first principles/intuition pretty easily (it's why I liked the course at least), and one of the things it does it make it more obvious how to construct these probability equations about your chances of ending up in a particular state, or how long it takes to get there, or whatever.
Dunno if that made any sense, but there you go.
Edit: Oh, and I'd say it's pretty cool to work that out just off the top of your head - you'd probably get a few marks in second year Cambridge Tripos exams for it, at any rate.
Re: Is this obvious, or am I cool?
I have heard of Markov chains, but only in a very simple example where it was picking a letter at random from a book, and examining how likely it was to be vowel or consonant, and then how that changed if you were allowed to see whether the previous letter was a vowel or consonant (and then seeing the previous two letters, etc)
Anyway, it didn't contain anything like what I wrote above.
Anyway, it didn't contain anything like what I wrote above.
- Charlie Reams
- Site Admin
- Posts: 9494
- Joined: Fri Jan 11, 2008 2:33 pm
- Location: Cambridge
- Contact:
Re: Is this obvious, or am I cool?
It particularly reminds me of a random walk or the Gambler's Ruin problem (both of which are Markov problems), although it's not identical. But it's still cool to figure this stuff out for yourself.
- Jon O'Neill
- Ginger Ninja
- Posts: 4552
- Joined: Tue Jan 22, 2008 12:45 am
- Location: London, UK
Re: Is this obvious, or am I cool?
You're really cool.
-
- Kiloposter
- Posts: 1786
- Joined: Sat Oct 23, 2010 3:21 pm
- Location: Dublin
Re: Is this obvious, or am I cool?
I don't understand most of that. I did go on a random walk once though, tossing a coin to decide which way I should go.Charlie Reams wrote:It particularly reminds me of a random walk or the Gambler's Ruin problem (both of which are Markov problems), although it's not identical. But it's still cool to figure this stuff out for yourself.
Re: Is this obvious, or am I cool?
I knew it. Fucking get in.Jon O'Neill wrote:You're really cool.
Re: Is this obvious, or am I cool?
I'll get the dictionary.Charlie Reams wrote:random walk
A random walk, sometimes denoted RW, is a mathematical formalisation of a trajectory that consists of taking successive random steps. For example, the path traced by a molecule as it travels in a liquid or a gas, the search path of a foraging animal, the price of a fluctuating stock and the financial status of a gambler can all be modeled as random walks. The term random walk was first introduced by Karl Pearson in 1905. Random walks have been used in many fields: ecology, economics, psychology, computer science, physics, chemistry, and biology. Random walks explain the observed behaviors of processes in these fields, and thus serve as a fundamental model for the recorded stochastic activity.
-
- Post-apocalypse
- Posts: 13329
- Joined: Mon Jan 21, 2008 10:37 pm
Re: Is this obvious, or am I cool?
When I saw that, I had to think for a bit about your * p at the end, but I also saw that it was still obviously 2/3 anyway because if you look at the infinite sum, their figure is always half your figure.Jon Corby wrote:p = 0.5 (winning on your first go)
+ 0.5 (not winning on your first go) * 0.5 (them not winning on their first go) * p (as you're back where you started, so it must be the same value).
This then solves as p = 2/3.
For you it would be 1/2 + 1/8 + 1/32 etc.
For them it would be 1/4 + 1/16 + 1/64 etc.
(You're cool.)
Re: Is this obvious, or am I cool?
Yeah I guess, but it would still work in some other turn-based game where there's like five of you, and all with differing probabilities of success on a single turn, where the sums aren't so apparent.
- Steve Balog
- Acolyte
- Posts: 168
- Joined: Fri Apr 15, 2011 12:18 am
- Location: neither here nor there
Re: Is this obvious, or am I cool?
The way I'm thinking of it (I might be wrong):
Let's say there's three people in this game. Player one wins with probability X. Player 2 wins with probablity 0 1/2 the time, and probability 1/2(X) the other half, because he essentially becomes player 1 if player 1 fails. Then player 3 has a 1/2*1/2*X chance, as he needs two flips to become player 1.
So, X + 1/2X + 1/4X = 1, and X = 4/7. player 1 wins 4/7, player two 2/7, player 3 1/7.
For 4 players, it becomes 8/15, 4/15, 2/15, 1/15 by the same logic, etc.
For a game with n players, it's 2^(n-1)/((2^n)-1), 2^(n-2)/((2^n)-1), 2^(n-3)/((2^n)-1), ... , 1/((2^n)-1).
For a non-fair coin, just replace 1/2 with a different p. Like, for the three people problem, player 2 has a .8X chance, and player 3 a .64X chance, so X + .8X + .64X = 1, and X = ~.409836.
EDIT: yea this is for all intents and purposes a Markov chain, or something
Let's say there's three people in this game. Player one wins with probability X. Player 2 wins with probablity 0 1/2 the time, and probability 1/2(X) the other half, because he essentially becomes player 1 if player 1 fails. Then player 3 has a 1/2*1/2*X chance, as he needs two flips to become player 1.
So, X + 1/2X + 1/4X = 1, and X = 4/7. player 1 wins 4/7, player two 2/7, player 3 1/7.
For 4 players, it becomes 8/15, 4/15, 2/15, 1/15 by the same logic, etc.
For a game with n players, it's 2^(n-1)/((2^n)-1), 2^(n-2)/((2^n)-1), 2^(n-3)/((2^n)-1), ... , 1/((2^n)-1).
For a non-fair coin, just replace 1/2 with a different p. Like, for the three people problem, player 2 has a .8X chance, and player 3 a .64X chance, so X + .8X + .64X = 1, and X = ~.409836.
EDIT: yea this is for all intents and purposes a Markov chain, or something
There are no such things as methods. Only madness.
Re: Is this obvious, or am I cool?
Yeah, I see what you did there Steve. That's a very nice way of solving it too. Maths is cool.
(ETA that you can't use it though if each player has a different chance of success on an individual turn, can you?)
(ETA that you can't use it though if each player has a different chance of success on an individual turn, can you?)
- Steve Balog
- Acolyte
- Posts: 168
- Joined: Fri Apr 15, 2011 12:18 am
- Location: neither here nor there
Re: Is this obvious, or am I cool?
Yea, that assumes that the state merely "shifts" if a player fails on a given turn; that is, the probability is the same for each person.
It wouldn't work if, for example, you wanted to change the probability of winning for each person so that each player has an equal chance of winning. I think you can use Markov chains for that, but not the generalised method from the last post. I'll think about that one.
It wouldn't work if, for example, you wanted to change the probability of winning for each person so that each player has an equal chance of winning. I think you can use Markov chains for that, but not the generalised method from the last post. I'll think about that one.
There are no such things as methods. Only madness.
- Jon O'Neill
- Ginger Ninja
- Posts: 4552
- Joined: Tue Jan 22, 2008 12:45 am
- Location: London, UK
Re: Is this obvious, or am I cool?
If it's a fair coin it's either heads or tails so your chances are 50/50.
- Charlie Reams
- Site Admin
- Posts: 9494
- Joined: Fri Jan 11, 2008 2:33 pm
- Location: Cambridge
- Contact:
Re: Is this obvious, or am I cool?
I don't think that has a solution anyway.Steve Balog wrote:It wouldn't work if, for example, you wanted to change the probability of winning for each person so that each player has an equal chance of winning.
-
- Post-apocalypse
- Posts: 13329
- Joined: Mon Jan 21, 2008 10:37 pm
Re: Is this obvious, or am I cool?
What, as in one person always has a probability of x on their go and one person always has a probabaility of y and you want to make it so that they have the same chance of winning overall? What about 0.5 and 1?Charlie Reams wrote:I don't think that has a solution anyway.Steve Balog wrote:It wouldn't work if, for example, you wanted to change the probability of winning for each person so that each player has an equal chance of winning.
Edit - 1/4 and 1/3?
Edit - 1/n and 1/(n-1)?
- Charlie Reams
- Site Admin
- Posts: 9494
- Joined: Fri Jan 11, 2008 2:33 pm
- Location: Cambridge
- Contact:
Re: Is this obvious, or am I cool?
Oh right, I was talking about the x=y case. (This thread has way too many tl;drs so I should probably just shush.)Gavin Chipper wrote:What, as in one person always has a probability of x on their go and one person always has a probabaility of y and you want to make it so that they have the same chance of winning overall? What about 0.5 and 1?Charlie Reams wrote:I don't think that has a solution anyway.Steve Balog wrote:It wouldn't work if, for example, you wanted to change the probability of winning for each person so that each player has an equal chance of winning.
Edit - 1/4 and 1/3?
Edit - 1/n and 1/(n-1)?
-
- Post-apocalypse
- Posts: 13329
- Joined: Mon Jan 21, 2008 10:37 pm
Re: Is this obvious, or am I cool?
Oh OK. For my example, I think you can extend it to multiple players with 1/n, 1/(n-1), 1/(n-2) etc.Charlie Reams wrote:Oh right, I was talking about the x=y case. (This thread has way too many tl;drs so I should probably just shush.)Gavin Chipper wrote:What, as in one person always has a probability of x on their go and one person always has a probabaility of y and you want to make it so that they have the same chance of winning overall? What about 0.5 and 1?Charlie Reams wrote: I don't think that has a solution anyway.
Edit - 1/4 and 1/3?
Edit - 1/n and 1/(n-1)?
Re: Is this obvious, or am I cool?
Well, replying to the title of this thread, you are Not cool so...yeah, let's just call it obvious. You're a retard. Lol.Jon Corby wrote:Have I just discovered something amazing? Or was it so obvious that it didn't need saying and I'm a retard for not realising it sooner?
TBH I have no idea WTH you were on about but you are still not cool!
One Direction are my life. <3
"The reason for life is to find out who you are"
"It always seems impossible until it's done"
Love loads of celebs to be honest... Might marry Nicky Maccy
"The reason for life is to find out who you are"
"It always seems impossible until it's done"
Love loads of celebs to be honest... Might marry Nicky Maccy