Saturday, 23 March 2024

The James Grimes card trick

 I recently came across a Numberphile video posted by James Grimes which I found quite diverting. James described a numerical conjuring trick for which it was not entirely obvious why it worked. His trick (minus all the conjuring patter) goes as follows:

  • The performer presents 10 playing cards with face values 1, 2, ..., 10 to the spectator and invites them to divide the cards into two arbitrary subsets A and B of 5 cards each.
  • He then gets them to arrange A into an increasing sequence; and then to arrange B into a decreasing sequence. The second sequence is placed below the first.
  • Then he gets them to write down the 5 differences of corresponding terms in the two sequences (here "difference" means absolute value of the difference).
  • Finally he gets them to add these 5 numbers together.

Surprise, surprise: the answer is always 25.

James eventually gave the reason for this surprise. Writing the increasing and decreasing sequences as a1 a2 a3 a4 a5, and b1 b2 b3 b4 b5 it turns out that, for every pair ai bi, (whose difference is to be calculated) one of ai and bi is in the range 1 to 5, and the other is in the range 6 to 10.

To see this write L (low) for any of the values from 1 to 5 and H (high) for any of the values from 6 to 10. Suppose the first sequence has r low numbers and s=5-r high numbers so that it looks like LrHs. Then the second sequence has 5-r=s low numbers and 5-s=r high numbers so that it looks like HrLs. So each pair of positions must have an L and an H.

From this it follows that each difference has the form H-L and so their sum is the sum of the H's minus the sum of the L's. This comes to 25.

I have laboured this little argument for two reasons. The first is that I found it hard to find it myself and was embarrassed by its simplicity. The second is that, from it, one can see a much more general result.

Plainly the same type of argument will apply if one starts with the first 2n integers rather than 10. In this case it turns out that the sum of differences is n2 which is rather neat. Also it applies if one starts with any collection of 2n numbers (and I said "collection" rather than "set" because repeats would be allowed). In that case the sum of differences is always the sum of the H's minus the sum of the L's whatever that turns out to be.

Both these observations were made by James himself. But even more is true. All that matters is that the two sequences are of the form LrHs and HrLs. This is a much weaker condition than that the first sequence is increasing and the second is decreasing. Even a weaker a condition can be required: so long as matching pairs comprise both an L and an H this will be enough.

In his video James asked for variations on his original trick. Here is one that exploits the more general case.

The performer presents a set of cards face down to one spectator and a second set to another spectator. Each spectator draws a card from his set and the two cards are given to the performer who places them also face down to form the first cards of a pair of rows. This is repeated until all the cards have been drawn and placed in the rows thereby producing two rows of cards. The cards are then turned over and the corresponding differences are calculated and summed. The performer predicts the sum.

Before performing the trick the performer has arranged that one set of cards contains low (L) cards and the other high (H) cards. The spectators will not notice this because the performer places each pair of cards randomly in either the first row or the second row; therefore when the cards are turned over all evidence of lowness and highness will have disappeared.

Monday, 19 February 2024

The Impossible Chessboard Puzzle

I recently came across a beautiful puzzle on the YouTube channel of 3Blue1Brown. The puzzle was entertaingly discussed on Stand-up Maths but I confess that I needed to watch both these videos several times before I truly understood the solution. This post is to help reinforce my own understanding and to help those readers who did understand the puzzle but perhaps struggled with the solution. 

For completeness here is a description of the puzzle.

The warden of a prison generously offers freedom to two prisoners, Joe and Donald, if they are able to find a solution to a certain puzzle. The puzzle consists of a room containing a chessboard, every square of which contains a coin, each coin being either heads or tails in some arbitrary pattern. Underneath one of the coins is hidden the key to their gaol. Joe will enter the room and will be shown which chessboard square hides the key. Joe must then flip one coin only and retire from the room. Donald will then enter the room and has to deduce the location of the key, thereby winning freedom for him and Joe. 

That is the general format of the puzzle and the two inmates have to devise a strategy whereby Joe can reveal the location to Donald.

The problem, of course, is to work out how Joe can somehow manage to tell Donald the location of the key. They know nothing in advance of the disposition of heads and tails, and no further communication between them is allowed.


The language of binary digits, 0 and 1, is going to be convenient as we consider how to proceed. In this language every possible board configuration is equivalent to a vector of length 64 with entries 0 (Heads) and 1(Tails): a bit string of length 64. We could consider this bit string to be laid out 8 bits at a time according to the 8 rows of the chessboard. We can also consider it to be laid out as a long row of 64 bits. The two layouts are equivalent of course but either of them allows us to number the positions of the bit string with the numbers 0, 1, 2, ..., 63.

Notice that when Joe flips one of the coins the bit representing the coin's value changes from 0 to 1, or 1 to 0, and all other bits stay the same. In other words Joe has altered exactly one position of the length 64 bit string and, in the language of coding theory, the new bit string is distance 1 away from the original bit string in the Hamming metric (which measures the distance between two bit strings by the number of positions where they differ). If two bit strings differ in exactly one position we shall call them "neighbours".

So Joe encounters a bit string and a key position. He changes the bit string into one of the 64 possible other strings (neighbours) at Hamming distance 1. Donald now sees this new bit string and has to infer the key position.

Let's introduce a way of referring to a bit string and a position within it (the key location). We'll imagine 64 different colours that will be used for colouring the bit strings: if a bit string has a certain colour that colour picks out a position in the bit string.

So Joe, because he knows the key position,  knows the colour of the bit string.

Now let's imagine something utterly extraordinary. We are going to imagine that Joe and Donald have together made a list of all possible bit strings and have given a colour (one of the 64 agreed colours) to each of them. So "all" that Joe has to do is to change the original bit string into a bit string at Hamming distance 1 which has the colour that reveals the key position. Donald then consults the list of all the bit strings and their colours that he and Joe agreed on, finds the colour of the bit string Joe has made for him, and triumphantly exposes the key.

Two considerations immediately come to the fore. The first is that making this list of the bit strings, with a colour for each, is practically infeasible since there are  264 of them. We'll worry about that later.

The second consideration is that Joe and Donald must have constructed a colouring with a very special property: the colours of the 64 neighbours of each bit string must account for all 64 colours. If there were a bit string b which, for example, had no neighbour coloured red, and Joe was presented with a board which defined the bit string b in which the key was hidden in the red position, he would be unable to change it into a bit string that was coloured red.

The fact that all the 64 neighbours (of every bit string) use up all 64 colours is equivalent to saying that the 64 neighbours all have different colours. This is a very strong property of Joe and Donald's colouring and, at the moment, we cannot be sure that such a colouring even exists! 

We'll take a little diversion and explore this very point in the more general situation that our bit strings are of some length k, and we are hoping to colour them with k colours so that, for each bit string, its k neighbours are coloured differently (so all k colours occur, each once only). Let's fix on one of the colours Red, say, and let's count all ordered pairs (a, b) where a and b are neighbouring bit strings of length k where bit string a is coloured red. Let's give a name, r, to the number of bit strings coloured Red.

Now, there are r ways in which we might choose the first component a; and for each such choice there are k choices for the neighbouring second component b: rk pairs in all. But we can count these pairs another way. We could choose b first (in 2k different ways); but, for a given b there is exactly one red neighbour a: 2k pairs in all.

That means that rk = 2k and that means that k must be a power of two. It also means that every colour occurs 2k/k times.

We can return from this diversion somewhat emboldened. We have discovered that colourings of the type we are after can only exist if k is a power of two. In our case k=64 which is a power 2. However, we still are not guaranteed that a suitable colouring exists and now we must address this question (and also solve the consideration of infeasibility that we deferred our anxiety about previously).

What we need is a rule for colouring bit strings that is simple enough that both Joe and Donald can apply it, possibly with a small amount of calculation. Such a rule will obviate the need for a memorised table that gives a colour to each of the 264 bit strings. And, of course, this rule must, when applied to the 64 neighbours of each bit string, deliver the full set of all 64 colours.

Joe uses this rule to select that neighbour of the bit string representing the original board which has the colour that identifies the board position hiding the key. Donald uses the rule to compute the colour from the bit string that Joe leaves for him.

So now, all we need is the rule! To introduce the rule I shall take a greatly simplified version of the puzzle: the case k=4, there are 16 bit strings are of length 4, and so 4 colours are used. Now, right at the start, when I introduced bit strings for board positions I de-emphasised that they arose from an 8 by 8 board. It is convenient to return to the square layout, rather than vector layout. When k=4 we have a 2 by 2 board. Here are the 16 possible boards:
I am going to colour these boards with red, blue, green, brown (and looking ahead these colours will be encoded as 00, 01, 10, and 11). Here is the colouring

Each 2 by 2 board is given a colour according to the codes of the colours, and according to the parities of the initial row and initial column of the board. For example the board in the top right corner of the layout above has initial row 1 1 (parity 0) and initial column 1 0 (parity 1); so its colour code is 01 which is blue.

This colouring rule does ensure that, for each 2 by 2 board, the four boards at distance 1 from it have different colours. In other words, for every 2 by 2 board, we can, by altering exactly  one position, alter the parities of its initial row and column, to any of the four parity pairs:- changing the parity of the bottom right bit does not alter the pair of parities, changing the parity of the top right bit changes only the parity of the initial row, changing the parity of the bottom left bit changes only the parity of the initial column, and changing the parity of the top left bit changes both the parities of the initial row and initial column.

This solves the k=4 problem. But it also points the way to how we might generalise. Firstly, the binary string approach looked effective (both for representing boards and for representing colours). Furthermore, parity was playing an important role. When we computed the parity of a binary string we summed its individual bits according to the rules 0+0=0, 0+1=1, 1+0=1, and 1+1=0. This unusual interpretation of addition is either considered to be "addition modulo 2" (if you are a mathematician) or "exclusive or" (if you are a computer scientist). At any rate this is what "+" will mean from now.

The new addition applies also to bit strings: we simply add up the corresponding components of the strings: thus 0110+1010 = 1100. It's easy to see that, when we add two bit strings, their parities add up in the same way: in other words, the parity of the sum is equal to the sum of the parities.

But now let's go back to our colour encoding rule when k=4. Because the colour of a 4-bit string is defined by the parities of two 2-bit strings we can deduce that, for every pair of 4-bit strings a and b, colour (a+b) = colour (a) + colour(b). In mathematical language: the function that maps 4-bit strings to their 2-bit colouring is linear.

This gives us the clue to how we can define a colouring of k-bit strings (boards) for every possible k  (recall from our discussion above that k itself has to be a power of 2, k=2t say, and colours will be t-bit strings).

Our colouring is going to be linear. That means that we only need to define the colour of the k special binary strings which have a single binary digit 1, and all other digits zero (we'll call these special strings the basic strings - mathematicians will know why). Then, we can extend the colouring to every k-bit string using the linearity. For example, when k=4, colour(1101) = colour(1000) + colour (0100) + colour (0001).

The k-neighbours of the binary string of all 0s are just the k basic strings, and we must therefore colour these with the k different colours. (Remember we are looking for colourings where the k neighbours of any k-bit strings are given different colours.) It follows from this that the k-neighbours of every k-bit string a will have different colours. This is because the neighbours of a are obtained by adding each basic string b to a and colour(a+b) = colour(a) + colour(b).

We shall number the components of each vector as 0, 1, ..., k-1 (rather than 1, 2, ..., k for a convenience that will emerge immediately). The  k different special strings will be called e0, e1, ..., ek-1 and we shall denote the colour of special string ei by the t-bit value of i (this is the reason for numbering components from 0 rather than from 1).

Now let's start putting all this notation together to solve the puzzle and we shall demonstrate the solution procedure using an example with k=16 (so t=4). The example "board" we shall use is

b = (0 0 1 1, 1 0 1 0, 1 1 0 1, 0 0 0 1)

(for typographical reasons this is written as a 16-vector, in groups of 4 for readability, but equally we could have represented it as a 4 by 4 array).

We'll assume the first prisoner, Joe, is shown that the key is hidden under position 13. Then we have
b = e2 + e3 + e4 + e6 + e8 + e9 + e11 + e15.
Therefore
colour(b) = colour(e2) + colour(e3) + colour(e4) + colour(e6) + colour(e8)
                    + colour( e9) + colour(e11) + colour(e15)
                = 0010 + 0011 + 0100 +0110 + 1000 + 1001 + 1011 + 1111
                = 0110

In the language we have developed, Joe's task is to find one of the special vectors cu and change b into d = b + cu so that colour (d) = 1101 (the binary value of 13, the key position). Then Donald simply has to compute colour(d) to locate the key.

So Joe requires that 
1101 =  colour(d) = colour(b + cu) = colour(b) + colour(cu) = 0110 + colour(cu).
Therefore colour(cu) = 1101 - 0110 = 1011.
But this means that u=11, the value of the binary string 1011, and that is the board position that Joe changes.

We can verify this really is the right position by computing (as Donald will do) the colour of the new board d = (0 0 1 1, 1 0 1 0, 1 1 0 0, 0 0 0 1). This is simply
colour(e2) + colour(e3) + colour(e4) + colour(e6) + colour(e8)
                    + colour( e9) + colour(e15) 
which is 0010 + 0011 + 0100 +0110 + 1000 + 1001 + 1111 = 1101, and this is the binary value of 13 as expected.

I hope it is clear that this example generalises. Therefore the general solution is as follows:
  1.  Joe computes the colour of the given board b as a t-bit binary number x
  2.  Joe converts the position of the key as a t-bit binary number y
  3.  Joe calculates z = x + y and flips the bit at position z of the board, giving a new board d
  4.  Donald computes the colour of the board d. This is a t-bit binary number w that identifies the position of the key.
In principle the problem is now complete, not only for the original 8 by 8 chessboard but for all boards with 2k squares (rectangular boards included). However it is worth returning to the original 8 by 8 case to present the solution in a possibly simpler way to actually carry out. The solution involves some binary conversions and these cannot be finessed. The more complicated parts of the solutions are the two colour computations in steps 1 and 4.

We'll revert to the usual chessboard 8 by 8 layout with squares numbered 0 to 63 as shown:

which, with the positions represented by their 6-bit binary strings, is



and consider the computation of colour(b) for some board b = (b0, b1, ..., b63). We are calculating a 6-bit binary string:
colour(b) = colour(b0e0 + b1e1 + ... +b63e63)
                = b0colour(e0) + b1colour(e1) + ... +b63colour(e63)
and on the right-hand side of this equation we have summands bicolour(ei). However colour(ei) is the 6 bit binary string whose value is i and we add these terms component by component.

Let's focus on the first component of these 6-bit strings. The only way in which one of the summands bicolour(ei) can contribute to the first component of the result is if bi=1 and colour(ei) has first component 1. But the latter condition says that colour(ei) is a binary number between 32 and 63, that is, i is in the second half of the board. Thus to get the first component of the sum we are adding up (so getting its parity) all the bits in the lower half of the board. To summarise: we get the first bit of the sum by concentrating on the lower half of the board and computing its parity.

How about the second component of the sum? Here what matters is the set of all 6 bit binary numbers which have 1 as second component. These are the numbers 16 to 31 and 48 to 63: a region of the board represented by rows 2, 3, 6, 7  (numbering rows from 0) which look like two thick horizontal stripes. The parity of this region gives the second bit of the sum.

For the third component the relevant region is rows 1, 3, 5, 7 (again numbering from 0).

For the fourth component the region is the entire right half of the board, for the fifth it is columns 2, 3, 6, 7 (numbering columns from 0, and for the last component it is columns 1, 3, 5, 7.

To confirm that these are indeed the regions stated, refer to the array of binary strings above (or argue from first principles).

For convenience the 6 partitions of the board into regions are shown in the diagram below (where I have shaded the region whose parity must be computed).
So, if Joe and Donald want to demonstrate the original escape method, each of them must memorise the 6 diagrams above. When Joe sees the board he computes the 6 bits of its colour by considering each of the diagrams one by one. For each one he computes the parity of the shaded region obtaining a 6 bit colour. He adds the colour to the key position and determines which bit to flip. Donald does the same with the new board and its colour gives him the key position.








 

Thursday, 18 January 2024

My friend Nelson Stephens

My friend Nelson Stephens died peacefully, with family members at his side, on 8 January 2024. He had a wonderful sense of humour and he would have enjoyed the ambiguity in the previous sentence. That humorous side of him was evident on many occasions: as limerick writer on the blackboard in the Mathematics common room in Cardiff, in his gentle takedowns of self-important colleagues, in his ability to find absurdity in the most prosaic of situations, and in his delighted grin when he managed to lull you into an error. All benign, none malign.

I met Nelson in 1972 when he joined the department of Computing Mathematics at University College, Cardiff. I warmed to him immediately and for 10 years we were close friends, played badminton and Othello together, enjoyed our families meeting for dinner, and we went on many outings together. I particularly remember the occasion when Fred Lunnon led a walk to the Waterfall Country around Ystradfellte in the Neath Valley. We had to make a number of tricky river-crossings that Nelson struggled cheerfully with (he had a life-long foot problem that must have affected his balance).

The department specialised in using computers to solve problems in Pure Mathematics. This was Nelson's forte and he had already done significant work both in his PhD studies and at the Atlas Computing Laboratory in Number Theory where he was an expert in elliptic curves. This esoteric subject eventually became very important in cryptography and Nelson remained an active researcher in the field throughout his academic career. Luckily for me his expertise and interests were much wider than that and I knew I was fortunate to have a colleague that I could discuss mathematics with.

In 1975 I attended a series of lectures he gave to our Masters students, largely working through some of the chapters of Hopcroft and Ullman's new book which became very influential in the young field of data structures and algorithms. I learnt a great deal from these lectures and particularly enjoyed the lectures on the Finite Fourier Transform and Matrix Multiplication. Nelson and I began to think about the general context for these two topics: the computation of several bilinear forms. This this led to our publishing two papers that are still being cited. I remember how this research was kick-started. Nelson met me in the department one morning excited by an idea he'd had in bed: it involved solving a generalised eigenvalue equation and we both knew it was a breakthrough.

I left Cardiff in 1982 but we remained very close friends with me visiting him several times over the years. Whenever we met we slipped back into an easy familiarity sharing our personal pleasures and problems. On one of my visits he took me to his bridge club in Cardiff. I was nothing like as good a player as him but that evening we had a very good game together topping the field and winning about £40.

We never published together again although there was one year when I managed to interest him in an algebraic problem. In a very short time he produced a computer program that generated a large amount of useful data that we pored over together making various conjectures. Nelson then applied for and received a small grant from the UK Engineering  and Physical Science Research Council to enable us to visit one another. Unfortunately this never came to fruition because I emigrated to New Zealand.

Nelson left Cardiff after about 20 years to become Professor of Computing at Goldsmiths College, London. He did not give up his home in Cardiff and undertook the challenging London-Cardiff commute. On the only occasion I visited him at Goldsmiths I had the impression that he was coping with the new challenges there but it was very hard work.

Throughout his life Nelson took a keen interest in politics. He was a staunch member of the Labour party and I can attribute my own passage from the political centre to the political left partly to him. I remember once joking with him that the Labour party was his natural home as he shared his birthday with Tony Blair.

One of the things I particularly admired in him was his personal modesty. We both deplored that new breed of academic who have unbounded egos. Nelson was not like that. He spoke frankly when it was warranted but never rudely. He listened attentively rather than switching off and using the time you were speaking to prepare his next statement about himself. As a result conversation with him was a delight.

Farewell, my good friend. You leave me with a treasure trove of wonderful memories.

Tuesday, 5 December 2023

An original SIN

This post is about my struggles with Canadian bureaucracy. At the end I shall draw some conclusions about a peculiar Canadian trait that, despite its benign intent, often leaves its victims feeling rather frustrated.

The background is that in December 2022 I moved from New Zealand to Ottawa, Canada in order to spend the last years of my life near to my children. I had worked in Ottawa for 10 years in the 1980s and my children are all Canadian citizens. In those days I had been a permanent resident of Canada (though not a citizen), a status I had had to renounce on leaving Canada in 1992.
 
Canada has a programme whereby citizens can apply to bring their parents and grandparents to live in Canada as permanent residents. It allocates places to applicants by a lottery system but at present that programme has been suspended. Instead there is a programme that allows parents and grandparents to hold a long term visitor visa (a Super Visa); it is ostensibly valid for 10 years and allows visits of up to 5 years at a time. My children and I decided that I should apply for a Super Visa and that I would make a new life in Canada with them. The application process is dauntingly long and costly but that is another story. The very abbreviated version is that I now have a Super Visa and live in Ottawa.

Once my Super Visa had been granted I had to set about integrating into my new environment and complying with its laws. As I was no longer a short-term resident I knew I would have to register with the Canada Revenue Agency (CRA) in order to pay my taxes. For this, the first thing I needed was a Social Insurance Number (SIN). I did not at first see this a problem as I still retained my SIN from the 1980s but I thought I should verify that my old SIN was still valid.

The first bit of bad news emerged only gradually. A visit to Service Canada (the agency that deals with SIN matters) and a long wait to be seen produced incomprehension as to why I would need a SIN at all as I did not intend to work. To my answer that I needed it to pay my Canadian taxes I received the response "OK, so where is your work permit?". I responded "But I don't intend to work". More incomprehension followed by the suggestion that maybe my existing SIN would suffice, but then the comment that my old SIN was for permanent residents only (it did not begin with a '9' you see, or maybe you don't). Then finally the advice to call the CRA to ask whether I could retain my old SIN.

That afternoon I phoned the CRA. That's not as easy as it sounds because one gets directed to a series of automatic telephone menus, each with a long (sometimes several minutes long) explanation of various further menu options. After about 40 minutes I got a human being who gave me the news that a return to Service Canada would be necessary and that I needed a new SIN. At least that seemed definite if disappointing news.

The next day I was back at Service Canada and another long wait. The outcome was not satisfactory. The agent I saw said he absolutely did not know what to do: the combination of issuing a SIN to someone who did not intend to work appeared to be an insoluble conundrum. However this agent helpfully supplied me a telephone number for a Service Canada helpline and I phoned it later that day.

After a 30 minute wait to speak to a human being I was buoyed by her initial apology about the wait. Further positive feelings were caused by her disparagement of the Service Canada office that had twice turned me away. She gave me a set of instructions  to follow for my next encounter with Service Canada and I returned home optimistically.

On no account was I to return to the original office so I looked up her recommended office. Gloom ensued as this office was about 50 kilometres away. I decided to try a different and closer Service Canada office.

On the morrow, armed with many pieces of official documentation I presented myself to this new office. Initially I caused the same consternation I was now familiar with but this time I stood my ground and explained that I knew there was a solution and all they had to do was find it.

The agent I was speaking to accepted the challenge. His first move was to phone his superior. This superior was similarly stumped and so he phoned his own superior. At last there was a breakthrough. Some relevant forms and procedures were located and I was able to make my application for a new SIN receiving the news that it would take no longer than 24 business days.

Last week I received by mail  (dated November 21) the notification of my new SIN. Unfortunately and perplexingly the notification stated that my SIN would expire on November 22.

I may be 77 years old and no longer as sharp as I once was but even I perceived that this was nonsensical so I phoned the number given on my notification for further inquiries. Again, many menus and minutes later, I spoke to a human being. She took my inquiry for a 15 minute excursion as she consulted her superior and returned with the advice that I should wait for 4 weeks: then, if no clarifying mail arrived, to phone again in January.

I can hardly wait.

***Addendum***
As there was no clarifying letter I did phone again in January. There was no very long phone wait. I was told that I should not be concerned that my new SIN had been cancelled after one day, that this was the normal procedure, and I could continue to use my cancelled SIN for tax purposes. While this was reassuring my perplexity with the whole process remained.
***End of Addendum***

At the beginning of this post I promised some summary conclusions about Canadian bureaucracy and I shall begin with two comments. The first is that the saga I have recounted is only the latest in a series of similar frustrations  and the second is that I fully accept that the public services in Canada are under-resourced and doing their best within an imperfect system. That said I think the Canadian services I have dealt with (public and private) are different to those in New Zealand in that the personnel are not empowered to act with initiative. Instead they are captive to their processes which they follow with robotic precision. That sounds bad and often it is awful but there is a reason for it. The system is designed to make it difficult for persuasive individuals to make special pleas for preferential treatment - and, of course, that is laudable.

Canada is a larger country than New Zealand and has chosen a system that does not automatically assume that its citizenry act in good faith. That is sad and, as I have discovered, it often leads to apparently absurd outcomes.

Sunday, 20 August 2023

Sums of three squares

When I turned 62 my daughter Susanna informed me that 62 was the sum of three squares in two different ways: 12 + 52 + 62 and 22 + 32 + 72.

She had looked up this fact with a keyword search such as "Interesting facts about the number 62". I certainly did find that interesting but for 15 years I didn't take the matter any further. I did however know that there was a characterisation of numbers which were representable as the sum of three squares and this characterisation indicated that, while 62 was the smallest example of a number having two representations, it would not be the only such number. In writing this note I researched this question more thoroughly and discovered that very much more is known including asymptotic results on the number of such representations. This note has little information to add to the question but, at least, I hope it will be easy reading.

Recently I observed that 2, 3, 7 were (modulo 8) the negatives of 1, 5, and 6. This "explains" Susanna's fact as an example of the following observations. Given 3 squares a2, b2, and c2 the equation

a2 + b2 + c2 = (m-a)2 + (m-b)2 + (m-c)2

will be true (by elementary algebra) if

m = (2a + 2b + 2c)/3.

If a=1, b=5, c=6 (the first of Susanna's triples) we would have m=8 and then

m-a = 7, m-b = 3, m-c = 2: the second triple.

This gives immediately the existence of many pairs of triples whose sums of squares are equal. For example, with a = 3, b = 4, c = 8, we have m = 10, m-a = 7, m-b = 6, m-c = 2. Therefore 101 is the sum of 9, 16, and 64 as well as the sum of 49, 36 and 4. This trick of obtaining a second triple does not always work. There are some cases where the triple (m-a, m-b, m-c) is the same (to within a rearrangement} as (a, b, c). Such cases are easily seen to be when a, b, c are in arithmetic progresion.

A more serious barrier to the trick producing a second triple is that m might turn out not to be an integer. For example 32 + 62 + 72 = 94. Here m=32/3 and we find that

m-a = 23/3, m-b = 14/3, m-c = 11/3

whose squares do sum to 94 but they are not integers. In this case there is, nevertheless, a second solution, namely the triple (2, 3, 9) whose squares sum to 94. However I do not see a general pattern suggested by these two solutions.

Thursday, 2 February 2023

Goodness as an absolute quality

If you were to ask anyone (Donald Trump, Adolf Hitler, Pope Pius X, Myra Hindley, Mother Theresa - name anyone you like) whether they thought they were good people then, any false modesty aside, they would surely answer "Yes". Now ask a random person whether they agreed: no such uniformity of assent would be forthcoming. On some of the names on that list it is possible that no-one would say they were good.

What can we make of that? What if we ask about particular issues: is slavery bad, is homosexuality bad, is unfaithfulness to ones spouse bad, is eating battery-farmed chicken bad? (to name just a few moral positions) we would not find universal agreement either. It is possible that some answers might be of the kind "Well, it depends on the circumstances, the time era of the issue). Even those who give answers that are qualified in this way will likely still feel that, if the question could be made more precise, then they should be able to give a clear cut answer.

Why is this? We have got very used to the idea that these questions should have definite answers. Our society often legislates the answer, or the prevailing moral climate determines an answer. So we are loath to believe that such questions have no answer. Indeed you may very well suspect that, unless a society had an agreement on the worth of an answer to these complex questions, the society would collapse in significant way because we could all behave as we felt like at the time. You might even think that, on an issue such as homosexuality, where society had legislated an answer that you didn't agree with, you would feel duty-bound to go along with the consensus rather than disrupt your society by public disagreement.

The conclusion I want to draw from these examples is that the idea of absolute good or absolute evil is too nebulous to sustain. This conclusion is unpalatable to many of us because it contradicts the way we have been educated to behave. We want to feel that we are good people who act as we do because of some absolute imperative that tells us how to behave. We have been conditioned to think like this sometimes because our parents have had to instil into us a model of behaviour that allows to rub along with our fellow humans, or our church has had offered us divinely inspired moral guidance, or our law-makers have offered absolutist reasons for certain behaviours, or important role models in our lives have set a strong example.

Yet most, if not all, of our moral positions are unsustainable as absolute positions - we cannot agree on them and it is not always just crazy people, or hardened contrarians, who cannot agree. My conclusion is simple: "goodness" or "evil" are not concepts that exist in an absolute sense.

I must add immediately that this does not mean one can therefore act as one pleases because the concept of acting as a good individual is meaningless. More of that later.

I believe that one cannot build "good" societies by first identifying the "good" qualities that one would like the society to have because the idea of a "good" quality is too elusive as we saw in the examples above. My model of societal growth is more chaotic than that. Societies grow from very small collections of people into the complex societies that we see all around us today. This growth has some features in common with the development of species arising generation by generation by random events. Some developments will arise and quickly fade away because they have not been conducive to the survival of the society - and some developments will cause long term thriving. In other words societies are complex systems whose future is a product of fortunate accidents (and the more fortunate the accident the longer will its consequences be felt). As an example, early Greek democracies (to be accurate, very crude quasi-democracies) arose more by accident than design - yet it was a a fortunate societal accident producing a prototype organisation which has lasted a very long time. An example on the other side is the National Socialist experiment of Germany in the 1930s and 1940s - again arising by the conjunction of exceptional conditions - this was not a successful accident as it only lasted two decades. 

To repeat: "good" societies do not arise because of "good" qualities. On the contrary, it is the other way round. When a society has arisen it is legitimate to ask what about the society is good. Consider the society of the Roman republic and early imperium and ask that question. The Patricians would claim they lived in a wonderful society, economically prosperous, and intellectually vibrant; the Plebs would answer very differently. Yet both of them enjoyed an urban existence that was the envy of neighbouring tribes. I would judge that society to be relatively good - it certainly lasted for centuries. When it did collapse it left an intellectual legacy that people looked back on as "good" times. As that society developed into a mighty empire one can perhaps guess at the reasons for its longevity: perhaps it was the way that early consuls were appointed or, later, the rigorous training undergone in the legions, or the mild climate of the era. Romans themselves might say "we have a good way of appointing our consuls, or we have a very good army, or the gods have given us many good harvests". In other words, the judgement of whether Roman society was "good" is a post-hoc judgement rather than a template for why their society flourished.

I think one should look at our current societies in this way. 

Consider the example of the modern USA. The Americans promote the myth that their national society was the result of deliberate design by the founding fathers. But I think that is far too simplistic. The awful things in their society were obviously not deliberately planned. But the successful aspects of it were either lucky (great natural resources, guns which enabled them to steal their land from the native population, the entrepreneurial spirit that was enabled by the natural wealth in resources and human capital) was also not deliberately planned. What has grown up has been a mixture of successes and failures and, quite naturally, they celebrate their successes and forget their failures, while pretending that the "American dream and their manifest destiny" are designed either by god or by their national spirit.

British society is an older and longer lasting example. For nearly a millenium (since the Norman conquest) it has evolved in a way where accidents have been largely responsible for the way it has changed. Magna Carta for example was definitely not the result of planned good government. The Hundred Years war was a mish-mash of successes and reverses (successes="good", reverses="bad"). The foundation of the British Royal Society in 1660 which ushered in an era of brilliant scientists was "good" but who among its founders could have foreseen that? These and many other examples make it very implausible that an intial set of good design principles are responsible for modern British society. On the other hand we can look at contemporary British society and observe some things that work very well (examples: the National Trust organisation, the rich artistic and cultural life in the big centres, the ancient beautiful buildings (ruined or not) etc. none of which were planned to develop as they have).

Finally, I will return to a point I mentioned above. Just because there is no such thing as absolute good doesn't mean that we should behave as moral delinquents. We can look around our society, spot the things that work well, and then do our best to push the successful parts of our society. For example, those parts of our society where there are undesirable actions, such as outright crime or tax-dodging, are sections of society which do not contribute to the smooth functioning of the society: this suggests that we avoid crime and tax-dodging.

It's really not very difficult. Don't appeal to those unreliable authoritative concepts which assume that goodness is an absolute concept. Instead, think about which parts of your society are successful, those likely to grow into societal success, and do your best to  support them.