Skip to content
Vamshi Jandhyala

Mathematics

Charlotte's New Web

PDF

A circular billiard puzzle by Xavier Durawa: Charlotte's strands reflect inside a circular frame; how many earlier strands does the n-th strand cross on average? A self-contained walk through the geometry, the modular-arithmetic reformulation, the piecewise integration, the antipode trick, and the telescoping sum that lands the exact closed form.

A puzzle by Xavier Durawa for the week of 5/3.

The puzzle

Charlotte is building a web inside a circular frame. She picks a starting point on the boundary uniformly at random, picks a direction pointing into the disk uniformly at random, walks in a straight line, and lays down a strand of silk. When she reaches the boundary she reflects elastically, in exactly the way a billiard ball or a beam of light would, and lays down the next strand. New strands cross many of the earlier ones. On average, how many of the previous strands does the nn-th strand cross?

That is the whole question. Getting to a clean answer takes about ten small steps, and we will spell out every one of them. The road runs through some elementary geometry of reflection, a change of variables that collapses two random choices into one, a piecewise integration, a symmetry argument with a satisfying twist, and a telescoping sum. The reward at the end is an exact closed form, simple enough to fit on a single line.

We work in the unit disk {(x,y):x2+y21}\{(x, y) : x^2 + y^2 \leq 1\}. Charlotte’s starting point is on the boundary circle and her initial direction is some unit vector pointing inward.

Step 1: every chord has the same length

Here is the first surprise. Every strand Charlotte lays down has exactly the same length, no matter where the bounces occur. The reflection law arranges this for free.

To see why, look at the very first bounce. Charlotte travels along a chord from AA to BB, reflects, and continues along BCBC. We claim AB=BC|AB| = |BC|.

The unit disk with centre O, three boundary points A, B, C, the chords AB and BC, the dashed radii OA, OB, OC, and the tangent line at B. Equal angles α are marked at A (between OA and AB), and at B (between OB and BA, and between OB and BC), illustrating the isosceles base angles and the reflection law.

Let OO be the centre of the disk. Triangle OABOAB is isosceles, since the two sides OAOA and OBOB are radii of equal length. A standard fact about isosceles triangles is that their two base angles (the angles opposite the two equal sides) are equal. So OAB=OBA.\angle OAB = \angle OBA. Call this common angle α\alpha.

Now we need one fact from elementary plane geometry: at any point of a circle, the radius is perpendicular to the tangent line. Quick justification: the tangent line at BB touches the circle only at BB, and any other point on the tangent line is outside the circle, i.e. at distance greater than 11 from OO. So BB is the closest point on the tangent line to OO. The closest point on a line to a fixed external point is always the foot of the perpendicular dropped from that point, so OBOB must meet the tangent at BB at a right angle.

Back to the bounce. The chord BABA leaves BB along a direction making angle α\alpha with the radius OBOB, so it makes angle 90°α90° - \alpha with the tangent. The reflection law says the angle of incidence equals the angle of reflection, both measured against the tangent. So the outgoing chord BCBC also makes angle 90°α90° - \alpha with the tangent, just on the opposite side. That places BCBC at angle α\alpha from the radius OBOB on the opposite side. So OBC=α\angle OBC = \alpha as well.

We have arrived at two isosceles triangles with the same shape. Triangle OABOAB has OA=OB=1OA = OB = 1 and base angles α\alpha; its apex angle at OO is therefore 180°2α180° - 2\alpha (since angles in a triangle sum to 180°180°). Triangle OBCOBC has OB=OC=1OB = OC = 1 and base angle α\alpha at BB, hence by isosceles symmetry base angle α\alpha at CC too, and apex angle at OO also 180°2α180° - 2\alpha.

The two triangles each have two unit sides separated by the same included angle, 180°2α180° - 2\alpha. By side-angle-side, they are congruent. In particular the third sides match: BC=AB|BC| = |AB|.

So every chord has the same length. Equivalently (by the law of cosines applied to OABOAB, which gives AB2=22cosAOB|AB|^2 = 2 - 2\cos\angle AOB), every chord subtends the same central angle. Call this constant central angle δ\delta. The boundary points P0, P1, P2, P3, P_0,\ P_1,\ P_2,\ P_3,\ \dots where successive strands meet the circle therefore form an arithmetic progression of angles: if P0P_0 sits at angle θ0\theta_0, then PkP_k sits at angle θ0+kδ\theta_0 + k\delta.

Step 2: the rotation δ\delta is uniform on (0,2π)(0, 2\pi)

The puzzle hands us two pieces of randomness: a uniform starting point and a uniform inward direction. We have just seen that the entire web is determined by the single number δ\delta. So the next question is, what is the distribution of δ\delta?

The starting point itself does no work. The whole problem is rotationally symmetric, so we can place P0P_0 at (1,0)(1, 0) once and forever, and forget about it.

What is left is the random direction. Parametrise inward-pointing unit vectors at (1,0)(1, 0) by an angle ϑ(0,π)\vartheta \in (0, \pi) measured from the upward tangent. The tangent at (1,0)(1, 0) points in the yy-direction, so the unit vector v(ϑ)=(sinϑ, cosϑ)\mathbf{v}(\vartheta) = (-\sin\vartheta,\ \cos\vartheta) points along the upward tangent at ϑ=0\vartheta = 0, along the inward normal (1,0)(-1, 0) at ϑ=π/2\vartheta = \pi/2, and along the downward tangent at ϑ=π\vartheta = \pi. The puzzle specifies the direction as uniform, so ϑ\vartheta is uniform on (0,π)(0, \pi). (No Bertrand-style ambiguity here: the random ingredient is the direction at a fixed boundary point, not the chord.)

The unit disk with starting point P_0 = (1, 0) on the right edge. A copper-coloured arrow at P_0 points inward at angle ϑ from the upward tangent, labelled v(ϑ) = (-sin ϑ, cos ϑ). The chord from P_0 to P_1 is drawn faintly. P_1 sits on the circle at angle 2ϑ above the x-axis. The angle ϑ is marked at P_0 between the tangent and v; the central angle 2ϑ is marked at the centre O.

Charlotte then walks along the line P(t)=(1,0)+tv(ϑ)=(1tsinϑ, tcosϑ),t0.P(t) = (1, 0) + t\,\mathbf{v}(\vartheta) = (1 - t\sin\vartheta,\ t\cos\vartheta), \qquad t \geq 0. She bounces when she meets the boundary again, i.e. when P(t)2=1\|P(t)\|^2 = 1:

(1tsinϑ)2+(tcosϑ)2=112tsinϑ+t2(sin2ϑ+cos2ϑ)=1t22tsinϑ=0t(t2sinϑ)=0.\begin{aligned} (1 - t\sin\vartheta)^2 + (t\cos\vartheta)^2 &= 1 \\ 1 - 2t\sin\vartheta + t^2(\sin^2\vartheta + \cos^2\vartheta) &= 1 \\ t^2 - 2t\sin\vartheta &= 0 \\ t(t - 2\sin\vartheta) &= 0. \end{aligned}

The root t=0t = 0 is the starting point. The other root, t=2sinϑt = 2\sin\vartheta, is the next bounce. Substitute it back: P1=(12sin2ϑ, 2sinϑcosϑ)=(cos2ϑ, sin2ϑ),P_1 = \bigl(1 - 2\sin^2\vartheta,\ 2\sin\vartheta\cos\vartheta\bigr) = (\cos 2\vartheta,\ \sin 2\vartheta), where the last step uses the double-angle identities cos2ϑ=12sin2ϑ\cos 2\vartheta = 1 - 2\sin^2\vartheta and sin2ϑ=2sinϑcosϑ\sin 2\vartheta = 2\sin\vartheta\cos\vartheta.

So P1P_1 sits on the unit circle at angle 2ϑ2\vartheta. The central angle from P0P_0 to P1P_1 is δ=2ϑ\delta = 2\vartheta.

Since ϑ\vartheta is uniform on (0,π)(0, \pi), the rotation δ=2ϑ\delta = 2\vartheta is uniform on (0,2π)(0, 2\pi). Setting β=δ2π,\beta = \frac{\delta}{2\pi}, we have a single random parameter β\beta, uniform on (0,1)(0, 1), that determines the entire web. The whole problem is now parametrised by one number on the unit interval.

Step 3: boundary positions on a circle of length 1

It will pay to forget about angles entirely and measure boundary positions as fractions of the circumference. The boundary becomes the interval [0,1)[0, 1) with the two endpoints glued together. Place P0P_0 at position 00. The bounce point PkP_k is then at position kβmod1=the fractional part of kβ.k\beta \bmod 1 = \text{the fractional part of } k\beta. A note on the notation: for any real xx, the symbol xmod1x \bmod 1 means the unique y[0,1)y \in [0, 1) with xyZx - y \in \mathbb{Z}. So 1.7mod1=0.71.7 \bmod 1 = 0.7, 2.5mod1=0.52.5 \bmod 1 = 0.5, 0.3mod1=0.7-0.3 \bmod 1 = 0.7.

The kk-th strand (for k1k \geq 1) is the chord whose two boundary endpoints are (k1)βmod1(k-1)\beta \bmod 1 and kβmod1k\beta \bmod 1. That is the picture we will work with from now on: a sequence of points marching around a length-1 circle in steps of β\beta, with chords joining consecutive points.

Step 4: when do two chords cross inside the disk?

Two chords cross strictly inside the disk if and only if their four endpoints alternate around the boundary. The chord abab separates the open disk into two pieces; a second chord crosses abab iff its two endpoints lie on opposite arcs.

Alternation is invariant under rotating the boundary, so we can shift strand ii to sit at {0,β}\{0, \beta\}. For strand jj with m=ji1m = j - i \geq 1, the endpoints become {u, u+βmod1},u=mβmod1.\{u,\ u + \beta \bmod 1\}, \qquad u = m\beta \bmod 1. The chord {0,β}\{0, \beta\} cuts the boundary into two arcs: A=(0,β)A = (0, \beta) of length β\beta, and B=(β,1)B = (\beta, 1) of length 1β1 - \beta. Strands ii and jj cross iff exactly one of {u,u+βmod1}\{u,\, u + \beta \bmod 1\} lies in each arc.

A 2-by-3 grid of circle diagrams. Top row, β = 0.30 (case β < 1/2): three snapshots of the second chord as u sweeps through (0, β), (β, 1-β), (1-β, 1) — labelled cross, no cross, cross. Bottom row, β = 0.70 (case β > 1/2): three snapshots through (0, 1-β), (1-β, β), (β, 1) — labelled cross, no cross, cross. The first chord at endpoints {0, β} is shown in copper, the second chord at {u, u+β mod 1} in green, with intersection points highlighted.

Case β<1/2\beta < 1/2 (top row). Arc AA has length β\beta and is the shorter one. Three sub-cases for uu:

  • u(0,β)u \in (0, \beta): uAu \in A and u+β(β,2β)Bu + \beta \in (\beta, 2\beta) \subset B. Cross.
  • u(β,1β)u \in (\beta,\, 1 - \beta): uBu \in B and u+β(2β,1)Bu + \beta \in (2\beta, 1) \subset B. No cross.
  • u(1β,1)u \in (1 - \beta,\, 1): uBu \in B and u+β1(0,β)=Au + \beta - 1 \in (0, \beta) = A. Cross.

The cross region is u(0,β)(1β,1)u \in (0, \beta) \cup (1 - \beta, 1).

Case β>1/2\beta > 1/2 (bottom row). Now arc BB has length 1β1 - \beta and is the shorter one. Three sub-cases:

  • u(0,1β)u \in (0,\, 1 - \beta): uAu \in A and u+β(β,1)=Bu + \beta \in (\beta, 1) = B. Cross.
  • u(1β,β)u \in (1 - \beta,\, \beta): uAu \in A and u+β1(0,2β1)Au + \beta - 1 \in (0, 2\beta - 1) \subset A. No cross.
  • u(β,1)u \in (\beta,\, 1): uBu \in B and u+β1(2β1,β)Au + \beta - 1 \in (2\beta - 1, \beta) \subset A. Cross.

The cross region is u(0,1β)(β,1)u \in (0, 1 - \beta) \cup (\beta, 1).

Both cases together. In each case, the cross region consists of those uu whose circle-distance to the nearer of {0,1}\{0, 1\} is less than the length of the shorter arc. Writing the circle distance as d(x)=min(x, 1x),x[0,1),d(x) = \min(x,\ 1 - x), \qquad x \in [0, 1), the shorter-arc length is d(β)=min(β,1β)d(\beta) = \min(\beta, 1 - \beta), and the criterion collapses to  strands i and j cross      d(mβmod1)<d(β),m=ji. \boxed{\ \text{strands $i$ and $j$ cross}\ \iff\ d(m\beta \bmod 1) < d(\beta), \qquad m = j - i.\ } The condition has nothing to do with ii or jj separately, only on the gap mm between their indices. That is the simplification we need.

Step 5: the answer is a sum of probabilities

For each m1m \geq 1, define Pm=P(d(mβmod1)<d(β)),βUnif(0,1).P_m = \mathbb{P}\bigl(d(m\beta \bmod 1) < d(\beta)\bigr), \qquad \beta \sim \mathrm{Unif}(0, 1). By Step 4, PmP_m is the probability that any two strands whose indices differ by mm cross.

Let NnN_n be the number of previous strands that strand nn crosses. For each k=1,,n1k = 1, \dots, n - 1, strand nn versus strand kk has m=nkm = n - k, so by linearity of expectation (which holds without any independence assumptions), E[Nn]=k=1n1P(strand n crosses strand k)=m=1n1Pm.\mathbb{E}[N_n] = \sum_{k=1}^{n-1} \mathbb{P}\bigl(\text{strand $n$ crosses strand $k$}\bigr) = \sum_{m=1}^{n-1} P_m. The puzzle has reduced to a single problem: compute PmP_m.

Step 6: a worked example, P2P_2

Let us compute P2=P(d(2βmod1)<d(β))P_2 = \mathbb{P}(d(2\beta \bmod 1) < d(\beta)) by hand. The trick is to chop [0,1][0, 1] into pieces on which both d(β)d(\beta) and d(2βmod1)d(2\beta \bmod 1) are linear in β\beta, and read off the answer piece by piece.

The function d(β)d(\beta) is a tent: it climbs linearly from 00 at β=0\beta = 0 up to 1/21/2 at β=1/2\beta = 1/2, then descends to 00 at β=1\beta = 1. Explicitly, d(β)=βd(\beta) = \beta on [0,1/2][0, 1/2], and d(β)=1βd(\beta) = 1 - \beta on [1/2,1][1/2, 1].

The function d(2βmod1)d(2\beta \bmod 1) is the same shape, but at twice the frequency: two tents stacked side by side. A direct computation on each quarter-interval gives

A plot on β ∈ [0, 1] showing two functions: the green tent d(β) = min(β, 1-β) climbing to 1/2 at β = 1/2 then descending, and the orange double-tent d(2β mod 1) with peaks at β = 1/4 and 3/4. Two shaded regions sit between β = 1/3 and 1/2, and between β = 1/2 and 2/3, where the orange function lies below the green. Total shaded length 1/3.

The probability we want is the total length of the β\beta-interval on which the orange tents (the high-frequency function) are below the green tent (the low-frequency one). Reading off each piece:

β[0,14]:2β<β    β<0.Empty.β[14,12]:12β<β    β>13.Length 1213=16.β[12,34]:2β1<1β    β<23.Length 2312=16.β[34,1]:22β<1β    β>1.Empty.\begin{aligned} \beta \in [0,\tfrac14]:\quad & 2\beta < \beta \iff \beta < 0.\quad \text{Empty.} \\ \beta \in [\tfrac14, \tfrac12]:\quad & 1 - 2\beta < \beta \iff \beta > \tfrac13.\quad \text{Length } \tfrac12 - \tfrac13 = \tfrac16. \\ \beta \in [\tfrac12, \tfrac34]:\quad & 2\beta - 1 < 1 - \beta \iff \beta < \tfrac23.\quad \text{Length } \tfrac23 - \tfrac12 = \tfrac16. \\ \beta \in [\tfrac34, 1]:\quad & 2 - 2\beta < 1 - \beta \iff \beta > 1.\quad \text{Empty.} \end{aligned}

Adding the four contributions, P2=0+16+16+0=13P_2 = 0 + \tfrac16 + \tfrac16 + 0 = \tfrac13.

The same recipe works for general mm: the function d(mβmod1)d(m\beta \bmod 1) has 2m2m linear pieces, and on each piece the comparison with d(β)d(\beta) is a single linear inequality whose solution set is an interval (or empty). Machine arithmetic with exact rationals can carry the calculation out to whatever mm we want.

Step 7: a table for PmP_m and a closed form

Carrying out exactly that integration for m=1,2,,12m = 1, 2, \dots, 12 in exact rational arithmetic (the code is at the end of this article) gives P1=0, P2=13, P3=12, P4=715, P5=12, P6=1735, P7=12, P8=3163, P9=12,P_1 = 0,\ P_2 = \tfrac{1}{3},\ P_3 = \tfrac{1}{2},\ P_4 = \tfrac{7}{15},\ P_5 = \tfrac{1}{2},\ P_6 = \tfrac{17}{35},\ P_7 = \tfrac{1}{2},\ P_8 = \tfrac{31}{63},\ P_9 = \tfrac{1}{2},\dots

Two patterns leap off the page. Every odd m3m \geq 3 gives Pm=1/2P_m = 1/2 exactly. The even values P2kP_{2k} fit the formula P2k=2k214k21.P_{2k} = \frac{2k^2 - 1}{4k^2 - 1}. Quick check: P2=(21)/(41)=1/3P_2 = (2-1)/(4-1) = 1/3 at k=1k = 1; P4=(81)/(161)=7/15P_4 = (8-1)/(16-1) = 7/15 at k=2k = 2; P6=(181)/(361)=17/35P_6 = (18-1)/(36-1) = 17/35 at k=3k = 3. The pattern matches.

Both patterns deserve a proof. The first has a slick one. The second needs more work.

Why Pm=1/2P_m = 1/2 for every odd m3m \geq 3

Here is the nice symmetry. The integral defining PmP_m is invariant under the substitution ββ\beta \mapsto \beta', where β:=(β+12)mod1\beta' := (\beta + \tfrac12) \bmod 1 is the antipode of β\beta on our length-1 circle. This substitution is a measure-preserving bijection of [0,1)[0, 1) to itself, so any probability over a uniform β\beta is the same as the corresponding probability over a uniform β\beta'.

What does the substitution do to our two circle distances?

First, d(β)d(\beta'). Shifting by 1/21/2 moves a point to its antipode. The antipode of a point at circle-distance d(β)d(\beta) from 00 sits at circle-distance 12d(β)\tfrac12 - d(\beta) from 00. (Check: if β=0.1\beta = 0.1, then β=0.6\beta' = 0.6, and d(β)=10.6=0.4=0.50.1=0.5d(β)d(\beta') = 1 - 0.6 = 0.4 = 0.5 - 0.1 = 0.5 - d(\beta). If β=0.7\beta = 0.7, then β=0.2\beta' = 0.2, and d(β)=0.2=0.50.3=0.5d(β)d(\beta') = 0.2 = 0.5 - 0.3 = 0.5 - d(\beta).) So d(β)=12d(β).d(\beta') = \tfrac12 - d(\beta).

Second, d(mβmod1)d(m\beta' \bmod 1). Compute: mβ=mβ+m2=mβ+m12+12.m\beta' = m\beta + \tfrac{m}{2} = m\beta + \tfrac{m-1}{2} + \tfrac12. For odd mm, the term (m1)/2(m-1)/2 is an integer. Reducing modulo 1 kills the integer: mβmod1=(mβ+12)mod1.m\beta' \bmod 1 = (m\beta + \tfrac12) \bmod 1. So mβmod1m\beta' \bmod 1 is the antipode of mβmod1m\beta \bmod 1, and by the same antipode rule, d(mβmod1)=12d(mβmod1).d(m\beta' \bmod 1) = \tfrac12 - d(m\beta \bmod 1).

Now substitute everything into the inequality d(mβmod1)<d(β)d(m\beta \bmod 1) < d(\beta). After substitution it becomes 12d(mβmod1)<12d(β),\tfrac12 - d(m\beta \bmod 1) < \tfrac12 - d(\beta), which simplifies to d(mβmod1)>d(β).d(m\beta \bmod 1) > d(\beta). The substitution flipped the direction of the inequality. So Pm=P(d(mβmod1)<d(β))=P(d(mβmod1)>d(β)).P_m = \mathbb{P}(d(m\beta \bmod 1) < d(\beta)) = \mathbb{P}(d(m\beta \bmod 1) > d(\beta)). The equality case d(mβmod1)=d(β)d(m\beta \bmod 1) = d(\beta) has zero probability (it occurs on a finite set of β\beta-values, which has Lebesgue measure zero), so the two complementary events have probabilities summing to 1. Each must be 1/21/2.

Why P2k=2k214k21P_{2k} = \tfrac{2k^2 - 1}{4k^2 - 1}

The slick substitution above fails for even mm, because the term (m1)/2(m-1)/2 is no longer an integer and so does not vanish modulo 1. We have to roll up our sleeves and integrate. The same piecewise-linear approach we used by hand for m=2m = 2 goes through for general m=2km = 2k; it is just longer.

Halve the interval by symmetry. The substitution β1β\beta \mapsto 1 - \beta is a measure-preserving bijection of [0,1)[0, 1) to itself. It sends β\beta to its mirror image about 1/21/2. Under it, d(β)=min(β,1β)d(\beta) = \min(\beta, 1-\beta) is unchanged (since min(1β,β)=min(β,1β)\min(1-\beta, \beta) = \min(\beta, 1-\beta)), and similarly d(2kβmod1)d(2k\beta \bmod 1) is unchanged (since dd is symmetric: d(1x)=d(x)d(1-x) = d(x), and 2k(1β)mod1=(2kβ)mod12k(1-\beta) \bmod 1 = (-2k\beta) \bmod 1). So the integral over [0,1][0, 1] is twice the integral over [0,1/2][0, 1/2]. We compute the latter and double.

The structure of d(2kβmod1)d(2k\beta \bmod 1) on [0,1/2][0, 1/2]. On [0,1/2][0, 1/2], d(β)=βd(\beta) = \beta, the simpler of the two functions. The function h(β):=d(2kβmod1)h(\beta) := d(2k\beta \bmod 1) has period 1/(2k)1/(2k) in β\beta (because adding 1/(2k)1/(2k) to β\beta shifts 2kβ2k\beta by 1, which is killed by mod1\bmod 1). The interval [0,1/2][0, 1/2] contains exactly kk full periods, indexed by p=0,1,,k1p = 0, 1, \dots, k - 1.

The pp-th period is the interval [p2k,p+12k]\bigl[\tfrac{p}{2k},\, \tfrac{p+1}{2k}\bigr], on which hh traces out a tent of height 1/21/2. Within this period, the tent’s left half is the interval [p2k,2p+14k]\bigl[\tfrac{p}{2k},\, \tfrac{2p+1}{4k}\bigr], where hh rises linearly from 00 to 1/21/2 with slope 2k2k: h(β)=2kβpon the left half of the p-th period.h(\beta) = 2k\beta - p \quad \text{on the left half of the $p$-th period.} The right half is [2p+14k,p+12k]\bigl[\tfrac{2p+1}{4k},\, \tfrac{p+1}{2k}\bigr], where hh falls from 1/21/2 to 00 with slope 2k-2k: h(β)=(p+1)2kβon the right half of the p-th period.h(\beta) = (p + 1) - 2k\beta \quad \text{on the right half of the $p$-th period.}

One period of the tent h(β) = ||2kβ|| over the interval [p/(2k), (p+1)/(2k)], peaking at 1/2 at the midpoint (2p+1)/(4k). The diagonal line y = β is overlaid. Two shaded regions where the tent dips below the diagonal: a left-cross sub-interval [p/(2k), p/(2k-1)] and a right-cross sub-interval [(p+1)/(2k+1), (p+1)/(2k)].

The diagonal y=βy = \beta has slope 11, while the tent has slope ±2k\pm 2k. The tent crosses y=βy = \beta once on each half, so the cross region inside the period is two short intervals at the ends.

Integrating piece by piece. We want, on each period, the set of β\beta where h(β)<βh(\beta) < \beta.

Left half of period pp. Solve 2kβp<β2k\beta - p < \beta: (2k1)β<p,i.e.,β<p2k1.(2k - 1)\beta < p, \quad\text{i.e.,}\quad \beta < \frac{p}{2k - 1}. For p=0p = 0 this gives β<0\beta < 0, empty. For p1p \geq 1 we intersect with the left-half interval [p2k,2p+14k]\bigl[\tfrac{p}{2k},\, \tfrac{2p+1}{4k}\bigr]. Note p2k<p2k1\tfrac{p}{2k} < \tfrac{p}{2k-1} (denominators), so the lower bound is p/(2k)p/(2k); and one can check p2k12p+14k\tfrac{p}{2k-1} \leq \tfrac{2p+1}{4k} holds for pk1p \leq k - 1 (cross-multiplying gives 4kp(2p+1)(2k1)=4kp+2k2p14kp \leq (2p+1)(2k-1) = 4kp + 2k - 2p - 1, equivalent to 2k2p102k - 2p - 1 \geq 0, which is true for pk1p \leq k - 1). So the upper bound is p/(2k1)p/(2k-1), and the contribution from the left half of period pp is p2k1p2k=p(2k(2k1))(2k1)(2k)=p(2k1)(2k).\frac{p}{2k - 1} - \frac{p}{2k} = \frac{p \cdot \bigl(2k - (2k-1)\bigr)}{(2k - 1)(2k)} = \frac{p}{(2k - 1)(2k)}.

Right half of period pp. Solve (p+1)2kβ<β(p + 1) - 2k\beta < \beta: (2k+1)β>p+1,i.e.,β>p+12k+1.(2k + 1)\beta > p + 1, \quad\text{i.e.,}\quad \beta > \frac{p + 1}{2k + 1}. Intersect with the right-half interval [2p+14k,p+12k]\bigl[\tfrac{2p+1}{4k},\, \tfrac{p+1}{2k}\bigr]. By a similar denominator check, 2p+14k<p+12k+1\tfrac{2p+1}{4k} < \tfrac{p+1}{2k+1} (cross-multiply: (2p+1)(2k+1)=4kp+2k+2p+1(2p+1)(2k+1) = 4kp + 2k + 2p + 1 vs. 4k(p+1)=4kp+4k4k(p+1) = 4kp + 4k, difference 4k2k2p1=2k2p104k - 2k - 2p - 1 = 2k - 2p - 1 \geq 0 for pk1p \leq k - 1); and p+12k12\tfrac{p+1}{2k} \leq \tfrac12 for pk1p \leq k - 1 (with equality at p=k1p = k - 1, where the right end of the period is exactly 1/21/2). So the contribution from the right half of period pp is p+12kp+12k+1=(p+1)((2k+1)2k)(2k)(2k+1)=p+1(2k)(2k+1).\frac{p + 1}{2k} - \frac{p + 1}{2k + 1} = \frac{(p + 1)\cdot\bigl((2k+1) - 2k\bigr)}{(2k)(2k + 1)} = \frac{p + 1}{(2k)(2k + 1)}.

Sum the periods. Adding both halves over p=0,1,,k1p = 0, 1, \dots, k - 1:

measure on [0,12]=p=0k1p(2k1)(2k)+p=0k1p+1(2k)(2k+1)=1(2k1)(2k)p=0k1p+1(2k)(2k+1)p=0k1(p+1)=1(2k1)(2k)(k1)k2+1(2k)(2k+1)k(k+1)2=k14(2k1)+k+14(2k+1).\begin{aligned} \text{measure on } [0, \tfrac12] &= \sum_{p=0}^{k-1} \frac{p}{(2k - 1)(2k)} + \sum_{p=0}^{k-1} \frac{p + 1}{(2k)(2k + 1)} \\ &= \frac{1}{(2k - 1)(2k)} \sum_{p=0}^{k-1} p + \frac{1}{(2k)(2k + 1)} \sum_{p=0}^{k-1} (p + 1) \\ &= \frac{1}{(2k - 1)(2k)} \cdot \frac{(k - 1)k}{2} + \frac{1}{(2k)(2k + 1)} \cdot \frac{k(k + 1)}{2} \\ &= \frac{k - 1}{4(2k - 1)} + \frac{k + 1}{4(2k + 1)}. \end{aligned}

We used p=0k1p=(k1)k/2\sum_{p=0}^{k-1} p = (k - 1)k/2 and p=0k1(p+1)=q=1kq=k(k+1)/2\sum_{p=0}^{k-1} (p + 1) = \sum_{q=1}^{k} q = k(k + 1)/2. Doubling, by the symmetry we opened with, P2k=k12(2k1)+k+12(2k+1).P_{2k} = \frac{k - 1}{2(2k - 1)} + \frac{k + 1}{2(2k + 1)}.

Putting it on a common denominator 2(2k1)(2k+1)=2(4k21)2(2k-1)(2k+1) = 2(4k^2 - 1), the numerator becomes (k1)(2k+1)+(k+1)(2k1).(k - 1)(2k + 1) + (k + 1)(2k - 1). Expand each piece: (k1)(2k+1)=2k2+k2k1=2k2k1(k-1)(2k+1) = 2k^2 + k - 2k - 1 = 2k^2 - k - 1, and (k+1)(2k1)=2k2k+2k1=2k2+k1(k+1)(2k-1) = 2k^2 - k + 2k - 1 = 2k^2 + k - 1. Adding, (2k2k1)+(2k2+k1)=4k22(2k^2 - k - 1) + (2k^2 + k - 1) = 4k^2 - 2. So P2k=4k222(4k21)=2k214k21.P_{2k} = \frac{4k^2 - 2}{2(4k^2 - 1)} = \frac{2k^2 - 1}{4k^2 - 1}.

Sanity check. At k=1k = 1, 1/31/3, matching P2P_2. At k=2k = 2, 7/157/15, matching P4P_4. At k=3k = 3, 17/3517/35, matching P6P_6.

Step 8: summing the PmP_m‘s

We now want to compute E[Nn]=m=1n1Pm\mathbb{E}[N_n] = \sum_{m=1}^{n-1} P_m. Split the sum by the parity of mm. Among the values m=1,2,,n1m = 1, 2, \dots, n-1:

  • m=1m = 1 contributes 00.
  • The odd values m=3,5,m = 3, 5, \dots each contribute 1/21/2. There are n/21\lfloor n/2 \rfloor - 1 of them (the odd numbers strictly between 1 and nn).
  • The even values m=2,4,,2Km = 2, 4, \dots, 2K each contribute P2k=(2k21)/(4k21)P_{2k} = (2k^2 - 1)/(4k^2 - 1). Here K=(n1)/2K = \lfloor (n-1)/2 \rfloor, the number of even values among {1,2,,n1}\{1, 2, \dots, n-1\}.

So E[Nn]=0+(n/21)12+k=1K2k214k21.\mathbb{E}[N_n] = 0 + \bigl(\lfloor n/2 \rfloor - 1\bigr) \cdot \tfrac12 + \sum_{k=1}^{K} \frac{2k^2 - 1}{4k^2 - 1}. The even-mm summand has a tidy rewrite: 2k214k21=1212(4k21).\frac{2k^2 - 1}{4k^2 - 1} = \frac{1}{2} - \frac{1}{2(4k^2 - 1)}. Check: 1212(4k21)=(4k21)12(4k21)=4k222(4k21)=2k214k21\tfrac12 - \tfrac{1}{2(4k^2-1)} = \tfrac{(4k^2-1) - 1}{2(4k^2-1)} = \tfrac{4k^2 - 2}{2(4k^2-1)} = \tfrac{2k^2 - 1}{4k^2 - 1}. ✓

Substituting, E[Nn]=(n/21)12+K212k=1K14k21.\mathbb{E}[N_n] = \bigl(\lfloor n/2 \rfloor - 1\bigr) \cdot \tfrac12 + \frac{K}{2} - \frac{1}{2} \sum_{k=1}^{K} \frac{1}{4k^2 - 1}. The first two terms are just half the count of all mm‘s that contribute 1/21/2 each. The total count of contributors of either parity is n2n - 2 (we have n1n - 1 values of mm, of which one, namely m=1m = 1, contributes 00). So (n/21)+K=n2,\bigl(\lfloor n/2 \rfloor - 1\bigr) + K = n - 2, which means (n/21)12+K2=n22.\bigl(\lfloor n/2 \rfloor - 1\bigr) \cdot \tfrac12 + \tfrac{K}{2} = \tfrac{n - 2}{2}. A small sanity check at n=5n = 5: odd m{3}m \in \{3\} has count 1; even m{2,4}m \in \{2, 4\} has count K=2K = 2; total 1+2=3=n21 + 2 = 3 = n - 2. ✓

So E[Nn]=n2212k=1K14k21,K=(n1)/2.\mathbb{E}[N_n] = \frac{n - 2}{2} - \frac{1}{2} \sum_{k=1}^{K} \frac{1}{4k^2 - 1}, \qquad K = \lfloor (n - 1)/2 \rfloor. The only mystery left is the small tail sum.

Step 9: telescope the sum

The denominator factors: 4k21=(2k1)(2k+1).4k^2 - 1 = (2k - 1)(2k + 1). Partial fractions then give 1(2k1)(2k+1)=12(12k112k+1).\frac{1}{(2k-1)(2k+1)} = \frac{1}{2}\left(\frac{1}{2k-1} - \frac{1}{2k+1}\right). Quick check. The right side equals 12(2k+1)(2k1)(2k1)(2k+1)=122(2k1)(2k+1)=1(2k1)(2k+1)\tfrac12 \cdot \tfrac{(2k+1) - (2k-1)}{(2k-1)(2k+1)} = \tfrac12 \cdot \tfrac{2}{(2k-1)(2k+1)} = \tfrac{1}{(2k-1)(2k+1)}. ✓

The point of partial fractions here is that the sum now telescopes: each negative term in one summand cancels the positive term in the next. Writing the first few out:

k=1K14k21=12k=1K(12k112k+1)=12[(1113)+(1315)+(1517)++(12K112K+1)]=12(112K+1)=1212(2K+1).\begin{aligned} \sum_{k=1}^{K} \frac{1}{4k^2 - 1} &= \frac{1}{2} \sum_{k=1}^{K} \left(\frac{1}{2k-1} - \frac{1}{2k+1}\right) \\ &= \frac{1}{2}\left[\left(\frac{1}{1} - \frac{1}{3}\right) + \left(\frac{1}{3} - \frac{1}{5}\right) + \left(\frac{1}{5} - \frac{1}{7}\right) + \cdots + \left(\frac{1}{2K-1} - \frac{1}{2K+1}\right)\right] \\ &= \frac{1}{2}\left(1 - \frac{1}{2K + 1}\right) \\ &= \frac{1}{2} - \frac{1}{2(2K + 1)}. \end{aligned}

The middle line is where the work happens: 1/3-1/3 from the first parenthesis kills the +1/3+1/3 from the second, 1/5-1/5 kills +1/5+1/5, and so on down the line. Only the very first +1+1 and the very last 1/(2K+1)-1/(2K+1) survive.

Substituting back into Step 8, E[Nn]=n2212(1212(2K+1))=n2214+14(2K+1)=2n54+14(2K+1).\mathbb{E}[N_n] = \frac{n - 2}{2} - \frac{1}{2}\left(\frac{1}{2} - \frac{1}{2(2K+1)}\right) = \frac{n - 2}{2} - \frac{1}{4} + \frac{1}{4(2K + 1)} = \frac{2n - 5}{4} + \frac{1}{4(2K + 1)}.

Step 10: the exact closed form

The final job is to simplify 2K+12K + 1 in terms of nn. Recall K=(n1)/2K = \lfloor (n-1)/2 \rfloor:

  • If nn is odd, n1n - 1 is even, K=(n1)/2K = (n-1)/2, so 2K+1=n2K + 1 = n.
  • If nn is even, n1n - 1 is odd, K=(n2)/2K = (n-2)/2, so 2K+1=n12K + 1 = n - 1.

Define n=nn_\ast = n for nn odd, and n=n1n_\ast = n - 1 for nn even. We have proved  E[Nn]=2n54+14n. \boxed{\ \mathbb{E}[N_n] = \frac{2n - 5}{4} + \frac{1}{4 n_\ast}.\ }

That is the answer. Two things are worth noticing.

First, as nn \to \infty the residual 1/(4n)1/(4 n_\ast) vanishes and E[Nn](2n5)/4=n254\mathbb{E}[N_n] \to (2n - 5)/4 = \tfrac{n}{2} - \tfrac{5}{4}. A plausible-looking guess might be that the nn-th strand crosses “half of the previous ones,” i.e. (n1)/2=n212(n-1)/2 = \tfrac{n}{2} - \tfrac12. The true answer undershoots that guess by exactly 34\tfrac34 in the limit. The discrepancy comes from the fact that consecutive strands (m=1m = 1) share a boundary endpoint and so never cross at all, which systematically depresses the count.

Second, the residual 1/(4n)1/(4 n_\ast) decays like 1/(4n)1/(4n) but does so in pairs of equal height: n=3n = 3 and n=4n = 4 both give residual 1/121/12; n=5n = 5 and n=6n = 6 both give 1/201/20; and so on. Going from an odd nn to the next n+1n + 1 does not move nn_\ast at all, so the residual stays put.

Small-nn table

nnE[Nn]\mathbb{E}[N_n] exactdecimal(2n5)/4(2n-5)/4
31/31/30.33330.2500
45/65/60.83330.7500
513/1013/101.30001.2500
1034/934/93.77783.7500
20333/38333/388.76328.7500
30399/29399/2913.758613.7500
501164/491164/4923.755123.7500
1009653/1989653/19848.752548.7500

Monte Carlo verification

A plot of E[N_n] versus strand index n, with the (n-1)/2 heuristic line, the (2n-5)/4 asymptote, the exact closed-form curve, and 80,000-trial Monte Carlo dots overlaid. The dots sit on the closed-form line out to n = 100. An inset shows the exact residual 1/(4 n_*) decaying as 1/(4n) in pairs of equal height.

Each dot is the average of 80,000 random β\beta draws. For each draw we build the boundary positions {0,β,2β,,100β}mod1\{0, \beta, 2\beta, \dots, 100\beta\} \bmod 1 and, for each strand nn, count by direct geometry how many of the previous n1n - 1 strands it crosses. The dots sit on the closed-form curve all the way out to n=100n = 100. The inset shows the exact residual E[Nn](2n5)/4=1/(4n)\mathbb{E}[N_n] - (2n - 5)/4 = 1/(4 n_\ast), which is already about 0.0025 at n=100n = 100 and decays as 1/(4n)1/(4n) in pairs of equal height.

Python code

import numpy as np
from fractions import Fraction

def positions(n, beta):
    """Boundary positions of P_0, P_1, ..., P_n in [0, 1)."""
    return (np.arange(n + 1) * beta) % 1.0

def to_xy(pos):
    """Map a position in [0, 1) to its (x, y) on the unit circle."""
    a = 2 * np.pi * pos
    return np.column_stack([np.cos(a), np.sin(a)])

def segments_cross(p1, p2, p3, p4, eps=1e-12):
    """Open segments p1-p2 and p3-p4 cross strictly inside the disk?"""
    d1, d2 = p2 - p1, p4 - p3
    denom = d1[0]*d2[1] - d1[1]*d2[0]
    if abs(denom) < eps:
        return False
    diff = p3 - p1
    t = (diff[0]*d2[1] - diff[1]*d2[0]) / denom
    s = (diff[0]*d1[1] - diff[1]*d1[0]) / denom
    return eps < t < 1-eps and eps < s < 1-eps

def E_Nn_montecarlo(n_max=100, n_trials=80_000, seed=0):
    """Estimate E[N_n] for n = 2..n_max by Monte Carlo."""
    rng = np.random.default_rng(seed)
    counts = np.zeros(n_max + 1)
    for _ in range(n_trials):
        beta = rng.uniform(0, 1)
        pts = to_xy(positions(n_max, beta))
        for n in range(2, n_max + 1):
            a, b = pts[n-1], pts[n]
            counts[n] += sum(
                segments_cross(a, b, pts[k-1], pts[k])
                for k in range(1, n)
            )
    return counts / n_trials

def exact_E_Nn(n):
    """Closed form: (2n-5)/4 + 1/(4 n_*) where
    n_* = n if n is odd, else n - 1."""
    n_star = n if n % 2 == 1 else n - 1
    return Fraction(2*n - 5, 4) + Fraction(1, 4 * n_star)