The combination lock
How does a dial padlock know the right numbers?
The question
A dial padlock has no key. Turning one dial somehow checks three numbers. How does it remember them?
Have a guess, then show the answer
Behind the dial is a stack of three wheels, each with a notch, the gate. The dial only drives the first wheel, and each wheel drags the next one by a little pin, so turning back and forth lets you set them one at a time. When all three gates line up, a bar called the fence drops into them and the shackle is free.
Play
Dial the code
The dial is on the left, and the wheel pack behind it is drawn on the right, wheels side by side. Turn the dial and watch the pins pick up the wheels one by one. Get all three gates under the fence, then pull the shackle.
Tap any part of the lock to see what it does.
0 of 3 gates in line.
- Right 3 full turns, then on to 12. All three wheels are picked up; wheel 3 is now set.
- Left: pass 30 twice, stop the third time. Wheel 3 is left behind; wheel 2 is set.
- Right: pass 4 once, stop the second time. Only wheel 1 moves. Then pull.
Drag the dial (clockwise is right), use the buttons, or focus the dial and press the arrow keys.
What's happening
- 1
The wheel pack. Three loose wheels sit on one spindle behind the dial. Each has a gate, a notch cut in its edge, in a place set by the code.
- 2
Drive pins. The dial turns a drive cam. A pin on the cam catches a pin on wheel 1, which catches wheel 2, which catches wheel 3. A wheel only moves once the pin before it has come round and caught it.
- 3
Setting the wheels. Turning one way a few times picks up every wheel; stop on the first number and the far wheel is set. Turn back, and the near wheels are caught again but the far one is left behind. Each change of direction sets one more wheel.
- 4
The fence. A bar rests on the edges of all three wheels. It can only drop when every gate is right under it. Then it lets the latch move and the shackle pull out.
- 5
With 40 numbers on the dial and 3 wheels there are 40 × 40 × 40 = 64,000 possible codes.
The maths
Each wheel can be in any of 40 places, independently, so
In real locks the gates are a little wider than one number, so a code one number out often still opens, and far fewer codes are really different.
Simplified, and sources
In the widget every pickup takes exactly one full turn, so the order is right 3 turns, left 2, right 1, the pattern used on many safe locks. Real padlocks differ by brand; a common set of instructions is right three turns to the first number, left one full turn past it to the second, then right straight to the third, because their pins, drive cam and latch leave different amounts of free play. The wheels are drawn side by side instead of stacked, the gates are exactly one number wide, and 40 numbers is the usual count on a dial padlock but some have more or fewer. 64,000 is the count on paper; how many are really different depends on how loose the gates are.