A submarine starts at an unknown whole number on a line and moves the same unknown whole number of places every turn: forwards, backwards, or not at all. Once a turn you may drop a depth charge on one whole number. A hit sinks it, and a miss tells you nothing.
Can you guarantee to sink it?
Count the turns from 1. A submarine that started at with speed is at on turn . Call it the submarine .
Since a miss tells you nothing, nothing you learn can change what you do next: until the hit, every hunt goes the same way. So a strategy is just a sequence of positions written down in advance, and the question is whether some sequence meets every line .
This is the film's first route, and the point is that it is not slow but dead. Take any turn , any position , and any misses at all on the turns before. A submarine that is at now with speed was at on an earlier turn . A miss on at turn rules that submarine out only if , that is, only if
which is one speed at most. So misses rule out at most of the infinitely many speeds that bring a submarine to by now, and every position is still possible. Ten charges a turn change nothing: they rule out at most speeds.
That is the film's fan. At turn 6, one straight line ends on each position from −24 to 24. Each miss can cross off at most one line through each position, and there are infinitely many lines through each.
This is the film's second route. The unknown is not a place but a pair of whole numbers, and pairs are the points of a grid. Walk the grid in a square spiral, right one, up one, left two, down two, right three, and so on:
The walk finishes the square round the origin in 9 steps, the in 25, and the in , so every pair comes up, and exactly once.
On turn , take the -th pair on the walk, , and drop where that submarine would be:
If the real submarine is the -th pair, it is at on turn , which is where the charge is. Every pair has a place on the walk, so every submarine is sunk on the turn of its place, or earlier if some other pair's charge happens to land on it first. The place is a deadline, not an average.
The spiral is a drawing. Cantor's pairing is a formula, and it needs no drawing at all. First turn the whole numbers into :
which is for and for . Write for the result. Then give the place
which counts along the diagonals one after another. Every pair gets one place and every place one pair, and the hunter is one line of arithmetic: on turn , find the pair whose place is , and drop where it is.
The proof is the same and so is the guarantee; only the deadlines move. The film's submarine has place 49 on this list instead of 26, and in fact it is sunk on turn 2, by luck: turn 2 reads off (−1, 0), whose charge lands on −1, and is at −1 on turn 2 as well.
Neither proof used the fact that the paths are straight. Suppose the submarine follows one of a family of paths that can be put in a list, , each saying where it is on every turn. Drop on
the -th path's position on turn . If the submarine follows , then on turn the charge is at , and so is the submarine. That is the whole proof, and the film's case is . Draw a table with one row for each path and one column for each turn, and the hunter is its diagonal. The next film, The Deep, turns this argument round on itself.
The film follows the submarine that starts at 3 and moves −2 a turn. On the spiral is pair 26, so its deadline is turn 26: 25 misses, then a hit at −49.
| Turn | Pair read off | Drop on | The submarine is at |
|---|---|---|---|
| 1 | (0, 0) | 0 | 1 |
| 2 | (1, 0) | 1 | −1 |
| 3 | (1, 1) | 4 | −3 |
| 4 | (0, 1) | 4 | −5 |
| 5 | (−1, 1) | 4 | −7 |
| 6 | (−1, 0) | −1 | −9 |
| 7 | (−1, −1) | −8 | −11 |
| 8 | (0, −1) | −8 | −13 |
| 9 | (1, −1) | −8 | −15 |
| 10 | (2, −1) | −8 | −17 |
| 11 | (2, 0) | 2 | −19 |
| 12 | (2, 1) | 14 | −21 |
| 13 | (2, 2) | 28 | −23 |
| 14 | (1, 2) | 29 | −25 |
| 15 | (0, 2) | 30 | −27 |
| 16 | (−1, 2) | 31 | −29 |
| 17 | (−2, 2) | 32 | −31 |
| 18 | (−2, 1) | 16 | −33 |
| 19 | (−2, 0) | −2 | −35 |
| 20 | (−2, −1) | −22 | −37 |
| 21 | (−2, −2) | −44 | −39 |
| 22 | (−1, −2) | −45 | −41 |
| 23 | (0, −2) | −46 | −43 |
| 24 | (1, −2) | −47 | −45 |
| 25 | (2, −2) | −48 | −47 |
| 26 | (3, −2) | −49 | −49: hit |
The charges wander because each is aimed at a different submarine. Not one of the 25 misses told the hunter anything, and the hunter did not need to be told.
An earlier version of the script had caught on turn 43. Turn 43 is real, but it belongs to (−3, −3).
Pick a submarine and a hunter, and step through the turns. A shaded square is a submarine that cannot be there, because it would have been sunk already: everything the misses rule out between them. The spiral and the formula clear the whole box. The sweep does not.
| Hunter | Catches (3, −2) | Has sunk all 169 by |
|---|---|---|
| Walk the spiral | turn 26 | turn 169 |
| Cantor's formula | turn 2 | turn 313 |
| Sweep the line | never | never: it only ever sinks 39 of them |
Acceleration. A submarine at has three hidden numbers, and triples can be listed too, shell by shell round the origin. Proof three applies unchanged. The script lists the 343 triples with every entry from −3 to 3 and checks that each is sunk by its own place:
| Submarine | Place on the list | Caught on turn | At |
|---|---|---|---|
| t² | 3 | 3 | 9 |
| 1 − t + t² | 24 | 24 | 553 |
| −2 + 3t − t² | 216 | 1 | 0 |
| 3 − 2t² | 298 | 298 | −177,605 |
The third was sunk on turn 1, by luck: turn 1's charge is on 0, and so is it.
More hidden numbers. Any fixed number of hidden whole numbers can be listed, so a submarine in the plane, with a start and a velocity , is caught by listing quadruples. A polynomial path of any degree with whole coefficients can be listed as well, degree and coefficients together.
Irrational speeds. A submarine with speed must still be on whole numbers, so say it is at . That is not a straight line, since it steps by 1 on some turns and by 2 on others. But it is one rule, so a longer list catches it: list the submarines , for every whole and every , by Cantor's formula, and has place 6. What escapes a list is not being irrational, but being on no list at all.
Big families. The argument needs a family of paths that can be listed, which is what a mathematician calls countable. That is enough, but it is not necessary. The paths that sit on 0 at turn 1 are far too many to list, and one charge on 0 at turn 1 sinks every one of them. What can never be caught is the family of every path: whatever positions a hunter drops on, the submarine at on every turn is never hit.
Real starts and speeds. If and may be any real numbers, with the submarine at , the family is too big to list and the argument says nothing. Whether some cleverer hunter catches all of them is a different question, and this page does not settle it.
A submarine that reacts. Everything here assumes the rule is fixed before the hunt starts. If the submarine may watch the charges and change course, it just moves away from wherever the next one is going.
The sweep, revisited. The sweep does sink some submarines, just not reliably. On an odd turn it drops on , and on an even turn on , so it hits only if one of
has a whole-number solution , and neither has more than one. Of the 361 submarines with it ever sinks 65. The other 296 it never will, however long it runs. In the film the sweep plays against , for which neither equation has a solution, so those misses would go on for ever.
| Speed | Submarines | Ever caught by the sweep |
|---|---|---|
| −2 | 19 | 3 |
| −1 | 19 | 9 |
| 0 | 19 | 19 |
| 1 | 19 | 9 |
| 2 | 19 | 5 |
The spiral clears the box , all submarines in it, by turn , one pair a turn. One charge can sink several submarines at once, since every pair on the line is under it. So is there a quicker hunter?
Not much quicker. A charge on at turn sinks the pairs with , and inside the box that needs , which at most speeds can manage. So any hunter that has cleared the box by turn has
The extra is only about , which is small next to , so for a big box nothing beats the spiral by more than a sliver. At the bound is 0.996 of the spiral's time:
| r | Any hunter needs at least | The spiral | Cantor's formula |
|---|---|---|---|
| 1 | 6 | 9 | 13 |
| 2 | 17 | 25 | 41 |
| 3 | 35 | 49 | 85 |
| 9 | 303 | 361 | 685 |
| 30 | 3,460 | 3,721 | 7,321 |
| 100 | 39,303 | 40,401 | 80,401 |
| 1000 | 3,988,483 | 4,004,001 | 8,004,001 |
For the smallest box, , the script searches every sequence of drops: the best possible is 7 turns, against the bound's 6 and the spiral's 9. Cantor's formula is about twice as slow on a big box. To reach every pair with it has to finish every diagonal up to , a triangle of about places, where the spiral needs a square of about .
None of the above is left to the proofs, as far as finite checking can go. scripts/submarine.mjs reads the film's own hunt.json and rebuilds it from scratch: the spiral's first 120 pairs, the 26 turns of the hunt, the turn-43 pair, the sweep, the film's sweep submarine and the fan of witnesses. Any disagreement stops the build.
The sweep is dead. For every turn up to 39 and every position from −25 to 25, with the film's own sweep as the misses, the script counts the speeds from −400 to 400 that those misses rule out. It is never more than the number of misses, and no position is ever ruled out. It does the same against a hunter who had dropped on every position from to on every earlier turn, up to turn 24, and against random misses with several charges a turn.
| Turn t | Misses | Most speeds lost at a position | Positions ruled out |
|---|---|---|---|
| 1 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 |
| 5 | 4 | 3 | 0 |
| 10 | 9 | 4 | 0 |
| 20 | 19 | 6 | 0 |
| 39 | 38 | 7 | 0 |
| Charges a turn | Cases | Worst share of the bound | Ruled out |
|---|---|---|---|
| 1 | 252 | 71% | 0 |
| 3 | 252 | 58% | 0 |
| 10 | 252 | 46% | 0 |
Every submarine in a box. Both lists are run against every pair in the box. Each pair is checked to be under the charge on its own place, and to be sunk no later than that. Sunk early counts the pairs a charge meant for another pair caught first. The mean is the turn it is actually sunk, luck included.
| List | R | Last deadline | Sunk early | Mean turn |
|---|---|---|---|---|
| Spiral | 9 | 361 | 40 | 163.4 |
| Spiral | 15 | 961 | 75 | 450.7 |
| Formula | 9 | 685 | 42 | 188.1 |
| Formula | 15 | 1,861 | 83 | 521.2 |
The rest. The spiral is checked for 4,000 steps to be one unbroken path with no repeats, and its place formula is checked against the walk. Cantor's formula is checked to be a one-to-one list on its first 200,000 places and on every pair with . The sweep's two equations are checked against the sweep itself for every pair with over 4,000 turns, and survives 100,000 turns of it. The limit of submarines a charge is checked for every possible charge up to and , and the table above uses it. The hunt lab runs the same functions this script imports, and the script checks the pasted copy against them, square by square.
What is not checked. A script can check every submarine in a box, but not every submarine. That all of them are caught is the proof, which is short enough to check by eye. What the script vouches for is that the hunt is built the way the proof says, and that every finite claim on this page is true.
Turn 4, at 4. is the fourth pair on the walk, after , and , so turn 4's charge is at . None of the first three charges lands on it.
On an odd turn the sweep is at and the submarine at , which would need . On an even turn the sweep is at and the submarine at , which would need . Neither has a whole-number solution. The script also runs the two for 100,000 turns.
No. Each charge rules out at most one speed for each position, so after turns a position has lost at most of its infinitely many speeds, and it is still possible. Any finite number of charges a turn gives the same answer. In the script's random histories with ten charges a turn, no position ever lost more than 46% of that allowance, and none was ruled out.
List the four hidden numbers , shell by shell, and on turn drop on for the -th quadruple. The 81 submarines with every entry from −1 to 1 come first, and each is sunk by turn 81.