# Can you eat more pizza than your siblings?

## Riddler Express 2017-07-14

https://fivethirtyeight.com/features/can-you-eat-more-pizza-than-your-siblings/

> You and your two older siblings are sharing two extra-large pizzas and decide to cut them in an unusual way. You overlap the pizzas so that the crust of one touches the center of the other (and vice versa since they are the same size). You then slice both pizzas around the area of overlap. Two of you will each get one of the crescent-shaped pieces, and the third will get both of the football-shaped cutouts.
> 
> Which should you choose to get more pizza: one crescent or two footballs?


```python
from bokeh.io import output_notebook
output_notebook()
```



<div class="bk-root">
    <a href="http://bokeh.pydata.org" target="_blank" class="bk-logo bk-logo-small bk-logo-notebook"></a>
    <span id="62c973a1-dba7-4b68-93c3-15ed6c19dd8b">Loading BokehJS ...</span>
</div>




The diagram shows the overlapping areas in the middle shaded darker than the others.  This area will be removed from each pizza.


```python
from bokeh.plotting import figure, show
import numpy as np

p = figure(plot_width=400, plot_height=400, x_range=[-2, 2], y_range=[-2, 2])
p.ellipse([-0.5, 0.5], [0, 0], width=2, height=2, color="darkred", alpha=0.25)
p.line(x=[0.5, 0, 0, 0.5], y=[0, np.sqrt(3)/2, -np.sqrt(3)/2, 0], color='black', alpha=0.5)
# p.arc(x=0.5, y=0, radius=1, start_angle=2*np.pi/3, end_angle=-2*np.pi/3)
show(p)
```




    <div class="bk-root">
        <div class="bk-plotdiv" id="487d968b-abce-411c-9a33-14ab420c5204"></div>
    </div>



To calculate the area of the overlap, consider the wedge that is cut from one of the circles.  It is composed of a triangle as well as an additional section.  The overlap is equal to two of these additional sections.  To get the area of this section, we can compute the area of the wedge minus the triangle.  Since the total overlap area is twice this, and it comes from both circles, the total pizza is four times this section.

We will call the length of the vertical line segment $x$ and compute it given the right triangle with base $\frac{r}{2}$, height $\frac{x}{2}$ and hypotenus $r$.

$$
\begin{align}
(\frac{x}{2})^2 + (\frac{r}{2})^2 = r^2 \\
\frac{x^2 + r^2}{4} = r^2 \\
x^2 + r^2 = 4r^2 \\
x^2 = 3r^2 \\
x = \sqrt{3}r \\
\end{align}
$$

So the area of the triangle above is

$$
\begin{align}
A_{\text{triangle}} & = \frac{1}{2} x \frac{r}{2} \\
& = \frac{1}{2} \sqrt{3} \frac{r}{2} \\
& = \frac{\sqrt{3}}{4} r^2
\end{align}
$$

To calculate the area of the circular wedge, we need to figure out the angle.  If we call $\alpha$ the half angle that is part fo the right triangle,

$$
\begin{align}
cos(\alpha) = \frac{1}{2} \\
\alpha = arccos(\frac{1}{2}) = \frac{\pi}{3}
\end{align}
$$

And the area of this circular wedge

$$
\begin{align}
A_{\text{wedge}} & = \dfrac{2 \alpha}{2 \pi} \pi r^2 \\
& = \alpha r^2 \\
& = \frac{\pi}{3} r^2
\end{align}
$$

And the area of the section is the area of the wedge minus the area of the triangle.

$$
\begin{align}
A_{\text{section}} & = A_{\text{wedge}} - A_{\text{triangle}} \\
& = \frac{\pi}{3} r^2 - \frac{\sqrt{3}}{4} r^2 \\
& = (\frac{\pi}{3} - \frac{\sqrt{3}}{4}) r^2
\end{align}
$$



```python
print('Area of wedge:          {}'.format(np.pi/3))
print('Area of triangle:       {}'.format(np.sqrt(3)/4))
area_section = np.pi/3 - np.sqrt(3)/4
print('Area of section:        {}'.format(area_section))
print('Area of pizza minus:    {}'.format(np.pi - 2*area_section))
print('Area of total sections: {}'.format(4*area_section))
```

    Area of wedge:          1.0471975511965976
    Area of triangle:       0.4330127018922193
    Area of section:        0.6141848493043783
    Area of pizza minus:    1.9132229549810364
    Area of total sections: 2.4567393972175133



```python

```

4322f6659c40c5fe031926637c4570d30aca07cf
ipynb
Jupyter Notebook
fivethirtyeight/2017-07-14 Slice the pizza.ipynb
dennisobrien/PublicNotebooks
a2b6974a84468f2f91c25398cbd374bb03151582
MIT
2018-03-12T20:13:28.000Z
2018-03-12T20:13:28.000Z
fivethirtyeight/2017-07-14 Slice the pizza.ipynb
dennisobrien/PublicNotebooks
a2b6974a84468f2f91c25398cbd374bb03151582
MIT
fivethirtyeight/2017-07-14 Slice the pizza.ipynb
dennisobrien/PublicNotebooks
a2b6974a84468f2f91c25398cbd374bb03151582
MIT
Qwen/Qwen-72B
1. YES
2. YES