Re: Distribution and probability



In article <1140399129.657590.103190@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Alun <al.lpool@xxxxxxxxxxxxxxxx> wrote:

[...]
assuming a game of toss-a-coin. The rules are that there
are a maximum of ten spins, I call heads on each toss of the coin, and
if I am ahead at any time then I win. Otherwise I lose.

As such it strikes me that I can win 1-0, 2-1,3-2,4-3 or 5-4 (I can't
win 2-0, say, because if I win the first toss then thats it, game over,
I've won).

Or I can lose by the game going to full term.

So my question is effectively, what are my chances of winning this
game. And why?

There are slicker ways to do this that are more adaptable to
larger games but this one is small enough to work out by hand.

First note the tenth flip is pointless: you can't win then if you haven't
already won. More generally, parity considerations can reduce the size
of the problem for you.

On the first flip, you could win if you get heads; that happens in
half of all games. Keep that in mind, but from here on out assume you
flipped tails the first time. So you're already behind and have to
catch up and pull ahead.

After that, consider all _pairs_ of flips; four patterns will occur
equally often -- HH, HT, TH, and TT. In the middle two cases there's
a cancelling out -- you end up just as far behind as you were before
you flipped the pair. In the first case you pull ahead by 2 heads,
and in the last case you fall further behind. The nice thing about
this analysis is you have only four pairs to flip before the game is over.

Moreover, there are only a few interesting outcomes to keep track of
after the next pair of flips. You're already 1 flip in the hole, and
your running total will change by an even number with each pair of
coin tosses. If at some point you pull ahead, the game is over. If
you stay 1 behind, or drop to 3 behind, you can continue. If ever you
get to 5 behind, you might as well quit because you can never get ahead
within the 10-flip limit.

So you can draw a little picture showing the possible states after
pairs of flips:

-> win -> win -> win -> win
/ / / /
-1 ---> -1 ---> -1 ---> -1 ---> -1
\ X X X
-> -3 ---> -3 ---> -3 ---> -3
\ \ \
->lose ->lose ->lose

The X's are supposed to represent crossed arrows. You should draw this
out on paper.

Now you can label each arrow by the probability that it occurs. You
have a 25% chance of getting each of the possible pairs, giving you
a 1/4 chance of moving higher, a 1/4 chance of moving lower, and a
1/2 chance of moving straight across. Use these probabilities to
compute the chances of having one running-total or another after
1,2,3,or 4 pairs of flips. Don't forget that you start off in the
initial "-1" state only half of the time because the other half
of the time you flipped H your very first time out.

So in the next column we compute the probabilities of winning as
(1/2)*(1/4); of being still at -1 as (1/2)*(1/2); and of being
at -3 as (1/2)*(1/4).

The next column is a little trickier: you move from "-1" to "win"
with overall probability (1/4)*(1/4), from "-1" to "-1" in
(1/4)*(1/2) of all games, and from "-1" to "-3" in (1/4)*(1/4) of
all games. But the X in the picture remind us that you
can also end up at state "-1" by climbing up from state "-3",
and the transition occurs in (1/8)*(1/4) of all games. So when
you combine the two paths that lead to this "-1", you see that
you will get there in 1/8 + 1/32 = 5/32 of all games.

In this way you can scribble in the probabilities of arriving at each
of the states shown (all the "-1"s and "-3"s and "win"s and "lose"s).
Fortunately for you, all you want is the probabilities of winning,
so some of the numbers don't have to be computed at all. I just did
this by hand and got these probabilities:

-> 1/8 ->1/16 ->5/128 -> 7/256
/ / / /
1/2---> 1/4 --->5/32 -->7/64 --> ...
\ X X X
-> 1/8 ---> 1/8 --> ... --> ...
\ \ \
-> ... -> ... -> ...

So it looks to me like in 1/8 of all games you will win on the 3rd flip,
in 1/16 of all games you will win on the 5th, in 5/128 of them on the 7th,
and in 7/256 of them on the 9th. Of course you also win in half of all
games right away on your first flip. Grand total then is
1/2 + 1/8 + 1/16 + 5/128 + 7/256 = 193/256,
just over 3/4 of all games played.

This kind of tree-like diagram is really handy for analyzing the
probability of compound events.

A little more high-falutin' is the use of Markov chains. With each
pair of coin flips here you are moving from one of the four interesting
states ("-1", "-3", "win", "lose") to another, each time with the
same probability. They're useful in other contexts; look 'em up!

dave
.



Relevant Pages

  • Re: Flipping a HEP
    ... flip it right out of the shop- why wouldn't someone just send their ... through the doors of HEP, there is no more 'low' in the equation. ... and the other reputable pin restorers have customers but it is a much ... own games from time to time- not sure why you are looking to play the ...
    (rec.games.pinball)
  • Re: Sys 80 questions
    ... When I put it in the machine and flip the power on there ... - yes this is the normal startup process - a host delay, then a click-click from the game over relay and all the displays come to life. ... Call 872-5757 or Fax 872-2010 (Pinballs, Jukes, Video Games) ...
    (rec.games.pinball)
  • Re: Is there a known algorithm to solve this "playoff ranking" problem?
    ... a set of n teams playing a fixed set of pairwise games (with ... probabilities of each team winning at a certain percentage), ... winning enough games to get to the 6th spot. ... of the 2 win team winning all its remaining games, ...
    (comp.theory)
  • Re: Have you ever hid your games from overactive kids?
    ... hit the ball farther if you let the bat go all the way back. ... I'll also have a few small crates of different sizes for smaller kids. ... certain games kids get more than others too. ... I LOVE the "flip, flip, flip, ...
    (rec.games.pinball)
  • Re: Is there a known algorithm to solve this "playoff ranking" problem?
    ... a set of n teams playing a fixed set of pairwise games (with ... probabilities of each team winning at a certain percentage), ... winning enough games to get to the 6th spot. ... of the 2 win team winning all its remaining games, ...
    (comp.theory)