# DonaldRauscher.com

## A Blog About D4T4 & M47H

The robot's first cut will create 2 pizza slices. The robot's second cut will create either 3 or 4 pizza slices. The robot's third cut will create 4, 5, or 6 slices if starting with 3 slices or 5, 6, or 7 slices if starting with 4 slices. I began by thinking about the probability of these outcomes in a specific state. So that the geometry mimics the probability distribution, I'm setting the circumference of the pizza equal to 1.

Second CutThird Cut (Starting w/ 3 Slices)Third Cut (Starting w/ 4 Slices)

Next, I integrated over the entire state space to get the probability of each of these outcomes. The state space for the second cut (after 1 cut has been made) is very easy to define; we only need 1 variable (x) to specify the size of each of the two slices. The state space for the third cut (after 2 cuts have been made) is more challenging; we need 3 variables to define the space (x, y, and z). Each integral is multipled by the number of circular permutations; in the case of the third cut, there are 4 points, so (4 - 1)! = 6.

For that second cut:

For that third cut:

Putting this all together:

I found it easiest to think about this problem in terms of polar coordinates. The furthest point that we can eat along trajectory is the following:

Plotting this, it forms this weird, rounded rectangle shape:

I integrated the above equation to get the area. Unlike a regular integral where each area is a rectangle (Reimann sum), each incremental integration area is a circular sector with . Putting this all together:

Extending this logic, I also derived an expression for the area eaten for a regular polygon with n sides:

As n goes to infinity, the area that the picky eater eats becomes a circle with a radius half that of the sandwich, making the area that is eaten equal to 25%. This is the most efficient shape for the picky eater.

For this week's Riddler, I estimated that the division leader would have 88.8 wins after 162 games. I assumed that each team plays the other teams in it's division 19 times for a total of 76 intradivision games and 86 interdivision games, consistent with the actual scheduling rules.

Interdivision games are pretty easy to deal with because the outcomes of each team's interdivision games are independent of one another. If all 162 games were interdivision (i.e. the teams in the division somehow never play one another), the answer would be pretty straightforward (code in R):

> cdf <- (pbinom(1:162, 162, 0.5))^5
> pmf <- cdf - c(0, head(cdf, -1))
> sum(1:162 * pmf)

[1] 88.39431

However, teams in the division obviously do play one another, so win-loss records are not independent. We can think of intradivision games as a series of consecutive round robins. Each round robin consists of 10 games, and each team plays in 4 of those games (one game against each of their division foes). Each team plays 76 intradivision games, which is 19 round robins and 190 games. I started by creating an exhaustive state space (and corresponding probabilities) for the win totals of the 1st, 2nd, 3rd, 4th, and 5th place teams after the 190 intradivision games. Each state is defined as such that . As you can expect, there are many possible outcomes (157,470 states in my state space)!

Next, for each state, I calculated the probability that the division winning team would have less than X wins after the remaining 86 interdivision games. Results of interdivision games are independent, making this pretty easy. Sum-product with the state probabilities and we have the CDF for X!

This computes to 88.8 wins. This is slightly higher than the all-interdivision calculation above, which makes intuitive sense. In the all-interdivision scenario, we could theoretically have a division leader with 0 wins (all 5 teams go winless). However, when we have intradivision games, the division leader cannot have fewer wins than the number of intradivision games that they play divided by 2; one team's loss is another team's win.

I've posted my code on my GH here. Enjoy!