GSO003 Problem 1
Problem Statement
Laser Trajectory in a Fully Mirrored Room
Problem Statement
A square room sits on a flat floor. Define the floor as the x-y coordinate plane.
The four walls of the room stand along the following line segments, and all inner surfaces are ideal mirrors that reflect light perfectly.
- South wall: y=0 (for 0≤x≤W)
- North wall: y=D (for 0≤x≤W)
- West wall: x=0 (for 0≤y≤D)
- East wall: x=W (for 0≤y≤D)
A single, extremely narrow laser beam is fired into the room through a tiny gap at the southwest corner, the origin (0,0).
The light travels in a straight line through the uniform space and reflects off walls following the law of reflection (angle of incidence equals angle of reflection) exactly.
The laser beam reflects first off the north wall, then off the east wall, and finally hits a tiny light-absorbing sensor embedded exactly at the midpoint of the south wall, (W/2,0), where it is absorbed.
Find the total distance L traveled by the laser beam from the origin (0,0) until it hits the sensor.
Constraints
- W=36m
- D=36m
Input Format
Find the total travel distance L in m and give the answer as a positive integer.
Solution
1. The Unfolding Method
Instead of tracing the broken path directly, we use the "unfolding" method: each time the light reflects off a wall, we reflect the virtual space across that wall. In the unfolded space, the light travels in one straight line from start to destination.
2. Tracking the Target in Image Space
The laser reflects in order: north wall → east wall, ending at the sensor (W/2,0).
① First reflection: north wall (y=D)
Reflect the entire space across y=D (upward). The target point (W/2,0) maps to:
(x1,y1)=(2W, 2D)② Second reflection: east wall (x=W)
Now reflect across x=W (rightward). The point (W/2,2D) maps to:
x2=W+(W−2W)=23W=1.5W,y2=2D③ Final destination in image space:
(xtarget, ytarget)=(1.5W, 2D)In the unfolded space, the light travels in a straight line from (0,0) to (1.5W,2D).
3. Computing the Total Distance
L=(1.5W)2+(2D)2Substituting W=36m, D=36m:
1.5W=54m,2D=72m L=542+722=182(32+42)=1825=18×5=90m4. Validity Check
The line from (0,0) to (54,72) has equation y=34x.
- Segment 1: First hits north wall (y=36) at x=27m — within 0<x<36. ✓
- Segment 2: Next hits east wall (x=36) at y=48m — within 36<y<72. ✓
- Segment 3: Reaches (54,72) directly. ✓
Answer: 90