Thursday, 30 October 2008

I Will STILL Derive

OK, after all those years of teaching calculus, it seems I've been saying it all wrong, or at least that is the opinion of several people on the AP calculus list who think that the verb "Derive" is not acceptable for "differentiate" which they suggest is better. I have even posted videos "I will Derive" parodies of the old "I will survive" song.

Ok, maybe they have a point...but I'm a little confused. If they want to get pedantic about not using "derive" then they certainly must avoid "derivative" (that which is derived, to obtain or receive from a source)..If you differentiate, then you get a differential; yes??? So if you want to find the derivative... well, you get my drift.

Derive is kind of a great word, it comes directly from the word river (which once meant the banks and not the river, hence the Riviera is the coast). In days of yore the draining of water out of the river and into the fields for irrigation was something like "derivering" and then worked its way into "deriving" (get it, to draw from a source). We use derive in that sense a lot in math for any type of deductive reasoning. To me it seems perfectly logical to talk about deriving the function for the slope from the original function, and calling the result of that derivation, the derivative.

Sorry guys, but I'm afraid that I've been doing it way to long to break the habit now, so I will continue to derive, but if I can remember I will try to tell my students that they may encounter a future professor who may dislike the usage, and they should be prepared for such an event... but honest, I don't much care which word they use, I just wish they would remember to apply the chain rule.

Monday, 27 October 2008

What! You Don't Believe in Aliens?

Casey, one of my Stats students, didn't believe in the evidence of alien intelligence on Earth. I decided that I would have to convince him with the one most certain piece of evidence imaginable, so I asked, "You know what a thremos bottle is, right; so what happens if I put hot coffee in a thermos?"

Casey: "It stays hot." almost as a question

ME: "Yes.... and what if I put cold milk in the thermos,,,, what then?"

Casey, uncertainly: "Ummm... well, stays cold."

ME: " Un Huh... (in triumph) and HOW does the thermos know which I put in????" with a slow wink and a finger tapping the side of the head

I'm sure that Casey now believes, but if you are one of those people who STILL doesn't believe there is other intelligent life in the universe, here is the incontrovertable proof you have been waiting for from John Hodgman. A story about aliens, physics, time, space and the way all of these somehow contribute to a sweet, perfect memory of falling in love.

Sunday, 26 October 2008

Searching for Snarks

The happy band of mathematical warriors above joined me on Thursday night as we set out to the Center for Mathematical Sciences at Cambridge. Our quest was to discover all that Emeritus Gresham College Professor of Geometry Robin Wilson might know about "Lewis Caroll in Numberland." The lecture, which can only be described as "math-lite" was entertaining none the less, and made even better by the good companions who joined me.

Wilson is also, not by coincidence, the author of a book on the topic that is soon to be released in the US (and can be purchased in advance from Amazon at a healthy discount) entitled, Lewis Carroll in Numberland: His Fantastical Mathematical Logical Life.

Wilson explained that if Dodgeson (the real name of Lewis Carroll) had not written the "Alice" stories for which he is so well remembered, he might well be remembered for being one of the pioneering child photographers of the 19th century. And if he had not done either, he might be remembered as an accomplished mathematician and teacher who made contributions in the areas of Logic, algebra, geometry, and the mathematics of elections. Wilson points out that:
"Yet another interest of his was the study of voting patterns. Some of his recommendations were adopted in England, such as the rule that allows no results to be announced until all the voting booths have closed. Others, such as his various methods of proportional representation, were not. As the philosopher Sir Michael Dummett later remarked:

It is a matter for the deepest regret that Dodgson never completed the book he planned to write on this subject. Such was the lucidity of his exposition and mastery of this topic that it seems possible that, had he published it, the political history of Britain would have been significantly different."

He also credits Carroll with the invention of the modern method of seeding tennis matches:
Another interest of Dodgson's was the analysis of tennis tournaments:"At a lawn tennis tournament where I chanced to be a spectator, the present method of assigning prizes was brought to my notice by the lamentations of one player who had been beaten early in the contest, and who had the mortification of seeing the second prize carried off by a player whom he knew to be quite inferior to himself.
Let us take sixteen players, for example, ranked in order of merit, and let us organise a tournament with 1 playing 2, 3 playing 4, and so on. Then the winners of the first round will be 1, 3, 5, and so on; those of the second round will be 1, 5, 9 and 13; the final will then be won by player 1, defeating player 9 who wins the second prize but actually started in the lower half of the ranking.
To avoid this difficulty, he managed to devise a method for re-scheduling all the rounds so that the first three prizes go to the best three players, which presaged the present system of seeding.

For a brief discription of some of his work in Logic diagrams see My page here and for A different version of the Wilson's talk on Lewis Carroll given at Gresham College, look here

Wednesday, 22 October 2008

More on Price matrices for Primitive Pythagorean triples.

For the lack of a better term, I will call the 2x2 matrices used to describe Primitive Pythagorean Triples in my last blog as "the matrices".

One of the consequences of the way they are constructed is that the two numbers in the right column represent the difference and sum of the two numbers in the left column.

This allows you to construct the full 2x2 matrix when any two of the elements are known. This, in conjunction with the knowledge that each offspring on the Barning tree has an incenter that was one of the three excenters of the parent, allow us to produce the tree without the use of matrix transformations.

If we start with the 3,4,5 triangle, which has a matrix ) we have already established that the products of the bottom row and the two diagonals give the radii of the three excircles (1x3=3, 1x2=2, 2x3=6)... So we can find the three offspring of the 3,4,5 triangle by promoting each of these excircles to an incircle, as shown here:

Now by using the fact that the right hand column is made up of the difference and sum of the left hand values, we can complete the two missing values to find the descendants of the parent matrix.

But we don't really want to know the matrices, we want the Pythagorean triples. Fortunately it is easy to find the triple associated with any of the matrices. Multiply down the left column and double to get the even leg; multiply down the right column to get the odd leg, and then sum the products of the two diagonals to get the hypotenuse. So the matrix on the lower left with rows of 2,1 and 3,5 will have an even leg that is twice 2x3, or 12. Its odd leg is 1x5 = 5 and the hypotenuse is 1x5 + 1x3 = 13. That means one descendant of the 3,4,5 triangle is the 5, 12, 13. You can work out the other two.

If you are paying careful attention, we just added the excenters of the two legs to get the hypotenuse of the triangle... did you know that worked that way? How about this, you also get the hypotenuse if you subtract the top row product from the bottom one. Geometrically that would be subtracting the incenter from the excenter on the hypotenuse... Now go convince yourself that makes perfect sense.

If you find the determinant of a matrix, but ignore the signs and add everything (like we did when we added the diagonals of the 2x2) it is called the Permanent of the matrix. I had never seen this word before. Jeff Miller's web site on the first use of math words provided a little detail. The term seems to have been created by Cauchy. "In his book Permanents [9] H. Minc mentions that the name permanent is essentially due to Cauchy (1812) although the word as such was first used by Muir in 1882. Nevertheless a referee of one of Minc's earlier papers admonished him for inventing this ludicrous name!"

Sunday, 19 October 2008

Even More on Pythagorean Triples and Barning Trees

A while back I wrote a couple of blogs on Primitive Pythagorean triples and Matrices and Barning Trees of Primitive Pythagorean triples. Shortly afterward I got a nice note from H. Lee Price with a link to a paper he wrote 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:
"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 has a radius of 2, and the three ex-circles have radii of 3, 10, and 15 units respectively. 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 the two acute angles of the triangle. 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.

Tuesday, 14 October 2008

A Sign of Nothing

Ok, I have admitted before that British Signs sometimes confuse me, but Saturday as I was driving down to Gatwick Airport to pick up my beautiful wife, I came across another. Driving around the M25 on a clear early morning, I suddenly came into some thick fog. Traffic slowed to about 15 mph and as we crept along, I saw an illuminated sign ahead with flashing lights above and below.... ahhh, life saving information to avoid catastrophe. I peered into the fog to make out the sign.... three letters, one word....


Who was it for? Anyone who could see the sign, certainly if they could get close enough to read it, must surely have known there was fog about. On the other hand, I'm not sure what I would think if I came across the sign as the person who took this picture did. Bright, warm and sunny afternoon and the fog warning clearly lit.

Thursday, 9 October 2008

"I Don't Get It!"

It was a quote from Augustus De Morgan that started it. "Mr.Ballew" he says, "I don't get it," This was a young man who usually gets it, and when he doesn't he has to scratch the itch to know. The quote was on my board, so I was the logical one to ask.

The quote (actually a slight modification of the true words of De Morgan) said:
Imagine a person with a gift of ridicule . He might say first that a negative quantity has no logarithm; secondly he might add that a negative quantity has no square root; and finally he could comment that the ratio of the first non-existent to the second is the same as the circumference of a circle is to the diameter.
"So tell me what you DO understand." I asked

He explained that he thought the "negative has no logarithm" means that you couldn't take logarithm of a negative because the domain of logarithms was limited to values greater than zero. The teacher "stayed still, and Br'er Fox, he lay low". "And I guess the second part is that you can't take the square root of a negative number."... and now the teacher raises one eyebrow..."Ok, you can, but you don't get a real number, you get an imaginary number"...

As the teacher unfolds his arms, one long sweep brings a finger to slide beneath the last line... and then ... . "Ok, and the ratio of the circumference of a circle to the diameter is Π " .. at last the teacher speaks...."Good." and he walks to the board to pick up a marker.

"I think you have seen this somewhere, even if you were not sure what it meant." and on the board he writes Euler's beautiful result (which Cotes shoud get more credit for); eπ i = -1

The student admits to have seen it, and the teacher negotiates an agreement to accept it, or at least accept that De Morgan believed it was true. "Now let's take the natural log of both sides, and we get..." and he writes,... Π i = ln(-1) Now we are in the part that the teacher loves... the student is hooked.. its art and entertainment and poetry and math all in one... and the clever student sees the first inkling of the result... Pi is waiting on one side... the log of a negative on the other... and then he sees all.....

" Ahhhh," he says, "just divide by i... "... The teacher yeilds the marker, ...passing the torch to a new generation??? ... and feels a pang of be so bright and so young... and the young man writes Π = ln(-1) / i..... and then thinking of the quote, rewrites it as

Monday, 6 October 2008

Standard Deviation Computation in One Pass

One more new (to me) item in my explorations of the standard deviation. I came across a one-pass method of computing the sample standard deviation which seems to be exact, not an approximation.

Normally the way we compute the sample standard deviation requires two passes through the data, one where we calculate the mean, then again to find the deviations from the mean to calculate the RMS of the deviations. This method is good for most cases where the data comes to you in a set and complete. But in cases where you have data streaming in constantly, say as from the Hubble telescope or something, having to go back and recalculate the total each time may be time consuming. What is needed is a way to take the old results and produce the new result with the one piece of data added.

I found just such a result at a page From John D Cook He writes, "This better way of computing variance goes back to a 1962 paper by B. P. Welford and is presented in Donald Knuth's Art of Computer Programming Vol 2, page 232, 3rd edition. Although this solution has been known for decades, not enough people know about it. ...It is not obvious that the method is correct even in exact arithmetic. It's even less obvious that the method has superior numerical properties, but it does. The algorithm is as follows.

Initialize M1 = x1 and S1 = 0.

For subsequent x's, use the recurrence formulas

Mk = Mk-1+ (xk - Mk-1)/k

Sk = Sk-1 + (xk - Mk-1)*(xk - Mk).

For 2 ≤ k ≤ n, σ2 = Sk/(n - 1)."
although I think the sigma-squared should be s2 from the values I get and the division by n-1. For those who use the Ti 84 and such calculator, this is an easy program to write, or you may download a program I quickly wrote here. It asks for each x in turn, and reports the running mean and sk after each entry.

Saturday, 4 October 2008

A Nice, but Tough, Problem

Click on images to see higher resolution

This one is for my old teaching friend, Al Harmon, who has asked and answered problems for me and from me for many years... This is a variation of a problem that was on the "Wild About Math" website, adjusted a little to make it more compatible to students at HS level..

If you take a number (let's use 200 for an example) and think of all the ways you could write it as a sum or positive integers... (100+100, or 2 + 105 + 93 or... 1+1+1+.....+1) these are called the partitions of the number. Now if you take all the integers in the partition and multiply them together, which one would give the largest product? Obviously 1+1+1...+1 will not amount to a very large product.... 100* 100 is lots larger, and 66* 67 * 67 is even larger...almost 3 (10 5),... which might make you think... aha...more small numbers is better... so 2100 will be great! ...Well it is better, its about 1.126 (1030 ) which is way larger than the others... but can we make it bigger???... What if we experiment a little with other values we try five, and find 5 40 = about 9 (10 27) .... big, but not as big as 2100 ...

well, what about 4 50... wait, that is exactly the same as 2100 by the exponent laws... so using all twos or all fours gives the same result... and fives yeilds less

Hmmmm..... We can't use all threes, but just for the heck of it, we try using two threes in place of three of the twos... what would 297 (32) give us...... aha... more.... just a little more, but more... about 1.46 (1030)... would more threes help??? would lots of threes help??? We could try using all threes and as many twos as would be left over at the end... 66 threes and 1 two would give us 6.18 (1031) more than any of the others. But Is THAT the largest... how can we convince ourselves that using threes is better than anything else?

Side trip to remember some ideas about logarithms.... remember that if a>b then ln(a) > ln(b) ... bigger numbers have bigger maximizing the product is the same as maximizing the log of the product.... and when we multiply numbers together, we are adding their logarithms to get the log of the product...[ln (bc)=lln (b) + ln(c)] ... now we can use that to think about how the log of the product changes...each time we use a number from the partition of the value, we add x to the sum, and ln(x) to the ln of the product.. so whatever number has the largest ratio of ln(x)/x will be the best choice to use.... If we graph the function (I used winplot, which is a wonderful FREE software.. ) we see the graph below.

It seems to be highest somewhere between 2 and 3, and a calculus student should be able to figure out that happens when f'(x) = 0, and since the numerator of the derivative is 1- ln(x), we know that will happen when ln(x) = 1, or x=e..... but that is NOT an integer... but we do notice the slope is always positive to the left of x=e, and always negative to the right of x=e, so whichever one of the two adjacent integers is most efficient, will be the most efficient.. we find that ln(3)/3 > ln(2)/2 and our question is answered.

Wednesday, 1 October 2008

Fibonacci's Thumb

One of those things that goes around the internet math groups every now and then, is going around again.... things to do with the Fibonacci sequence. I call them Fibonacci Rules of thumb... Ok, you remember Fibonacci, he introduced the Arabic numbers to the west with his famous book, The Liber Abaci.. and had a problem about rabbits where the number each month was given by 1, 1, 2, 3, 5, 8, 13, 21, etc....... YEAH, the one in the DaVinci Code!

The most common Fibonacci Rule of Thumb is converting between miles and kilometers. Suppose you are zipping along in Canada and the speed limit is in Km/hr, and you wonder..."Gosh, just how fast AM I driving?". So take your speedometer reading in good old miles per hour, and think of the number in the fibonacci sequence nearest this one... suppose you are driving a modest 55 mph.. which just happens to be a number in the sequence. Find the next number in the sequence, in this case 89, and that is a really good estimate of your speed in Km/hr (OK, I think it works out to be more like 88.5, but you get the idea).

So why does that work? The typical conversion is miles = 1.609344 kilometers (I know, I just googled it); and if you take any Fibonacci number, and divide it by the one in front, you get about that number. As the numbers get larger and larger, the ratios get closer and closer to 1.618033989.... so the ratios are pretty close. Of course you could use it for lots of other things, and with a little torture, you can make it work for less usual measures... If you want to know how many seconds (appx) in N years, where N is a Fibonacci number, then you can just take the next Fibonacci number, double it, and multiply by 107... So for example, If you wanted to find the number of seconds in 5 years... the next Fibonacci number is 8... double that to get 16... and now add the seven zeros to get 160,000,000 seconds in five years. You can check that one on your own.

And if you are STILL not convinced, would you be impressed if I told you that for N electrons (where N is a Fibonacci number), you can find the charge in Couloumbs by taking the next Fibonacci number, and multiply by 10-19... NOW THAT IS USEFUL STUFF