Battleship at Scale

What does optimal Battleship look like?

I've always played a 3-parity strategy of Battleship, assuming that it was better to hope to get lucky on the 2-ship than hunt exhaustively or randomly. While playing a game with my 7-year-old, I wondered how optimal this was and if there were simple strategies to play that would be better. A quick literature search didn't turn up an answer, so I turned to Claude. The short answer: 3-parity is pretty good, better than the simple alternatives: it beats the checkerboard (2-parity) on random and hard boards alike, and the heat map once the opponent knows how you hunt. We found a slightly better heuristic, smart 3-parity. On the classic board, 3-parity is at least 5 points of win rate short of optimal, and about 10 on the hardest boards we found; smart 3-parity closes about 2½ and 3½ of those points.

Most people who think about Battleship find one of three approaches. The first is the checkerboard or parity strategy: color the board red and black like a checkerboard and fire at random at the squares of one color (Berry 2011).

The second, 3-parity, is the checkerboard's every-third cousin: it fires first only at every third diagonal, a third of the board, with the direction (↘ or ↙) and the starting diagonal picked at random. Any three cells in a row cross three neighboring diagonals, so every ship of three cells or more has a cell there. The catch is the 2-cell ship, which crosses only two: the random pick catches it two times in three, wherever it hides; otherwise 3-parity moves on to a second set of every-third diagonals, which is sure to catch it.

The third is the heat map, the hunt most people would program first: for every cell, count how many ways the remaining ships could cover it, and fire at the hottest. It is fast against random boards, but completely predictable: an opponent who knows it can hide the fleet where it looks last.

Figure 1
Three obvious hunts
where the hunt fires firstthe cell that finds the shipheat map: more ways the ships could cover the cell
Checkerboard · 50 shaded cells
ABCDEFGHIJ12345678910
3-parity · 34 shaded cells
ABCDEFGHIJ12345678910caughtslips between
Heat map · darker means more ways
ABCDEFGHIJ12345678910first shot: one of the ringed cells
Left: the checkerboard fires only at one color (shaded, 50 of the 100 cells); every ship covers at least one square of each color. Middle: 3-parity fires first at every third diagonal (shaded, 34 cells); a 3-cell ship always covers exactly one of them (starred). The 2-cell ship, drawn in two possible places, is caught at C7–C8 but slips between the shaded diagonals at I6–J6. Right: the heat map shades each cell by how many ways the five ships could cover it on an empty board (darker means more); it fires first at one of the four darkest cells (ringed) and counts again after every shot.

Which is best? And how much better can a more sophisticated strategy do?

Below, the hunts raceHow the race works: both players fire one shot every round, at the same time, and whoever first sinks the other's whole fleet wins; a finish in the same round counts as half a win. A hit is answered just "hit", and a sink by size only ("you sank a 3", not which 3). A strategy's win rate is its chance of winning, a tie counting half; differences between win rates are in percentage points, "points" for short. The box rules (Hasbro 2002) alternate single shots and name the ship on every hit and sink. each other on the classic board (10×10; ships of 5, 4, 3, 3 and 2 cells), played the plainest way: shots according to one of the strategies above, and after a hit, fire next to it and extend any line of hits. Boards are random boards, where every layout (a way of hiding the whole fleet; ships may touch but not overlap) is equally likely. Luck with the 2-cell ship decides a lot for 3-parity, but on average it beats the checkerboard.

Head to head on random boards
HuntAverage shots to sink the fleetWin rate vs checkerboardWin rate vs 3-parityWin rate vs heat map
3-parity49.359.8%—38.2%
3-parity, first set touches the 2-cell ship44.176.3%63.4%50.0%
3-parity, first set misses the 2-cell ship59.826.6%22.9%14.4%
Checkerboard51.4—40.2%29.4%
Heat map44.870.6%61.8%—
Every hunt plays the same 32,000 random boards, each in all eight rotations and reflections; each row's hunt races each column's, and a finish in the same round counts half; blue where the row's hunt wins more than half its races, orange where it wins fewer. 3-parity's split by luck comes from 1,000,000 further games.

The heat map is the fastest of the three on random boards, but an opponent who knows how you hunt won't hide at random. So we also score every hunt against an adversarial hider: its worst case is its win rate on the hardest board a computer search could find against it. To keep the scores comparable, every hunt races the same opponent, the strongest strategy we found (section 3).

Figure 2
The heat map's worst board
fewer to more ways the ships could cover the cell (10 to 34)the heat map's worst board found
ABCDEFGHIJ12345678910A1: 10 waysB1: 15 waysC1: 19 waysD1: 21 waysE1: 22 waysF1: 22 waysG1: 21 waysH1: 19 waysI1: 15 waysJ1: 10 waysA2: 15 waysB2: 20 waysC2: 24 waysD2: 26 waysE2: 27 waysF2: 27 waysG2: 26 waysH2: 24 waysI2: 20 waysJ2: 15 waysA3: 19 waysB3: 24 waysC3: 28 waysD3: 30 waysE3: 31 waysF3: 31 waysG3: 30 waysH3: 28 waysI3: 24 waysJ3: 19 waysA4: 21 waysB4: 26 waysC4: 30 waysD4: 32 waysE4: 33 waysF4: 33 waysG4: 32 waysH4: 30 waysI4: 26 waysJ4: 21 waysA5: 22 waysB5: 27 waysC5: 31 waysD5: 33 waysE5: 34 waysF5: 34 waysG5: 33 waysH5: 31 waysI5: 27 waysJ5: 22 waysA6: 22 waysB6: 27 waysC6: 31 waysD6: 33 waysE6: 34 waysF6: 34 waysG6: 33 waysH6: 31 waysI6: 27 waysJ6: 22 waysA7: 21 waysB7: 26 waysC7: 30 waysD7: 32 waysE7: 33 waysF7: 33 waysG7: 32 waysH7: 30 waysI7: 26 waysJ7: 21 waysA8: 19 waysB8: 24 waysC8: 28 waysD8: 30 waysE8: 31 waysF8: 31 waysG8: 30 waysH8: 28 waysI8: 24 waysJ8: 19 waysA9: 15 waysB9: 20 waysC9: 24 waysD9: 26 waysE9: 27 waysF9: 27 waysG9: 26 waysH9: 24 waysI9: 20 waysJ9: 15 waysA10: 10 waysB10: 15 waysC10: 19 waysD10: 21 waysE10: 22 waysF10: 22 waysG10: 21 waysH10: 19 waysI10: 15 waysJ10: 10 ways54332
The worst board our search found against the heat map. Shading: how many ways the five ships, one at a time, could cover each cell of an empty board, from 10 at a corner to 34 near the middle (darker means more).

The heat map's worst board shows how. Fewer ship placements fit over an edge or corner cell than over a central one, so the heat map rates those cells low and reaches them last, game after game. This board packs four of the five ships into the top-left corner, where the heat map needs 66.2 shots on average and wins at most about 4 races in 100. A hunt that randomizes, like 3-parity, has no such fixed blind spot.

The worst board is no fluke, and there is no easy fix. On the three-ship boards of sections 1 and 2, where every layout can be scored, the heat map falls into the same trap. 3-parity is slower on ordinary layouts but far better against adversarial play, and its lead on the worst layout grows with the board.

Table 1
Average shots, random boardsWin rate, random boardsWin rate, worst board found
Checkerboard51.435.7%≤ 27.5%
Plain 3-parity49.345.0%≤ 34.1%
Smart 3-parity (section 3)47.847.4%≤ 37.6%
Best strategy found (section 3)47.350%≤ 43.9%
Heat map44.857.1%≤ 4.2%
Every win rate races the best strategy we found, which faces random boards; its own row is a race against a copy of itself. Worst boards come from a search, so their win rates are upper bounds; the searches were of similar size for the first four rows (smart 3-parity's had one confirming descent more), and the heat map's was about half as large. Shading compares each hunt with the best strategy's row: blue where it does better, orange where it does worse.

In the race one player's win is the other's loss, so a Nash equilibrium strategy maximizes the win rate it can guarantee whatever the hider does: it has to hold up on its worst board, so it looks more like the randomized 3-parity than the heat map. Can we beat that simple approach without losing to an adversary? Building up from small boards to the full game, we find strategies slightly better: on the classic board, about 5 points of win rate on random boards and 10 on the worst boards found (Table 1). This page builds up to two results.

  1. On the classic board, the strategy with the best worst case we found is a machine that plays a smaller game, treating the carrier and the battleship as water until they turn up. We also develop a simple approximation of it that can be played without a computer, smart 3-parity; its card is under How to hunt. Section 3
  2. On a board that grows without limit, with two 3-cell ships and a 2-cell ship, plain 3-parity comes within 2 to 3 points of the best possible, and one extra rule for the endgame, hunting the 2 next to the unshot cells of the other half first, wins back about half of that, in a simplified model and against a fixed opponent. Section 4

1Small boards, solved

A fixed hunt has no dice: the same information always produces the same shot, so it has layouts it finds last. A mixture is a lottery over fixed hunts, drawn in secret before the game, so a hider cannot know which layouts it will find last. Recipes like the three opening hunts are hand-written rules: they may roll dice for small choices but are not optimized mixtures.

Until section 3 the fleet we focus on is two 3-cell ships and a 2-cell ship, written {3,3,2}. On 5×5 it can be hidden 8,000 ways; that is the largest board we could bring close to perfect play. Our near-perfect strategies come from a loop that alternates an exact best reply, the hunt that wins the most races against a placement distribution (a lottery over where the hider puts the fleet), with a linear program, a standard optimization that can be solved exactly:

q ← any placement distribution
pool ← empty
repeat:
    # exact, by dynamic programming over all 181 million states (5×5)
    h ← best reply to q
    add h to pool
    # best mixture of the pool, and the hider's best placements against it
    mixture, q ← linear program over pool

One caveat: because the game is a race, every step maximizes the chance of winning the race, not the average number of shots to finish.

To test a finished strategy we compute its best reply, built knowing exactly how it plays and free to change both where it hides and how it hunts; what it gains over 50% is the strategy's exploitability. On the smaller 4×4 board our player is the optimal decoupled strategy to within 0.02 points: a best reply that hides and hunts independently gains almost nothing against it. A best reply that couples hiding and hunting, tuning its hunt to where it hid its own fleet, gains 0.14 points. Raced against a copy of itself, our 5×5 player never wins less than 49.9% on any layout, and its best reply gains 1.4 points.

Near-perfect play is remarkably flat: on 5×5 its average ranges only from 13.7 to 14.4 shots across all 1,009 distinct layouts (counting rotations and reflections as one). It is also slightly faster than the heat map, 14.1 shots on average against 14.4, so the heat map wins only 45.1% of their races. Against an adversary the gap is dramatic: on its worst layout the heat map wins only 4.1% of races against near-perfect play's pace, while near-perfect play never drops below 49.9%. Simple rules lose on both counts: plain 3-parity by hand needs 15.4 shots and wins 35.3% head-to-head and 19.9% on its worst layout, and the best hand-written rule we tried, the three-ship core of smart 3-parity in section 3, wins 36.0% and 22.1% and needs 16.4 shots on its slowest layout.

Figure 3
Average against worst on 5×5
Self-play mixtureRule you can play by handRule that needs a computerHeat-map hunters (need a computer)50% lines; the vertical one is the near-perfect player
Show the data as a table
StrategyHead-to-headWorst layoutNotes
Self-play mixture (section 2)48.54%48.36%a machine (self-play mixture)
Smart 3-parity, three-ship core (section 3)36.0%22.1%pencil and paper
3-parity, heat-map finishing, cells next to misses shot later (light)37.3%20.4%needs a computer
3-parity, heat-map finishing (needs a computer)37.2%20.1%needs a computer
3-parity played by hand35.3%19.9%pencil and paper
3-parity, heat-map finishing, cells next to misses shot later (strong)37.6%19.6%needs a computer
Checkerboard, heat-map finishing, cells next to misses shot later (strong)34.2%18.7%needs a computer
Checkerboard played by hand30.8%18.7%pencil and paper
Checkerboard, heat-map finishing, cells next to misses shot later (light)33.7%18.3%needs a computer
Checkerboard, heat-map finishing (needs a computer)33.5%18.1%needs a computer
Particle-filter hunter41.8%17.8%needs a computer
3-parity, densest cell first42.5%17.3%needs a computer
Checkerboard, densest cell first42.5%4.8%needs a computer
Heat map45.1%4.1%needs a computer
Each dot is a strategy. Right = faster on ordinary layouts: head-to-head win rate against a near-perfect player, both fleets hidden the way it hides its own. Up = safer: win rate on the worst of all 1,009 layouts, racing the same player. Against perfect play nobody can guarantee more than half the races, so the top-right corner stays empty. Every hand-written rule wins about 22% or less on its worst layout; the self-play mixture of section 2 sits just short of the 50% lines.

Value of context

"Solved" here means the game in which each player uses only their own progress: their own hits and misses, and the sizes of the ships they sink. Real Battleship offers more context: you see where the opponent shoots and which of your ships they have hit, you may know who goes first, and you can couple where you hide to how you hunt. Context lets you play the score: if the opponent has already hit most of your fleet, it can pay to switch to a riskier hunt that finishes fast when it gets lucky. Against a frozen near-perfect 5×5 opponent the gain is real but small: knowing which of your ships are hit is worth 0.38 points of win rate, and letting your hunt also depend on where you hid and who goes first (in a variant where the players take turns) brings it to 1.1. Even knowing in advance when the opponent will sink your last ship, the most anyone could learn about how far behind they are, would be worth only 1.6. One reason it stays small: a player whose hunt does not depend on where it hid gives nothing away through its shots, a classic idea from Aumann and Maschler's work on private information (see Hart 2006).

Context is also expensive. Without it, an exact best reply on 5×5 is one pass over 181 million states of knowledge, about 8 seconds and 100 GB of memory on a 56-core machine. Knowing which of your ships have been hit splits every state by the history of those hits, and the same reply takes 45 minutes and about 280 GB. A gain of about a point is not worth that on bigger boards, so we drop context: from here on every strategy hides independently of how it hunts and uses only its own shots and the sink announcements. It is an open question whether context matters more on larger boards (the gains we measured grew from 4×4 to 5×5), and whether simple heuristics, such as taking more risk when behind, could capture some of it without this blowup in states.

Without context the two hunts never interact, so a strategy can be scored against the spread of its opponent's finishing times alone, which we call the pace. On these small boards the pace is that of the strong player you race, with both fleets hidden the way it hides its own.

Watch how often the hunter in the replay ignores the hottest cell, the one most likely to hold a ship; the heat map's worst board, near the top, shows why.

Replay 1 · 5×5
A near-perfect 5×5 hunter

Try this: at shot 1, switch the shading to “Where it shoots next”. The opening shot can land on 21 of the 25 cells, none more than 13% of the time.

A near-perfect 5×5 hunter at work: each game draws one of its fixed hunts in secret. The shading is the heat map, how likely each cell is to hold a ship given everything announced so far; the hunter fires at the hottest cell on only 55% of its shots. The “Where it shoots next” view shows its own odds for the next shot instead; rolling dice with those odds at every shot is the same strategy as drawing one hunt in secret (Kuhn 1953).

In detail: the 5×5 page has the exact machinery, every hand-written rule we scored, where the near-perfect player hides and fires, the full value of context, and the 4×4 board.

2Scaling up with self-play

Past 5×5 we cannot solve the game, but with the {3,3,2} fleet we can still score a hunt on all 240,669 distinct layouts of 10×10. Finding the best hunt is the hard part, so we use a form of self-play in which the strategy sets its own pace:

pool ← a few fixed hunts
pace ← a starting pace
repeat:
    # one linear program, with the pace held fixed:
    #   mixture = best win rate on the worst layout against the pace
    #   q = the hider's lottery over layouts that hurts mixture most
    mixture, q ← linear program over pool
    h ← a hunt that beats mixture against q  # by search, not exactly
    if no such hunt is found, or the round budget is spent: stop
    add h to pool
    pace ← halfway to mixture's finishing times

The search step is where the heat map comes back: against a known lottery q, firing where a ship is most likely is already a strong reply. One such hunt is easy to exploit, as the opening showed, but the loop adds a different one for each q, and the mixture over many of them holds up on its worst layout. Each round runs several searches at once: beam searches that keep the best few partial hunts, a two-shot lookahead, and one aimed at the hider's hardest layout.

Game theorists call this loop column generation, a one-sided version of the double-oracle method (McMahan, Gordon and Blum 2003): only the hunts' pool grows, since every layout is already in the program.

The result is flat: on its worst layout, the finished 10×10 mixture still wins 49.95% of races against its own pace. Flat is not fast, though: a player who fires at random also wins half its races against itself. So we checked from outside. On 5×5, a mixture built this way, without ever seeing a near-perfect player, wins 48.5% head-to-head against one and 48.4% on its worst layout. On 10×10, the best counter-strategy our searches found gains under 1 point against it. Speed points the same way: head-to-head, no hand-written rule we tried wins even half its races against the mixture (the heat map 48.2%, the best rule 48.6%; chart below). The mixture gives up almost no speed for its safety.

Figure 4
Average against worst on 10×10, three ships
Self-play mixtureRule you can play by handRule that needs a computerHeat-map hunters (need a computer)50% lines
Show the data as a table
StrategyHead-to-headWorst layoutNotes
Self-play mixture of section 2 (own pace)50.0%49.75% (own pace)a machine (self-play mixture)
Smart 3-parity, three-ship core (section 3)47.7%38.6%pencil and paper; worst case from a quick pass over every layout, approximate
3-parity, heat-map finishing (needs a computer)46.8%37.8%needs a computer; worst case from a quick pass over every layout, approximate
3-parity, heat-map finishing, cells next to misses shot later (light)46.9%37.6%needs a computer; worst case from a quick pass over every layout, approximate
3-parity, heat-map finishing, cells next to misses shot later (strong)47.1%37.3%needs a computer; worst case from a quick pass over every layout, approximate
3-parity played by hand46.5%37.2%pencil and paper; worst case from a quick pass over every layout, approximate
Checkerboard, heat-map finishing (needs a computer)39.9%31.9%needs a computer; worst case from a quick pass over every layout, approximate
Checkerboard, heat-map finishing, cells next to misses shot later (light)40.1%31.7%needs a computer; worst case from a quick pass over every layout, approximate
Checkerboard, heat-map finishing, cells next to misses shot later (strong)40.3%30.8%needs a computer; worst case from a quick pass over every layout, approximate
Checkerboard played by hand38.9%30.1%pencil and paper; worst case from a quick pass over every layout, approximate
3-parity, densest cell first48.6%23.8%needs a computer; worst case from a quick pass over every layout, approximate
Checkerboard, densest cell first45.1%9.5%needs a computer; worst case from a quick pass over every layout, approximate
Heat map48.2%8.9%needs a computer; worst case from a quick pass over every layout, approximate
10×10 {3,3,2}. Every win rate here races the self-play mixture of this section: right, head-to-head, with both fleets hidden the way its hider hides them; up, on each strategy's worst layout. The mixture's own point is against its own pace, so it shows flatness, not speed; it is an earlier snapshot (49.75%), the one these rules were scored against. The rules' worst cases come from a quick pass with a fixed number of games per layout: treat them as approximate.
Replay 2 · 10×10, three ships
The 10×10 {3,3,2} self-play mixture

Try this: pick either “Hardest layout” game and step through the first ten shots: every one lands on the same set of every-third diagonals.

The finished 10×10 {3,3,2} self-play mixture at work. Each game draws one of its nearly a thousand fixed hunts, by weight, in a random rotation or reflection. Before its first hit it puts most of its search shots on one set of every-third diagonals (88% across 2,000 replayed games; random shooting scores about half, since the test picks the set after the fact). On its hardest layout most hunts finish in 22 to 37 shots; a few take much longer.

In detail: the 10×10 page has how the self-play run converged and how its searches work, how we checked it, what the mixture does, and every rule we raced against it.

3The classic fleet: the best strategy we found

Now the real game: 10×10, with a carrier (5 cells), a battleship (4), two 3s and a 2. There are about 15 billion ways to hide this fleet, too many to score, so every worst case from here on comes from a search and is an upper bound. The sheer number of layouts also stalls the column-generation loop of section 2: its linear program can hold every layout only while there are millions of them.

So we tried many different approaches, 70 in all. In the end the best thing to do was to hunt the two 3s and the 2 as well as possible and assume we would find the 4 and the 5 along the way.

The hunt for the small ships is section 2's 10×10 {3,3,2} self-play mixture, used unchanged:

Why does a three-ship strategy win? A 4 or a 5 crosses every set of every-third diagonals, just like a 3, and that is where the small-ship hunt spends most of its search shots, so it usually makes the first hit on the big ships itself: on the carrier in 90% of games and on the battleship in 87%. The three-ship game could be checked against every layout, so the small ships are guaranteed to be found efficiently wherever they hide, and the randomized hunt that finds them leaves the 4 and the 5 little room to hide. Self-play on the full fleet produced the classic-board self-play mixture, which is faster than the best strategy on average (46.4 shots) but performs poorly against adversarial placement: it wins at most 26.3% of races on its worst board found.

The best strategy needs 47.3 shots on average, against 49.3 for 3-parity and 51.4 for the checkerboard. Its finishing times on 32,000 random boards are the pace for every classic strategy on this page, so by definition it wins 50% on average, and at most 43.9% on its worst board found (Table 1). Racing a strategy against its own games can flatter it (section 2), but against the classic-board self-play mixture's faster pace it still holds ≤ 41.0% on its worst board found.

Figure 5
Average against worst on the classic board
Self-play mixtureRule you can play by handBy hand, plus one count of where ships fitRule that needs a computerHeat-map hunters (need a computer)Computed mixture of rules50% lines

Every worst case on this chart is an upper bound (≤) from a search: a stronger search might find a worse board.

Show the data as a table
StrategyAverageWorst board foundNotes
Best strategy found: the {3,3,2} self-play mixture, replayed50.0% (own pace)≤ 43.9%47.3 shots on average; a machine (self-play mixture)
Rule mixture (a weighted die over four rules)47.8%≤ 38.1%48.1 shots on average; needs a computer (a weighted die over rules)
Smart 3-parity (the one on the card)47.4%≤ 37.6%47.8 shots on average; pencil and paper
3-parity, computer counts the big-ship endgame47.0%≤ 37.2%48.8 shots on average; needs a computer
Rule mixture, second version48.5%≤ 36.9%48.0 shots on average; needs a computer (a weighted die over rules)
3-parity, big ships: densest cell of the densest every-fourth-diagonal set46.7%≤ 36.6%48.9 shots on average; needs a computer
3-parity in halves, jump in 35% of games, big ships: the densest every-fourth-diagonal set, 2-hunt prefers cells a big ship could also cover46.8%≤ 36.5%48.1 shots on average; pencil and paper, plus one count of where ships still fit
Smart 3-parity, first version (before the order for the 2)46.8%≤ 36.5%48.2 shots on average; pencil and paper
3-parity in halves, jump in 35% of games, big ships: the set with the fewest cells they could still occupy, 2-hunt prefers cells a big ship could also cover, computer finishing49.0%≤ 36.5%47.5 shots on average; needs a computer
3-parity in halves, jump in 35% of games, big ships: the set with the fewest cells they could still occupy, 2-hunt prefers cells a big ship could also cover47.1%≤ 36.3%48.1 shots on average; pencil and paper
3-parity in halves, jump in 35% of games, big ships: the densest every-fourth-, then every-fifth-diagonal set46.6%≤ 36.2%48.2 shots on average; pencil and paper, plus one count of where ships still fit
Variant of smart 3-parity: big ships on the densest every-fourth-diagonal set46.5%≤ 36.2%48.2 shots on average; pencil and paper, plus one count of where ships still fit
3-parity, big ships: densest cell of the densest 3-parity set46.7%≤ 36.2%48.9 shots on average; needs a computer
3-parity, big ships: random cells of the densest every-fourth-diagonal set45.6%≤ 36.0%49.2 shots on average; pencil and paper, plus one count of where ships still fit
The opening's 3-parity with the lazy endgame (first search)45.3%≤ 35.9%49.2 shots on average; pencil and paper
Smart 3-parity with the lazy endgame (a random every-fourth-diagonal set)46.2%≤ 35.9%48.3 shots on average; pencil and paper
3-parity in halves, jump in 40% of games, lazy endgame (a random every-fourth-diagonal set)46.1%≤ 35.9%48.3 shots on average; pencil and paper
The opening's 3-parity with the lazy endgame (second search)45.4%≤ 35.7%49.2 shots on average; pencil and paper
3-parity, big ships: random cells of the densest 3-parity set45.7%≤ 35.7%49.1 shots on average; pencil and paper, plus one count of where ships still fit
3-parity in halves, jump in 35% of games, 3-parity set kept until the 4 sinks46.4%≤ 35.5%48.4 shots on average; pencil and paper
3-parity in halves, jump in 35% of games, big ships: the densest every-fourth-diagonal set, computer finishing48.5%≤ 35.4%47.6 shots on average; needs a computer
3-parity in halves, jump in half the games, lazy endgame (a random every-fourth-diagonal set)46.0%≤ 35.4%48.4 shots on average; pencil and paper
3-parity in halves, jump in 35% of games, big ships: the set with the fewest cells they could still occupy, 2-hunt prefers cells a big ship could also cover, computer finishing (tempered)49.0%≤ 35.1%47.5 shots on average; needs a computer
3-parity in halves, never jump, big ships: the densest every-fourth-, then every-fifth-diagonal set46.9%≤ 35.0%48.1 shots on average; pencil and paper, plus one count of where ships still fit
3-parity (opening), the same rule searched a second time44.9%≤ 34.8%49.3 shots on average; pencil and paper
3-parity in halves, jump in 35% of games, big ships: the densest every-fourth-diagonal set, computer finishing (tempered)48.4%≤ 34.3%47.7 shots on average; needs a computer
3-parity in halves, never jump, lazy endgame (a random every-fourth-diagonal set)46.5%≤ 34.3%48.2 shots on average; pencil and paper
3-parity, heat-map finishing, cells next to misses shot later (strong)47.9%≤ 34.2%48.4 shots on average; needs a computer
3-parity, heat-map finishing, cells next to misses shot later (light)47.7%≤ 34.2%48.5 shots on average; needs a computer
3-parity (opening)45.0%≤ 34.1%49.3 shots on average; pencil and paper
3-parity rule, random checkerboard order, lazy endgame (a random every-fourth-diagonal set)46.1%≤ 33.9%48.4 shots on average; pencil and paper
3-parity, heat-map finishing (needs a computer)47.5%≤ 33.7%48.6 shots on average; needs a computer
3-parity in halves, jump in 35% of games, checkerboard kept for the big ships43.9%≤ 33.1%49.0 shots on average; pencil and paper
3-parity rule, checkerboard weighted by where a 2 fits, lazy endgame (a random every-fourth-diagonal set)47.2%≤ 32.0%47.9 shots on average; pencil and paper
3-parity rule, random checkerboard order, checkerboard kept for the big ships43.9%≤ 31.4%49.1 shots on average; pencil and paper
Checkerboard, computer counts the big-ship endgame39.2%≤ 30.9%50.4 shots on average; needs a computer
Checkerboard, big ships: densest cell of the densest every-fourth-diagonal set38.9%≤ 30.8%50.4 shots on average; needs a computer
Checkerboard, big ships: random cells of the densest 3-parity or every-fourth-diagonal set38.0%≤ 30.0%50.7 shots on average; pencil and paper, plus one count of where ships still fit
Checkerboard, big ships: random cells of the densest every-fourth-diagonal set38.0%≤ 29.7%50.7 shots on average; pencil and paper, plus one count of where ships still fit
Checkerboard, heat-map finishing, cells next to misses shot later (light)38.9%≤ 29.6%50.2 shots on average; needs a computer
3-parity rule, checkerboard by fewest shot neighbors (hits break ties), lazy endgame (a random every-fourth-diagonal set)48.3%≤ 29.2%47.4 shots on average; pencil and paper
3-parity rule, checkerboard by fewest shot neighbors, 3-parity set kept until the 4 sinks48.3%≤ 29.0%47.5 shots on average; pencil and paper
3-parity rule, checkerboard by fewest shot neighbors, big ships: the densest every-fourth-, then every-fifth-diagonal set48.8%≤ 28.5%47.3 shots on average; pencil and paper, plus one count of where ships still fit
3-parity rule, checkerboard by fewest shot neighbors, lazy endgame (a random every-fourth-diagonal set)48.3%≤ 28.4%47.4 shots on average; pencil and paper
Checkerboard, heat-map finishing (needs a computer)38.6%≤ 28.1%50.3 shots on average; needs a computer
Fastest rule playable by hand (3-parity rule, checkerboard by fewest shot neighbors)48.9%≤ 28.1%47.3 shots on average; pencil and paper
3-parity rule, checkerboard by fewest shot neighbors, big ships: the densest every-fourth-diagonal set, 2-hunt prefers cells a big ship could also cover48.7%≤ 27.9%47.4 shots on average; pencil and paper, plus one count of where ships still fit
3-parity rule, checkerboard by fewest shot neighbors, big ships: the set with the fewest cells they could still occupy, 2-hunt prefers cells a big ship could also cover48.8%≤ 27.9%47.3 shots on average; pencil and paper
3-parity in halves, always jump, lazy endgame (a random every-fourth-diagonal set)45.7%≤ 27.7%48.5 shots on average; pencil and paper
Checkerboard (opening)35.7%≤ 27.5%51.4 shots on average; pencil and paper
Checkerboard (opening), the same rule searched a second time35.7%≤ 27.4%51.4 shots on average; pencil and paper
Checkerboard, heat-map finishing, cells next to misses shot later (strong)39.4%≤ 27.2%50.0 shots on average; needs a computer
3-parity rule, fixed orientation and sweep, lazy endgame (a random every-fourth-diagonal set)47.7%≤ 26.9%47.7 shots on average; pencil and paper
3-parity rule, random orientation, fixed sweep, lazy endgame (a random every-fourth-diagonal set)47.8%≤ 26.4%47.6 shots on average; pencil and paper
Classic-board self-play mixture52.3%≤ 26.3%46.4 shots on average; a machine (self-play mixture)
3-parity, densest cell first55.8%≤ 24.0%45.8 shots on average; needs a computer
3-parity rule, checkerboard by fewest shot neighbors, big ships: the set with the fewest cells they could still occupy, 2-hunt prefers cells a big ship could also cover, computer finishing (tempered)50.7%≤ 23.9%46.8 shots on average; needs a computer
3-parity rule, checkerboard by fewest shot neighbors, big ships: the set with the fewest cells they could still occupy, 2-hunt prefers cells a big ship could also cover, computer finishing50.9%≤ 23.5%46.7 shots on average; needs a computer
3-parity rule, checkerboard by fewest shot neighbors, lazy endgame (a random every-fourth-diagonal set), computer finishing50.3%≤ 22.4%46.9 shots on average; needs a computer
Earlier version of the best strategy52.7%≤ 20.0%46.4 shots on average; a machine (self-play mixture)
Particle-filter hunter56.4%≤ 8.4%45.1 shots on average; needs a computer
Checkerboard, densest cell first55.0%≤ 8.0%45.1 shots on average; needs a computer
Heat map57.1%≤ 4.2%44.8 shots on average; needs a computer
Three-ship heat map, computer counts the big-ship endgame57.5%≤ 3.3%44.8 shots on average; needs a computer
Three-ship heat map, big ships: random cells of the densest 3-parity or every-fourth-diagonal set56.3%≤ 3.3%45.2 shots on average; needs a computer
Three-ship heat map, heat-map endgame57.5%≤ 3.3%44.8 shots on average; needs a computer
Three-ship heat map on the better checkerboard color56.2%≤ 2.5%45.2 shots on average; needs a computer
Three-ship heat map weighted by the self-play hider, big ships: densest cell of the densest 3-parity or every-fourth-diagonal set57.8%≤ 1.5%44.7 shots on average; needs a computer
Three-ship heat map weighted by the self-play hider, computer counts the big-ship endgame58.0%≤ 1.5%44.6 shots on average; needs a computer
Three-ship heat map weighted by the self-play hider, big ships: random cells of the densest 3-parity or every-fourth-diagonal set56.8%≤ 1.5%45.0 shots on average; needs a computer
The classic board, average against worst. Right: win rate against the best strategy's finishing times on 32,000 random boards (unlike the two smaller-board charts, where both fleets were hidden the way the strong player hides its own). Up: win rate on the worst board a search found. Color shows what playing each strategy takes. Every strategy to the right of 50% falls to ≤ 26.3% on its worst board found. The opening's checkerboard (two dots: the same rule, searched twice) is leftmost, and its 3-parity sits below and left of smart 3-parity. Differences under about one point are within the noise of the search.

Behind each point on that chart is a whole spread of finishing times; the next figure shows five of them.

Figure 6
How long each strategy takes on the classic board

Random boards: the benchmark's 32,000 random boards; smart 3-parity and the heat map play each of them in all eight rotations and reflections. Worst board found: 8,000 new games on each board (smart 3-parity and the heat map play it in all eight rotations and reflections, 1,000 games each). Their win rates differ from the search's own measurements, given in the text and the scatter above, by less than a point (0.7 points for smart 3-parity, half a point at most for the others), and their average shots by less than a quarter of a shot. The curves are smoothed over five neighboring shots; the crosshair (or the arrow keys, once the chart has focus) gives the exact share at each shot.

Show the data as a table
StrategyBoardsAverage shotsMedianMiddle 80% of gamesWin rate against the paceGames
Best strategy foundRandom boards47.34636–6150.0%32,000
Best strategy foundWorst board found48.24840–56≤ 44.2%8,000
Classic-board self-play mixtureRandom boards46.44635–5952.3%32,000
Classic-board self-play mixtureWorst board found55.55841–66≤ 26.8%8,000
Smart 3-parityRandom boards47.84737–6047.4%256,000
Smart 3-parityWorst board found51.35041–64≤ 36.9%8,000
Heat mapRandom boards44.84433–5857.1%256,000
Heat mapWorst board found66.26663–70≤ 4.3%8,000
CheckerboardRandom boards51.45339–6235.7%256,000
CheckerboardWorst board found54.35543–64≤ 27.6%8,000
How long each strategy takes to sink the whole fleet: the share of its games that end at each shot. Random boards: a new random layout every game. Worst board found: the hardest layout our search found against that strategy, a different board for each, played 8,000 times; a stronger search might find a worse one, so each strategy's true worst case is at least this bad. The gray area is the pace, the best strategy's games on random boards, and every win rate is a race against it. Of these five, the heat map is the fastest on random boards and by far the slowest on its worst board found, while the best strategy's games shift the least.
Replay 3 · classic fleet
The best classic strategy

Try this: in the typical game, step through shots 30 to 34. The hunt hits the carrier three times, chasing it as if it were a small ship; the finisher sinks it at shot 34, and the hunt replays its game as if its first hit there had been water. The same happens at shot 39 for the battleship, and on the hard board at shots 8 and 16.

The best classic strategy at work. Watch for a hit on a big ship: it is chased as if it were a small ship, then finished, and the plan replayed.

Smart 3-parity: the pencil-and-paper version

The rule to beat is plain 3-parity from the opening: 49.3 shots on average and ≤ 34.1% on its worst board found (Table 1). Smart 3-parity keeps its set of every-third diagonals but uses it better. It is the best simple rule we found for the three-ship game, with a sweep for the big ships added; the full recipe is on the card at the bottom:

# before the game
S ← every third diagonal, direction at random
A, B ← S's dark-square and light-square diagonals, in random order
# each shot
if a hit is not yet explained by a sink:
    extend a line of hits, else fire next to one
else if a 3 is afloat:
    if the first 3 just sank: jump ← true in 35% of games
    # section 4 shows why jumping helps
    if jump and B has cells left:
        fire at a random cell of B
    else:
        fire at a random cell of A, then of B
else if the 2 is afloat:
    # on the more-fired checkerboard color, where a 2 fits:
    fire first beside unshot cells of the other half,
    then at the rest of this color's half, then anywhere on it
else:
    sweep for the 4 and the 5

Why it beats plain 3-parity: the set's diagonals alternate between the two checkerboard colors, and every 2-cell ship covers a square of each color. So the heuristic sweeps one color's half of the set first, and once both 3s are down it hunts the 2 on that already well-covered color, only where a 2 still fits, instead of sweeping the rest of the set and then a second one. It starts with the cells beside unshot cells of the other half, where the 2 can still lie in the most ways. The occasional jump keeps a hider from exploiting that order (section 4).

Smart 3-parity needs 47.8 shots and holds ≤ 37.6% on its worst board found, about 6 points short of the best strategy (Table 1). Its order for the 2 comes from the large-board analysis of section 4: without it, the first version of the heuristic won about 0.7 points fewer races, both on random boards and on the hardest boards a stronger search found (≤ 36.1% against ≤ 36.8%). Is it the best rule a person can play? It is the best simple one we found: three close variants tie with it within the search's noise, and the stronger search holds it to ≤ 36.8%, where Table 1's search found ≤ 37.6%. Only strategies that need a computer sit noticeably higher on the classic chart above.

In detail: the classic-fleet page has how the races and the search for hard boards work, all 70 strategies, how many shots each needs, the best strategy in depth, why self-play on the full fleet stalled, and the rules a person can play.

4The large-board limit

Now let the board grow without limit and keep the fleet of two 3s and a 2. Finishing a ship after its first hit then costs a few shots that vanish next to the board's size, and edges stop mattering, so what is left is small enough to compute almost exactly.

Every third diagonal. One set of every-third diagonals, a third of the board, touches every 3-cell ship exactly once, and no pattern does it with fewer cells (Dumitrescu and Tkadlec 2024); one checkerboard color touches every 2-cell ship. The set's diagonals alternate between the colors: call its half on dark squares A (a sixth of the board), its half on light squares B (a sixth), and the remaining dark squares C (a third). Every sensible hunt is a choice of order over A, B and C; the rest of the board never needs a search shot.

Figure 7
Every third diagonal
A: every third diagonal, dark squares B: every third diagonal, light squares C: rest of the dark squares never needs a search shot dot: a dark square of the checkerboard (A and C) the cell that finds each ship

Drag a ship to move it; tap or click it to rotate. With a keyboard, Tab to a ship: the arrow keys move it and R rotates it.

Every 3-cell ship, wherever you drag it, covers exactly one cell of A and B together (34 of the 100 cells here), and every 2-cell ship covers a dark square, in A or C.

Three plans. The plain plan sweeps A and B together in random order, then C. It needs exactly 33⅓ shots per 100 cells on average wherever the ships are, so a hider has nothing to aim at; on a big board the opening's 3-parity is exactly as fast. The adaptive plan, smart 3-parity in a game where it does not jump, sweeps A, then B while a 3 is afloat, then the rest of the checkerboard: about 32 shots per 100 cells on average, but a hider who knows the rule can still make it spend 33⅓. Always jumping from A to B as soon as the first 3 sinks is worse: 38 shots per 100 cells in the worst case. The adaptive plan and always jumping each have a layout that hurts them: if the two 3s lie in opposite halves, jumping after the first sink finds the second one sooner; if they share a half, jumping sends you to search the half with no 3.

Beating the plain plan. Take the plain plan's finishing times as the pace: against them the plain plan itself wins exactly half its races on every layout. Can anything guarantee more? A little, and one extra rule does most of it. Keep the plain plan, sweeping B in long runs along its diagonals, until both 3s are down; then hunt the 2 first in the cells of C that touch an unshot cell of B, then in the rest of A, then in the rest of C. A cell of C next to an unshot B cell can still hold the 2 in more ways than one whose B neighbors are already shot. That plan wins exactly 37/72, about 51.4%, on every layout. Changing only where you search for the 3s does less: the adaptive plan and always jumping can each be held below 49%, and the best coin between them, jumping in about a third of games, about as often as smart 3-parity does, reaches only 49.4%. Searching part of B after the first sink, instead of tossing a coin, lifts one plan to 51.8%, mixing such plans gives 51.95%, and ordering every shot inside each part gives at least 52.14%; no strategy can guarantee more than 19/36, about 52.8%, against this pace.

Figure 8
How much can cleverness buy?
Guaranteed win rate against the plain plan's finishing times, on the hider's best layout, in the large-board model. Every value is exact or certified, and the ceiling is proven, so the best possible guarantee lies in the shaded band.

On a real board. On 10×10 with this fleet, in shots on the worst layout found for each rule, the opening's 3-parity and the adaptive rule are level, always jumping is worst and jumping in about a third of games is best. The self-play mixture of section 2 opens like the plain plan (the second replay).

In detail: the large-board page has the model in full: why every third diagonal, the exact laws of the three plans, the hider's patterns and the plans that beat 3-parity. The 10×10 page plays the model's rules on a real board.

How to hunt

Smart 3-parity: classic fleet, pencil and paper

(47.8 shots on average; against the best strategy's finishing times, 47.4% of races on random boards and ≤ 37.6% on the worst board found)

Before the first shot. Pick a 3-parity set at random: a diagonal direction and one of its three sets of every third diagonal. Each diagonal lies on one checkerboard color, and the set's diagonals alternate between the two. Split the set by color, at random which is which: half A on one color, half B on the other.

Finishing comes first. With a hit not yet accounted for by a sink, extend any line of two or more hits; otherwise shoot next to a single hit.

The 3s. Fire at random unshot cells of half A, then half B. When the first 3 sinks, decide in secret whether to jump (35% of the time: 1–7 on a twenty-sided die); if so, switch to half B at once (back to A if B runs out).

The 2. Once both 3s are down, take the checkerboard color you have already fired at more; its half of the set (A or B) is your half. Fire at random cells of that color where a 2 could still fit, in this order: first the cells outside your half that touch an unshot cell of the other half, then the rest of your half, then the rest of the color.

The 4 and 5, if still afloat. A ship of k cells crosses k neighboring diagonals, so every k-th diagonal catches it: every set of every third or every fourth diagonal (diagonals with the same remainder when divided by 3 or 4) crosses both big ships, and every set of every fifth diagonal crosses the 5. Call a cell live if a straight run of unshot cells through it is long enough for the smallest big ship left. Count the live cells on each every-third-diagonal set (both directions) and on each every-fourth-diagonal set in one direction (drawn at random for the game), plus each every-fifth-diagonal set (both directions) when only the 5 is left. Sweep the set with the fewest live cells (but at least one), at random, until none is left; repeat.

Lazy version of that last step (slightly less safe: ≤ 36.4% against ≤ 36.8% in the stronger search of section 3; 48.0 shots): at the start of the game, pick one every-fourth-diagonal set at random; at the end, fire at random live cells of it, then at any live cell.

{3,3,2} on a big board

(in the large-board model: 51.4% of races against plain 3-parity's finishing times, whatever the layout)

Set up A and B as for the classic fleet, and call C the rest of A's checkerboard color.

  • Until both 3s are down: sweep A and B together, one shot each in turn, and sweep B in long runs along its diagonals.
  • Then the 2: first the cells of C that touch an unshot cell of B, then the rest of A, then the rest of C.

Searching part of B after the first sink, instead of sweeping A and B together, adds about 0.4 points: the large-board page.

How to hide

Hide at random, unless you know how your opponent hunts. Random hiding gives a hunter nothing to aim at, and the strongest hunts barely notice it: the near-perfect player of section 1's chart wins 50.04% of races against a randomly hidden 5×5 fleet, and on the classic board no hiding rule we tried moves the best strategy we found by more than 3.4 points.

Against the heat map, use the edges and corners, where it looks last (its worst board is near the top of the page). Putting just the 2 in a corner cuts its win rate from 57.1% to 28.5%. Don't pack everything into one corner, though: that cuts it only to 50.6%, and helps the pattern hunts.

Against a pattern hunt (plain 3-parity, the checkerboard, smart 3-parity), edges help the hunter. Keep your ships apart and off the edges instead, and above all keep the 2 from touching another ship: that takes 7 to 9 points off these hunts.

Hiding rules on the classic board
HiderHeat mapPlain 3-paritySmart 3-parityBest strategy found
At random57.1%45.0%47.4%50%
Every ship along an edge36.5%50.1%51.3%52.9%
The 2 in a corner28.5%44.3%45.2%50.1%
Ships apart, none on an edge73.3%36.4%40.0%47.6%
The 2 in a corner, ships apart29.3%40.2%41.5%46.7%
The hunter's win rate against a fleet hidden by each rule, racing the best strategy we found as in Table 1; lower is better for the hider. Each rule's boards are drawn at random among the layouts that obey it. Along an edge: the whole ship lies on the outer row or column. Apart: no two ships touch side to side or end to end. The best strategy's column comes from 2,000 games per rule (about ±0.6 points), the others from at least 32,000.

Against an opponent who won't adapt, the best all-round rule we tried is the 2 in a corner with ships apart: it beat random hiding against 12 of the 13 hunts we raced. But a habit is information. On 10×10 with the {3,3,2} fleet, a hunter that knows your rule wins 67% to 89% of races against such habits, against 54% when you hide at random.

Sources and caveats

Data as of 15 October 2026. Every number comes from the project's published results or from the new computations listed at the end; statements about earlier work come from the publications under Related work and further reading. Win rates are a strategy's own chance of sinking the whole enemy fleet first, with a finish in the same round counting half; differences are in percentage points.

What is exact

What is estimated

What is an upper bound

The large-board model (section 4)

These are computations in a model of an unlimited board: edges are ignored and a ship counts as found at its first hit. They are accurate to about 0.1 points, they are measured against the plain plan's pace rather than in a race where both players adapt, and the ceiling near 52% is an estimate from a discretized calculation, not a proof.

Earlier work

The literature search found no earlier analysis of the race scored by its worst board, but three papers that might anticipate parts of this page could not be read: Nakai (1990, “A preemptive detection game”, where two searchers compete to detect first), Rodin and colleagues (1988), which may use a diagonal search pattern, and Sakuta and Iida (2008), on randomized placement and attack. Golomb (1954) was read through a later exposition; Lidbetter (2013) was read in full (the open copy on LSE Research Online).

Figures and replays

New on this page

These numbers were computed for this page and are not yet on the project site: