A Reasonably Sliced PBJ

Probability, Calculus; Difficulty: easy

Peanut Butter Jelly Sandwich
Photo by Giorgio Trovato on Unsplash

A Reasonably Sliced PBJ

This week’s Riddler Classic is a relatively straightforward probability question. The Classic reproduced:

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?

*spoiler alert*  solution and answer follow below

Solution

Consider the square PBJ of length 1 unit (without loss of generality) as shown in the figure below. Let \(X\) and \(Y\) be the randomly chosen points of first and second cut respectively at distances \(x\) and \(y\)  on the perimeter measured from 0. Since these are chosen independently and randomly on the perimeter of length 4 of the square, the joint probability density function of \(x\) and \(y\) is given by:

\[
f_{X,Y}(x,y) = \frac{1}{16} \quad 0 \leq x \leq 4 \ ; \ 0 \leq y \leq 4
\]

The needed probability of a reasonable slice \(P_r\) is then given by:

\[
P_r = \iint\limits_{X,Y\in \mathit{F}}^{} f_{X,Y}dxdy
\]

where \(\mathit{F} \) is the feasible region of cutpoints for \(X\) and \(Y\).

PBJ
(click to expand)

The symmetry of the problem can be exploited to make the solution simpler: consider \(X\)  lying on edge \(OA\) at a distance of \(x \leq 0.5\) from \(O\). The needed probability \(P_r\) is then 8 times the probability of \(Y\) being the in the feasible region for this \(X\) since there are 8 such identical half edges for the cutpoint \(X\).

For us to have a reasonable cut when \(x \leq 0.5\), \(Y\) can only possibly be on edges \(AB\) (shown as \(Y1\) at a distance of \(y_1\) from \(A\), or \(1+y_1\) from O) OR on edge \(BC\) (shown as \(Y2\) at a distance of \(y_2\) from \(B\), or \(2+y_2\) from O) 

Consider point \(Y = Y_1\). For this to be a feasible cut, Area \((\triangle XAY_1) \) has to be between 1/4 and 3/4:

\begin{align*}
\frac{1}{4} \ \leq \ \frac{1}{2}(1-x)y_1 \ \leq \ \frac{3}{4} \\
\Rightarrow y_1 \geq \frac{1}{2(1-x)}
\end{align*}

Similarly considering point \(Y = Y_2\) and trapezium \( OXY2C\) we get:

\begin{align*}
\frac{1}{4} \ \leq \ \frac{x+1-y_2}{2} \ \leq \ \frac{3}{4} \\
\Rightarrow y_2 \leq \frac{1}{2} + x
\end{align*} 

Note that in both cases we only need one resulting inequality since the other is always satisfied!

The resultant feasible \(Y\) cut points as \(X\) varies  are illustrated as green on the edges in the animation below:

The required answer can now be calculated as:

\begin{align*}
P_r &= \iint\limits_{x,y\in \mathit{F}}^{} f_{X,Y} \\
&= 8 \int\limits_{x=0}^{0.5}\left [\ \int\limits_{y=1 + \frac{1}{2(1-x)}}^{2}\frac{1}{16} + \int\limits_{y=2}^{2+\frac{1}{2}+ x} \frac{1}{16} \right ]dydx \\
&= \frac{1}{2}\ \int\limits_{x=0}^{0.5}\left [ 1 – \frac{1}{2(1-x)} \ + \ \frac{1}{2} + x \right ]dx \\
&= \frac{1}{2}\ \int\limits_{x=0}^{0.5}\left [ \frac{3}{2} \ + \ x \ – \ \frac{1}{2-2x} \right ]dx \\
&= \frac{1}{2}\biggr [ \ \frac{3}{2}x \ + \ \frac{x^2}{2} \ + \ \frac{\ln(2-2x)}{2} \biggr ]_0^{\frac{1}{2}} \\
&= \frac{7}{16} – \frac{\ln2}{4} \\ \\
&\approx \mathbf{{\color{Red} {0.2642 \text{    OR    } 26.42\%}}}
\end{align*}

Like this content? Subscribe by email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Comments