Showing posts with label Hamilton. Show all posts
Showing posts with label Hamilton. Show all posts

Saturday, 6 February 2021

Hamiltonian Paths and Knight's Tours

I encountered Hamiltonian paths before but never in the context of my daily number count. The reason is clear when we look at Figure 1 showing the initial members of OEIS A003216:

  
   A003216

Number of Hamiltonian graphs with \(n\) nodes.     
 

Figure 1: source

Looking at Figure 1, it can be seen that \(n\)=8 yields a value of 6196 but \(n\)=9 yields a value of 177083. This is a massive jump that completely misses the numbers that I am traversing as I track my diurnal age. Currently I am 26241 days old and one of the properties of this number is that it is a member of OEIS A283420 where \(n\)=9:

   
  A283420

Number of simple (not necessarily connected) untraceable graphs on \(n\) nodes.     
   

Even in the A283420 sequence the numbers get large very quickly. Here are the values from \(n\)=1 to 11: 0, 1, 2, 6, 16, 65, 310, 2316, 26241, 522596, 18766354. My current diurnal age just happened to be a member of this sequence and this is what led me to reacquaint myself with Hamiltonian graphs. Figure 2 shows all the possible non-Hamiltonian graphs for the case of \(n\)=5:


Figure 2: source

Looking at Figure 2, the distinction between graphs that are connected and those that are disconnected is apparent. But what about the terms simple and untraceable? At this point, it's a good idea to define separately what is meant by a simple graph and traceable graph (which will then explain an untraceable graph).

To quote from WolframMath World:
A simple graph, also called a strict graph, is an unweighted, undirected graph containing no graph loops or multiple edges. A simple graph may be either connected or disconnected. Figure 3 shows the differences between a simple graph and a nonsimple one:

Figure 3: source
A traceable graph is a graph that possesses a Hamiltonian path. Hamiltonian graphs are therefore traceable, but the converse is not necessarily true. The numbers of traceable graphs on \(n\)=1, 2, ... are 1, 1, 2, 5, 18, 91, 734, ... (OEIS A057864), where the singleton graph \(K_1\) is conventionally considered traceable. The first few are illustrated in Figure 4, with a Hamiltonian path indicated in orange for each. Source.

Figure 4: source

Comparing Figures 2 and 4, it can be seen what it is that defines a Hamiltonian path and a Hamiltonian cycle:
A Hamiltonian path or traceable path is a path that visits each vertex of the graph exactly once. A graph that contains a Hamiltonian path is called a traceable graph ... A Hamiltonian cycle, Hamiltonian circuit, vertex tour or graph cycle is a cycle that visits each vertex exactly once. A graph that contains a Hamiltonian cycle is called a Hamiltonian graph. Source.
Figure 5 shows a Hamiltonian cycle for the dodecahedron. 


Figure 5: source

A knight's tour can be viewed as either a Hamiltonian cycle or path when each square is regarded as a vertex:
A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square exactly once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is closed; otherwise, it is open. The knight's tour problem is an instance of the more general Hamiltonian path problem in graph theory. The problem of finding a closed knight's tour is similarly an instance of the Hamiltonian cycle problem. Unlike the general Hamiltonian path problem, the knight's tour problem can be solved in linear time. Source.
Figure 6 shows an open knight's tour that is a Hamiltonian path but not a cycle:


Figure 6: source
It has been shown that closed knight's tours are possible on any \(m\) x \(n\) board with \(m\) ≤ \(n\) unless one or more of these three conditions are met:
  • \(m\) and \(n\) are both odd
  • \(m\) = 1, 2, or 4
  • \(m\) = 3 and \(n\) = 4, 6, or 8
On an 8 × 8 board, there are exactly 26,534,728,821,064 directed closed tours (i.e. two tours along the same path that travel in opposite directions are counted separately, as are rotations and reflections). The number of undirected closed tours is half this number, since every tour can be traced in reverse. Source. 

Finally let's not fail to mention the great mathematician, Sir William Rowan Hamilton, after whom the Hamiltonian paths and cycles were named. Figure 7 shows a photograph of him.


Figure 7: Hamilton (1805-1865)

For a brief account of his life, follow this link.

Monday, 26 November 2018

Augustus De Morgan

Augustus De Morgan was a British mathematician and logician. He formulated De Morgan's laws and introduced the term mathematical induction, making its idea rigorous. He famously stated that he was \(x\) years old in the year \(x^2\), leaving us to surmise when he was born. A definite answer is possible once we know that he was born in the 19th century. This is a laughably simple problem and I am not suggesting that it has any mathematical significance but it popped up as an exercise in a book that I just started reading titled "Elementary Number Theory with Applications" by Thomas Koshy. It inclined me to find out a little more about this mathematician but first let's deal with the problem, simple as it might be.

One approach is to find a number between 1801 and 1900 that is a square number. There is only one such number and that is \(1849=43^2\). Thus we can say that he was born in 1806 and indeed he was born on the 27th of June 1806 and died on the 18th March 1871). This leads us to ask what in the next birth year that would allow its natives to make a similar claim. Well, those who were 44 years old in 1936 could make such a claim since \(1936=44^2\) and all would have been born in the 1892. Similarly, anyone born in 1980 will turn 45 in the year \(2025=45^2\).

The same approach could be taken with the cube of the year. If one were 12 years old in 1728, the claim could be made that one was \(x\) years old in the year \(x^3\). One would have be 13 years old in 2197 to make the same claim. The years that are perfect cubes will obviously be much farther apart than the perfect squares.


What about De Morgan himself? The Wikipedia article seems to give the most comprehensive account of his life. I was reminded that I had a copy of E. T. Bell's "Men of Mathematics" but De Morgan doesn't get a mention in that. He was a confirmed athiest:
His mother was an active and ardent member of the Church of England, and desired that her son should become a clergyman, but by this time De Morgan had begun to show his non-conforming disposition. 
As he himself said in 1838:
There is a word in our language with which I shall not confuse this subject, both on account of the dishonourable use which is frequently made of it, as an imputation thrown by one sect upon another, and of the variety of significations attached to it. I shall use the word Anti-Deism to signify the opinion that there does not exist a Creator who made and sustains the Universe. 
Even though he obtained a Bachelor of Arts degree at Cambridge, he could not progress to a Master's degree because that involved a theological test to which De Morgan would not subject himself to (even though he had been brought up in the Church of England).
As no career was open to him at his own university, he decided to go to the Bar, and took up residence in London; but he much preferred teaching mathematics to reading law. About this time the movement for founding London University (now University College London) took shape. The two ancient universities of Oxford and Cambridge were so guarded by theological tests that no Jew or Dissenter outside the Church of England could enter as a student, still less be appointed to any office. A body of liberal-minded men resolved to meet the difficulty by establishing in London a University on the principle of religious neutrality. De Morgan, then 22 years of age, was appointed professor of mathematics.
The theological test for Oxford and Cambridge was abolished in 1875. De Morgan was an outstanding teacher of Mathematics as well as a brilliant and witty writer. He was a lifelong friend of the Irish mathematician William Rowan Hamilton who discovered the Quaternions.

Of his childhood:
Augustus De Morgan was born in Madurai, India in 1806.[a] His father was Lieut.-Colonel John De Morgan (1772–1816), who held various appointments in the service of the East India Company. His mother, Elizabeth Dodson (1776–1856), was a descendant of James Dodson, who computed a table of anti-logarithms, that is, the numbers corresponding to exact logarithms. Augustus De Morgan became blind in one eye a month or two after he was born. The family moved to England when Augustus was seven months old. As his father and grandfather had both been born in India, De Morgan used to say that he was neither English, nor Scottish, nor Irish, but a Briton "unattached", using the technical term applied to an undergraduate of Oxford or Cambridge who is not a member of any one of the Colleges.
In Autumn of 1837, he married Sophia Elizabeth Frend (1809–1892). Of his family:
De Morgan had three sons and four daughters, including fairytale author Mary de Morgan. His eldest son was the potter William De Morgan. His second son George acquired distinction in mathematics at University College and the University of London. He and another like-minded alumnus conceived the idea of founding a mathematical society in London, where mathematical papers would be not only received (as by the Royal Society) but actually read and discussed. The first meeting was held in University College; De Morgan was the first president, his son the first secretary. It was the beginning of the London Mathematical Society. 
Unfortunately, his son George (the previously mentioned first secretary of the London Mathematical Society) died and not long after a daughter. After this, his health deteriorated and he died of "nervous prostration" at age 64.

De Morgan also promoted the work of the self-taught Indian mathematician Ramchundra. Here is an excerpt from the Wikipedia article about Ramchundra:
Ramchundra (1821–1880) was a British Indian mathematician. His book, Treatise on Problems of Maxima and Minima, was promoted by the prominent mathematician Augustus De Morgan. In his introduction to Ramchundra's book, De Morgan says that he was born in 1821 in Panipat to Sunder Lal, a Kayasth of Delhi. De Morgan came to know of Ramchundra when, in 1850, he was sent by a friend to work on maxima and minima by the 29-year-old self-taught mathematician. Ramchundra had published his book at his own expense in Calcutta in that year. De Morgan arranged for the book to be republished in London under his own supervision. De Morgan was so impressed that he undertook to bring Ramchundra's work to the notice of scientific men of Europe. Charles Muses, in an article in the Mathematical Intelligencer (1998) called Ramchundra "De Morgan's Ramanujan". He was mystified why, in spite of De Morgan's efforts to make this "remarkable Hindu algebraist known, he does not appear in most texts on history of mathematics." Ramchundra was teacher of science in Delhi College for some time. In 1858, he was native head master in Thomason Civil Engineering College (now Indian Institute of Technology, Roorkee) at Roorkee. Later that year, he was appointed head master of a school in Delhi.