Library · The Fiddler: Solutions · Chapter 1
Bouncing Billiards
In the game of bouncing billiards, a cue ball of radius is centred at and a red ball of radius is centred at . The table has a top wall along and two side walls along and , which run downwards for ever; there is no bottom wall. The table and walls are frictionless, so a ball never slows down, and it bounces off a wall as light bounces off a mirror. You strike the cue ball in a direction chosen uniformly at random, and you want it to hit the red ball.
Your friend challenges you to make the cue ball hit the red ball before it touches the walls twice: it may hit the red ball directly, or after bouncing off a wall exactly once. What is the probability that you succeed?
The Fiddler, Zach Wissner-Gross, November 13, 2026(original post)
The official solution appears in the post of November 20, 2026, which had not been published when this chapter was written. The answers here are my own.
Solution
Two simplifications make the geometry clean. First, follow only the centre of the cue ball. The ball touches a wall when its centre is one unit away, so the centre moves inside the narrower region , , and bounces off the lines and . Two balls of radius touch when their centres are apart, so the shot succeeds when the centre enters the disc of radius about . The cue ball has become a point and the red ball a target disc of radius .
Second, unfold the bounces. When a point bounces off a mirror, its path after the bounce is the mirror image of the straight line it would have followed had the mirror not been there. So instead of bending the path, reflect the table: each time the centre reaches a wall, let it carry straight on into a mirror copy of the table on the other side. The bouncing path becomes a straight ray from the origin, and the red ball is replaced by its mirror images, one in each copy of the table. A shot succeeds exactly when its ray passes through one of the image discs, and the number of walls it touched on the way is the number of wall lines the ray crossed before getting there.
Where are the images? Reflecting in the line sends to , and reflecting in sends it to , so repeated side reflections place copies of the target at for every whole number , reached after side bounces. Reflecting in the top line sends to , which moves the targets to , one bounce more. There is only ever one top bounce: the side walls never change the vertical part of the velocity, so once the ball is moving downwards it moves downwards for good. The unfolded picture is therefore a row of target discs along and a second row along , shown in the second figure with each disc labelled by its number of bounces.
One more observation settles which directions can work at all. A shot aimed downwards (below the horizontal) never climbs, so its centre stays below and can never come within of the red ball’s centre at height . Half of all directions fail at once, and only upward rays matter.
A ray from the origin meets a disc of radius whose centre is at distance in a fan of directions. The two edges of the fan are the tangent lines, which make an angle with the line to the centre, because the radius to a point of tangency is perpendicular to the tangent and so forms a right triangle with hypotenuse and opposite side . A disc whose centre lies in direction is therefore hit by every ray within of .
At most one bounce. The discs reachable with at most one bounce are with no bounce, with one side bounce, and with one top bounce. The last one adds nothing. It lies straight above and, being farther away, is hit by a narrower fan of rays (); every ray that reaches it passes through the disc at first, and in the real game that shot hits the red ball directly.
The direct fan is centred on the vertical, with half-width , so it runs from to . The disc at lies at distance in direction , with half-width , so its fan runs from to ; the disc at mirrors it. The three fans do not overlap. And a ray in the fan of really does reach the red ball after one bounce: it misses the disc at , and it stays below until it gets there, so the only wall it crosses is .
The successful directions make up out of a full turn of , so or about percent.
The computation
The check does not unfold anything. It plays each shot out on the real table, bouncing the centre off the lines and , and it finds the set of successful directions by sweeping the angle.
For a given direction, move the centre in a straight line. Work out when it would first come within of and when it would first reach a wall line. Whichever comes first happens.
At a wall, reverse the matching part of the velocity, count the bounce and continue. Stop with a failure when the bounce limit is used up, or when the ball is moving down below height , from which it can never return.
Test evenly spaced upward and downward directions. Wherever two neighbours disagree, locate the switch between success and failure by bisection to machine precision, and add up the lengths of the successful stretches.
import math
def hits(theta, max_bounces):
"""Shoot the cue ball at angle theta and follow it on the real table."""
x, y = 0.0, 0.0 # cue ball's centre
vx, vy = math.cos(theta), math.sin(theta)
bounces = 0
while True:
# first time t at which the centre is 2 from the red ball's centre
px, py = x, y - 5
b = px*vx + py*vy
disc = b*b - (px*px + py*py - 4)
t_red = -b - math.sqrt(disc) if disc > 0 else math.inf
if t_red <= 1e-12:
t_red = math.inf
# first time the centre reaches a wall line (x = +-4, y = 9)
t_wall, wall = math.inf, None
if vx > 0: t_wall, wall = (4 - x)/vx, "side"
if vx < 0: t_wall, wall = (-4 - x)/vx, "side"
if vy > 0 and (9 - y)/vy < t_wall: t_wall, wall = (9 - y)/vy, "top"
if t_red < t_wall:
return True
if vy < 0 and y < 3: # falling below the red ball:
return False # it can never climb back
if bounces == max_bounces:
return False
x, y = x + t_wall*vx, y + t_wall*vy
bounces += 1
if wall == "side": vx = -vx
else: vy = -vy
def success_probability(max_bounces, grid=20000):
"""Measure of successful angles / 2 pi, edges found by bisection."""
angles = [math.pi*k/grid for k in range(1, grid)]
ok = [hits(a, max_bounces) for a in angles]
total = 0.0
def edge(lo, hi, ok_lo): # bisect a success/failure switch
for _ in range(60):
mid = (lo + hi)/2
if hits(mid, max_bounces) == ok_lo: lo = mid
else: hi = mid
return lo
start = 0.0 if ok[0] else None
for i in range(1, len(angles)):
if ok[i] != ok[i-1]:
e = edge(angles[i-1], angles[i], ok[i-1])
if ok[i]: start = e
else: total += e - start
if ok[-1]: total += math.pi - start
return total/(2*math.pi)
print("at most one wall contact: %.10f" % success_probability(1))
It prints
at most one wall contact: 0.2669849726
which is the boxed value to all ten places. Only directions between and are tested; the downward half fails, as shown above, and still counts in the denominator .
Extra Credit
Your friend relents: now the cue ball may bounce off the walls any number of times before it hits the red ball. What is the probability that you succeed?
Solution
Every disc in the unfolded picture now counts, and the question becomes which upward rays miss all of them. The figure suggests the answer: rays close to the horizontal are caught by the long row along , and only a few narrow wedges higher up slip through. By symmetry about the vertical, it is enough to look at directions between and .
Shallow shots always succeed. Take a ray of slope with . It passes the vertical lines at heights , which climb in steps of from a first value of at most . The first of these heights to exceed is therefore at most , so some height lies between and (landing exactly on or happens for only finitely many directions, which carry no probability). At that moment the ray is directly above or below the centre and within of it vertically, so it is within of it outright: it enters that disc. The ray is still below , so this really is an image disc of the lower row, and the shot succeeds. Every direction from up to works.
Steeper shots. Between and only a handful of discs can matter. Above the slope exceeds , so beyond the ray is higher than , above every disc (the highest reach ); discs with are out of reach, and discs with lie on the other side of the vertical. The fans of the relevant discs are, using the same tangent rule:
| disc | bounces | centre direction | fan |
|---|---|---|---|
| to | |||
| to | |||
| to | |||
| to |
The remaining nearby discs add nothing: the fan of ends at , inside the shallow range, and the fan of lies inside that of . Reading up the table, the directions are covered from to , then there is a gap up to , coverage to , a thin gap up to , and coverage again to the vertical. A shot in either gap misses the red ball on its way up, bounces off the top wall near a corner, and misses it again on the way down, after which it can never return.
Adding up. With the tangent rule each gap edge has a closed form. The two gaps on the right have total width since the gaps run from the top of the fan to the bottom of the fan, minus the full width of the fan in between. The gaps on the left are the mirror images, so the successful directions measure out of , and the probability is : or about percent. Allowing unlimited bounces raises the chance from about percent to percent; with the downward half of all directions lost for good, the most it could ever have been is percent.
The computation
The same sweep on the real table, from The computation above, now with no practical limit on the number of bounces. Shallow shots take many bounces before they find the red ball (about ), which the simulator follows one by one.
print("any number of bounces: %.10f" % success_probability(10**6))
It prints
any number of bounces: 0.4627604484
agreeing with the boxed value, , to all ten places. A plain Monte Carlo run of two million random shots on the same simulator gives .