Average Arc Length Containing a Fixed Point on a Circle
Math & Bit ManipulationAuto-graded · 14 test casesLast updated
Tests understanding of geometric probability, the inspection paradox, and computing expectations when a random partition is observed from a fixed viewpoint.
Three points are placed independently and uniformly at random on the circumference of a unit circle (radius 1, centered at the origin). These three random points divide the circle into three arcs.
Consider the arc that includes the point (1, 0) — that is, the point at angle 0 radians. What is the expected length of this arc, measured along the circumference?
Return this expected value as a floating-point number.
Constraints:
- The circle has radius 1, so its total circumference is 2π
- Arc length is measured along the curved edge of the circle
- The three points are chosen independently from a uniform distribution on [0, 2π)
- You may assume no point lands exactly at angle 0 (probability zero event)
Examples
Example 1
Input: arc_containing_fixed_point()
Output: 3.141592653589793
Example 2
Input: arc_containing_fixed_point()
Output: 3.141592653589793
Hints
Hint 1
The arc containing angle 0 is bounded by the nearest point in each direction (clockwise and counterclockwise). What are the expected distances to these boundary points?
Hint 2
For n independent uniform random variables on [0, T], the minimum has expected value T/(n+1). Apply this to find the expected distance to the nearest point in each direction.
Hint 3
This is not simply 2π/3 (the average arc length). A fixed observation point is more likely to fall within a longer arc — this is called the inspection paradox or size-biased sampling.
Worked solution
Easy Try it yourself first — then compare your approach, complexity and edge cases.
Approach
The arc that includes the fixed point at angle 0 extends from the nearest random point going counterclockwise to the nearest point going clockwise. We can compute the expected distances in each direction and sum them.
Let the three random points have angles θ₁, θ₂, θ₃, each uniformly distributed on [0, 2π). Define:
- D₁ = distance counterclockwise from 0 to the nearest point = min{θ₁, θ₂, θ₃}
- D₂ = distance clockwise from 0 to the nearest point = min{2π - θ₁, 2π - θ₂, 2π - θ₃}
The arc length is L = D₁ + D₂.
Key insight: For n independent uniform random variables on [0, T], the minimum has expected value T/(n+1).
This follows from P(min > t) = (1 - t/T)ⁿ, which integrates to E[min] = T/(n+1).
With T = 2π and n = 3:
- E[D₁] = 2π/4 = π/2
- E[D₂] = 2π/4 = π/2 (since 2π - θᵢ are also uniform on [0, 2π))
By linearity of expectation (which does not require independence): E[L] = E[D₁] + E[D₂] = π/2 + π/2 = π
Why not 2π/3? The naive answer would be "each of three arcs averages 2π/3 by symmetry." This is wrong because we're observing from a fixed point, not choosing a random arc. The fixed point is more likely to fall within a longer arc, creating a size bias. This phenomenon is called the inspection paradox.
Sanity check: With 2 random points, the formula gives 4π/3, versus an average arc of π. With 1 point, it gives 2π (the whole circle). The containing arc is always larger than average, by a factor that decreases as more points are added.
Time Complexity: O(1) — direct calculation
Space Complexity: O(1) — no additional storage needed
import math
def arc_containing_fixed_point() -> float:
return math.pi