Can You Divide the PBJ?

Riddler Classic

I have made a square peanut butter and jelly sandwich, and now it’s time to slice it. But rather than making a standard horizontal or diagonal cut, I instead pick two random points along the perimeter of the sandwich and make a straight cut from one point to the other. (These points can be on the same side.)

My slice is “reasonable” if I cut the square into two pieces and the smaller resulting piece has an area that is at least one-quarter of the whole area. What is the probability that my slice is reasonable?

Solution

WLOG, place one of the points on one of the sides of the sandwich. The other point can be on any of the other four sides.

There are three cases to consider.

Points are on the Same Side.

This happens $\frac{1}{4}$ of the time. The larger piece is 100% of the original sandwich.

Thus, the probability of a reasonable slice is 0 in this case.

Points are on Adjacent Sides.

This happens $\frac{1}{2}$ of the time. The larger piece is a pentagon and the smaller piece is a triangle.

The area of the piece can be represented as
$$A = \dfrac{xy}{2} \ge \dfrac{1}{4}$$
where $0 \le x,y \le 1$. Note that because of the definition of "reasonable", this is updated to $\frac{1}{2} \le x,y \le 1$.

Assume $x$ is a fixed point at the horizontal base of the sandwich. Feasible $y$ values are $\frac{2A}{x} \le y \le 1$.

The probability that the piece is reasonable is:
$$\int\limits_{x=\frac{1}{2}}^{1} \left(1 - \dfrac{1}{2x}\right)dx$$
$$= x - \dfrac{1}{2}\ln(x)\bigg]_{\dfrac{1}{2}}^1$$
$$= (1 - 0) - \left(\dfrac{1}{2} - \dfrac{1}{2}\ln\left(\dfrac{1}{2}\right)\right)$$
$$= \dfrac{1}{2} + \dfrac{1}{2}\ln\left(\dfrac{1}{2}\right)$$

Points are on Opposite Sides.

This happens $\frac{1}{4}$ of the time. Both pieces are trapezoids, with a few scenarios being triangles and rectangles.

The area of the piece can be represented as
$$A = \dfrac{x_1+x_2}{2} \ge \dfrac{1}{4}$$
where $0 \le x_1,x_2 \le 1$. To achieve the smaller piece, let $0 \le x_1 \le \frac{1}{2}$.

Feasible $x_2$ values are $\frac{1}{2}-x_1 \le x_2 \le 1$. This can also happen for the other half of the base.

The probability that the piece is reasonable is:
$$2\cdot\int\limits_{x=0}^{\frac{1}{2}} \left(1 - \left(\dfrac{1}{2} - x\right)\right)dx$$
$$= x + x^2\Big]_0^{\frac{1}{2}}$$
$$= \left(\dfrac{1}{2} + \dfrac{1}{4}\right) - (0 - 0) = \dfrac{3}{4}$$

Answer

Adding the three cases yields:
$$\left(\dfrac{1}{4} \cdot 0\right) + \left(\dfrac{1}{2} \cdot \left(\dfrac{1}{2} + \dfrac{1}{2}\ln\left(\dfrac{1}{2}\right)\right)\right)+\left(\dfrac{1}{4} \cdot \dfrac{3}{4}\right)$$
$$ = \dfrac{7}{16} + \dfrac{1}{4}\ln\left(\frac{1}{2}\right) \approx 0.264213$$

I ran a simulation of 100,000,000 sandwiches and received a similar result.

Rohan Lewis

2022.11.14

Code can be found here.