Showing posts with label Probability. Show all posts
Showing posts with label Probability. Show all posts

Thursday, 2 February 2012

Please Think of the Children

I've recently started teaching KS3 maths (pupils aged 11 - 14) and I must say I'm not a fan of the way probability is taught. For example one practice question is "Alice flips a coin 100 times. How many times would you expect her to get a head?" with the possible answers being 50, 25, or 100. My objection to this is that without the words 'on average' in the question I have no expectation for the result of her trial. The problem can be illustrated without even doing much maths because in order for exactly 50 heads and 50 tails the after the second to last flip their must either be 49 heads or 49 tails and the probability that the next coin flip brings us up to exactly 50 is a half. Doing the maths we find that there is only a 7.96% chance that Alice will actually record 50 heads.

Another question "John and Julie are both strong badminton players. Is it more probable that Julie will beat John in four games out of seven or five games out of nine?" First we must assume that by saying both are strong players that there is a 50:50 chance each will win. When I first saw this question my gut reaction was to say 5 out of 9 because it is closer to the 50:50 average. However, when we do the maths we find that Julie will win 4 out of 7 games 27.3% of the time and 5 out of 9 games only 24.6% of the time.

The question I had the biggest dislike for was "Helen and Christine play noughts and crosses 20 times. Helen wins 12 of the games. Estimate the probability that Christine will win the next game." My objection is not that the sample size isn't large enough to make the estimate from, but rather that they chose the game noughts and crosses, which as I have explained in an earlier entry should always result in a draw, and I would hope that after 20 games the players would have worked this out, so my estimate for winning the next game is 0. This assuming that the dataset is large enough shows up again in the following question "2 netball teams played 10 games. Team A won 2, B won 5 and 3 were draws. If they played 20 games, how many might A win?" With the options being 2, 4, or 10. Ignoring the fact that draws in netball are very rare, and also the lack of information about the victory margins, it is possible for all three of those options to occur, team A might win 2, or 4, or 10 of the next 20 games but answer that gets you the tick is 4 because if they won 2 out of 10 they might win 4 out of 20.

I realise that this post has been a bit different to usual but teaching this maths course has helped me to gain a better understanding of why some people struggle so much with playing risk/reward style games. So please think of the children and teach maths better, otherwise they won't grow up to be world class game players!

Monday, 9 January 2012

Schrodinger's Card

In 1935 Erwin Schrodinger devised a thought experiment whereby a cat was placed in a box with a vial of poison, a hammer, a radioactive source, and a Geiger counter. If the Geiger counter detects radioactive decay it lowers the hammer, breaking the vial and killing the cat. The Copenhagen interpretation of quantum mechanics treats the cat as being in both an alive and dead state, until such time as the box is opened and the fate of the cat is discovered. But what does this have to do with games?

Quite often when playing a game there will be some hidden information, a face down or as yet undelt card, some undefined counters, or even the result of the next dice roll. When we make our decisions we need to consider what these still to be determined events could be and the risk/reward in each case. For example, playing The Settlers of Catan I have nine cards in hand on my turn and have to make the choice between using some of these cards or keeping them to use later, the risk being that if I choose the latter a seven will be rolled and I'll lose half of them. How should I make my decision? Well I need to consider the probability of a seven being rolled and also the probability that if it isn't I will be able to make better use of my cards next turn.

Let us now switch games to cribbage. At the start of each hand a player must decide which two cards to place in the crib before the starter card is revealed. Because the starter is used at the end of the hand for scoring consideration to how our kept cards can combine with the starter is important. Since sixteen of the cards have a value of ten and only four a value of nine, keeping a five is more beneficial than keeping a six (having cards that add to fifteen scores two points). It is also worthwhile, as explained in my How to get Lucky post, to consider the chance of keeping a hand that is not currently high scoring but with the right starter card becomes high scoring. Some people find this kind of thinking difficult, as the obviously the top card is already determined, and also your opponent has six cards in their hand so none of these six card can be on top! However, probability doesn't understand that and we must treat the cards like Schrodinger's cat, being all cards at once until such time as they are observed, except for one small problem.

Our opponent is not random, but rather is making decisions all the time and based on these decisions we can get a hint about what cards are where. In 2008 a Nature article detailed scientists 'peeking' at the cat without causing it to become either alive or dead. When our opponent plays their first card we immediately gain some information and get a 'peek' at the cards in their hand, for example if our opponent leads a ten I would assume that they have a five, I don't know for certain so the card is still undefined but I get a hint. The reason is that, as I explained earlier, the starter card is most likely worth ten, also the most common card value in your hand is a ten which means that keeping fives is very common, meaning the chance of someone having a five as one of their four kept cards is closer to 2/5 than 2/7, so by leading a ten I assume that they have a five to play (scoring two points for doubles) in the event that I play my five.

This type of thinking also applies to poker, when a player folds rather than bids we gain information about what they don't have in their hand, and the probability that those cards will appear in the community cards increases, of cause poker also gives us the option of lying which is where knowing your opponents play styles and 'tells' comes in handy. I once used knowledge of my opponents play styles and 'peeking' to great effect in a game of 500. Due to time constraints it was the final hand, I had dealt and the player to my left opened the bidding at the eight level which my partner then matched, the player to my right then made a bid at the nine level. I still hadn't looked at my cards but I had played with these people a lot and knew they were not the types to overvalue a hand even if it was the final had of the day, so still without looking at my cars I bid open Misere, after some complaining about bidding blind and me wasting their time the bid was accepted and made, winning my partner and I the game. Afterwards I pointed out that because of the way they had bid I knew my hand had nothing in it and that was why I was comfortable making such a large bid without having seen it. Despite this explanation I still got a reputation for being a maverick, crazy player who despite making stupid bids would end up winning.

Monday, 7 November 2011

How to get Lucky


Have you ever noticed how some people just seem to be lucky? The reason for this is twofold, firstly the Barnum Effect (people tend to remember positive results) and secondly these 'lucky' people set them selves up to win against the odds. What I mean by this second point is that some people are good at recognising when they are no longer able to win in the conventional way and so adapt their play style to favour a much less common victory condition.

In Magic: TheGathering (yes another Magic example) we often refer to someone getting lucky and drawing the card they need as 'top decking'. People who are considered good at top decking are actually good at adapting their play style to maximise the number of cards in their deck that can win them the game. Here's an example from a game I played, I was loosing and my opponent had just declared all his creatures as attackers and while the damage that they would deal to me wouldn't make me lose it would mean that I would lose on their next turn, I had one card in hand which was a removal spell. Now you might think that I should destroy the largest of the attacking creatures, but in my view that would only mean I die in two turns instead of one, also I know that there is a creature in my deck that if drawn when they have no blocker will win me the game, so I decide to take the damage. In their second main phase my opponent casts a blocker and goes to end the turn, at this point I use my removal spell to get rid of the blocker. Now because I believe in top decking with style, I untapped my land drew the top card of my library and placed it face down on the table without looking at it, I then announced the creature that would win me the game, tapped the appropriate amount of mana and turned the card over revealing the named creature. While I didn't do very well in that tournament, my game was the only one people still remembered a month later.

So did I get lucky? Well yes and no, while the chance of me drawing the required creature was about one in twenty had I not saved the kill spell for the blocker my chance of winning was zero. It was this recognising a way to win and adapting my play style to it that actually won me the game. Let's have another example this time for Cribbage.

It is your opponents crib, they are 4 points from the end and you are 15 points away. You are dealt a hand of A, 4, 6, 6, 10, 10 (the ace and 4 are not suited) and now have to decide which two cards to discard to the crib. Because maths is fun, I can tell that the average points value for the possible hands are:

A, 4, 10, 10: 7.913
6, 6, 10, 10: 5.217
A, 4, 6, 6: 4.696
A, 4, 6, 10: 4.261
4, 6, 6, 10: 4.087
4, 6, 10, 10: 3.347

So if all we want to do is maximise the number of points we get we should keep the A, 4, 10, 10 hand. However, the most this hand could score is 12 (an A, 4, or 10 as the starter) meaning that we would have to score three points during the play to have any chance of winning, which is not very likely as we have to lead. On the other hand the 4, 6, 6, 10 has a two in twenty three chance of being worth 14 points (a five being revealed as the starter) and in this case we would only need to get one point during the pay to win. So the way I view the situation is do you want to definitely lose but keep the margin as small as possible, or take the gamble and either lose by a larger margin or win? So once again we will have had to 'get lucky', but before we can do that we have to identify that our path to victory involves keeping the hand with the second worst average return, and not the one that you would normally want to keep.