Monthly Archives: November 2018

Mathematics in Battleships… Hit or Miss?

Even upon just taking the lid off of the box, it is already clear that there are elements of Mathematics in the classic game ‘Battleships’, some of which would be fantastic in the classroom for facilitating learning if used effectively. The most obvious of these to me at first glance is the use co-ordinates. This is not really a surprise at this point, as the module is continuing to surprise me with how prevalent mathematics is in our world right up until the end. The real question though, is how much mathematics plays a part in the workings of the game. This part, is a surprise to me.

Let’s start with the basics. The game itself is made up of 100 squares (Pencil and Paper Games, no date) – although the image below fails to highlight that vital concept, it does provide a sufficient summary of the rules and instructions for playing.

gif/illustration of how to play battleship

https://www.thesprucecrafts.com/the-basic-rules-of-battleship-411069

With a total of 17 “hit” points (calculated by simply adding up the individual hit points on each ship) and 100 squares on the board overall, it would seem reasonable to assume that there is a 17% chance of making a hit. However, much like the Monty Hall Problem (Petrie, 2018) this is an example of counter-intuitive maths that we must pause, and analyse.

Nick Berry (2011) does just that. He lays out three approaches to play, which does not include the method of firing randomly at every square until you win (or more likely, lose horrifically to your opponent).

  • Hunt/Target (somewhat efficient)

Effectively, you do fire at random until a hit is made. Once this happens however, you then go for all surrounding squares until another hit is made. This is the method I used when I played the game as a child, however it is far from ideal. All the edges of each square must also be checked to make sure no ships are touching, and this is not before having to firstly figure out which direction the ship has been planted, where it starts, and where it ends. This averages out at about 66 moves required. (Berry, 2011; Harris, 2012)

http://www.datagenetics.com/blog/december32011/

Hunt/Target – Improved (slightly more efficient than somewhat efficient)

This approach involves visualising the play board as a chess board. Every ship has a minimum of two hit positions on it, so if one were to fire at every ‘black’ square on the board, you would be guaranteed to hit every ship at least once. ‘White’ squares can then be taken into account, and the Hunt/Target method can continue to bring each individual ship down. This improves the average moves required… by 1, taking the number down to 65. Thankfully, there is a much more efficient approach, which involves some fundamental concepts of mathematics.  (Berry, 2011; Harris, 2012)

  • Using Probability (the most efficient)

Nick Berry created a probability algorithm, whereby all the possible variations of how a ship can be placed on the board is calculated. The middle of the board has the highest chance of containing one of the ships, with the most likely co-ordinates being E5, E6, F5 and F6 (Brown, no date). The edges and corners on the other hand have a very low score, as there are less possible ways in which a ship can be positioned (Alemi, 2011; Harris, 2012)

Hence, in regards to Berry’s Algorithm, each square does not represent 1%. In actuality, there can be up to a 20% chance in the centre of the board (Berry, 2011)

heat map for ship of length 3

https://math.stackexchange.com/questions/144834/battleship-probability-matrix

The Aircraft Carrier for example is 5 ‘hit points’ long. Thus, it obviously can’t stretch from A3 to A8, nor only from A3 to A6, should it start at A3. As the game progresses and more squares are eliminated, the probability of each square increases.

https://nationalinterest.org/feature/the-ultimate-weapon-combining-battleship-aircraft-carrier-13826

Some have even taken the time to develop a probability calculator, which they state assists players in effectively cheating at the game.

Take a look for yourself: https://cliambrown.com/battleship/

Yet, is it actually cheating? In my opinion, that depends on your perception of what cheating is. In a scenario where one person was familiar with the underlying mathematics and basic concept of probability, it would certainly reduce the amount of enjoyment had from the game for the novice player. However, if both players were familiar with the concept of probability and chance, plus how it applies to the concept of the game, I believe this would actually increase the fun with higher tensions, alongside the less enjoyable ‘random firing’ being significantly reduced (not eliminated) with our mathematical mind-sets in play.

That said, Battleship remains a game of chance, and so just because one may have the knowledge on how to improve their odds of success, that does not necessarily mean they are going to be on an unstoppable winning streak (Harris, 2012) Of course, that does not negate the usefulness of the maths behind it all – it’s not an automatic fix for life, but rather a tool we can use to aid us throughout it.

References

Alemi, A. (2011) The Linear Theory of Battleship. Available at: http://thephysicsvirtuosi.com/posts/the-linear-theory-of-battleship.html (Accessed: 26 November 2018)

Berry, N. (2011) Battleship. Available at: http://www.datagenetics.com/blog/december32011/ (Accessed: 26 November 2018)

Brown, C.L. (no date) Battleship Probability Calculator. Available at:

https://cliambrown.com/battleship/ 

(Accessed: 26 November 2018)

Harris, A. (2012) How to Win at Battleship. Available at: http://www.slate.com/blogs/browbeat/2012/05/16/_battleship_how_to_win_the_classic_board_game_every_time.html (Accessed: 26 November 2018)

All image references accompany images.

“I’ve gotten this far… I may as well finish it”

With the amount of times it has happened already, I should not really be surprised that the next area covered in Discovering Mathematics is another one that not only astounds me, but applies to me directly – and yet, my jaw is once again left near-enough dropped as I began to uncover Counter Intuitive Mathematics.

Story time – there’s a point I want to make, I promise. A few years back now in 2013, I downloaded an app from the App Store called ‘The Simpsons: Tapped Out’, which would turn into an addiction I would hold onto for some time after.

The premise of the game was fairly simple – you complete quests, build your ‘Springfield’ and level up. Special events would be held throughout (for example, at Halloween or Christmas) where for a restricted amount of time, there were limited items in the game you could unlock, should you manage to collect enough of the event currency. Like a lot of things, it was fun at first. Quite quickly, I became quite invested in the game and it became very much a part of my routine in a desperate frenzy to get every item possible. Eventually though, after spending a few years playing the game, I was ranking up my event currency from the latest update for the next prize when I began to reach a disheartening conclusion. This wasn’t enjoyable anymore – at all. All I was doing, was tapping for the sake of completion. Tap, gain points, tap gain points, and so on. I was not having fun, yet for some reason, I kept on playing. I continued on, with my mind thinking back to all the time (and real money at points!) I had spent on this game, and how I didn’t want any of it to go to waste. The game became much more a chore than a hobby, which is never enjoyable. In this scenario, there was no end.

Although the game is actually still going somewhat strong today (Musgrave, 2018), after several guilty return trips to the game, I did eventually leave the time-consuming annoyance behind. This experience however, is a personal example of the Sunk Cost Fallacy. I had a difficult time letting go of a past cost which could not be recovered. I felt defeated.

The video below features Julia Galef, who explains the Sunken Cost Fallecy in a relatable, and therefore understandable sense:

The decision to leave the game behind was a tough one, having accumulated so much and spent so much of my time and effort into. I had to make the decision that was best for me, and that meant slashing out the idea that should I continue to play, I would be gaining a non-existent hypothetical value. This links strongly to what is referred to as ‘Loss Aversion’.

 

As humans, we would much rather avoid losing than losing. Obviously. What is more interesting however, is that studies have shown that we would much rather avoid losing than winning (Kay, no date). For example, if I was to wake up one morning and find a £50 note in my driveway, I would be delighted and filled with excitement. If however, I was to come home one day after work and realise that I had lost an existing £50 note, my feelings of dismay and frustration would outweigh the former outcome.

 

Along with the Sunk Cost Fallacy, Kruger, Mirtz and Miller (2005) reference Loss Aversion as a reason to changing our answers. They refute against the expressions ‘go with your gut’ or ‘stick with your instincts’ that others such as Brownstein, Wolf and Green (2000) have made. They claim that that the majority of decision changes result in a win/correct answer. ‘The Monty Hall problem’ supports this statement with some admittedly at first glance perplexing, but fascinating mathematics.

Scenario – a gameshow tells you to pick a door. One has a car. The other two have goats. Whatever option you choose (A, B or C), the host will always show you where ONE of the other goats are. At this point, you are asked to stick or switch. Without analysis, it would appear that since one goat will be revealed and discarded, you now have a 50% chance of winning or losing either way – but this is incorrect! (Mitzenmacher, 1986).

Taken from Wikipedia

In fact, you have a much higher chance of winning the car if you switch. What took me time to get my head around personally was the fact that the odds do not change from 33.3(333333…..)% to 50%. They in fact shift over the remaining closed door (Mitzenmacher, 1986). Of course, a win is not guaranteed, but it is certainly more likely. On the well-established YouTube channel Numberphile, you can find a video which explains this in a lot more detail. Click here.

With similar links to my previous post on probability (which you can view here), we can take the basic concepts of percentages and chance and apply it to a much grander situation. This links into the idea of connectedness, one of four key properties that Liping Ma (2010) underlines as what an individual needs to have for a Profound Understanding of Fundamental Mathematics (PUFM). The options listed in the Monty Hall Problem feeds the second property, multiple perspectives – there are advantages and disadvantages for any outcome chosen, though the former will probably prevail over the latter due to the nature of the predicament. Likewise, different approaches can be made when it comes to The Sunk Cost Fallacy. That is, to continue on with something for your own perceived satisfaction, or leave it behind for the greater good – both of which at a cost of losing something (e.g. time money). The basic idea of loss aversion of course can have either small or catastrophic consequences – this is something recognised by Barclay’s in reference to investments.

Would it be fair to say that Maths makes our decisions for us? Of course not. But can it influence them? Most definitely. A PUFM will be extremely beneficial in relation to this aspect. From a personal standpoint, given the repetitive nature of The Simpsons Tapped Out, I am willing to bet I wasn’t the only one who had this experience. However, I am also willing to bet that some people may not have realised the process they are going through, or if they do, will fail to escape in an attempt to avoid perceived loss.

References

Big Think (2013) Julia Galef: The Sunk Cost Fallacy. Available at: https://www.youtube.com/watch?v=vpnxd31y0Fo (Accessed: 3 November 2018)

Brownstein, S., Wolf, I., and Green, S. (2000) Barron’s ‘How to Prepare for the GRE: Graduate Record Examination’. (14th edn.) New York: Barrons Educational Series Inc.

Kay, M. (no date) You can implement these tips to your site or you can keep losing subscribers every day. The story of loss aversion. Available at: http://psychologyformarketers.com/loss-aversion/ (Accessed: 3 November 2018)

Kruger, J., Wirtz, D., & Miller, D. T. (2005). Counterfactual Thinking and the First Instinct Fallacy. Journal of Personality and Social Psychology, 88(5), 725-735. Available at: http://dx.doi.org.libezproxy.dundee.ac.uk/10.1037/0022-3514.88.5.725 (Accessed: 3 November 2018)

Ma, L. (2010) Knowing and Teaching Elementary Mathematics. (Anniversary Ed.) New York: Routledge.

MindfulThinks (2017) Sunk Cost Fallacy And Why You Should Quit. Available at: https://www.youtube.com/watch?v=xXpzfy5oKWg (Accessed: 3 November 2018)

Mitzenmacher, M (1986) The Monty Hall Problem: A Study. Available at: https://pdfs.semanticscholar.org/4ece/81b2830bb47e279920f7cf92d672ba5a1373.pdf (Accessed: 3 November 2018)

Musgrave, S. (2018) Best iPhone Game Updates: ‘Marvel Contest of Champions’, ‘Mines of Mars’, ‘Temple Run 2’, ‘Choice of Games’, and More. Available at: https://toucharcade.com/2018/10/08/best-iphone-game-updates-marvel-contest-of-champions-mines-of-mars-temple-run-2-choice-of-games-and-more/ (Accessed: 3 November 2018)

mybarclayswealth (2016) Loss Aversion. Available at: https://www.youtube.com/watch?v=OfQkGoNS15Q (Accessed: 3 November 2018)

Images Used

https://en.wikipedia.org/wiki/The_Simpsons:_Tapped_Out

https://deepvalueetfaccumulator.com/behavioral-finance-and-the-value-investor/consequences-panic-selling-almost-always-bad/attachment/loss-aversion/

https://math.stackexchange.com/questions/1684694/could-the-monty-hall-problem-be-applied-to-multiple-choice-tests