Consider a 10 x 10 Battleship grid that hides a single ship of length = 3. This ship can be placed vertically or horizontally in any of the 100 cells. The problem is to get the 10 x 10 probability matrix that maps the best cells to shoot (higher probability to hit the ship).
My first idea was to loop through each cell, and if the ship can be placed in that cell, increment this cell in the probability matrix. With the problem stated above, this approach gives a probability of 0.01 for each cell
Then i consider the following: if a generate all the possible board positions for this ship and perform a "intersection sum" of all these boards, i get a very different result from the method above. In the problem stated above, this method tells that the cells in the center are the best to shoot.
In the mathematical sense, what is the difference between these two methods? The image shows the heat map using the second method. Thanks!