### Riddler Express

This week's Riddler Express asks:

Last Sunday we lost Alex Trebek, a giant in the world of game shows and trivia. The show he hosted over the course of four decades — Jeopardy! — has previously appeared in this column. Today, it makes a return.

You’re playing the (single) Jeopardy! Round, and your opponents are simply no match for you. You choose first and never relinquish control, working your way horizontally across the board by first selecting all six $200 clues, then all six $400 clues, and so on, until you finally select all the $1,000 clues. You respond to each clue correctly before either of your opponents can.

One randomly selected clue is a Daily Double. Rather than award you the prize money associated with that clue, it instead allows you to double your current winnings or wager up to $1,000 should you have less than that. Being the aggressive player you are, you always bet the most you can. (In reality, the Daily Double is more likely to appear in certain locations on the board than others, but for this problem assume it has an equal chance of appearing anywhere on the board.)

How much money do you expect to win during the Jeopardy! round?

Extra credit:Suppose you change your strategy. Instead of working your way horizontally across the board, you select random clues from anywhere on the board, one at a time. Now how much money do you expect to win during the Jeopardy! round?

#### Solution

Since we are assuming that the Daily Double is equally likely to appear on every tile, we can calculate the winnings for each possible scenario and average them.

If the Daily Double is anywhere in the first row, the winnings would be $18,000 plus $800, since in the Daily Double, if you have less than $1,000 at the time you can bet up to that amount. If the Daily Double is on the first $400 clue, you can wager up to $1,200 (also $800 more than the value of the clue itself), for a total winning of $18,800. If it occurs on the second $400 clue, you can bet up to $1,600 for a total prize of $19,200. Calculate this for every possible outcome, and you arrive at the expected winnings of **$23,800**.

We can test this empirically by simulating the game. I wrote some code to simulate 10,000,000 times, and got... $23,799.29 on average. Pretty close!

```
# python
import random
def estExpWinnings():
results = []
for j in range(10000000):
values = [200] * 6 + [400] * 6 + [600] * 6 + [800] * 6 + [1000] * 6
dd = random.sample(list(range(30)), 1)[0]
winnings = []
for i in range(30):
winningsSoFar = sum(winnings)
if i == dd:
if winningsSoFar <= 1000:
winnings.append(1000)
else:
winnings.append(winningsSoFar)
else:
winnings.append(values[i])
results.append(sum(winnings))
return sum(results) / len(results)
estExpWinnings()
```

For the extra credit, in some ways this is actually an easier problem to solve. When choosing questions in a random order, the expected value of each question flattens down to $600 exactly. So, to determine the expected winnings, we just have to conduct the same exercise as above, but where each question is worth $600 in expectation. On average, we get **$26,146.67**.

Again, we'll test our calculation against millions of simulated games:

```
# python
def estExpHuntWinnings():
results = []
for j in range(10000000):
values = [200] * 6 + [400] * 6 + [600] * 6 + [800] * 6 + [1000] * 6
dd = random.sample(list(range(30)), 1)[0]
winnings = []
playOrder = random.sample(list(range(30)), 30)
for i in playOrder:
winningsSoFar = sum(winnings)
if i == dd:
if winningsSoFar <= 1000:
winnings.append(1000)
else:
winnings.append(winningsSoFar)
else:
winnings.append(values[i])
results.append(sum(winnings))
return sum(results) / len(results)
estExpHuntWinnings()
```

And again, we get a value very close to our calculation. This time: $26,147.36

Finally, as an extension, I wonder what the expected winnings would be if you were so well-studied that you *knew* what the Daily Double distribution looked like, and strategized accordingly. In this case, the strategic player would aim to hit the Daily Double last, as to maximize its effect. Like before, finding the (weighted) average of the 30 possible outcomes gives us the expected winnings, given that the player will choose clues in a predetermined order. In this case, the expected winnings is **$28,049.94**. And finally (really this time), we can check our calculation by simulating.

```
# python
def estExpStratWinnings():
results = []
for j in range(10000000):
values = [200] * 6 + [400] * 6 + [600] * 6 + [800] * 6 + [1000] * 6
dailyDoubleDist = [
2, 0, 3, 1, 2, 0, 286, 131, 202, 173, 214, 124, 703, 352, 581, 557,
533, 358, 866, 508, 795, 719, 763, 518, 602, 281, 497, 530, 448, 355
]
dd = random.choices(list(range(30)), weights = dailyDoubleDist, k = 1)
playOrder = list(np.argsort(np.array(dailyDoubleDist)))
winnings = []
for i in playOrder:
winningsSoFar = sum(winnings)
if i == dd:
if winningsSoFar <= 1000:
winnings.append(1000)
else:
winnings.append(winningsSoFar)
else:
winnings.append(values[i])
results.append(sum(winnings))
return sum(results) / len(results)
estExpStratWinnings()
```

And, of course, we get a very close approximation: $28,048.76.

### Riddler Classic

This week's Riddler Classic asks:

From Angela Zhou comes a bad football puzzle. The puzzle’s great, but the football is bad:

Football season is in full swing, and with it have been some incredible blown leads. The Atlanta Falcons know a few things about this, not to mention a certain Super Bowl from a few years back. Inspired by these improbabilities, Angela wondered just how likely one blown lead truly is.

The Georgia Birds and the Michigan Felines play a game where they flip a fair coin 101 times. In the end, if heads comes up at least 51 times, the Birds win; but if tails comes up at least 51 times, the Felines win.

What’s the probability that the Birds have at least a 99 percent chance of winning atsome pointduring the game — meaning their probability of victory is 99 percent or greater given the flips that remain — and then proceed to lose?

Extra credit:Instead of 101 total flips, suppose there are many, many more (i.e., consider the limit as the number of flips goes to infinity). Again, the Birds win if heads comes up at least half the time.Nowwhat’s the probability that the Birds have a win probability of at least 99 percent at some point and then proceed to lose?

#### Solution

I ran out of time on this one, but I was able to simulate it a bunch of (10,0000,000) times, and it seemed that **0.21%** of the time, the Birds would reach a 99% chance of winning and then blow it.

```
# r
calcPOfWinning <- function(n, h, N){
# n is the number of throws so far
# h is the number of heads so far
# N is the total number of throws
# H is the heads needed to win
H <- ceiling((N + 1) / 2)
# R is the heads needed left to win
R <- H - h
# r is the remaining throws
r <- N - n
q <- 0
if(h > n){
q <- 0
} else if(R > r){
q <- 0
} else {
for(i in R:r){
q <- q + (choose(r, i) / 2 ^ r)
}
}
q
}
playGame <- function(N){
H <- ceiling((N + 1) / 2)
flips <- sample(c(0,1), N, replace = T)
n <- 0
h <- 0
p <- 0
for(f in flips){
q <- calcPOfWinning(n, h, N)
if(q > p){
p <- q
}
h <- h + f
n <- n + 1
}
r <- p > .99 & h < H
r
}
playGameRepeatedly <- function(N){
x <- replicate(10000000, playGame(N))
y <- mean(x)
y
}
playGameRepeatedly(101)
```