Showing posts with label Maths. Show all posts
Showing posts with label Maths. Show all posts

Saturday, 22 December 2012

How Many Presents from my True Love?

On the first day of Christmas my true love gave to me a partridge in a pear tree.
On the second day of Christmas my true love gave to me two turtle doves and a partridge in a pear tree.
...
On the twelfth day of Christmas my true love gave to me twelve drummers drumming, eleven pipers piping, ten lords-a-leaping, nine ladies dancing, eight maids-a-milking, seven swans-a-swimming, six geese-a-laying, five golden rings, four calling birds, three french hens, two turtle doves and a partridge in a pear tree.
So how many presents did I receive all together?

This can be solved using the differences method, which is nicely explained by Ken Ward.

In the table below, n represents the day of Christmas (starting from 0, the day before I start receiving presents), p(n) represents the number of presents I receive on that day, P(n) represents the total number of presents received so far, δ1 is the first difference (the difference between successive terms of P(n) — which is p(n) of course), δ2 is the second difference (that between successive terms of δ1) and δ3 is the third difference.

n0123456...
p(n)0136101521...
P(n)01410203546...
δ1136101521...
δ223456...
δ31111...

As the δ3 values are all the same, the equation we're after is a cubic polynomial.  That is, it's of the form:

[1]P(n) = an3 + bn2 + cn + d

Now we can do some substitution.  We can see immediately that

P(0) = 0a + 0b + 0c + d = 0 ⇒ d = 0

And now, from the next three terms, we can create 3 simultaneous equations:

[2]P(1) = a + b + c = 1
[3]P(2) = 8a + 4b + 2c = 4
[4]P(3) = 27a + 9b + 3c = 10

We can eliminate c, first from [2] and [3] and then from [2] and [4] to produce:

[5]6a + 2b = 2
[6]24a + 6b = 7

From which we can deduce that (24 – 18a) = 1 ⇒ 6a = 1, or a = 16.

Substituting that back in [5], we find that 1 + 2b = 2 ⇒ 2b = 1, or b = 12.

Finally we can use [2] to determine that 16 + 12 + c = 1, or that c = 13.

Now we can substitute these values back in [1] and tidy up a bit:

P(n)= 16n3 + 12n2 + 13n
= 16n(n2 + 3n + 2)
= 16n(n + 1)(n + 2)

So, by the 12th day of Christmas I will have received 16.12(12 + 1)(12 + 2) or 2.13.14 = 364 presents. Not bad going.

Wednesday, 7 February 2007

Sea More

An earlier post concerned the Sea in Solomon's temple and the value of pi. That got me thinking about whether we can deduce anything about the shape of the Sea from the further description in 1 Kings 7. This says that the Sea was 5 cubits high and 10 cubits in diameter, and that it held 2000 baths. (Incidentally, 2 Chronicles 4:5 says that it held 3000 baths. This may have been a copyist's error at some point, although there are other possibilities. Perhaps I will post about that another time.)

The immediate problem is that we don't know for sure how cubits and baths map on to the measurements we use today. It seems that there were at least two, possibly more, types of cubit in use in ancient Israel, and different scholars have come up with their own values. A scan of various web sites and the commentaries I have suggests that the length of a cubit could have been anything between about 44.7cm/17.6in and 55.4cm/21.8in. Similarly, various possibilities for the size of a bath have been suggested, ranging from 20.1 litres/4.4 gallons to 48 litres/10.6 gallons.

Assume for the moment that 1 cubit = 48cm. That's about average.

Possible Sea ShapesLet's also assume that the Sea was a cylinder with an internal radius of 4.8 cubits (giving a circumference of about 30.2 cubits) and height 5 cubits. (When these values are rounded to the nearest integer, we obtain the measurements quoted in the text.) The volume of this cylinder is given by the formula πr²h, where r=4.8 and h=5. This comes to about 362 cubits³, which (conveniently!) is about 40.0m³. This would suggest that a bath is about 20 litres, which is at the lower end of the range of possibilities suggested.

Starting from this cylinder, we can generate a couple of other possible shapes with similar volumes. In both cases we have to assume that the writer, rather than rounding to the nearest integer, rounded off at least the circumference to 1 significant digit (i.e. to 30, rather than to 29 or 31, cubits). If we allow the internal radius at the top of the Sea to be 5 cubits, reducing to 4.8 cubits in the middle and 4.5 cubits at the bottom, then we end up with a beaker-shaped vessel with the same volume. The circumference ranges from 31.4 cubits at the top to 28.0 cubits at the bottom.

Finally, it may have been more pot-shaped, with a bulge towards the middle. In the example illustrated, the top and bottom have a radius of 4.83m; this reduces to 4.62 at the neck of the pot and then bulges out to 5.01m in the middle. The circumference of this pot is 29.0 cubits at the narrowest part and 31.5 cubits at the widest.

It seems possible that the Sea could have had any of these three shapes, given the scant knowledge we have of the measurements in use at the time.

In closing, let's consider Josephus's statement that the Sea was a hemisphere: Antiquities of the Jews, 8.3.5. This appears unlikely unless a bath was much smaller than research generally indicates. The volume of a sphere is given by the formula (4/3)πr³. So the volume of a hemisphere with a radius of 4.8 cubits is (2/3)π4.8³, which is about 232 cubic cubits, or about 25.6m³. This would make a bath about 12.8 litres - much smaller than the "minimum" value of 20.1 litres. Indeed Josephus himself said a bath was equal to 72 sextarii (Antiquities of the Jews, 8.2.9) or xestes; this would make it equal to 1 Attic metretes, which is usually taken to be equivalent to 39.4 litres.

Wednesday, 31 January 2007

All at Sea about Pi

The otherwise excellent Penguin Dictionary of Curious and Interesting Numbers states that, “In the Old Testament, 1 Kings 7:23 implies that π is equal to 3”. Since I first read that, I have come across several internet sites that say, either implicitly or explicitly, “The Bible says π = 3, therefore it cannot be trusted.”

1 Kings 7:23-26 describes the Sea in Solomon’s temple that was used by the priests for washing: “He made the Sea of cast metal, circular in shape, measuring ten cubits from rim to rim and five cubits high. It took a line of thirty cubits to measure around it. … It was a handbreadth in thickness, and its rim was like the rim of a cup, like a lily blossom.”

π is the ratio of the circumference to the diameter of a circle. Here the circumference is given as 30 cubits and the diameter as 10. So the ancient Jews must have thought that π = 30/10 = 3, mustn’t they? Well, no … as I shall try to explain.

First, what is described is a very large, thick basin with a kind of lip to it, “like the rim of a cup, like a lily blossom”. It’s about 4½ metres in diameter, and about 8 centimetres thick. It’s not clear whether the rim-to-rim measurement was internal, or if it included the lip, or somewhere between. Similarly, it’s not stated whether the measurement around it included the lip or not. In fact, the “line … around it” may have been measured round the widest part of the Sea—which may not have been around rim at all: it may have bulged below the rim.

Secondly, the measurements here—and elsewhere in the description of the temple—are approximate. In fact, in the 140 or so verses in the Bible that mention cubits, most only ever refer to whole numbers of them. The remaining dozen or so refer to half-cubit measurements, but that’s the smallest fraction ever used. These are not exact measurements taken from the architect’s drawings.

So even if the measurements are both taken as referring to the same part of the rim, all we can confidently say about π from this passage is that it lies somewhere between about 29½/10½ (≈ 2.81) and 30½/9½ (≈ 3.21).

Saturday, 6 January 2007

Teaser 2


This has been one of my favourites for a while…  If you built a monorail around the equator, 1 mile above the ground, how much longer than the earth's circumference would it be?

Answer

2π (that's just over 6¼) miles. (Of course, I've assumed the earth is a perfect sphere.)

Explanation

At first, it looks as though some crucial information is missing: for example, the radius or diameter of the earth. As it happens, though, the answer is the same however big the planet is.

Suppose the radius of the earth is r miles. Then its circumference is 2πr miles.

The radius of the monorail will be r+1 miles, so its circumference is 2π(r+1) miles. This can be expanded to 2πr + 2π miles.

So, the difference between the two circumferences is 2πr + 2π − 2πr, i.e. , miles.

Tuesday, 12 December 2006

Benford's Law

Start with a group of numbers - say, the lengths of all the rivers in the UK, the numbers mentioned on the front page of a newspaper, or the populations of villages and towns in England. Then take the first digit of each of these numbers. You would probably assume that each of the digits 1 to 9 would appear with equal frequency in the resulting list. (Although that wasn't true of the three people in my family that I asked about this!)

What actually happens is that the digit 1 occurs much more frequently than the others; in fact about 30% of these initial digits will be 1s. 2 appears less often; and so on, down to 9 which accounts for only about 5% of the numbers.

Even more strangely, perhaps, is that these results are "scale invariant": it doesn't matter what units are used in the initial sample. For example, you would see the same results whether your river lengths were in miles or kilometres, or cubits.

In fact, the expected proportion of numbers starting with the digit n is ln(1 + 1/n) / ln(10). There's a pretty good description of how this formula is derived in Plus magazine

I tried it out on a couple of sets of data. Here are the results for the total amounts of all the transactions in my church's accounts in 2005:


A pretty close fit. Even better when the amounts are converted from pounds to euros:


Another example. Here's the results from the numbers of people in each UK area who declared that there religion was Jedi in the 2001 census:


This effect was apparently first noticed in 1881, but the law is named after Frank Benford who stated it in 1938.

Note that you have to pick your data set correctly. The law doesn't apply for truly random numbers, in which each digit has the same probability of occurring first. Nor does it apply when the data set is highly constrained. For example, if the height of hills is defined to be between 300 and 999 feet then certain initial digits are excluded by definition.