Is this obvious, or am I cool?

Discuss anything interesting but not remotely Countdown-related here.

Moderator: Jon O'Neill

Post Reply
User avatar
Jon Corby
Moral Hero
Posts: 8018
Joined: Mon Jan 21, 2008 8:36 am

Is this obvious, or am I cool?

Post by Jon Corby »

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?
User avatar
Michael Wallace
Racoonteur
Posts: 5458
Joined: Mon Jan 21, 2008 5:01 am
Location: London

Re: Is this obvious, or am I cool?

Post by Michael Wallace »

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.
User avatar
Jon Corby
Moral Hero
Posts: 8018
Joined: Mon Jan 21, 2008 8:36 am

Re: Is this obvious, or am I cool?

Post by Jon Corby »

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.
User avatar
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?

Post by Charlie Reams »

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.
User avatar
Jon O'Neill
Ginger Ninja
Posts: 4545
Joined: Tue Jan 22, 2008 12:45 am
Location: London, UK

Re: Is this obvious, or am I cool?

Post by Jon O'Neill »

You're really cool.
Mark James
Kiloposter
Posts: 1771
Joined: Sat Oct 23, 2010 3:21 pm
Location: Dublin

Re: Is this obvious, or am I cool?

Post by Mark James »

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.
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.
User avatar
Jon Corby
Moral Hero
Posts: 8018
Joined: Mon Jan 21, 2008 8:36 am

Re: Is this obvious, or am I cool?

Post by Jon Corby »

Jon O'Neill wrote:You're really cool.
I knew it. Fucking get in.
User avatar
Jon Corby
Moral Hero
Posts: 8018
Joined: Mon Jan 21, 2008 8:36 am

Re: Is this obvious, or am I cool?

Post by Jon Corby »

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.
I'll get the dictionary.
Gavin Chipper
Post-apocalypse
Posts: 13215
Joined: Mon Jan 21, 2008 10:37 pm

Re: Is this obvious, or am I cool?

Post by Gavin Chipper »

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.
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.

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.)
User avatar
Jon Corby
Moral Hero
Posts: 8018
Joined: Mon Jan 21, 2008 8:36 am

Re: Is this obvious, or am I cool?

Post by Jon Corby »

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.
User avatar
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?

Post by Steve Balog »

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
There are no such things as methods. Only madness.
User avatar
Jon Corby
Moral Hero
Posts: 8018
Joined: Mon Jan 21, 2008 8:36 am

Re: Is this obvious, or am I cool?

Post by Jon Corby »

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?)
User avatar
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?

Post by Steve Balog »

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.
There are no such things as methods. Only madness.
User avatar
Jon O'Neill
Ginger Ninja
Posts: 4545
Joined: Tue Jan 22, 2008 12:45 am
Location: London, UK

Re: Is this obvious, or am I cool?

Post by Jon O'Neill »

If it's a fair coin it's either heads or tails so your chances are 50/50.
User avatar
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?

Post by Charlie Reams »

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.
I don't think that has a solution anyway.
Gavin Chipper
Post-apocalypse
Posts: 13215
Joined: Mon Jan 21, 2008 10:37 pm

Re: Is this obvious, or am I cool?

Post by Gavin Chipper »

Charlie Reams wrote:
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.
I don't think that has a solution anyway.
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?

Edit - 1/4 and 1/3?

Edit - 1/n and 1/(n-1)?
User avatar
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?

Post by Charlie Reams »

Gavin Chipper wrote:
Charlie Reams wrote:
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.
I don't think that has a solution anyway.
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?

Edit - 1/4 and 1/3?

Edit - 1/n and 1/(n-1)?
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
Post-apocalypse
Posts: 13215
Joined: Mon Jan 21, 2008 10:37 pm

Re: Is this obvious, or am I cool?

Post by Gavin Chipper »

Charlie Reams wrote:
Gavin Chipper wrote:
Charlie Reams wrote: I don't think that has a solution anyway.
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?

Edit - 1/4 and 1/3?

Edit - 1/n and 1/(n-1)?
Oh right, I was talking about the x=y case. (This thread has way too many tl;drs so I should probably just shush.)
Oh OK. For my example, I think you can extend it to multiple players with 1/n, 1/(n-1), 1/(n-2) etc.
User avatar
Soph K
Devotee
Posts: 679
Joined: Sat Dec 04, 2010 4:20 pm
Location: Lalaland

Re: Is this obvious, or am I cool?

Post by Soph K »

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?
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.









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 :P
Post Reply