Tag Archives: mathematics

When will Australia’s coal run out?

Coal exports are a growth industry for Australia. A lot is being invested in infrastructure for coal production and transport to keep this growth going. But how long will this bonanza last? After all, there is only a finite amount of the stuff in the ground.

Earlier this year, the Australian Bureau of Agricultural and Resource Economics (ABARE) released an extensive report on Australia’s energy resources. The chapter on coal included the following observation about black coal:

At the 2008 rate of production of around 490 Mt [mega-tonnes] per year the EDR are adequate to support about 90 years of production.

For those unfamiliar with the jargon of the industry,  “EDR” stands for “Economic Demonstrated Resources” which means an estimate of the total amount of coal in the ground that we could feasibly dig up.

Now some of you may already be thinking that 90 years does not sound all that long, but there’s a problem. The authors of the report do not understand exponential growth! The catch is hidden in the apparently innocuous phrase “at the 2008 rate of production”. In other words, to come up with the 90 year figure they are assuming that production levels do not grow at all for the next 90 years. Is that reasonable?

A quick look at coal production over almost 50 years would indicate that it is far from a reasonable assumption.

Coal Production chart

Australian Coal Production 1961-2008

Even to the untrained eye, a growth trend is evident in this chart, a fact which is confirmed by looking at year-on-year growth, which has averaged around 5% and has only been negative three times over the whole period.

Coal Production Growth II (chart)

Annual Growth in Australian Coal Production 1961-2008

So, where does the 90 year figure come from? According to the ABARE report, Economic Demonstrated Resources are 39.2 giga-tonnes (Gt). Add to this another 8.3 Gt of “Sub-economic Demonstrated Resources”, or SDR, (i.e. reserves that are really hard to get) gives an estimate total of 47.5 Gt for Australia’s coal reserves. Now 90 × 490 Mt (the 2008 production rate) gives 44.1 Gt, which is somewhere between EDR and the combined total of EDR and SDR. Presumably the ABARE authors are allowing for the possibility that over time it will become economically feasible to mine some of the coal that is currently classified as sub-economic.

But there is no way that 2008 production rates will be kept steady for the next 90 years. Apart from anything else, there are plenty of stakeholders in the coal industry doing their best right now to see their export business grow.

To come up with a better estimate of how long the coal might last, rather than assuming zero production growth, I will assume a constant growth rate. While the annual growth rate from 1961 to 2008 averaged 5% per annum, growth has been a little slower more recently. The last 5 years have seen growth average only 3.1% (presumably the global financial crisis did not help). Working with the ABARE estimate that viable coal reserves are 90 times 2008 production levels and assuming 3.1% annual growth in production, the reserves will in fact only last for 43 years! That is less than half the 90 year figure in the ABARE report and it starts to seem like an awfully short period of time. Since the working life of coal-fired power stations is typically around 40 years, this means any new power stations built today would still work out their useful life, but they could be the last ones we build and extract the full value of their potential productivity.

Of course, if the growth rate is higher, the time to deplete the reserves will be lower, as is illustrated in the table below. In fact, if production growth returns a long run average of 5%, then reserves would only last 34 years.

Growth Rate Years Left
5%
34
4%
38
3%
44
2%
51
1%
64
0%
90

Reserves 90 times 2008 production

Optimists may counter that the ABARE estimates of the available reserves might be far too conservative. Perhaps there are coal fields out there just waiting to be discovered. Surely that would give us room to have coal export growth go gangbusters, wouldn’t it? Let’s see. I’ll be generous and assume that coal reserves are in fact twice as big (EDR has not changed much over the last 30 years). Running the figures again assuming reserves total 180 times 2008 production levels still means that with 3.1% annual production growth, the coal will all be gone in 60 years and if growth is 5%, it will only last 46 years.

Growth Rate Years Left
5%
46
4%
53
3%
62
2%
76
1%
103
0%
180

Reserves 180 times 2008 production

Now it may be the case that climate change will trigger disasters on such as scale that in 40 years time we are not too worried about coal production, nevertheless, these basic calculations mean that some or all of the following must be true.

  • Australian coal is going to run out in around 40 years
  • The coal industry cannot continue to grow at the rate it has done over the last 50 years
  • Australian energy will be turning to coal alternatives sooner that we may expect (with or without a carbon price)
  • There is a significant expansion in EDR in the future (much greater than we’ve seen over the last 30 years)

If we are going to stretch coal supplies beyond 40 years, what can slow down the need for production? With a price on carbon not looking likely to slow Australian energy consumption in the near future, one possibility would be to reduce the share of coal production that is exported and keep more of it for our own energy needs. After all, the export share has been growing quite rapidly.

Export Share II (chart)

Share of Australian coal production exported (1961-2008)

With around 66% going offshore, there is quite a bit that could be clawed back there. But who would dare suggest slowing export growth? Maybe we will just wake up one morning and discover, with a shock, that the coal is all gone and, since it is estimated that Australia has about 6% of the world’s coal reserves, the rest of the world may face the same realisation even sooner.

Data source: ABARE (note that the 2007-08 production figures in this data set look a little lower than the 490 Mt figure quoted in the report, this is because the chart shows saleable coal which is lower than total coal extracted).

UPDATE: there was initially an error on the export share chart. Thanks to @paulwallbank for pointing it out!

Natural frequencies

In my last post, I made a passing reference to Gerd Gigerenzer’s idea of using “natural frequencies” instead of probabilities to make assessing risks a little easier. My brief description of the idea did not really do justice to it, so here I will briefly outline an example from Gigerenzer’s book Reckoning With Risk.

The scenario posed is that you are conducting breast cancer screens using mammograms and you are presented with the following information and question about asymptomatic women between 40 and 50 who participate in the screening:

The probability that one of these women has breast cancer is 0.8%. If a woman has breast cancer, the probability is 90% that she will have a positive mammogram. If a woman does not have breast cancer, the probability is 7% that she will still have a positive mammogram. Imagine a woman who has a positive mammogram. What is the probability that she actually has breast cancer?

For those familiar with probability, this is a classic example of a problem that calls for the application of Bayes’ Theorem. However, for many people—not least doctors—it is not an easy question.

Gigerenzer posed exactly this problem to 24 German physicians with an average of 14 years professional experience, including radiologists, gynacologists and dermatologists. By far the most common answer was that there was a 90% chance she had breast cancer and the majority put the odds at 50% or more.

In fact, the correct answer is only 9% (rounding to the nearest %). Only two of the doctors came up with the correct answer, although two others were very close. Overall, a “success” rate of less than 20% is quite striking, particularly given that one would expect doctors to be dealing with these sorts of risk assessments on a regular basis.

Gigerenzer’s hypothesis was that an alternative formulation would make the problem more accessible. So, he posed essentially the same question to a different set of 24 physicians (from a similar range of specialties with similar experience) in the following way:

Eight out of every 1,000 women have breast cancer. Of these 8 women with breast cancer, 7 will have a positive mammogram. Of the remaining 992 women who don’t have breast cancer, some 70 will still have a positive mammogram. Imagine a sample of women who have positive mammograms in screening. How many of these women actually have breast cancer?

Gigerenzer refers to this type of formulation as using “natural frequencies” rather than probabilities. Astute observers will note that there are some rounding differences between this question and the original one (e.g. 70 out of 992 false positives is actually a rate of 7.06% not 7%), but the differences are small.

Now a bit of work has already been done here to help you on the way to the right answer. It’s not too hard to see that there will be 77 positive mammograms (7 true positives plus 70 false positives) and of these only 7 actually have breast cancer. So, the chances of someone in this sample of positive screens actually having cancer is 7/77 = 9% (rounding to the nearest %).

Needless to say, far more of the doctors who were given this formulation got the right answer. There were still some errors, but this time only 5 of the 24 picked a number over 50% (what were they thinking?).

The lesson is that probability is a powerful but confusing tool and it pays to think carefully about how to frame statements about risk if you want people to draw accurate conclusions.

The Mule goes SURFing

A month ago I posted about “SURF”, the newly-established Sydney R user forum (R being an excellent open-source statistics tool). Shortly after publishing that post, I attended the inaugural forum meeting.

While we waited for attendees to arrive, a few people introduced themselves, explaining why they were interested in R and how much experience they had with the system. I was surprised at the diversity of backgrounds represented: there was someone from the department of immigration, a few from various areas within the health-care industry, a group from the Australian Copyright Council (I think I’ve got that right—it was certainly something to do with copyright), a few from finance, some academics and even someone from the office of state revenue.

Of the 30 or so people who came to the meeting, many classed themselves as beginners when it came to R (although most had experience with other systems, such as SAS). So if there’s anyone out there who was toying with the idea of signing up but hesitated out of concern that they know nothing about R, do not fear. You will not be alone.

The forum organizer, Eugene Dubossarsky, proceeded to give an overview of the recent growth in R’s popularity and also gave a live demo of how quickly and easily you can get R installed and running. Since there were so many beginners, Eugene suggested that a few of the more experienced users could act as mentors to those interested in learning more about R. As someone who has used R for over 10 years, I volunteered my services. So feel free to ask me any and all of your R questions!

As well as being a volunteer mentor, I will have the pleasure of being the presenter at the next forum meeting on the 18th of August. Regular readers of the Stubborn Mule will not be surprised to learn that the topic I have chosen is The Power of Graphics in R. Here’s the overview of what I will be talking about:

In addition to its statistical computing prowess, R is one of the most sophisticated and flexible tools around for visualizing quantitative data. It can produce a wide variety of chart types, including scatter plots, box plots, dot plots, mosaic plots, 3D charts and more. Tweaking chart settings and adding customized annotations is a breeze and the charts can readily be output to a range of formats including images (jpeg or png), PDF and metafile formats.

Topics covered in this talk include:

  • Getting started with graphing in R
  • The basic charting types available
  • Customising charts (labels, axes, colour, annotations and more)
  • Managing different output formats
  • A look at the more advanced charting packages: lattice and ggplot2

Anyone who ever has a need to visualize their data, whether simply for exploration or for producing slick graphics for reports and presentations can benefit from learning to use R’s graphics features. The material presented here will get you well on your way. If you have ever been frustrated when trying to get charts in Excel to behave themselves, you will never look back once you switch to R.

For those of you in Sydney who are interested in a glimpse of how I use R to produce the charts you see here on the blog, feel free to come along. I hope to see you there!

Surf

I hope this will not come as too much of a disappointment to anyone, but despite the title, this post has nothing to do with the ocean. Here “Surf” refers to the newly established Sydney R user group. While the acronym may be a little forced (it actually stands for “Sydney Users of R Forum”), as a long-time user of the R programming language for statistics and a resident of Sydney, I have signed up and will be doing my best to make it to the first meeting. Any other Sydney-siders who read the post on graphing in R and would like to learn more about R may be interested in coming along too as the group is aimed as much at beginners as old-timers like the Mule. I might even see you there.

If I do make it along to the meeting, I will report back here on what it was like.

UPDATE: I did make it along and will in fact be presenting at the next forum meeting.

The Monty Hall Problem

It’s probability time again!

The discussions about the Tuesday’s Child problem were intense, so a break from probability puzzles was in order. But now that your brains are well rested, it is time to move on to the next puzzle from the Probability Paradoxes post: the Monty Hall problem. If you thought that the first puzzle was controversial, you ain’t seen nothing yet! Monty Hall has generated so much discussion (and, at times, acrimony), that there was enough material for someone to write a book on the subject.

In a possibly futile attempt to avoid some of that controversy, I will be taking a different approach to the discussion this time. I tried to come up with the “best” or “most reasonable” assumptions needed to solve the Tuesday’s Child puzzle, but in the case of Monty Hall I will side-step those sorts of questions and simply provide a framework for calculating solutions for a range of possible assumptions.

So here we go. Remember that the scenario we are presented with is as follows.

Suppose you’re on a game show, and you’re given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what’s behind the doors, opens another door, say No. 3, which has a goat. He then says to you, “Do you want to pick door No. 2?” Is it to your advantage to switch your choice?

I am going to jump right into the mathematics of conditional probability again. I will use “Car” to denote the possibility that door No. 1 (your door) has a car behind it and “Goat” to denote the possibility that it has a goat behind it. Without necessarily assuming Monty opens door No. 3, I will denote by R (for “reveal”) the possibility that Monty opens a door other than the one you have chosen and thereby reveals a goat.

With all of that in mind, I will compute the probabilities P(Car |  R) and P(Goat | R), that is the probability that you have picked a car or a goat respectively, given that Monty has shown you a goat behind another door. Even allowing for the goat being as good-looking as the one pictured here, I will also assume that you really want to win a car not a goat. On that basis, you should switch doors if P(Goat | R) is greater than P(Car | R) and stick with your original choice if P(Goat | R) is less than P(Car | R). If the two probabilities are the same, there is no advantage or disadvantage in switching.

Despite being a very easy theorem to prove, Bayes’ Theorem is one of the most fundamental results in probability and I will make use of it here.

P(\hbox{Car}| R) = \frac{P(\hbox{Car}) P(R | \hbox{Car})}{P(R)}.

The probability P(R) can be broken down in terms of the two mutually exclusive possibilities ‘Car’ and ‘Goat’:

P(R) = P(R | \hbox{Car}) P(\hbox{Car}) + P(R | \hbox{Goat}) P(\hbox{Goat})

Combining this with Bayes’ Theorem and the (fairly uncontroversial) facts P(Car) = 1/3 and P(Goat) = 2/3, we can conclude that

P(\hbox{Car}| R) = \frac{\frac{1}{3}P(R |  \hbox{Car})}{P(R | \hbox{Car}) \frac{1}{3} + P(R | \hbox{Goat}) \frac{2}{3}}.

Tidying this up a bit gives us a formula that will be able to deal with many (but by no means all) possible assumptions for the problem.

P(\hbox{Car}| R) = \frac{P(R |  \hbox{Car})}{P(R |  \hbox{Car}) + 2 P(R | \hbox{Goat})}

Of course, once we have this, we also know P(Goat | R) as it is 1 – P(Car | R).

All we need to do to use this formula is come up with assumptions that can be formulated in terms of P(R | Car) and P(R | Goat). Here are some examples of what we can do.

Case 1 (Classical)

Here we assume that Monty knows everything in advance about where the goats and the car are and that he can and always will show you a goat behind another door. This means that

P(R | Car) = P(R | Goat) = 1

Plugging this into the formula gives P(Car | R) = 1/3 and P(Goat | R) = 2/3, which means that we are better off switching. This is the standard solution to the Monty Hall problem and may come as a surprise to many people as the most common response, even with the assumption of an omniscient Monty, is that it doesn’t matter whether you switch or not.

Case 2 (Nice Monty)

This time we will still assume that Monty knows everything, but now he really wants you to win the car. So, he will only open a door to show you a goat if you have made the wrong initial choice. If you picked the car in the first place, he will simply open your door and congratulate you on your win. This means that

P(R | Car) = 0 and P(R | Goat) = 1 and so P(Car | R) = 0 and P(Goat | R) = 1. Once again you should switch. This time this conclusion should be obvious.

Case 3 (Nasty Monty)

Now Monty still has all the facts, but would prefer you to pick a goat. Perhaps Monty loves goats or perhaps the show is losing money and he doesn’t want to fork out for another car. Either way, these assumptions mean that

P(R | Car) = 1 and P(R | Goat) = 0 and so P(Car | R) = 1 and P(Goat | R) = 0. Now you should stick to your guns. Again, this conclusion should be obvious.

Case 4 (Lucky Monty)

Now we will stop assuming that Monty knows everything. When he opens the second door, he has no idea whether he’s going to spoil everything by revealing the car. If he does that, the show’s segment would, of course, end a little sooner than he had hoped. If you have picked the car, he will be fine, but if you picked a goat, he has a 50/50 chance of revealing the car instead of a goat. Translating all of this into mathematics gives:

P(R | Car) = 1 and P(R | Goat) = 1/2 and this time P(Car | R) = 1/2 and P(Goat | R) = 1/2. So, if Monty just happened to be lucky and show you a goat, it will not make any difference if you switch or not. Your odds will be the same either way.

Many other possible assumptions about what Monty does or does not know or do can also be cast in terms of P(R | Car) and P(R | Goat) and for each of these possibilities, it is therefore straightforward to decide whether to stick or switch.

In the debate over the Monty Hall problem, some have argued that Case 4 is a “better” interpretation of the puzzle than Case 1. While I won’t comment on that, I am sure that my attempt to evade the issue will not be enough to keep everybody happy with this solution. It seems that the Monty Hall controversy will not die.

Update: for anyone not convinced by the formula for the classical case, this spreadsheet may help.

Eliminating the irrelevant

After going to all the trouble of explaining the “classical” analysis of the Tuesday’s Child problem, here I will explain why I think that analysis ends up with the wrong answer.

This will get into the nuts and bolts of the mathematics of probability again, but I will start with some of the questions which led me to rethink this problem.

In her Math Blog, Tanya Khovanova approaches the problem in a very interesting way. Paraphrasing Tanya, if Mr Smith tells you that one of his two children is a boy born on Tuesday, you will (if you accept the classical reasoning) revise the probability of two boys from 1/4 to 13/27. But, you would do the same if he said the boy was born on Wednesday, or indeed any day of the week. So if he said he had a boy born on *$$*@day (his voice was muffled and you couldn’t quite catch which day he said), wouldn’t you then revise your probability to 13/27 too? After all, you’d make that revision regardless of what day he actually said! If so, couldn’t you then revise the probability to 13/27 even if he doesn’t mention a day of the week and just said he had a boy? This clearly makes no sense and suggests there is a problem with the classical analysis.

The crux of the problem is that if Mr Smith is volunteering information, he could just as easily have spoken of a day other than Tuesday. Indeed, he may have said ‘I have two girls’, ‘Anyone for tennis?’ or ‘The UK doesn’t have a solvency problem the way Greece does’. The situation is very different if you are asking the questions of Mr Smith. If you ask him whether he has a boy born on Tuesday, he is restricted to saying ‘yes’ or ‘no’. At least, that’s the case if you allow the one big assumption I am making here, namely that whatever Mr Smith says, he is telling the truth (even about macroeconomics).

So, exactly how the information is revealed makes a difference. That in itself is well understood, but at this point many people will simply give up saying that there are too many options open to Mr Smith so it is impossible to come to any sensible conclusions. So, they will either give up on the problem or rephrase it to one that can be answered, such as where you ask the questions of Mr Smith, as I did in the Tuesday’s Child post. But, if you rephrase the problem, you are solving a different problem and giving up on the original one. What I will argue here is that all those options open to Mr Smith do not matter at all. Mathematically we can eliminate “irrelevant” options and come up with a perfectly defensible solution to the problem.

To ease into the mathematics, I will go back to Gardner’s simpler two boys problem:

Mr Smith says, ‘I have two children and at least one of them is a boy.’ What is the probability that the other child is a boy?

Before trying to answer that, I will instead ask if Mr Smith had two boys, what is the probability that he would say ‘I have two children and at least one of them is a boy’. It is impossible to say: there are so many other things he could have said instead. But what if I asked about the probability that Mr Smith would say ‘I have two children and at least one of them is a boy’. Again it’s impossible to say, so instead I will ask how does that probability compare to the probability of him saying ‘I have two children and at least one of them is a girl’? I would argue that, by symmetry, these two probabilities have to be the same (whatever they may be). As soon as you accept that, the classical solution falls apart.

Now for the mathematics. To save a bit of space I’ll use X to denote the event “Mr Smith says, ‘I have two children and at least one of them is a boy’.” and I will write Y for “Mr Smith says, ‘I have two children and at least one of them is a girl’.” In mathematical terms, my symmetry argument is that P(X | BG) = P(Y | BG), even though we don’t know what either of these probabilities are. This is the sort of reasoning I will use to calculate the conditional probability:

P(BB | X) = P(BB)\frac{P(X | BB)}{P(X)}

Even though I will not be able to calculate either the top or the bottom term of this fraction, I will be able to calculate the ratio. To do this, I will use an equation I call “eliminating the irrelevant”. For any events A, B and Z, if A is a subset of Z and Z is independent of B then a bit of algebra will show that.

\frac{P(A | B)}{P(A)} = \frac{P(A | B\cap Z)}{P(A|Z)}.

I can apply that to the current problem by setting Z = X\cup Y as long as Z is independent of BB. While we have not been told that is the case, it would seem to be an extremely reasonable assumption. If you think of all the other things Mr Smith might have said, is there any reason to assume that he would be more likely to say something other than X or Y simply because he had two boys rather than two girls? I don’t think so. It’s certainly possible that there could be a link, in much the same way that a coin could be biased, but in the absence of any other information we would start by assuming heads and tails are equally likely.

Note that Y by itself is not independent of BB, nor is X. What I am arguing is that the fact that Mr Smith has two boys (BB) does not affect the likelihood that he will say either X or Y as opposed to something else entirely.

The formula above thus allows us to calculate the conditional probability we are after as follows:

P(BB | X) = P(BB)\frac{P(X | BB\cap Z)}{P(X | Z)}.

In one fell swoop, we have eliminated the irrelevant alternatives for Mr Smith and now have something we can work with, even though we will never know what the probability of X actually is!

The top line of the fraction is straightforward. If Mr Smith is restricted to X or Y and has two boys, only X is possible, so P(X | BB\cap Z) = 1. The bottom line requires a bit more work. As in the last post, we can break it up into disjoint alternatives:

P(X | Z) = P(X | Z\cap BB) P(BB) + P(X | Z\cap BG) P(BG) +P(X | Z\cap GB) P(GB).

Note that I have taken the liberty of dropping one term here as I know that P(X | Z\cap GG)=0. By symmetry, since Mr Smith is restricted to X and Y, P(X | Z\cap BG)=\frac{1}{2} and the same applies for the GB term. So, we now have

P(X | Z) = 1\times\frac{1}{4}+ \frac{1}{2}\times\frac{1}{4} + \frac{1}{2}\times\frac{1}{4} = \frac{1}{2}.

Now we’ve got everything we need and so

P(BB | X) = \frac{1}{4}\times\frac{1}{\frac{1}{2}} = \frac{1}{2}.

So instead of the classical conclusion that the probability that Mr Smith has two boys is 1/3, we have arrived at a figure of 1/2. The key to this result is that when we ask Mr Smith whether he has at least one boy, the probability that he says ‘yes’ is the same whether he has BB, BG or GB. When he makes an utterance of his own accord, although we don’t know what the probability values P(X | BB), P(X | BG) or P(X | GB) are, I am contending that P(X | BB) is double the other two (because in those cases he could have volunteered information about a girl). So, when Mr Smith volunteers that he has at least one boy, he is giving more information to us than if he simply answers ‘yes’ to our question.

The same reasoning will also give a probability of 1/2 for two boys in the Tuesday’s child case (there you would set Z to cover the 14 options for Mr Smith of saying one of boy/girl and one of Monday/Tuesday/Wednesday, etc).

To sum up, if Mr Smith volunteers ‘I have two children and at least one is a boy,’ then the probability that he has two boys is 1/2, whereas if you ask him ‘do you have two children and at least one boy’ and he answers ‘yes’, the probability that he has two boys is 1/3. Likewise, if he volunteers that he has a boy born on a Tuesday, the probability that he has two boys is 1/2 but if you ask him whether he does and he says yes, the probability of two boys is 13/27.

This gives the satisfying (and, I think, intuitive) result that the day of the week does not matter and Tanya’s paradox of a muffled word changing the probabilities is resolved.

Tuesday’s Child

Following on from the teasers in the probability paradoxes post, here is a closer look at “Tuesday’s child”. While it may not strictly be a paradox, it still has the rich potential for generating controversy. In fact, I don’t agree with what could be called the “classical” analysis of the problem. Here I will look at this classical approach and save my own interpretation for a later post.

A warning: this will be the most mathematical post on the blog to date, so it is not for the faint-hearted!

All of these probability paradoxes hinge on the notation of conditional probability. Conditional probability is the probability of one event given that another event has occurred. As a simple example, imagine roll a dice and A denotes “rolling a six” and B denotes “rolling an even number”. Then the probability of rolling a six is 1/6, but the probability of rolling a 6 given that I roll an even number is 1/3.

Now, before getting onto Tuesday’s child, I will go back to the simpler paradox, which I introduced in the Martin Gardner post. Note that throughout this post I will assume that girls and boys are equally likely and I will ignore identical twins (no offence to identical twins, of course!). I’ll quote from Gardner’s “Mathematical Puzzles and Diversions”:

Mr Smith says, ‘I have two children and at least one of them is a boy.’ What is the probability that the other child is a boy? One is tempted to say 1/2 until he lists the three possible combinations of equally probable possibilities – BB, BG, GB. Only one is BB, hence the probability is 1/3. Had Smith said that his oldest (or tallest, heaviest, etc.) child is a boy, then the situation is entirely different. Now the combinations are restricted to BB and BG, and the probability that the other child is male jumps to 1/2.

Without going into my reasons in this post, I don’t agree with Gardner’s solution to the problem as he posed it. But, with a little tweak, I would agree. If instead you ask Mr Smith whether he has at least one boy among his two children and he says ‘yes’ (as opposed to having him volunteer the details), then the probability that he has two boys is 1/3.

I’ll tweak the Tuesday’s child problem in the same way for now. Imagine the problem is now as follows:

Mr Smith has two children. You ask whether he has at least one boy born on a Tuesday. He says ‘yes’. A lucky guess perhaps, but now you wonder what the chances are that Mr Smith’s other child is also a boy.

At this point, we could enumerate all the possible combinations of children and weekdays of birth. All up there are 2\times 7\times 2\times 7 = 196 possibilities. Looking through that list, we would then scratch all of those that do not have at least one boy born on a Tuesday. In the list that remains, look at the proportion made up by families with two boys. Try it and you’ll find your revised list has 27 combinations in it and 13 of them have two boys, so the probability we are after is 13/27.

For me, that looks a bit much like hard work, so instead I would call on a bit more of the mathematics of conditional probability. Feel free to stop reading now if you don’t have the stomach for even more mathematics!

Mathematically, conditional probability is defined as follows:

P(A | B) = \frac{P(A \cap B)}{P(B)}
where the left hand term denotes the “probability of A given B” (and P denotes “probability of”). The top term on the fraction is “A intersection B”, which simply means that both A and B occur.

I will denote by X the “event” that Mr Smith said ‘yes’ to the at least one boy born on Tuesday question (the inverted commas are there because “event” is actually a technical term in probability). The probability we want to calculate is

P(BB | X) = P(BB) \frac{P(X | BB)}{P(X)}

Starting with the conditional probability on the top of this fraction, if we have a two-boy family, the answer to “do you have a boy” will certainly be “yes”, so we need to know the probability of at least one of the boys having a Tuesday birth date. There are 7 possible birthdates for each child, giving 49 possibilities. Of these, 7 have a Tuesday for the elder child and 7 for the younger, but this double-counts the case where both were born on a Tuesday, so we have:

P(X|BB) = \frac{13}{49}.

One way to calculate the probability of X itself is to break it down into different possible gender combinations:

P(X) = P(X \cap BB)+P(X\cap GG)+P(X\cap BG)+P(X\cap GB).

Here I am using the fact that probabilities of “disjoint” (non-overlapping) events add up, i.e. P(A \cup B) = P(A) + P(B) if A and B are disjoint. Using the conditional probability formula, this gives:

P(X) = P(X | BB) P(BB)+P(X | GG) P(GG) +P(X | BG) P(BG)+P(X | GB) P(GB).

Now the probability of the boy in a mixed gender family being born on a Tuesday is 1/7 and the probability of having boy-girl or girl-boy are both genders is 1/4. Combining this with the fact that the probability of a boy born on Tuesday is zero in a two-girl family and what we already know about a boy-boy family know gives us

P(X) = \frac{13}{49}\times \frac{1}{4} + 0 + \frac{1}{7}\times\frac{1}{4} + \frac{1}{7}\times\frac{1}{4}= \frac{13 + 2\times 7}{49}\times\frac{1}{4} = \frac{27}{49}\times\frac{1}{4}

Putting this all together, we have

P(BB | X) = \frac{1}{4}\times\frac{13}{49}/(\frac{27}{49}\times\frac{1}{4}) = \frac{13}{27}.

While you are waiting for the next post with an alternative interpretation, you might want to think about Gardner’s two boy problem a bit more. In order to get to the classical conclusion that there is a 1/3 chance Mr Smith has two boys then you effectively have to assume that if he had one boy and one girl, he would definitely say ‘I have two children and at least one of them is a boy’ and not ‘I have two children and at least one of them is a girl’. Does that really make sense?

UPDATE: Here is a spreadsheet which simulates the classic version of the Gardner problem (i.e. assuming that you ask Mr Smith the question), and here is an alternative analysis.

Probability Paradoxes

Probability is tricky.

If you are one of those people who likes to say “I was never any good at maths at school”, your response to this would be “of course!”. But probability seems to be tricky for mathematicians too, even for mathematicians who teach probability.

GoatI have always loved probability paradoxes and clearly remember spending most of a train-trip to Edinburgh almost 20 years ago debating the famous Monty Hall problem (see below).

Now I’ve been thinking about paradoxes again. It all started with a passing reference to the two boys paradox in my recent post about the passing of Martin Gardner. Commenting on that post, Bob Walters (who was in fact my honours supervisor a long time ago) drew my attention to his own reflections on that paradox, which opened a can of worms for me. I’ve been obsessing on the topic ever since.

Rather than jumping straight to my conclusions, I thought it would only be fair to give readers a chance to think things through themselves first. So in this post, I will simply state a few well-known probability paradoxes and discuss my own thoughts on each of them in future posts. Feel free to share your thoughts in the comments.

Tuesday’s Child

Bob’s post alerted me to a variant of the two boys problem that has been generating a lot of discussion (here, here, here and here among other places). Appropriately enough, all of this discussion emerged from the most recent Gathering for Gardner, a conference on mathematical puzzles held in honor of Martin Gardner.

So here is the puzzle.

A man says to you “I have two children, one is a boy born on a Tuesday”. What is the probability the man has two boys?

This is a more complicated version of the original puzzle where the man simply says “I have two children, one is a boy”. Classically, the answer to this one is that the probability of two boys is 1/3. The argument is that there are four equally likely probabilities to start with: Boy-Boy, Boy-Girl, Girl-Boy and Boy-Boy*. The statement rules out Girl-Girl, and Boy-Boy is one of the three equally likely remaining possibilities.

I say “classically” because I no longer agree with this reasoning. I’ll explain why in a later post, and for now I’ll just pose another question. Is there any difference between the scenario in which you ask the man “do you have at least one boy?” and the scenario in which the man simply volunteers the information? I think there is a difference and understanding this difference is the key to the puzzle. As for Tuesday’s child, does the day of the week have any bearing on the probability?

Monty Hall

This is perhaps the most famous of all probability paradoxes. It derives its name from the host of an old American TV game show called “Let’s Make a Deal”. Here’s how the problem was posed in a letter to the “Ask Marilyn” column in Parade magazine.

Suppose you’re on a game show, and you’re given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what’s behind the doors, opens another door, say No. 3, which has a goat. He then says to you, “Do you want to pick door No. 2?” Is it to your advantage to switch your choice?

Should you switch? Does it matter? When the problem appeared in Parade, it generated an enormous volume of mail, arguing both ways. So, if you think the answer is obvious, it may be worth thinking again!

The Envelope

This is perhaps the trickiest problem of the three.

You are given the choice of two sealed envelopes and told that they both contain money, and that one envelope contains exactly twice as much as the other. You pick an envelope and open it, discovering that it contains, say, $20. You are then given the option of keeping the $20 or switching envelopes.

It is suggested that there is a 50% chance that the other envelope contains $10 and a 50% chance that it contains $40 and that your expected pay-off is therefore 0.5 x $10 + 0.5 x $40 = $25 if you switch. Is this reasoning correct and should you therefore change envelopes?

If that reasoning is correct, doesn’t it also mean that you should switch if the first envelope contains $30 or $500? In which case, why even bother opening the envelope if you know you are always going to switch?

* Here I’m assuming that human babies are equally likely to be boys or girls, which is probably not quite true.

Vale Martin Gardner

I was saddened to hear today that Martin Gardner has passed away at the age of 95. Born in 1914, Gardner was a prolific and gifted writer. He is best known for his mathematical and scientific writing, but he also dabbled in magic and philosophy. His The Annoted Alice is perhaps the ultimate edition of Lewis Carrol’s Alice in Wonderland.

For many years he wrote a column on “Mathematical Recreations” in Scientific American, which I read avidly as a child. These columns gave me endless pleasure, solving puzzles, constructing tetraflexagons and hexaflexagons and pondering probability paradoxes.

I am sure it was reading Gardner that I first came across the peculiar “second child paradox”. While perhaps not strictly a paradox, it is at least a little counter-intuitive and goes something like this. Imagine you bump into an old friend you have not seen or heard from in years who tells you she has two children and one of them is a boy. What are the odds that she has two boys? Since the possibilities are Boy-Boy, Boy-Girl, Girl-Boy, the answer is 1/3. But if she had told you she has two children and the oldest is a boy, the odds that she has two boys are 1/2!

Of his science writings, my favourite is The Ambidextrous Universe (now in its third edition), which explores left and right “handedness”–the difference between an object and its mirror image–and its role in the physics of the universe. In exploring the notion of mirror symmetry, Gardner asks the strangely puzzling question why does a mirror reverse left and right but not up and down?

Gardner also gave me my first exposure to the debunking of pseudo-science. In 1952 he wrote “Fads & Fallacies in the Name of Science”, which takes on an eclectic mix of peculiar beliefs ranging from flat-earthers to UFO-logists, from bizarre beliefs about pyramids to ESP and from Forteans to medical quackery. But the chapter that has really stayed with me since reading Fads & Fallacies almost 30 years ago is the one on dianetics, the “science” behind Scientology.

In this chapter, Gardner describes the notion of an “engram”. According to adherents of dianetics, the unconscious mind has a habit of making recordings of painful experiences. These recordings, particularly those made as a child or even in utero, have a tendency to cause problems later in life. Of course, trained “auditors” can help identify and purge troublesome engrams. As Gardner notes, engrams seem to be susceptible to bad puns:

An auditor reported recently that a psychosomatic rash on the backside of a lady patient was caused by prenatal [engram] recordings of her mother’s frequent requests for aspirin. The literal reactive mind had been feeding this to her analytical mind in the form of “ass burn”.

As a skeptic, Gardner would look askance at anyone claiming to be able to predict the future, but it is a pity his own powers of prediction were not more accurate:

At the time of writing, the dianetics craze seems to have burned itself out as quickly as it caught fire, and Hubbard itself has become embroiled in a welter of personal troubles.

Sadly, Scientology is not only still around, it is probably stronger than it was back in the 1950s.

Science, mathematics and skepticism all continue to be very important to me, and I suspect that Martin had no small part to play in sowing their seeds in my mind many years ago. There are many others like me he has inspired and, along with his enormous catalogue of publications, that inspiration is a wonderful legacy.