Search This Blog

Monday, 28 March 2022

Was Ramanujan wrong, or wrongly reported?

 Most recreational mathematicians know the story of Godfrey Hardy’s taxi. In brief, Hardy called on his sick colleague, Srinivasa Ramanujan. In the course of making conversation, Hardy mentioned the number of his taxi-cab, his favourite form of transport. It had, said Hardy, a rather dull number, 1729. “No, Hardy! No, Hardy!” replied Ramanujan, “It is a very interesting number - it is the smallest number expressible as the sum of two cubes in two different ways.”

Ramanujan was referring here to the fact that 1729 is the sum of one cubed and twelve cubed, and also the sum of nine cubed and ten cubed. The two mathematicians then went on to discuss the fourth powers equivalent, but that has no part here. There is a solution, by the way, with 133 and 134 being the numbers on one side: the rest I leave to you, once you have my methodology, set out below. So Hardy is mainly remembered by mathematicians as the person who played straight man to Ramanujan.

There was more, as we shall see, but first, a small diversion: 1729 is one of a special group of numbers called Carmichael numbers, which are important in number theory. It is highly likely that Hardy was trying to find out if Ramanujan had discovered these numbers in his intuitive way, and got an answer from left field instead. As I am about to reveal, though, this was wrong, and given Ramanujan’s brilliance, it is far more likely that he was misquoted

It has been known for thirty years or so that there is an infinite number of Carmichael numbers, but is there an infinite number of them with factors in arithmetic progression? That description fits 1729 (7 x 13 x 19), but that may be just happenstance. On the other hand, I read recently that 91 is expressible as the sum of two cubes in two different ways: 91 = 33 + 43 = (-5)3 + 63

At 0600 this morning, it was dark, I had fetched the newspaper, and was trying to remember the target number, and the cubes that composed it. Then I recalled that it was 91, which my mind had filed as interesting, because it is 1/19 of 1729, being 7x13.

That did it. I got up, fired up Excel, and set to work. But before I continue, what are Carmichael numbers? Mathematicians will understand when I note that there is insufficient space in the margin of the page to offer it in full…

OK, I won’t be mean to those interested but less familiar with the trivia. Pierre de Fermat (1601–1665) is  remembered today mainly for his “Last Theorem”, which took more than 300 years to prove. In the margin of his copy of Diophantus’ Arithmetica, Fermat wrote:

“To divide a cube into two other cubes, a fourth power or in general any power whatever into two powers of the same denomination above the second is impossible, and I have assuredly found an admirable proof of this, but the margin is too narrow to contain it.”

Now on with the spreadsheet and how I saved myself a lot of what we Australians call hard yakka. One way to solve knotty problems is to try all the possibilities and these are Diophantine solutions, named after the author of the book that Fermat scribbled his note in.

I once wrote in one of my books that Diophantus would have killed to get his hands on a computer and a spreadsheet program, and I meant it. I am still trying to find a way of using a spreadsheet to test Collatz' conjecture.

In cell A2, I entered the value -20, then I selected that column down to row 89, and used FILL – SERIES to integers down to 67. Next, in cell B2, I inserted this formula: =A2*A2*A2. This, of course, returns the value (-8000), being the cube of -20.

Next, I used COPY – DOWN, or CTRL-D, to fill column B with cubes. Then I was ready to laboriously typed in the first row: C2 (=B2+B3); D2 (=B2+B4); E2 (=B2+B5) and so on, all the way to column AQ. Then I could highlight rows 2 to 89 and columns C to AQ and fill those cells with COPY – DOWN, or CTRL-D.



As you can see, I now had more sums-of-two-cubes values than I could poke a stick at, and a few of my “hits” are marked with colour. I highlighted all of the values, copied them and did an unformatted paste into a Word file. This gave me tab delimited rows, so I had to get rid of the tabs. In Word, CTRL-h gives FIND AND REPLACE, and if you are smart-lazy like me, you either know, or need to know two codes to use. A tab marker is ^t, and a carriage return (end of paragraph) is ^p.

So in no time at all, I had 1845 values that could be sorted into numerical order and searched. After getting through less than a page, I muttered something that a passing kookaburra misheard as beggar this for a game of soldiers. The actual words are now lost to the mists of time, so we shall move on.

I highlighted the whole column (CTRL-A) and copied it (CTRL-C). Then back to the spreadsheet, open a new worksheet, click on A1 and paste (CTRL-V). Now I have all of my values in order, but no great desire to eyeball them, as I had had no breakfast, and no mug of tea, either. Time for smart-lazy again. In cell B2, I added this formula: =IF(A1=A2, "hit","").

 

As you can see, there was no need to scrutinise all the values, but look on the right, where there are some trebles. Now ignoring zero, which can be obtained in an infinite number of ways: x3 + (-x)3, where x is any integer, the first treble is well below Ramanujan’s 1729. You can get both 728 and -728 in three ways.

Here they are: 728 = (-10)3 + 123 = 63 + 83 = (-1)3 + 93

Numerology is a trap, a snare and a delusion, but the difference between 1729 and 728 is 1001 (7x11x13), while 91 is 7x13 and 1729 is, as noted above, 7, 13 and 19. You can see why people get drawn in, even if I don’t mention that only in base-13 notation is it true that 6x9=42!

He proves by algebra that Hamlet's grandson is Shakespeare's grandfather and that he himself is the ghost of his own father.
—James Joyce, Ulysses, 21.

I think I’ll stop there.





Thursday, 24 March 2022

Collatz’ conjecture

 Number crunchers know that the word conjecture is always a warning that by the pricking of my sums, something evil this way comes. Conjectures are unsolved problems, and in fact, Paul Erdös, a noted Hungarian mathematician, was reported to have said of Collatz’ conjecture, “Mathematics may not be ready for such problems.” Others called it “dangerous” and “a quagmire”.

When it comes to mathematical challenges, the Four-colour map problem, Fermat’s last theorem and squaring the circle, are far too difficult to even consider on a bus, but the Collatz conjecture is nice and simple to play with. It was put forward by Lothar Collatz, who waited two years after receiving his doctorate, before offering this puzzle. Pro tip: always get your higher degree nailed to the wall before you make waves!

Choose any positive integer n to begin a series. For each following term, if the previous term is even, the next term is one half of the previous term. On the other hand, if the term is odd, multiply it by 3 and add 1. Collatz’ conjecture is that no matter what the value of n, the sequence will always reach 1. Here are five sample strings:

1, 4, 2, 1;

2, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1;

3, 10, 5, 16, 8, 4, 2, 1;

4, 2, 1;

5, 16, 8, 4, 2, 1.

The sequences generated are sometimes called the hailstone sequence or hailstone numbers, because the values usually go through multiple ascents and descents, like hailstones in a cloud.

If you are working through the numbers on your bus ride, can you see what the next number is that you need to test? From what you can see above, you can rule out 7, 8, 10, 11, 13, 16, 17 and lots more…

The Hungarian-born mathematician Paul Erdös (1913–1996), is considered to hold the world record for the number of papers he wrote in collaboration with other mathematicians. Erdös numbers are whimsical numbers given to mathematicians. Erdös himself has the Erdös number 0, and any person who has collaborated with Erdös on a paper has an Erdös number of 1, while a mathematician who has collaborated with a direct collaborator is given an Erdös number of 2, and so on.

Tuesday, 15 March 2022

Once in a thousand years

This is from my book for bright young people, Playwiths.

Consider the number of years between events described as “once in a thousand years”, such as floods. To the layperson, this immediately raises the question: how can the authorities access data, covering several thousand years? The answer is that they can’t, but they have what is usually referred to as the Poisson distribution to fall back on, and to understand that, we need to consider an old tale of Prussian cavalrymen who were kicked in the head by their horses.

Just in case you know any French, the Poisson distribution has nothing to do with handing out fishes. It was developed by (and named after) Siméon-Denis Poisson. It describes the probability of clusters in random events, given nothing more than the average occurrence of such events. (If you have no French, their word for fish is poisson, leading to dreadful puns about one man's meat being another man's poisson, but that is irrelevant.

This on the right is not irrelevant, but it is, instead, an elephant, which is a horse of a different colour, as we say in the writing trade. Now let's get back to the horses...

Poisson died in 1840, before the Prussians were kicked. Ladislaus Bortkiewicz published a book in 1898 in which he tried out the distribution of head kicks in each of the 14 corps of Prussian cavalry over a 20-year period, to see if it matched Poisson’s predictions.

Basically, the Poisson distribution works like this: given a sample average (or better, a population average), you can predict the probability of clusters of, say, breast cancer cases in a workplace, the number of calls to a call centre in a given minute, power failures on a grid, some types of traffic accident, the number of typographical errors on a page and the failure of light bulbs. And given some flood data for a few inundations, the Poisson distribution can predict about how often there would be a flood of a certain level.

Let us consider the Prussian data: there were several cases where a significant number of kicks had happened, and many more where no kicks had happened, so Bortkiewicz got hold of the data for 200 corps-years. In 109 cases, there were no injuries, but there were 65 instances of one injury, 22 cases of two, three cases of three head-kicks and one unfortunate corps, in one year, had four instances, a total of 122 cases. That meant the probability of a case in any given corps in any given year was about 6/10, or if you want precision, 0.61.

Bortkiewicz triumphantly showed that the known distribution was an almost perfect fit to the theoretical prediction. After that, people everywhere took up Poisson’s idea enthusiastically.

This story was popular, because most of the world liked the idea of Prussian cavalry being kicked in the head, but the main point was to say that there would be variation, and a high “score” did not necessarily imply carelessness or anything else. Ask anybody who has done some basic statistics, and they will all know about the Prussian head-kicks. It’s the example that is always mentioned.

What is less-mentioned is that you can calculate the flood height that, based on prior data, would happen once in a thousand years. This figure would be approximate, and the estimates would be refined after each flood, and they would be slightly invalidated if the risk is increasing rather than steady, but it’s better than nothing if you need a predictor.

I actually began looking into this issue, revisiting it after several decades, because somebody was questioning the science behind climate change and global warming, and as a throw-away line, poked fun at councils in Australia which have maps showing the limits of one-in-a-thousand-year floods. How, the idiot asked, could anybody know what has happened in the past?

Those who know my historical interests will not be surprised to learn that I point to 1859 as the year when scientists in unrelated disciplines began to be unable to understand one another. The public had started to feel lost around science a few years earlier, but after the 1860s, a great deal of science was either counter-intuitive or it relied on obscure methods. One way and another, science all got progressively more complicated.

Counter-intuitive science is in some ways the worst source of dissent and confusion, but if we know that mathematicians have a clever wrinkle that lets them estimate what a one-in-a-thousand-year flood would be like, we can accept that. The science that flies in the face of uninformed ‘common sense’, and the science that causes fears to arise, these are the sorts of science that cause trouble.

Even if the ancient Greeks knew that the world was a sphere, peasant minds were happy to say that the world they saw was clearly flat. In the same way, other equally simple and fearful peasant-quality minds attack the idea of evolution, misrepresenting what evolution is, even as they deny it. 

Climate is another case: the modern peasants who watch the weather on TV thinks they understand climate, but that, in fact, is a very different kettle of poissons.

Thursday, 3 March 2022

A question of class

This is another selection from Mr Darwin's Incredible Shrinking World, my social history of science in the year 1859. Find out more here. We are looking at Britain as it was in 1859.

* * * * *

In London, May, June and July were once the months when Parliament met, and this determined ‘the season’ which ended on 12 August, the first day of grouse shooting. The well off, even those not involved in politics, came to London in the season for races at Ascot, operas, balls, parties, viewings of the Royal Academy and other social events.

Every member of society had obligations, but the obligations of some were less onerous than the demands society made of others. In an age before labour-saving devices though, the rich had a duty to hire labour.

In 1859, Isabella Mary Beeton, known today as “Mrs Beeton”, even listed how many servants a household should have, based on income. She had, that year, begun a series of 48-page monthly supplements to The Englishwoman's Domestic Magazine, her husband’s journal, and in 1861, these were released as a single volume, Mrs Beeton's Book of Household Management. We will visit this in chapter 7.

Army officers, having purchased their commissions, were obliged to lead, and sailors and soldiers were obliged to submit to flogging. Still, the writing was on the wall for the lash as a naval punishment after an incident at Plymouth in July, on board HMS Caesar (then in dock) when a sailor was flogged in front of civilian workers. The outraged watchers protested and argued with some of the officers. Flogging was not abolished in the British army and navy until 1881, but it effectively ended in 1859, thanks largely to a crusading doctor.

When Mary Ann Evans published Adam Bede in 1859, she wrote as George Eliot, and was unprepared for the attention it would bring her. Well known and admired in her own circle of intellectuals, she now found herself publicly identified with George Eliot, the clever ‘male’ novelist. By the time Middlemarch came out in 1871–72, she was well respected, and admired, in both names, for her social conscience.

In chapter 16 of Middlemarch, her fictional characters debate Wakley’s view that coroners need medical training, so as not to be bamboozled or misled by inadequate medical men. Unlike the characters in Eliot’s  book, Thomas Wakley was a real person. As a young doctor he cared about the reform of the medical profession, and political reformer William Cobbett suggested that he establish a medical journal, which he did in 1832, calling it The Lancet.

In 1835, Wakley was elected to Parliament, and his maiden speech attacked the conviction of the Tolpuddle Martyrs, a group of unionists transported to New South Wales in 1834 on trumped-up charges for daring to organise to defend themselves. He was an all-round decent human being of liberal outlook who opposed slavery, the Corn Laws, the 1834 Poor Law and the Newspaper Stamp Act.

Wakley deserves most of the credit for the creation of the Royal College of Surgeons in 1843 and also the General Council of Medical Education and Registration in 1858, but his public fame rests mainly on his work as a coroner. He not only held the beliefs mentioned in Middlemarch, he put them into action.

No observer of coronial inquests today can hear a coroner’s blunt demolition of an evasive witness without recalling what happened when Wakley confronted a workhouse master. The man complained that an exhumed pauper’s body, while it had undoubtedly been scalded to death, had not been properly identified as Thomas Austin, the subject of the inquest. Said the worthy coroner: ‘If this is not the body of the man who was killed in your vat, pray, Sir, how many paupers have you boiled?’

To get his reform campaign moving, Wakley needed to be elected as a coroner. He narrowly lost his first attempt in East Middlesex in 1830, but won in West Middlesex in 1839. From time to time, Wakley reported details of notable coronial hearings in The Lancet, and that brings us to his inquest into the death of Fred White, a young soldier of the Queen’s Own Hussars who died in 1846.

The true cause of death, a flogging of 150 lashes, was covered up, but with a jury’s support, Wakley ordered the body exhumed so the original post mortem could be assessed. The evidence of military cruelty was there for all to see, and an end to flogging in the army came a step closer. The practice finally ceased after a man called Davies was flogged almost to death at Woolwich in September 1859; Wakley’s pursuit of the White case had laid the foundations.

Wakley and Dickens met in 1841, and Dickens once served on a jury under him. The two undoubtedly influenced each other, but Wakley’s essential humanity is seen best in an instance where he may have cut the odd coronial corner.

Thomas Glover was a Civil Surgeon at Scutari during the Crimean War, and either during that time or on his return, became addicted to chloroform and opium, both then readily available to doctors. In April, 1859, he died as a result of an excessive dose of chloroform, and his colleague Thomas Wakley, acting as coroner, brought in a verdict of accidental death. It did no harm. But there was harm enough around.