Library · The Fiddler: Solutions · Chapter 1

Bouncing Billiards

Revised Report an error

In the game of bouncing billiards, a cue ball of radius 11 is centred at (0,0)(0,0) and a red ball of radius 11 is centred at (0,5)(0,5). The table has a top wall along y=10y = 10 and two side walls along x=5x = 5 and x=−5x = -5, 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.

The table. The cue ball’s centre can only reach the dashed walls, one unit inside the real ones, and it hits the red ball when it enters the dashed circle of radius 2 . The orange path is a one-bounce shot.
The table. The cue ball’s centre can only reach the dashed walls, one unit inside the real ones, and it hits the red ball when it enters the dashed circle of radius 22. The orange path is a one-bounce shot.

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 −4≤x≤4-4 \le x \le 4, y≤9y \le 9, and bounces off the lines x=±4x = \pm 4 and y=9y = 9. Two balls of radius 11 touch when their centres are 22 apart, so the shot succeeds when the centre enters the disc of radius 22 about (0,5)(0,5). The cue ball has become a point and the red ball a target disc of radius 22.

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 x=4x = 4 sends (x,y)(x, y) to (8−x,y)(8 - x, y), and reflecting in x=−4x = -4 sends it to (−8−x,y)(-8 - x, y), so repeated side reflections place copies of the target at (8m,5)(8m, 5) for every whole number mm, reached after ∣m∣|m| side bounces. Reflecting in the top line y=9y = 9 sends (x,y)(x, y) to (x,18−y)(x, 18 - y), which moves the targets to (8m,13)(8m, 13), 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 y=5y = 5 and a second row along y=13y = 13, shown in the second figure with each disc labelled by its number of bounces.

The unfolded table. Dashed lines are the walls of the mirror copies; each disc is an image of the red ball, labelled with the number of bounces needed to reach it. Shots in the grey wedges miss every disc.
The unfolded table. Dashed lines are the walls of the mirror copies; each disc is an image of the red ball, labelled with the number of bounces needed to reach it. Shots in the grey wedges miss every disc.

One more observation settles which directions can work at all. A shot aimed downwards (below the horizontal) never climbs, so its centre stays below y=0y = 0 and can never come within 22 of the red ball’s centre at height 55. Half of all directions fail at once, and only upward rays matter.

A ray from the origin meets a disc of radius 22 whose centre is at distance dd in a fan of directions. The two edges of the fan are the tangent lines, which make an angle arcsin⁡(2/d)\arcsin(2/d) 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 dd and opposite side 22. A disc whose centre lies in direction φ\varphi is therefore hit by every ray within arcsin⁡(2/d)\arcsin(2/d) of φ\varphi.

At most one bounce. The discs reachable with at most one bounce are (0,5)(0, 5) with no bounce, (±8,5)(\pm 8, 5) with one side bounce, and (0,13)(0, 13) with one top bounce. The last one adds nothing. It lies straight above (0,5)(0,5) and, being farther away, is hit by a narrower fan of rays (arcsin⁡(2/13)<arcsin⁡(2/5)\arcsin(2/13) < \arcsin(2/5)); every ray that reaches it passes through the disc at (0,5)(0,5) first, and in the real game that shot hits the red ball directly.

The direct fan is centred on the vertical, with half-width arcsin⁡(2/5)≈23.58∘\arcsin(2/5) \approx 23.58^\circ, so it runs from 66.42∘66.42^\circ to 113.58∘113.58^\circ. The disc at (8,5)(8, 5) lies at distance 89\sqrt{89} in direction arctan⁡(5/8)≈32.01∘\arctan(5/8) \approx 32.01^\circ, with half-width arcsin⁡(2/89)≈12.24∘\arcsin(2/\sqrt{89}) \approx 12.24^\circ, so its fan runs from 19.77∘19.77^\circ to 44.24∘44.24^\circ; the disc at (−8,5)(-8,5) mirrors it. The three fans do not overlap. And a ray in the fan of (8,5)(8,5) really does reach the red ball after one bounce: it misses the disc at (0,5)(0,5), and it stays below y=9y = 9 until it gets there, so the only wall it crosses is x=4x = 4.

The successful directions make up 2arcsin⁡(2/5)+4arcsin⁡(2/89)2\arcsin(2/5) + 4\arcsin(2/\sqrt{89}) out of a full turn of 2π2\pi, so  P  =  arcsin⁡(2/5)+2arcsin⁡ ⁣(2/89)π  ≈  0.26698 \boxed{\ P \;=\; \frac{\arcsin(2/5) + 2\arcsin\!\big(2/\sqrt{89}\big)}{\pi} \;\approx\; 0.26698 \ } or about 26.726.7 percent.

The computation

The check does not unfold anything. It plays each shot out on the real table, bouncing the centre off the lines x=±4x = \pm 4 and y=9y = 9, and it finds the set of successful directions by sweeping the angle.

  1. For a given direction, move the centre in a straight line. Work out when it would first come within 22 of (0,5)(0,5) and when it would first reach a wall line. Whichever comes first happens.

  2. 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 33, from which it can never return.

  3. Test 20,00020{,}000 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 00 and π\pi are tested; the downward half fails, as shown above, and still counts in the denominator 2π2\pi.

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 y=5y = 5, and only a few narrow wedges higher up slip through. By symmetry about the vertical, it is enough to look at directions between 0∘0^\circ and 90∘90^\circ.

Shallow shots always succeed. Take a ray of slope s=tan⁡θs = \tan\theta with 0<s≤120 < s \le \tfrac12. It passes the vertical lines x=8,16,24,…x = 8, 16, 24, \dots at heights 8s,16s,24s,…8s, 16s, 24s, \dots, which climb in steps of 8s≤48s \le 4 from a first value of at most 44. The first of these heights to exceed 33 is therefore at most 3+4=73 + 4 = 7, so some height 8ms8ms lies between 33 and 77 (landing exactly on 33 or 77 happens for only finitely many directions, which carry no probability). At that moment the ray is directly above or below the centre (8m,5)(8m, 5) and within 22 of it vertically, so it is within 22 of it outright: it enters that disc. The ray is still below y=9y = 9, so this really is an image disc of the lower row, and the shot succeeds. Every direction from 0∘0^\circ up to arctan⁡12≈26.57∘\arctan\frac12 \approx 26.57^\circ works.

Steeper shots. Between 26.57∘26.57^\circ and 90∘90^\circ only a handful of discs can matter. Above 44∘44^\circ the slope exceeds 0.960.96, so beyond x=22x = 22 the ray is higher than 2121, above every disc (the highest reach y=15y = 15); discs with m≥3m \ge 3 are out of reach, and discs with m≤−1m \le -1 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
(8,5)(8, 5) 11 arctan⁡58=32.01∘\arctan\frac58 = 32.01^\circ 19.77∘19.77^\circ to 44.24∘44.24^\circ
(16,13)(16, 13) 33 arctan⁡1316=39.09∘\arctan\frac{13}{16} = 39.09^\circ 33.53∘33.53^\circ to 44.66∘44.66^\circ
(8,13)(8, 13) 22 arctan⁡138=58.39∘\arctan\frac{13}{8} = 58.39^\circ 50.86∘50.86^\circ to 65.92∘65.92^\circ
(0,5)(0, 5) 00 90∘90^\circ 66.42∘66.42^\circ to 113.58∘113.58^\circ

The remaining nearby discs add nothing: the fan of (16,5)(16, 5) ends at 24.2∘24.2^\circ, inside the shallow range, and the fan of (0,13)(0, 13) lies inside that of (0,5)(0, 5). Reading up the table, the directions are covered from 26.57∘26.57^\circ to 44.66∘44.66^\circ, then there is a gap up to 50.86∘50.86^\circ, coverage to 65.92∘65.92^\circ, a thin gap up to 66.42∘66.42^\circ, 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 G=[π2−arcsin⁡25]−[arctan⁡1316+arcsin⁡2425]−2arcsin⁡2233,G = \Big[\tfrac{\pi}{2} - \arcsin\tfrac25\Big] - \Big[\arctan\tfrac{13}{16} + \arcsin\tfrac{2}{\sqrt{425}}\Big] - 2\arcsin\tfrac{2}{\sqrt{233}}, since the gaps run from the top of the (16,13)(16,13) fan to the bottom of the (0,5)(0,5) fan, minus the full width of the (8,13)(8,13) fan in between. The gaps on the left are the mirror images, so the successful directions measure π−2G\pi - 2G out of 2π2\pi, and the probability is 12−G/π\tfrac12 - G/\pi:  P=1π(arcsin⁡25+2arcsin⁡2233+arctan⁡1316+arcsin⁡2425)  ≈  0.46276 \boxed{\ \begin{aligned} P &= \frac{1}{\pi}\Big(\arcsin\tfrac25 + 2\arcsin\tfrac{2}{\sqrt{233}}\\ &\qquad\quad + \arctan\tfrac{13}{16} + \arcsin\tfrac{2}{\sqrt{425}}\Big) \;\approx\; 0.46276 \end{aligned}\ } or about 46.346.3 percent. Allowing unlimited bounces raises the chance from about 2727 percent to 4646 percent; with the downward half of all directions lost for good, the most it could ever have been is 5050 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 5/(8tan⁡θ)5/(8\tan\theta)), 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, 0.46276044840…0.46276044840\ldots, to all ten places. A plain Monte Carlo run of two million random shots on the same simulator gives 0.4624±0.00040.4624 \pm 0.0004.

Report an error on this page

Reports are stored by Netlify. See the privacy note.