You've probably played countless games of Battleship. Simple to set up with paper and pencil, this classic game can be more complex than it seems, especially if you want to play like a true champion. As in any game of this type, the strategy you use to place your fleet and try to sink your opponent's ships is extremely important. But what is the best strategy for Battleship?

The rules of Battleship

It's difficult to find someone who doesn't know what the old game known as “Battleship” is about. It's an apparently simple strategy game in which each player has a sheet of paper with two 10×10 grids. On the first grid, you place your own “fleet,” composed of a series of “ships” that occupy two to five squares (these sizes depend somewhat on the rules used, but that doesn't matter for now). During the game, on the second grid, you mark the locations of the enemy fleet. Players take turns calling out coordinates (for example, “B-3”), and the opponent responds with “hit” if you've struck one of their ships, “sunk” if all squares of a ship have been hit, or “miss” if you hit nothing. Simple, right? Well, behind this apparent simplicity, there are strategies that can help you win almost every game.

The Best Strategy for Battleship

One of the first tricks you can use is to place your ships “touching” each other. Indeed, although the rules state that ships cannot overlap—that is, superpose on each other—nothing prevents them from “touching.” This often confuses the opponent, because what might appear as a “carrier” of length five on their board is actually a “battleship” of length four and part of a cruiser of length three.

The Best Strategy for Battleship
The rules don't prevent ships from touching each other.

The simplest but least effective way to attack is by firing at random. You pick any coordinate and call it out, hoping to get lucky. Unfortunately, this is the worst strategy of all. It might be useful for the first shot, but afterwards you should start “fine-tuning your aim.” If you hit an enemy ship, it's better to try the adjacent squares rather than choose a new random point. Computer simulations, running millions of virtual games, show that to sink the entire enemy fleet with random firing takes—on average—more than 95 shots. Usually, your fleet will be destroyed long before that.

The Best Strategy for Battleship
Using random fire, you need more than 95 shots.

As we said, it's quite easy to improve the effectiveness of your attack if, once you've hit an enemy ship, you fire up, down, left, and right of that square in search of the rest of the same ship. Although far from brilliant, this system produces significantly better results than random fire, and it's one of the strategies adopted by nearly all casual players. Computer analysis of 10 million games played with this algorithm reveals that you can defeat the enemy using about 60 or 70 shots on average. If your opponent uses a random strategy, it won't be hard to beat them this way.

The Best Strategy for Battleship

The best attack in Battleship

However, this system can be improved, although not by much. Applying what is known as “parity,” you can greatly reduce the number of squares to analyze. Since the minimum length of ships is two squares, you don't need to fire at every square, but can do “one in between,” only at the blue (or white, of course) squares in the next image. If you scan the board row by row, you can shoot at every other square because a length-2 ship will be hit anyway, and you save a few shots at the water.

The Best Strategy for Battleship
Shots with parity

Analysis of games played with this system shows that it's possible to defeat an enemy who doesn't use a parity-based strategy, but not always. Indeed, the improvement from using this system is small enough—it saves only a couple of shots on average—that it's quite possible your opponent will wipe you off the map before you manage to destroy them. The following graph compares the three strategies mentioned so far:

The Best Strategy for Battleship
Using parity improves our game a little.

Probability density function

But the best results come from a technique known as the “probability density function.” A player who uses this technique will be practically unbeatable, and sometimes it will even seem as if they “know” where your ships are. It relies on using the information obtained from the lengths of sunken ships, since allowing you to deduce the size of those remaining on the board provides very important information about where to look. Just as we were able to eliminate a large part of the board thanks to “parity,” if only ships larger than 3 squares long remain, the number of shots needed to hit them can be reduced even further. Unfortunately, to use it at 100% of its potential requires a computer, which assigns a probability to each free square and recalculates it with every shot. That's why it's so difficult to defeat a well-programmed computer at this game.

The Best Strategy for Battleship
In orange, the new and impressive algorithm.

As you can see in the graph above, this last strategy can send the enemy fleet to the bottom of the sea in about 40 shots on average, making it unbeatable against any of the strategies mentioned earlier. As you can see, even in a seemingly simple game like this, mathematics has a lot to say. Don't you feel like playing a game of Battleship? If you want to read the complete study, in English, go here. It's truly enlightening for knowing how to win at Battleship.

The Best Strategy for Battleship
The best strategy for Battleship
The Best Strategy for Battleship
We don't need to fire at every square.
The Best Strategy for Battleship
Using parity improves our game a little.
The Best Strategy for Battleship

Seen at Datagenetics