Puzzle
4 minute read

Ponder This Challenge - July 2025 - Swallows on a Wire

This puzzle was suggested by Latchezar Christov - thanks!

A wire with length LL is stretched between two poles. Swallows come, one by one, and land on the wire. All swallows have a width equal to 1 and cannot overlap on the wire, and each new swallow selects where to land at random with uniform probabilities (taken over all the perimissible options). This repeats until no swallow can land anymore.

In this moment, there are SS swallows on the wire. The number SS is a discrete random variable whose expectancy N=E[S]N=\mathbf{E}[S] depends on LL. We will call "flock density" (FD) the ratio FD(L)=N(L)L\mathbf{FD}(L) = \frac{N(L)}{L}. For example

FD(1.1)=0.909091
FD(2.2)=0.606061
FD(3.3)=0.665421
FD(10)=0.722358

etc.

Your goal: Find the lengths L1L_1 and L2L_2 (L1,L2>2L_1,L_2>2) for which the flock density is accordingly FD(L1)=3651\mathbf{FD}(L_1)=\frac{36}{51} and FD(L2)=3851\mathbf{FD}(L_2)=\frac{38}{51}. Provide eight decimal digits of accuracy.

A bonus "*" will be given for finding the median of the distribution of the distance between two consecutive landing points for LL\to\infty, where a "landing point" of a swallow is in the middle of the space it occupies. Provide four decimal digits after the decimal point.


We will post the names of those who submit a correct, original solution! If you don't want your name posted then please include such a statement in your submission!

We invite visitors to our website to submit an elegant solution. Send your submission to the ponder@il.ibm.com.

If you have any problems you think we might enjoy, please send them in. All replies should be sent to: ponder@il.ibm.com

Solution

  • July 2025 Solution:

    The numerical solutions are:

    L1=6.0507220
    L2=100.96564
    

    Bonus:

    m=1.26278296766
    

    This problem is better known as "Rényi's Parking Problem" which deals with cars parking randomally along the road. When the cars are of unit length 11 and we're interested in the mean number of cars that will be able to park on an interval of length xx, we have the following recursive formula:

    M(x)={00x<11x=11+2x10x1M(t)dtx>1M\left(x\right)=\begin{cases} 0 & 0\le x<1\\ 1 & x=1\\ 1+\frac{2}{x-1}\int_{0}^{x-1}M\left(t\right)dt & x>1 \end{cases} This formula can be obtained in the following (rather informal) manner: Consider an interval of length x+1x+1, and put a car on tt (0tx0\le t\le x), with the effect of splitting the interval into two smaller intervals of lengths tt and xtx-t. The expected number of cars on the interval (0,x+1)(0,x+1) in this case is M(t)+1+M(xt)M\left(t\right)+1+M\left(x-t\right) (since we also count the car already placed) And now, using The symmetry of M(t)M(t) and M(xt)M(x-t) we obtain M\left(x+1\right)=\frac{1}{x}\int_{0}^{x}\left[M\left(t\right)+1+M\left(x-t\right)\right]dt$$=1+\frac{2}{x}\int_{0}^{x}M\left(t\right)dt

    There are several methods to numerically compute this integral. One nice approach described in "Numerical Solution of Some Classical Differential-Difference Equations" computes a power series representation for MM in the interval [N,N+1][N,N+1] based on a power series representation for the previous integral. Implementing this approach yields an extremely fast and accurate algorithm for directly computing FDFD and a simple binary search algorithm (based on FDFD's monotonicity in the relevant domain) yields

    A common answer to the bonus was 1.3376171.337617\ldots, which is 1Cr\frac{1}{C_r} where CrC_r is Rényi's Parking Constant, C_r=lim_xM(x)xC\_r=\lim\_{x\to\infty}\frac{M(x)} {x}. This is due to an interpretation of the bonus question as requesting the **mean** distance between two swallows. To compute it, first note the the distance between two consecutive swallows is equal to half the first swallow + half the second one + the empty space between them. So if we compute the mean empty space + 1, we obtain the requested result. The mean total empty space for a wire of length xx is xM(x)x-M(x), and dividing by the number of swallows yields the result 1+xM(x)M(x)=xM(x)1+\frac{x-M(x)}{M(x)}=\frac{x}{M(x)} which, taken to the limit, is indeed 1Cr\frac{1}{C_r}.

    The intended meaning of the bonus was to find the median, not the mean. This can be done via a Monte Carlo simulation.

Solvers

  • *Bertram Felgenhauer (1/7/2025 4:27 PM IDT)
  • *Bert Dobbelaere (1/7/2025 11:03 PM IDT)
  • *Lazar Ilic (2/7/2025 4:39 AM IDT)
  • *Alper Halbutogullari (2/7/2025 9:52 AM IDT)
  • Jiri Spitalsky (2/7/2025 8:20 PM IDT)
  • *Paul Lupascu (2/7/2025 9:13 PM IDT)
  • *Daniel Bitin (2/7/2025 11:45 PM IDT)
  • *Guangxi Liu (3/7/2025 6:34 AM IDT)
  • *Ankit Chakraborty (3/7/2025 9:57 AM IDT)
  • *King Pig (3/7/2025 4:54 PM IDT)
  • *Juergen Koehl (4/7/2025 9:54 PM IDT)
  • *Prashant Wankhede (5/7/2025 9:09 PM IDT)
  • *Hugo Pfoertner (5/7/2025 9:18 PM IDT)
  • Kang Jin Cho (7/7/2025 8:51 PM IDT)
  • *Giovanni Basso (8/7/2025 12:30 AM IDT)
  • *Daniel Chong Jyh Tar (9/7/2025 8:31 PM IDT)
  • Lorenz Reichel (12/7/2025 12:43 PM IDT)
  • *Shirish Chinchalkar (13/7/2025 11:16 PM IDT)
  • *Vladimir Volevich (14/7/2025 7:08 PM IDT)
  • Christoph Baumgarten (14/7/2025 9:13 PM IDT)
  • Gary M. Gerken (15/7/2025 12:50 PM IDT)
  • Dieter Beckerle (15/7/2025 7:56 PM IDT)
  • *Jordan Payette (17/7/2025 6:58 PM IDT)
  • *Aayaam Panigrahi (17/7/2025 7:07 PM IDT)
  • *Klaus Nagel (18/7/2025 2:50 PM IDT)
  • *Camden Chappelle (18/7/2025 3:20 PM IDT)
  • Dominik Reichl (19/7/2025 6:10 PM IDT)
  • Stéphane Higueret (20/7/2025 9:26 AM IDT)
  • Sanandan Swaminathan (21/7/2025 9:42 AM IDT)
  • *Robert Berec (21/7/2025 11:17 PM IDT)
  • *David Greer (23/7/2025 4:48 PM IDT)
  • Peter Moser (24/7/2025 10:55 PM IDT)
  • *Nischal Agrawal (25/7/2025 2:51 AM IDT)
  • *Tim Walters (25/7/2025 2:41 PM IDT)
  • Radu-Alexandru Todor (27/7/2025 11:00 AM IDT)
  • Albert Stadler (29/7/2025 10:30 PM IDT)
  • *Hubert Puszklewicz (30/7/2025 8:50 PM IDT)
  • Armin Krauß (30/7/2025 11:11 PM IDT)
  • *Justin Mazenauer (31/7/2025 1:08 AM IDT)
  • Daniel Lincke (31/7/2025 1:38 PM IDT)
  • Mathias Schenker (31/7/2025 6:27 PM IDT)
  • *Motty Porat (1/8/2025 1:53 AM IDT)
  • Christopher Bender (1/8/2025 5:43 AM IDT)
  • *Jackson La Vallee (2/8/2025 10:54 PM IDT)
  • David F.H. Dunkley (4/8/2025 7:11 PM IDT)
  • *Li Li (5/8/2025 8:51 AM IDT)
  • *Evan Semet (5/8/2025 11:54 AM IDT)
  • *Marco Bellocchi (6/8/2025 2:48 AM IDT)
  • Stefan Wirth (8/8/2025 3:34 PM IDT)
  • Dan Dima (10/8/2025 1:37 PM IDT)

Related posts