When Will The Fall Colors Peak?

Riddler Classic

It’s peak fall foliage season in Riddler Nation, where the trees change color in a rather particular way. Each tree independently begins changing color at a random time between the autumnal equinox and the winter solstice. Then, at a random later time for each tree — between when that tree’s leaves began changing color and the winter solstice — the leaves of that tree will all fall off at once.

At a certain time of year, the fraction of trees with changing leaves will peak. What is this maximal fraction?

Solution

Let the length of time from the autumnal equinox to the winter solstice equal 1.

Assume some fraction of time, $t$, has passed. There have been a series of instances from $0$ to $t$ where trees' leaves have changed color. $1-t$ time remains for the leaves to fall off, regardless of when the leaves changed color.

Let $f(t)$ represent the fraction of trees whose leaves are currently changing at time $t$.

$$f(t) = \int\limits_{x=0}^{t} \frac{1-t}{1-x} dx$$


Evaluating the integral yields:
$$f(t) = (1-t) \cdot -\ln (1-x)\bigg]_0^t$$
$$f(t) = (1-t) \cdot \left(-\ln (1-t)+ \ln(1)\right)$$
$$f(t) = (t-1) \ln (1-t)$$
Solving for $f'(t) = 0$,
$$0 = (t-1) \cdot \dfrac{-1}{1-t} + 1 \cdot \ln(1-t)$$
$$0 = 1 + \ln(1-t)$$
$$\dfrac{1}{e} = 1-t$$
$$t = 1 - \dfrac{1}{e}$$

Answer

Substituting $t$ into $f(t) = (t-1) \ln (1-t)$,
$$f\left(1 - \dfrac{1}{e}\right) = \left(\left(1 - \dfrac{1}{e}\right) - 1\right) \ln \left(1-\left(1 - \dfrac{1}{e}\right)\right)$$
$$f\left(1 - \dfrac{1}{e}\right) = \left(- \dfrac{1}{e}\right) \ln \left(\dfrac{1}{e}\right) = \dfrac{1}{e} \approx 36.79\%$$

Rohan Lewis

2022.11.07

Code can be found here.