Saturday, 16 September 2023

Narcissisitic Numbers .... The History and Etymology of Math Terms

 Narcissisitic Numbers  The term seems to come from the pen of Joseph S. Madachy in his Mathematics on Vacation, 1966.  His definition is broader than the current use (at least as I know it) . "A Narcissistic number is one which can be represented as some function of its digits ." He includes examples like 145 = 1! + 4! + 5!. It also would include things like n=(sum of digits of n)^(number of digits in n).  

Today the term is used for numbers n (in a particular base) in which the digits are each raised to the power of the number of digits n has and then summed and found to be equal to n.  An early example is 153 = 1^3 + 5^3 + 3^3.  It has been proven that there are only 89 numbers in base ten that have this quality. 
G H Hardy's A Mathematician's Apology mentions the four three-digit solutions, (without using any particular name for them) but dismisses them with, "There is nothing in these odd facts which appeals to the mathematician." 
Another related problem is is there a number A in n digits where the sum of the digits of A raised to the power n = some Other number B and so that the same function of B, gives A again. Are there any that form three-cycles A-> B -> C ->A etc. (Pssst, the answer is yes)

Other names that have been used for these numbers are Armstrong Numbers and PluPerfect digital invariants, which is usually abbreviated PPDI, and is from the Latin past tense for "more than perfect".  
Armstrong numbers is from the name of  Michael F. Armstrong, a computer science teacher who died in 2020.  It seems to have been created shortly after the Narcissistic name, and grew in popularity as one finding these numbers became a popular task for programming classes.

Wednesday, 13 September 2023

The Rule(s) of Three and the Probability of Nothing, and of a single success


A Re-edit and Posting of a 2008 Blog with additional material (See, I do learn something over time.)


From 1827 Pike's Arithmetic



In my youth, back when dinosaurs roamed the earth, there was “the rule of three”… singular, one, and even then the name was often described as “archaic”. More modern books tended to develop “properties of proportions” or similar terms for the problems of proportionalities. Now there seem to be an abundance of them; including one for witches, and one about businesses. There is not space enough to talk about all of them so I will mention three, of course.
The first rule of three is as old as math, and shows up at least as early as the Hindu mathematician Brahmagupta, and in Fibonacci’s famous Liber Abaci(1202). It was once so common that it was introduced into common language. Abraham Lincoln is quoted in his biography as stating that he learned to "read, write, and cipher to the rule of 3."   So common that student's often wrote verse like the following, in their copy (practice) books.

Multiplication is vexation;
Division is as bad;
The Rule of Three doth puzzle me,
And Practice drives me mad

The most common and longest living form was the direct rule (although there was an inverse rule as well), in which case three numbers would be given and a fourth sought so that the ratio between the third and fourth would match the ratio between the first and second; a:b = c:d. Today students use the ideas in elementary school to complete fraction equivalences, “2/3 is the same as 10/?” Some of the ancient examples grew incredibly complicated.

I suppose the reason I chose to address three of the many “rules of three” is because of the rule of three from language and literature. Three just seems to be the right number for lots of things, there were Three Musketeers, Three Stooges, and Three Coins in the Fountain. It was Goldilocks and the Three Bears, and “bah bah black sheep” had “three bags full.” Comics in the newspaper usually have three panels and many jokes involve a three part ritual where the punch line is the third element, such as the t-shirt with “Great Cities of the World” on the top, and below, one after another, “Paris, Rome, Fargo”. The first two make the last funnier. In language the examples range from “Blood, sweat, and tears, to vidi, vidi, vici. If you don’t think there really is a mental tendency to have three terms, consider that in Churchill’s speech, he actually used four; “I say to the House as I said to ministers who have joined this government, I have nothing to offer but blood, toil, tears, and sweat. “

The final rule of three I would mention is from statistics, and is of more recent origin. It is also, I think, a really clever solution to what is a really difficult problem. Suppose something never happens; how can you assign a probability to it? It is not that it might not happen some day, just not so far. It is just such a problem the statistical rule of there was created to handle. Suppose you stopped at the same gum ball machine every day, but unlike the normal gumball machine, this one did not have a glass you could see into the gumballs inside. You buy a gum ball every day and get red ones, and green ones, but never a blue one. After a while you begin to wonder if they even put a blue one in the machine. So one day, after 20 days of getting all the other colors, over lunch you ask your local statistician (doesn’t everyone have lunch with a statistician?) how to figure out if there really is a blue one in there. He pauses, fork poised in mid-air, and informs you that you can be 95% sure (a common statistical benchmark) that the proportion of blue gum balls is no greater than 14.3%. He had mentally taken three, and divided by one more than the number of failed efforts, to get 3/21 or 1/7 as the upper limit of the possible fraction.
The idea is base on a simple extension of the binomial probability. If you knew that P % of the gum balls were blue, then you could calculate the probability that None showed up in 20 days. The probability would be (1-p)20. Working back through this calculation many times you might notice that the number followed a pattern, a rule of thumb to calculate without tables and calculators, and that turns out to be 3/(n+1), the statistical rule of three. If you wanted greater certainty, you can use the rule of seven, which says that 7/(n+1) will give the 99% interval boundary. So in the case of your gumballs, you can be 99% sure the percentage of blue gumballs is less than 1/3.

But what if after a long string of failures, you have a success.  How does this change your confidence interval?   Thanks to a recent post from John D Cook I now can tell you that as well.  

So suppose you had worked your way as before with twenty failures to get the blue gumball, and then after the aforementioned lunch with a statistician,  you get a blue gumball on the 21st try.  Now what can you say about the expected percentage of blue gumballs.  

After the first success according to the Beta distribution would give a 95% confidence interval of appx. [.1/n, 4.7/n]  .  For our imagined 21 tries, this would be about [.0047, .224]  So our confidence interval has opened up considerably.  

It appears, if I understand correctly, that the blue gumball could have occurred anytime among the first 21 tries and thus would still be the CI.  So if we went another nine tries without success, we would adjust our CI to {.1/30, 4.7/30] ... [ .00333, .157], back much closer to our expectations before we ever had a success.

Comparing this interval to the binomial confidence interval you learned in high school math, p +/- 2 sqrt(p*(1-p)/n).  The customary warning on the normal expectation is beware of p being too high or too low.  Using one success in 30 tries we get a 95% CI of [-.03, .099]... perhaps the negative lower bound is a sign that we have strayed to close to zero with our p-hat.  A nice topic to spring on your AP stats teacher when you get to confidence intervals, but please be kind. 

Tuesday, 12 September 2023

Charles the Obscure, The one you never heard of, but should have.

 My good and generous friend, Dave Renfro, sometimes finds time in his busy writing and research schedule to send me copies of some of the old documents he's working through.  Recently a collection from him included a 1979 Isis article by J. B. Gough.

One in particular, which I opened only weeks after the anniversary of the death of the unfortunate Jacques Charles, called the Geometer in his lifetime to avoid confusing him with Charles the Balloonist, and sometimes Charles the inventor, who is J. A. C Charles, and the namesake for the chemistry law that is sometimes, probably without merit, called Charles' Law.  Unfortunately, the point of Gough's article is that they did become confused, often due to lack of effort or interest on the part of historical writers, to the point that now you can find little or nothing about the "geometer" and much of what you find about the more famous Charles is, in fact, a mis-credit for the work of Charles the Geometer. 
I would have assumed that articles like the one by Gough in 1979, and another by the famous science historian Roger Hahn a few years later would have set the record straight, but in fact as I scanned a couple of biographies on the internet they still contain the residue of the confusion.
One of the first points of confusion is that you may see the date for the induction of the famous Charles into the Academy of Sciences as 1785.  This is off by almost a full decade, and is the actual date of the induction of Charles the Geometer.   The famous Charles would be inducted into the  Académie des Science in 1795, almost four years after the other Charles had gone to an early grave.

The image is an illustration of JAC Charles first Balloon flight on 1 Dec, 1783

*Wik


A second, and even more common error is that you will often still see biographies of the famous Charles that list him as a mathematician, and sometimes add something like, "most of his papers were in mathematics."  

Wikipedia currently lists JAC Charles as " French inventor, scientist, mathematician, and balloonist.,"and then follow up with, "Charles wrote almost nothing about mathematics, and most of what has been credited to him was due to mistaking him with another Jacques Charles, also a member of the Paris Academy of Sciences, entering on 12 May 1785." 

Searching for Jacque, the Geometer may be a long search, and unless you stumble across a copy of this blog, or the document I started from, you may find nothing at all.

 JAC Charles, the famous, it seems, was NOT a mathematician, and wrote almost nothing, including nothing about mathematics, and only the sketchiest outline of the law which, due to the graciousness of more capable scientists (you can read the name Joseph Louis Gay-Lussac here) would eventually bear his name.  J. B. Gough goes so far in his article in Isis to declare that this Charles was "nearly a mathematical illiterate."  He points out that of the eight articles credited to J. A. C Charles by Poggendorf, seven were actually by the more obscure (and more mathematical) Charles.

Gay-Lussac, in his published paper about the law credits Charles with this statement (English translation) "Before going further, I must jump ahead. Although I had recognized on many occasions that the gases oxygen, nitrogen, hydrogen, carbonic acid, and atmospheric air all expand identically from 0° to 80°, citizen Charles had noticed the same property in these gases 15 years ago; however, since he never published his results, it is only by great luck that I knew it. He had also sought to determine the expansion of water-soluble gas, and he had found for each a particular dilation different from that of other gases. In this respect, my experiments differ strongly from his".
Gough points as far back as 1870 with evidence to the ongoing confusion.  A donation of the physics lectures of the more famous Charles to the Institute de France prompted a notice in Comptes Rendes with a brief description of Charles life and career on February 7 of 1870.  Shortly after the publication a letter to the Perpetual Secretary questioned if the article had not confused Charles the balloonist with the geometer.  A followup with a brief description of the lives of both men was given in Comptes Rendes on March 7 of the same year.

I first wrote about this in 2013, and today, nine years later, there is no biography of Charles the geometer in St Andrews MacTutor.  Encyclopedia dot com also has no article about Charles the geometer, but writes about J A C Charles, "Charles published almost nothing of significance." 

"Assertions to the contrary notwithstanding, there is no evidence that Charles knew anything but the rudiments of mathematics. Through an unfortunate confusion of names, biographers and bibliographers have completely confounded J. A. C. Charles with another contemporary known only as Charles le Géomètre.

 Wikipedia also has no page for Jacque Charles the geometer, but says, "(J A C )Charles wrote almost nothing about mathematics, and most of what has been credited to him was due to mistaking him with another Jacques Charles, also a member of the Paris Academy of Sciences,... He was sometimes called Charles the Geometer."

So what of the mathematical Charles, who has so sadly been overlooked for several hundred years?  It seems that he was born around 1752 in Cluny, France in the Burgendy region of France.  He seems to have attempted to gain entry to the Paris Academy of Science, to which both Charleses would eventually belong, at the ripe age of about 18 while still living in Cluny.  His article, on a problem in Algebra, probably reflecting his youth, was rejected by the academy as being too elementary.  Two years later, he  submit a second paper two years later, "sur le dynamique" impressed the judges who inferred that the author must be aware of Euler's differential calculus.  When it was read to the full meeting of the  academy, Lavoisier's minutes of the meeting list Charles as a Professor of Mathematics at the school at Nanterre, most probably referring to a popular academy in that suburb of Paris that trained young Nobles who were intending to proceed to Engineering colleges.
 Over the period from 1779 to 1785, Charles continued to submit articles to the Academy.  In all he submitted seven articles all of which were deemed appropriate for publication.  After the seventh, Condercet, who had reviewed the paper for the Academy, pointed out that this, and any of the previous six, certainly merited his admission to the Academy.  His major obstacle seems to have been the opposition to his appointment by Laplace, who was motivated more by his rivalry with Charles' sponsor, Charles Bossut(famed for his textbooks in France).  Finally a vote on May 11, 1785 (this date is often given as May 12, I use Hahn's date as few have better records to the history of the Paris Academy) secured Charles his membership.

Charles, through his association with Bossut, had already obtained the position as the Chair of Hydrolics, which brought with it, admission to the Paris Academy of Architecture, which made Charles a duel academician.

Somewhere around 1789 Charles was onset with a paralysis which greatly affected his ability to write.  It is said that he had, for a short while,  to request another member to sign him in at meetings.  He did manage to learn to write with his other hand, but never with full control.  A few years later, in 1791, he died apparently from the same paralytic problem.  Only sketchy records exist of his death and burial due to the confusion created by events related to the revolution.  It appears he died on (or near) August 20, 1791 and it is reported that he was buried at Saint-Germain-l'Auxilles on the 22nd of the same month.  A memorial service was held at the Oratoire on Dec 29,1971.  Due to the events of the revolution, no M'emoires of the Paris Academy were produced that year, and hence no obituary for members who died.

I am still trying to learn more about the actual writings of Jacques Charles, the Geometer and would love to hear from those who have greater knowledge on this subject, and the man himself, to share.







Thursday, 7 September 2023

Pythagoras and Matrices,

 I first learned about Barning trees in 2008.   Over the years people much brighter than I am, chipped in to tell me more.  This is a consolidation of posts since then that I hope will be readable and informative.  I find the ideas here fascinating.  Hope you enjoy

You can click on most images to expand it and make them sharper. 

It’s been a good weekend for Geometry for me. Several notes from folks telling me about geometry stuff I never knew… While I’m waiting on permission from the author of one, I wanted to tell you about the other.. The graph (tree) below shows a set of Primitive Pythagorean triples… All the ones with hypotenuse less than 100. Primitive Pythagorean triples are right triangles that have all sides as integers and none of them have a common factor.

What was new (to me) was that any one of them (and all the others not shown here) can be found as transformations of (4,3,5) using only three transformations. Let me make that clearer. If you think of a primitive Pythagorean triple as a point in three-space, then any other primitive Pythagorean triple is a point in three space that is just a transformation of this one… but there are only three transformations needed to get ALL of them. The tree shows which ones are generated by which ones, but you need to crank out the calculator and do some of these to see how neat it really is.

This type of graph is called a Barning-Tree because it seems to have first been discovered by F. J. M. Barning, “On Pythagorean and quasi-Pythagorean triangles and a generation process with the help of unimodular matrices, (Dutch) Math. Centrum Amsterdam Afd. Zuivere Wisk, ZW-011 (1963) 37 pp..
I later learned that It was first discovered in 1963 by Barning , and was then independently discovered by A. Hall seven years later, and seems to keep being rediscovered by different approaches.
A number of rediscoveries have occurred more recently.If you take the three matrices below, and write any of the primitive triples as a column vector, then multiplying by any of the matrices will give you another unique triple.. they never duplicate one, and they don’t leave any out (OK, I’m taking that on faith as I haven’t proven it for myself yet). I think that is kind of wild, and am totally impressed with people who can notice stuff like that.
Here are the three transformations

When I was young, I found it amazing when I realized that there were an infinite number of primitive Pythagorean triples that had one leg that was one less than the hypotenuse. The idea emerges from an even simpler algebraic fact.  Every odd number is equal to the difference in the difference of the squares of two integers that differ by one.  13 for instance is the 7^2 - 6^2.  But if the original odd number is a perfect square, then we have the makings of a Pythagorean triple with one leg one less than the hypotenuse.   
This is one of those "tricks" that you may have seen in popular math books, take any odd integer to serve as one leg, then square it and divide as evenly as possible to get the other leg and hypotenuse. For one leg of 7, the square is 49, and 49 can be almost evenly divided into 24 and 25, so 7, 24, 25 is a primitive triple. On the Barning tree I noticed that each of these was created by starting with P=(4,3,5) and applying the first matrix operation, AP gives (12,5,13), A2P gives (24, 7,25) and so on.  These all appear on the series closest to the x axis. 
Of course, you could find right triangles that have a leg two less than the  hypotenuse.  You can see them by looking on the Barning tree branch closest to the y-axis .  Look at the smallest leg, what do you notice?  Now square the short leg.  Now add the longer leg and the hypotenuse.  Can you see the pattern? 
If we wanted to have a primitive Pythagorean triangle with a short leg of 16, we need to find half its square, 164/2 = 128, so this is the sum of the longer leg and hypotenuse.  We only need find one more and one less than 64, half of 128, and we are done.

In looking at the tree, I realized that each transformation matrix preserved one arithmetic difference in the three values. AP for any point P would preserve the difference between the first leg and hypotenuse. If we let P = (20,21,29) the difference is nine, and transformations by A preserve this so that AP = (80,39, 89) and A2P gives (176,57,185).

If we wish to preserve the difference between the second and third value of the point, we transform by matrix C. Keeping P = (20,21,29) the transformation CP gives (36,77,85), and C2P gives (52, 165, 173).
Matrix B then, preserves the difference between the legs. If we take (3,4,5) and repeatedly apply the transformation B, we get (21, 20, 29); (119, 120, 169); etc.

------------------------------------------------

A while after I wrote two short blogs on Primitive Pythagorean triples  I got a nice note from H. Lee Price with a link to a paper he had written on "The Pythagorean Tree: A New Species". A couple of things I learned from it were too good to keep to myself, so here are some of the things I thought were amazing.. or read the paper for yourself to find your own favorites.
One of the clever things that I learned was a way of creating an informative 2x2 matrix for any triple that holds some interesting information. I will use the 5,12,13 triangle as an example, but any of them produce the same sorts of information. Take one leg, and write it as a ratio to the sum of the hypotenuse and other leg, then simplify. Using 5 over 12+13 gives 5/25 or 1/5. Using the other leg we get 12/18 = 2/3. One of the first amazing things is that there will always be one, and only one even number in the two fractions created. Put the numerator and denominator of the fraction with the even number in the left column of a 2x2 matrix, and the other fraction makes the right column. For the 5, 12, 13 Pythagorean triple we get:
Here are several examples from Mr Price's paper:

"SO WHAT?", you ask. Well, amazingly, you can use these to quickly find the radii of the in-circle, and all three ex-circles of the triangle. If you multiply across the two rows the two products formed will give you the radius of the in-circle and also the radius of the ex-circle on the hypotenuse of the triangle. Then if you multiply the two diagonals, you get the other two ex-circles radii. 

In the case of the 5,12, 13 triangle, the in-circle is found by the product of the first row, 2 x 1 =2. The three ex-circles have radii of 3, 10, and 15 units respectively.from the products of the diagonals (1 x 3=3, and 2 x 5 = 10)  and the product of the bottom row elements, 3 x 5 = 15. I had never observed until it was pointed out to me, that the radius of the ex-circle on the hypotenuse is always the sum of the radii of the in-circle and the other two ex-circles...2 + 3 + 10 = 15....
Finally, these in-circle and ex-circle relations are tied back to the Barning tree. Remember the diagram that shows that each of the Pythagorean triples produces three offspring in the tree. Mr. Price points out that in each case, the new Triangle has an in-circle that is one of the three ex-circles of the parent triangle. The 3,4,5 triangle has ex-circle radii of 2, 3 and 6 units. The off spring triangles are the 5, 12, 13 triangle with in-center radius of 2, the 8, 15, 17 triangle with in-center radius of 3, and the 20,21,29 triangle with in-center radius of 6.

Somehow, all that geometry packed into a simple matrix seems incredible. By the way, the original two fractions we used to form the matrix, they are the tangents of 1/2 each acute angle. The arctan(1/3) is appx 11.31 degrees,  half of the arctan(5/12)=22.62degrees.

*Sidenote trivia  if we let x=2/3 and y = 1/5, then x + y + xy = 1, and this seems to work with all the paired half-tangents.


 The focus of Mr. Price's paper was to point out that from these 2x2 matrices, you can easily build a different tree to produce all the Primitive Pythagorean triples as well. I will return to that when time permits, and I feel I understand it well enough to do it justice. Check his Paper for a neat use of the Fibonacci sequence to produce additional trees of the 2x2 matrix for each primitive triple