Wednesday, May 22, 2013

Rat Race, differential odds, and a practical application of binary math

I seem to have a lot of favorite games on The Price is right, and Rat Race is definitely among them.



I often don't like games where perfectly skilled play still presents only a chance of winning (like 1/2 Off), but there's just something about Rat Race.  Maybe it's the fact that perfectly skilled play always guarantees you at least the smallest prize, or maybe it's the thought of this guy in the back of the studio diligently applying neon coats to stock rat racers.



For those of you who don't know the game, it's fairly simple, but also fairly difficult.

Contestants are shown a series of three prizes, escalating in price.  The first prize is under $10, the second is under $100, and the third is under $500.  The contestant must guess the price of these items within a certain tolerance in order to earn bets on rats in the eventual race.

The tolerance is tied (non-linearly) to the level of the prize that they are guessing.  The first prize must be guessed within $1, the second within $10, and the third within $100.

If the first prize is - for example - $7, then the contestant has to guess between $6 and $8.  Since the error bars extend on either side of the price (it's not closest without going over like contestants' row or the showcase), each tolerance is actually only half of the window that the contestant actually gets to cover in terms of range of price.

This also means that completely random guessing (if the prices were completely random, which they're almost certainly not) would give you a 20% chance of guessing the first item, a 20% chance of guessing the second item, and a 40% chance of guessing the third item.  Realistically, a guess of $350 on the third prize covers a huge part of the likely-to-be-used part of the scale ($250-450), but that's a question for a different post.

Guessing these prizes within tolerance is at least somewhat skill based, not withstanding that there might be a slight bias toward random luck if played in a smart fashion.  What happens when you have the rats is where skill departs and luck takes over.

You can see that a flawless run of this game leaves you with three rats in the second half of the game.  That second half is the race itself.

Five rats of different colors (yellow, pink, orange, green, blue) race on an S-shaped track (it's actually $-shaped) that gives them each an equal distance to cover.  Not unlike horse racing, the contestant is trying to pick both the rat that wins as well as those that place.

The game is often played for a car, or something else fairly large.  This is won if the contestant selects as one of their rats the rat that finishes in first place.

Following this are two lesser prizes, one medium prize if the contestant selects the second place rat and one small prize if they select the third place rat.

Like I said, if played correctly (i.e. you guess each prize right and end up with three rats) you will always win something.  Even if you pick the three worst rats you'll still have the 3rd/4th/5th set and win the small prize associated with 3rd place.  How likely is that to happen, though?

Well, we can figure out some odds, but they are dependent on how well the contestant does on the first half of the game.  Let's start with the simplest case - the contestant doesn't guess any of the prizes correctly.

In that case, I bet they get to at least watch the race, but they have no chance of winning.  The outcome is simple:

Zero rats:
100% chance of no prize

The next step up isn't much harder - if the contestant guesses one prize correct and gets to select one rat.

One rat:
20% chance of large prize
20% chance of medium prize
20% chance of small prize
40% chance of no prize

Even if the contestant only gets one prize right, the odds are still in their favor - there's a 60% chance of winning something.

Now, we could keep working this out by hand, but there's a much more fun way to do it.  That way is through using binary math.

If you're not familiar with binary, you may never have gotten the joke that there are 10 types of people in the world, those who understand binary and those who don't.  Worry no more - you'll know all you need by the end of this post.

The number system that most of us are most familiar with is base 10.  In base 10 our numbers are all responsible for conveying 10 pieces of information before that information is passed up to a higher digit.

For instance, we can create 10 numbers with a single digit.  Those numbers are:

0
1
2
3
4
5
6
7
8
9

When we get to 9 we've run out of single digit numbers and have to go up a digit.  We do that by adding another digit to note that we have one complete set of the first digit.  The original digit resets to 0, and the new digit becomes a 1.  We don't write out the zeros that we're not using, but if we did you'd see it perhaps a little clearer when you make the transition:

00
01
02
03
04
05
06
07
08
09
10

If you've driven a car that had an old analog odometer you might have a good feel for this resetting of a digit and movement up to a higher digit.  If you want an example you can play around with this counter here.

If you understand this aspect of base 10 math then it's a simple jump to binary.  You see, binary is base 2 math.  Instead of 10 numbers to play around with there are only two - 0 and 1.

You count in exactly the same way, it's just that each digit holds a lot less information.

Let's start with the number 0.  Well, in binary it is still just 0.

0 = 0

When you move up to the number 1 nothing else changes, either.  1 is simply 1.

1= 1

Moving up to 2 is where you have to apply the things I've just explained. You see, the character 2 doesn't exist in binary - we only have the numbers 0 and 1.  That doesn't mean that the number 2 doesn't exist in binary, it's just that we have to make it using only the characters 0 and 1.

Just like when we get to 9 in base 10 math, we are simply out of single digit characters.  Also just like in base 10 math, this is solved very simply by moving up to a higher digit and rolling over the first.

Thus,

2 = 10

Did you catch that?  And do you now get the joke?  Just as we get to 09 and have to increment the 0 to a 1 and reset the 9 back to a 0 (producing 10), we have to increment the 0 in 01 and reset the 1 in 01, resulting in 01 becoming 10.

When we get to 3 we're still good, actually, as just like the numbers 11-99 we still have room in the digits we have.  Thus,

3 = 11

When we get to 4, though, we need another digit.

4 = 100
5 = 101
6 = 110
7 = 111

At 7 we again run out of places to increment and need another digit to produce 8.

8 = 1000
9 = 1001
10 = 1010
11 = 1011
12 = 1100
13 = 1101
14 = 1110
15 = 1111

Same thing happens at the transition from 15 to 16.  In fact, the same thing will happen at the transition from any number 2^x-1 to 2^x - these are the powers of 2 (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024...)

You might start to recognize these numbers, and if you do it might help you understand why people use binary math.  There are certain places - like electronics - where it is most efficient to store information by having part of a circuit in either an on or off state.  These two states map perfectly well to 0s and 1s - base 2 math.

For instance, if we have a switch we can use it to store two values - off or on, 0 or 1.  If we have two switches we can use them to store four values, off/off, off/on, on/off, on/on, or 0, 1, 2, 3.  See what we're doing there?  Think about this next time you walk into a room with a bunch of switches on the wall.

This might seem like quite an aside, and it sort of is.  But one of the simplest ways to understand a contestant's chances in the game of Rat Race are by considering the fact that the contestant gets a few rats, and each of those rats can either win (1) or lose (0).  In fact, with 5 rats (digits) we can produce 32 outcomes.

It's also super easy to put them into a nice table.



You see, there are 32 potential betting outcomes in Rat race, if you were able to bet on any number of rats from 0 to 5.  Obviously, betting on 4 or 5 rats would give you much better odds (would also get two more products on TV), and would move the game from semi-skill to full-skill in that a perfect sweep of all five prize guesses would guarantee all three outcome prizes.  

Since you can't bet on four or five rats, though, six of the above outcomes are off the table, leaving us with 26 potential events, and only one chance at winning all three prizes (with three rats).

You can see that if you don't guess a single product you have no rats (1s) to place on the board, and no chance to win anything.  Once you get one rat, you can see that that rat can be in any of the places (each of the orange lines).  

With two rats there's still one way you can walk away empty-handed (the fourth line, first yellow line), by choosing the two losers.  

And finally, as we expected, the green lines (three rats) start with your worst case scenario netting you the small prize and two losers.

Overall, then, it breaks down as:

Zero rats:
100% chance of no prize

One rat:
60% chance of one prize
40% chance of no prize

Two rats:
30% chance of two prizes
60% chance of one prize
10% chance of no prize

Three rats:
10% chance of three prizes
60% chance of two prizes
30% chance of one prize
0% chance of no prize

Overall, the advice is far from shocking, as with most TPIR games - win more rats and you have a better chance of winning overall.  But if you want to know exactly, well, there you go.   

No comments:

Post a Comment