Riddler Express: June 4, 2021

David Ding

June 4, 2021

The Magic Wand

Max the Mathemagician is calling for volunteers. He has a magic wand of length 10 that can be broken anywhere along its length (fractional and decimal lengths are allowed). After the volunteer chooses these breakpoints, Max will multiply the lengths of the resulting pieces. For example, if they break the wand near its midpoint and nowhere else, the resulting product is 5×5, or 25. If the product is the largest possible, they will win a free backstage pass to his next show. (Amazing, right?)

You raise your hand to volunteer, and you and Max briefly make eye contact. As he calls you up to the stage, you know you have this in the bag. What is the maximum product you can achieve?

Extra credit: Zax the Mathemagician (no relation to Max) has the same routine in his show, only the wand has a length of 100. What is the maximum product now?

  1. Length-10 wand: \((2.5)^4 \approx 39.06\)
  2. Length-100 wand (Extra credit): \(\left(\frac{100}{37}\right)^{37} \approx 9.474 \times 10^{15}\)

Explanation:

To solve the puzzle, let's solve a simpler one first. If you were to split the wand only once, even intuitively you would go for the midpoint of the wand, as it just feels "symmetric" to do so in yielding the largest product. There are many ways to quantify this mathematically, but one of my favorite ways is to think of a "common difference" between the lengths of the two pieces and taking the product involving this value. Let the length of the first piece be \(x_1\) and the length of the second piece be \(x_2\), we now denote the arithimetic average of the two pieces as \(x_m\), and \(d\) as the common difference such that \(x_1 = x_m + d\) and \(x_2 = x_m - d\). The ensuing product is \(x_1 x_2 = (x_m + d)(x_m - d) = x_m^2 - d^2\). Obviously, the product is maximized when \(d = 0\), which means the optimal piece lengths are \(x_1 = x_2 = x_m = L/2\) where \(L\) is the length of the wand.

We can leverage the above insight for multiple breakpoints. Say you break up the wand into \(n\) pieces where \(n\) is a positive integer. Let us denote the lengths of the pieces as \(x_1, x_2, x_3, \dots, x_n\). When we take their products, any pair of the lengths multiplied together still has to follow the optimization condition as outlined above, and so by induction, the largest product is yielded when \(x_1 = x_2 = x_3 = \dots = x_n = L/n\). This means the product itself is equal to \(\left(\frac{L}{n}\right)^n\).

Before we dive in and attempt to optimize the product expression in terms of \(n\), we need to make a few observations to make our optimization fruitful, because we need to remind ourselves that \(n\) is a postive integer, as it represents the number of pieces for which we break up the wand. We can first relax \(n\) to be a positive real number, use calculus to get the optimal value, and then look at the related integer case only if we make sense of the function we are dealing with here. Therefore, first we let \(f(x) = \left(\frac{L}{x}\right)^x\) for \(x > 0\) and look at the shape of the function. Clearly we have a trade-off here: as \(x\) increases, the base of the exponent expression decreases, therefore contributing to the decreasing of the function's value. On the other hand, since \(x\) is also the exponent, increasing \(x\) also contributes to increasing the function's value. With this tradeoff, we can look for an optimal \(x\), and simply compare the integers bookending the \(x\) (if \(x\) isn't already an integer), to figure out our optimal \(n\).

The general solution is as follows:

First, to optimize \(x\), we take the derivative of \(f(x)\) and find critical points.

\begin{align} f(x) &= \left(\frac{L}{x}\right)^x \\ \log f(x) &= \log \left(\frac{L}{x}\right)^x \\ &= x \log \left(\frac{L}{x}\right) \\ (\log f(x))' &= \left( x \log \left(\frac{L}{x}\right) \right)'\\ \frac{f'(x)}{f(x)} &= \log \left(\frac{L}{x}\right) + \frac{x^2}{L} \frac{-L}{x^2} \\ f'(x) &= f(x)\left( \log \left(\frac{L}{x}\right) - 1 \right) \\ f'(x) &= \left(\frac{L}{x}\right)^x \left( \log \left(\frac{L}{x}\right) - 1 \right) \\ \end{align}

Do you remember you chain rule and product rule?

Now, setting \(f'(x) = 0\), and seeing that \(\left(\frac{L}{x}\right)^x > 0\) because \(x > 0\), the only way for the derivative to equal to 0 is for the following:

\begin{align} \log \left(\frac{L}{x}\right) - 1 &= 0 \\ \log \left(\frac{L}{x}\right) &= 1 \\ \frac{L}{x} &= e \\ x^* &= \boxed{\frac{L}{e}} \\ \end{align}

Where \(e \approx 2.1783\) is the natural exponent. We can easily perform a first-derivative test to figure out that this is a local maximum point. Since this is the only critical point over the entire \(x > 0\) domain, this is also a global maximum.

Once we have the optimal value of \(x\) in \(x^*\), we can look at the bounding integers of \(x^*\) to arrive at our solution for the wand with any postive length \(L\), as follows.

Denote \(\lfloor . \rfloor\) and \(\lceil . \rceil\) as floor and ceiling functions, respectively, our largest product is simply:

\begin{equation} \boxed{\max{\left(\left(\frac{L}{\lfloor x^* \rfloor}\right)^{\lfloor x^* \rfloor}, \left(\frac{L}{\lceil x^* \rceil}\right)^{\lceil x^* \rceil} \right)}} \end{equation}

For the first part of the puzzle, let us substitute \(L = 10\) and obtain the largest product. First, \(x^* = \frac{10}{e} \approx 3.68\), and so:

\begin{align} \max{\left(\left(\frac{L}{\lfloor x^* \rfloor}\right)^{\lfloor x^* \rfloor}, \left(\frac{L}{\lceil x^* \rceil}\right)^{\lceil x^* \rceil} \right)} &= \max{\left(\left(\frac{10}{3}\right)^{3}, \left(\frac{10}{4}\right)^{4}\right)} \\ &= \left(\frac{10}{4}\right)^{4} \\ &\approx \boxed{39.06} \\ \end{align}

Therefore the largest product obtained from a length-10 wand is to divide it into four equal pieces of length 2.5, and that product is \((2.5)^4 \approx 39.06\).

For extra credit, we simply substitute \(L = 100\). Here \(x^* = \frac{100}{e} \approx 36.8\), and so:

\begin{align} \max{\left(\left(\frac{L}{\lfloor x^* \rfloor}\right)^{\lfloor x^* \rfloor}, \left(\frac{L}{\lceil x^* \rceil}\right)^{\lceil x^* \rceil} \right)} &= \max{\left(\left(\frac{100}{36}\right)^{36}, \left(\frac{100}{37}\right)^{37}\right)} \\ &= \left(\frac{100}{37}\right)^{37} \\ &\approx \boxed{9.474 \times 10^{15}} \\ \end{align}

Divide up the wand into 37 pieces, each having length \(100/37 \approx 2.703\) and obtain a product that is surprisingly close to the length of one light-year in metres, the SI unit for length.

In general, for a given wand length \(L > 0\), the maximum achievable product is:

\begin{equation} f(L) = \max{\left(\left(\frac{L}{\lfloor L/e \rfloor}\right)^{\lfloor L/e \rfloor}, \left(\frac{L}{\lceil L/e \rceil}\right)^{\lceil L/e \rceil} \right)} \end{equation}

Achieved by dividing the wand into \(\lfloor L/e \rfloor\) or \(\lceil L/e \rceil\) pieces of equal length, whichever yields the greater product.