Wednesday, February 19, 2014

How does my GPS work?

I use her often, but sometimes neglect her for long periods of time. I take her for granted, just assuming that she will be there and that she will perform the services that I need. When I ask her to do something, she pretty much always tells me where to go. And like any guy, I will get angry with her when she refuses to perform.

This could apply equally well to pretty much anything female in my life, but today I am referring to my GPS. Just in case you are wondering why I used the feminine pronoun, I have my GPS set to a female voice because I have become accustomed to doing what a woman tells me to.

As I was watching a squirrel navigate itself around through the trees today, I found myself pondering how a GPS works.

Starting out with a level playing field

Let's say that there is a football game going on, and they have to postpone the game. It's raining out, so they need to take the ball off the field. When the game resumes, they will need to put the ball back exactly where it was. That's when the MathPhone rings. "Hey Math Guy! We have a tape measure, and we can use the two goalposts to fix the position of the ball. How do we do it?" 

Now, I haven't watched all that much football, but I do seem to recall that there are a bunch of lines on the field that might be used to determine position. But let's say that I am either not allowed to use the yard lines or that somehow it never occurred to me that I could use them to describe where the ball is. I dunno. Maybe it doesn't make sense to use them because I need to make sure the ball is repositioned down to a zillionth of an inch. 

So, I take out my tape measure and measure from one goalpost to the ball, and then from the other goal post to the ball. I am thinking: "The football field is a two dimensional grid, so I should be able to nail down its position with two numbers, right?" 


Not quite. The red arc in the diagram below shows all the points that are 140' 7" from the left goalpost. The yellow arc shows all the points that are 253' 6" from the left goalpost. Note from the drawing that there are two points that satisfy both conditions. There are two locations that the ball could be. That's not gonna work!
So, I get out my post hole digger and buy a bag of cement to sink a third goalpost at the 50 yard line. It's not like anyone in the Green Bay area is ever gonna get that far down the field, right? When I make this third measurement, I get 156' 4". From the diagram below, it's clear that I can distinguish between the upper and the lower locations. The blue arc goes nowhere near the lower location. It's clearly in the upper position.
Aside from the possibility that my measurements are wrong, I think I'm home free. Measurements from three goalposts are enough to plant the ball exactly where it was. 

Being overly determined

But as is the case in most of my blog posts, things might not be quite that simple. If I were a pure mathematician with my nose firmly embedded in my well work copy of Euclid's The Elements, I would be done. I would accept my exorbitant consulting fees and head out for a beer. If my clients were desperate enough, I might even have enough for two beers.

But as an applied math guy, I realize that as certain as the uncertainty principle, there are tiny errors in any measurement. I am not talking about out and out mistakes. I mean, that there will be a variation from one measurement to the next. One would be tempted to think that if I were counting discrete things, the variation would be zero, but this is not the case, especially when counted little tiny things like photons and electrons. But that's an idea for a different blog post.

Given that there is some error, we will almost certainly run into a situation like in the diagram below. Any pair of the circles define a point, but the three points are not in the same place. 


What we have is an over-determined system: too many constraints, potentially leading to no solution. Originally we had an under-determined system: not enough constraints potentially leading to too many solutions.

How to deal with this? One way would be to just take the intersection of the two most reliable measurements. In our case, the goalpost at the 50 yard line is likely less accurate, since it may shift as the cement cures. 

Another way would be to take the simple average of the three intersection points. This will tend toward being more accurate than the intersection between any two. Just as a rough measure, the error will be reduced by the square root of the number of observations. (There are caveats and assumptions here. Like, the errors must not be correlated.)

A third way - and this is what an applied mathematician would recommend - is to do least squares optimization. That might come up in another blog post.

Leaving the plane

I mentioned that a squirrel inspired this post. How did I make that leap?

I was watching the squirrel make multiple leaps and musing about the relative difficulty of his navigational task compared to mine. My navigational task is basically decide if I should go left, right, forward or backward. Birds, bats, fish, porpoises, new world monkey, and squirrels all have the additional need to navigate up and down. I was musing about how much of the little critter's brain must be devoted to that task. 

Or maybe it's not all that much difficult. I dunno. It still got me thinking about navigation and three dimensions. And that's one of the things missing in the football field problem. When I had the task of defining the position of the ball on the field, I was constrained by the ball being on a level playing field. What is this is not the case?  What if I am required to fix the location of the ball if it is some distance above the field?

Now we have to go to three dimensions. I need to make sure, of course, that I am starting my measurement from a fixed point in space. So, let's just assume that I am allowed to drill a hole into the side of the goalposts to attach a screw hooks.

If I attach my tape measure to the screw hook, and stretch it out to 140' 7" or whatever, then I am free to move the end in any position along the surface of a sphere, for example, any position on the bluish-purplish sphere below. Similarly, a tape measure set to 253' 4" from the other goal post would describe the surface of the red sphere.


The intersection of the surface of these two spheres represents all the locations that the ball could be if I have only measured from two goalposts. As you can see from the absolutely breathtaking drawing that I made, the two intersect in a circle. (Of course, the intersection could be a point, or there could be no intersection at all. I am just looking at the one case. If the measurements are accurate, then there really should be an intersection.)

For the kinetic learners, imaging connecting the ends of those two tape measures. With both tapes fully stretched out, the ends are free to swing around in a circle.

So, as in the case of the plane of the football field, we have an under-determined system. In three dimensions, measurements from two goalposts allow us to narrow down the ball's position to a circle, rather than two points.

Now it starts to boggle my brain. What happens when we add a third goalpost?  Bear in mind that the intersection of the first two spheres was a circle. The intersection of the first and third must also be a second circle. And finally, the intersection between the second and third must be a third circle.

In other words, the collection of points that are the correct distance from all three goalposts is the intersection between these three circles, as below. If all goes well, then the intersection is two points. Funny. We had the same thing happen with two circles when we were working on the surface of the football field. So, if we need to fix the location of our football in three dimensional space, then we need four fixed points to measure from.


Where is the GPS tape measure?

I think many of my readers may have guessed by now that the goalposts are an analogy for the GPS satellites. Currently there are 31 operational, but the system could run with as few as 24. With 24, then no matter where you are on Earth, there are always four satellites to use as goalposts. (Isn't that funny? That is exactly the number I came up with!) I won't go into details about the orbits, but I found a website that does a good job of explaining the GPS satellites' orbits

I do want to address one question, though. Where is the tape measure connected to my GPS? The GPS works pretty much like that crazy gal I dated before I met my wife. The GPS is constantly sending out a little message that says what time it is up in GPS-ville. 


The GPS receives these messages and compares against its own time. The difference in time is the time it takes the time-stamp message to travel from the satellite to my GPS. In this example, there is a delay of about 17.8 milliseconds. Since light travels at about 300,000 km/second, this particular GPS satellite must be about 5,340 km away.










Wednesday, February 12, 2014

Happy Darwin Day

First of all, I want to wish everyone the very merriest of Darwin Days. February 12 is the birthday of Charles Darwin.  Enjoy your celebrations, but please be sure to drink responsibly. This would be an unfortunate day to be inducted into the Darwin Awards

Darwin is the author of The Origin of the Species, which brought forth the idea of natural selection. Darwin defined natural selection in the introduction of his book:

As many more individuals of each species are born than can possibly survive; and as, consequently, there is a frequently recurring struggle for existence, it follows that any being, if it vary however slightly in any manner profitable to itself, under the complex and sometimes varying conditions of life, will have a better chance of surviving, and thus be naturally selected. From the strong principle of inheritance, any selected variety will tend to propagate its new and modified form.

In other words, those characteristics which lead to more offspring will tend to be propagated over the long term. How can this possibly be debated? It is perfectly logical, and has been demonstrated over and over through selective breeding. The inevitable implication of this idea - evolution - is what appears to be the big issue with creationists.
Bjork's unnatural selection of an Oscar dress

A friend of mine recently sent me a link to a web page that deserves note on this auspicious day: 44 Reasons Evolution is Just a Fairy Tale. Michael Snyder's article starts out as follows:

The theory of evolution is false. It is simply not true. Actually, it is just a fairy tale for adults based on ancient pagan religious philosophy that hundreds of millions of people around the world choose to believe with blind faith.

Perhaps I am not understanding his point here, but, aside from the mention of pagan, I think Snyder's comment about blind faith applies equally well to creationsists. For example, in the recent debate between Bill Nye (the Science Guy [1]) and Ken Ham (founder of the Creation Museum), Ham had the following to say: "The Bible is the word of God. I admit that's where I start from." No amount of evidence could convince him that the world was more than 6,000 years old.

Argument #1

Snyder leads off with this argument: "If the theory of evolution was true, we should have discovered millions upon millions of transitional fossils that show the development of one species into another species. Instead, we have zero."

I didn't have to think very long to come up with the words Eohippus and Merychippus that I learned in grade school. I admit that these are the only stages in the evolution of the horse I could think of off the top of my head, but the Florida Museum of Natural History was able to fill in some of the gaps for me. Even this is a summary of the transitional fossils found. For a more complete family tree, see this article on Horse Evolution.

Transitional fossils in evolution of the horse 

I'm sorry Mr. Snyder. You are not making a very compelling argument here. Your leading argument is just plain wrong. 

Or maybe I don't understand the idea of "transitional fossil"? I decided to check the ultimate authority on everything, Wikipedia on transitional fossils. This entry describes what appears to be three quarters of a zillion transitional fossils.

Argument #2

My readers may have not noticed that my tongue was firmly implanted in my cheek when I referred to Wikipedia as being the ultimate authority on everything. Any argument that rests solely on references to Wikipedia is potentially shaky. 

The question of exactly what constitutes a "transitional fossil" comes into question because of the next four arguments from Snyder. To summarize these arguments, Snyder has provided quotes from various scientists who say that transitional fossils do not exist.

The first scientist that Snyder brings up is none other than Darwin himself. Darwin is quoted as saying “why do we not find them embedded in countless numbers in the crust of the earth?” Snyder goes on to say that Darwin believed that these fossils would be discovered.
The search continues...

I don't think that anyone in the evolution business would claim that Darwin wasn't a luminary. But his comments on the completeness of the fossil record are perhaps not all that up to date. After all, paleontologists have had 155 years to sharpen their pickaxes since Darwin asked that rhetorical question.

Like a good historian, Snyder provides a reference for his quote from Darwin. Synder's quotation of Darwin is correct, but he refers to a rather dubious source for the quote. This secondary source is a web page with the title "The Big Lie - Exposed". This article starts by linking evolution to racism. The article follows with a quote from Mein Kampf. The second paragraph essentially says that evolution was a lie started by the Devil.

Ummm... need I go on? I'm sorry, Mr. Snyder, but if you wish to be taken seriously by me, you really should reference sources that are just a tiny bit less blatant in their bias.

Argument #3

In Snyder's next argument, he exhumes a quote from a paleontologist by the name of Colin Patterson. According to the quote, Dr. Patterson said there were no transitional fossils. Well. There you have it. The quote was from a book he wrote in 1978.

But this is a bit odd, really. The book that the quote came from was about evolution and had the curious title "Evolution". Surely if he had proof that evolution was bunk, he would not have chosen to be a paleontologist, and wouldn't have written a book on evolution!

The quote from Snyder's article also seems to contradict a statement from Dr. Patterson's own book:

In several animal and plant groups, enough fossils are known to bridge the wide gaps between existing types. In mammals, for example, the gap between horses, asses and zebras (genus Equus) and their closest living relatives, the rhinoceroses and tapirs, is filled by an extensive series of fossils extending back sixty-million years to a small animal, Hyracotherium, which can only be distinguished from the rhinoceros-tapir group by one or two horse-like details of the skull. There are many other examples of fossil 'missing links', such as Archaeopteryx, the Jurassic bird which links birds with dinosaurs (Fig. 45), and Ichthyostega, the late Devonian amphibian which links land vertebrates and the extinct choanate (having internal nostrils) fishes ...

So what gives? I found a few references to Patterson referencing his own quote:

One quote: "I think the continuation of the passage shows clearly that ... the creationists' [interpretation] is false."

Another quote: "I was putting a case for discussion, as I thought off the record, and was speaking only about systematics, a specialised field."

Still another: "I do not support the creationist movement in any way, and in particular I am opposed to their efforts to modify school curricula. In short the article does not fairly represent my views. But even if it did, so what? The issue should be resolved by rational discussion, and not by quoting 'authorities,' which seems to be the creationists' principal mode of argument."
It's not nice to twist my words!

One important thing to note is that Patterson was open to continuous revision of his understanding of evolution. He book on evolution came out in 1978 and was revised in 1999. The introduction to the second edition says something of his change in thinking:

The knowledge in my first edition came from education and indoctrination; it was that neo-Darwinism is certainty. The knowledge in this second edition comes more from working things out for myself; it is that evolution is certainty. And part of the ignorance in the first edition concerned the difference between neo-Darwinism and evolution, whereas the ignorance in this edition is of the completeness of neo-Darwinism as an explanation of evolution.

I am not sure I understand the distinction between neo-Darwinism and evolution, but... my explanation of the original Patterson quote that appeared in Snyder's article was that Patterson was a man willing to revise his own beliefs based on the facts presented. This is what science is all about. His questioning did not result in his abandonment of evolution, but rather his embracing a refinement to the original theory which was a better explanation of the existing facts.

Argument #4

In Snyder's fourth argument, he brings a quote from the well known author and paleontologist Stephen Jay Gould. [2] I didn't have to go to Google to find out who this guy is. I recall having read several of his books, and I think I still have a copy of The Panda's Thumb in one of my piles of books.

Snyder quotes Gould as having said the following in 1980:

The absence of fossil evidence for intermediary stages between major transitions in organic design, indeed our inability, even in our imagination, to construct functional intermediates in many cases, has been a persistent and nagging problem for gradualistic accounts of evolution.

Once again, I find myself a bit skeptical that such a strong advocate of the science of evolution would have been found saying something which appears to completely contradict the whole idea of evolution. Is there another explanation?

Note that Gould does not say "persistent and nagging problem for accounts of evolution". The word "gradualistic" is stuck in there. What could this possibly mean?

Gould's quote was taken out of context. Gould was not saying that evolution is false, but was arguing for a refinement to the theory of evolution. Don Batten (who Snyder references) does give a reasonable explanation for the quote from Gould:

Recognizing the non-gradualist nature of the fossil record, in 1972 Gould and Eldredge published a radical new theory of evolution that supposedly fitted the observations of the fossil record. They described the fossil record as representing long periods of equilibrium or stasis (things staying much the same), which are punctuated by the relatively sudden appearance of new forms. Hence they dubbed their new theory ‘punctuated equilibrium’ (PE).

This explanation actually fits quite well with an explanation from an eminent blogger who was summarizing a book by Stephen Jay Gould. I understand it was a book about pandas that the blogger found in a pile of books he had somewhere or other. I quote from the blog:

[Gould] argues that, while [the lack of missing links] could be explained by our sparse sampling of the geologic record, the lack of evidence points to our misconception about the evolutionary process. He claims that evolution is not always a gradual process, but that new species are created only when evolution occurs in spurts.

So... argument 4 is an example of quote mining, that is, sifting through to find a small snippet and then presenting it out of context. It is also an example of a fundamental misunderstanding of evolution. Here I get to the point of the blog I referred to earlier. Evolution may sometimes be a very gradual process, but oftentimes evolution is revolution.

Argument #5

Snyder brings yet another paleontologist to the stand. In this case it is Stephen M. Stanley of Johns Hopkins University [3], who is quoted to have said the following in 1981:

In fact, the fossil record does not convincingly document a single transition from one species to another.

Here we have another case of quote mining. The full context of this comment is that Stanley was not referring to the whole of the fossil record, just the Bighorn Basin. For the full quote, see section 8 on this web page.

Summary so far

So, Snyder's first argument was just plain incorrect. His quote in the second argument is 155 years old so it hardly can be taken to describe the most recent advances. The next three quotes (the newest of which is 35 years old) were taken out of context. In addition, Snyder is apparently unaware of the refinement to gradual evolution which is called punctuated equilibrium. This was first published in 1972.

Argument 6

The next argument shows a complete lack of understanding of the evolutionary process. Snyder says:

If “evolution” was happening right now, there would be millions of creatures out there with partially developed features and organs. But instead there are none.

Happening right now?  Evolution is happening right now, or at least "right now" on the geologic time scale. The domestication of plants and animals has demonstrated that natural selection can speed evolution along. A more recent example of evolution is the emergence of antibiotic resistant bacteria.

Corn and its distant cousin, teosinte
 
My dog Scrabble and his distant cousin
Wild boar and pig

Here are some additional examples of evolution in action:


I'm sorry, Mr. Snyder. You really should do a little research before making such statements.

Argument #8

Snyder's eighth argument concerns a quote from paleontologist Mark Czarnecki. Snyder says that Czarnecki "once commented on the fact that complex life appears very suddenly in the fossil record…" Unfortunately Snyder never read the quote that Czarnecki followed up with, since the quote from Czarnecki is about intermediate lifeforms, and not about the first lifeforms. So, the quote actually belongs among the first set of quotes about transitional forms.

The quote from Czarnecki may or may not have been taken out of context. I have not been able to find a copy of the article or a longer quote. The quote is apparently from the Canadian magazine MacLean's in 1981 [4]. The magazine is still in existence, but the archives on their website don't go back that far. When I do a Google search with a sequence of words in quotes, the search is unfortunately littered with hits from creationsist's websites that have copy/pasted the quote from somewhere else. Google tells me that there are about 20,000 copy/pastes.

So, I'm sorry... I can't fact check a quote from a little known paleontologist (not even mentioned on Wikipedia) writing in a popular magazine 33 years ago.  

Arguments #7 and #9

Snyder's seventh argument is a short one:

If the theory of evolution was true, we should not see a sudden explosion of fully formed complex life in the fossil record. Instead, that is precisely what we find.

Wisconsin's state fossil

About 500 million years ago, there was a sudden jump in the diversity and complexity found in the fossil record. When I say "sudden", what I really mean is "over a period of ten million years". For his ninth argument, Snyder brought out a quote from none other than Richard Dawkins. Dawkins is a well known atheist and adversary of creationism. Here is what Dawkins says about the Cambrian explosion:

It is as though they [fossils] were just planted there, without any evolutionary history. Needless to say this appearance of sudden planting has delighted creationists. Both schools of thought (Punctuationists and Gradualists) despise so-called scientific creationists equally, and both agree that the major gaps are real, that they are true imperfections in the fossil record. The only alternative explanation of the sudden appearance of so many complex animal types in the Cambrian era is divine creation and both reject this alternative.

Or at least that is what Snyder claims that Dawkins said. The quote above is an example of blatant and irresponsible misquotation. Snyder left out the ellipses just after "delighted creationists". This omission hides the fact that Dawkins offered one explanation for this sudden appearance. Here is the part that was elided (I added the bolding):

Evolutionists of all stripes believe, however, that this really does represent a very large gap in the fossil record, a gap that is simply due to the fact that, for some reason, very few fossils have lasted from periods before about 600 million years ago. One good reason might be that many of these animals had only soft parts to their bodies: no shells or bones to fossilize. If you are a creationist you may think that this is special pleading. My point here is that, when we are talking about gaps of this magnitude, there is no difference whatever in the interpretations of 'punctuationists' and 'gradualists'.

I provide the following three quotes to substantiate my claim that a critical part of Dawkins' quote was omitted:

First, this is from the book itself "The Blind Watchmaker".

Second, from Dawkins' book "The Greatest Show on Earth", where he quite rightly complains about being misquoted.

Finally, this is from a website that is devoted to correcting the dishonest quote-mining that has been done in the name of creationism.

I am not suggesting that Snyder is the one responsible for this outright lie. There are about 4,158 other websites which include the unethical misrepresentation of Dawkins' quote. Any one of them may have started this lie [5]. It is likely Snyder is guilty only of irresponsible scholarship. And being too lazy to think.

Summary

I stopped reading Snyder's article at this point. If you have to resort to lying to prove your point, there is no point. Not to mention that fact that Snyder has repeatedly demonstrated his ignorance of evolutionary science.

If there are logical and scientific reasons for evolution to be "a fairy tale for adults", those arguments are not to be found in this article.

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

[1] Imagine the pretense of someone calling himself "the science guy"!  John the Math Guy would never be so self-aggrandizing.

[2] Not that I am keeping track, but this is the third deceased scientist that Snyder has quoted, Darwin died in 1882, Patterson in 1998, and Gould in 2002.

[3] Dr. Stanley is still alive as I write this. But he did retire in 2005.

[4] What is it with Snyder's pulling up quotes from over 30 year's ago?

[5] I Googled the phrase "sudden planting has delighted creationists. Both schools of thought" including the quotes. Google initially turned up 41 hits. I scrolled to the bottom and clicked on "repeat the search with the omitted results included". It told me there are about 4,160 results. One of these was the legitimate fact checker site about quote mining.


Wednesday, February 5, 2014

A revolutionary idea about revolutions

Nicolaus Copernicus, remember him?  He's the guy who challenged the idea that the Earth is the center of the universe, and that the Sun, the planets and all the stars rotate around it. His book, De revolutionibus orbium coelestium (On the Revolutions of the Heavenly Spheres), published in 1543, put the Sun at the center.

Way back in the 2nd century AD, Ptolemy had published a set of tables and formulas that would allow one to estimate the positions of the planets at any time in the past or future. His book, The Almagest, was indispensable for any astrologer. It's right up there with the Da Vinci Code on the New York Times list.

Copernicus saw the complicated system of circles on circles that Ptolemy had described and said "there's gotta be a better way". He hit on the idea that putting the Sun at the center would eliminate a lot of the complication. He saw this, not just as a computational artifice, but as reality. He developed the theory, he developed the tables, and published it.

One of Coperniucus' early attempts

In his preface to De revolutionibus, Copernicus expressed his fear at being “hissed off the stage” for proposing that the Earth moves. Based on the reaction that the book received, his fears were well founded. Protestant leaders quickly started hissing. The Catholic church took it’s time to respond, but joined the hissing.  There were philosophers on either side, and even the scientists of the day were generally not kind.

Copernicus versus the Bible

Copernicus' book was destined to run afoul of "the authorities", since the whole heliocentric thing ("the Sun in the center with the Earth going around") contradicted a whole lot of verses from the Bible. There are a number of verses that make it clear that the position of the Earth is fixed: 

The world is firmly established; it shall never be moved.
I Chronicles 16:30

[The Lord] has established the world; it shall never be moved.
Psalms 93:1

The world is firmly established; it shall never be moved.
Psalms 96:10

You set the earth on its foundations, so that it shall never be shaken.
Psalms 104:5

And the whole foundation thing -- that the Earth is on some sort of holder -- comes up a lot. We see it in Job 38:4, 2 Samuel 22:16, Psalms 18:15, Psalms 82:5, Proverbs 8:29, Isaiah 24:18, Isaiah 40:21, Isaiah 48:13, Isaiah 51:13 and 16, Ecclesiastes 10:16, Ecclesiastes 16:10, Jeremiah 31:37, Micah 6:2, Zechariah 12:1, Mathew 13:35, and Mathew 25:34. Now, being a math guy, I'm not so good at counting, but I think there are almost 20 places where the Bible tells me that there is something physically holding up the Earth.
Actual satellite image of the Earth on it's foundation

Other verses in the Bible state that the Sun is the one that is doing all the moving:

In the heavens he has set a tent for the sun, which comes out like a bridegroom from his wedding canopy, and like a strong man runs its course with joy. Its rising is from the end of the heavens, and its circuit to the end of them; and nothing is hidden from its heat.
Psalm 19:4 - 6

The sun rises and the sun goes down, and hurries to the place where it rises.
Ecclesiastes 1:5

On the day when the Lord gave the Amorites over to the Israelites, Joshua spoke to the Lord; and he said in the sight of Israel, ‘Sun, stand still at Gibeon, and Moon, in the valley of Aijalon.’  And the sun stood still, and the moon stopped, until the nation took vengeance on their enemies. Is this not written in the Book of Jashar? The sun stopped in mid-heaven, and did not hurry to set for about a whole day.
Joshua 10:12-13

So, I think it's pretty clear. If you take these verses literally, then heliocentricity is just dumb.

Reaction from the religious sector - Protestant

The Protestant religious leaders seem to unanimously regard Copernicus as sacrilegious. Andreas Osiander was the Lutheran minister who supervised the printing of De Revolutionibus. Osiander felt compelled to put his own spin on the book, just to make it clear that the Earth doesn't spin. He added a forward that made it clear that taking the Earth away from the center of the universe was just an artifice used to make calculations of the positions of the planets easier:
  
For these hypotheses need not be true nor even probable. On the contrary, if they provide a calculus consistent with the observations, that alone is enough.

Copernicus' Revolutionibus and Kesey's Revolution Bus

As another example, Martin Luther, who led the Protestant Reformation, had this to say about Copernicus (1539):

[Copernicus] wishes the turn the whole of astronomy upside down. But I believe in the Holy Scripture, since Joshua ordered the Sun, not the earth to stand still.

Melanchthon was a close friend of Luther’s, and his comrade in arms in the protestant revolution. He wrote the following in 1549:

The eyes are witnesses that the heavens revolve in the space of twenty-four hours. But certain men, either from the love of novelty, or to make a display of ingenuity, have concluded that the Earth moves; and they maintain that neither the eighth sphere nor the Sun revolves. … Now, it is a want of honesty and decency to assert such notions publicly, and the example is pernicious. It is the part of a good mind to accept the truth as revealed by God and to acquiesce in it.

John Calvin, another protestant reformer was equally disdainful in 1554. He was reported to have said

Who will venture to place the authority of Copernicus above that of the Holy Spirit?

That’s what Calvin was supposed to have said, anyway. He probably never said it. Just someone said that he said it.

Reaction from the religious sector - Catholic

Originally, the Catholic church was receptive to Copernicus' idea and urged him to complete the tables and get the book published. But this excitement waned after the book came out. The Catholic church felt threatened by the Protestants, but not nearly so much as they felt threatened by a heliocentric universe. Pope Paul V (1616) was pretty clear in his denouncement:

[The Copernican theory is] more scandalous, more detestable, and more pernicious to Christianity than any contained in the books of Calvin, Luther and of all other heretics put together.

Cardinal Bellarmine was quite succinct:

[The Copernican theory is] false and altogether opposed to Scripture.

Pope Paul V placed De Revolutionibus on the Index of Forbidden Books in 1616. A Catholic faced excommunication for reading this seditious work. The pope did make a revised version of the book available, however. The revised version of the Revolutionibus was careful to state that this was all just a hypothesis.
Books can be used for enlightenment

... and from the philosophers

Even the philosophers weren't all that tight with Copernicus's revolutionary idea about revolutions. In 1597, the philosopher Jean Bodin ridiculed Copernicus:

No one in his senses, or imbued with the slightest knowledge of physics, will ever think that the Earth, heavy and unwieldy from its own weight and mass, staggers up and down around its center and that of the Sun; for at the slightest jar of the Earth, we would see cities and fortresses, towns and mountains thrown down.

Pierre Gassendi, who we have to thank for the phrase "aurora borealis", was a bit more encouraging. He held that the Copernican system was an interesting hypothesis, but lamented that it was inconsistent with scripture.

The poet John Donne was also encouraging. In his satirical book Ignatius His Conclave (1611), he has Copernicus pounding at the gates of Hell, and yelling to Lucifer to be admitted. 

... and lastly, from the scientists

Copernicus was originally not well accepted among the astronomers, either. The most prominent astronomer of the time, Tycho Brahe, obstinately held on to his own model of the universe. The Tycho universe has the Sun, the Moon, and the stars all going round a fixed Earth, but the planets all make their way around the Sun.
Tycho Brahe doing something scientific on some sort of scientific thing

Thomas Blundeville, an English astronomer was one of the more positive of the astronomers:

Copernicus… affirmeth that the Earth turneth about and that the Sun standeth still in the midst of the heavens, by the help of which false supposition he hath made truer demonstrations of the motions and revolutions of the celestial spheres, than ever were made before.

Christopher Clavius, a contemporary of Galileo, was known in his day as one of the most revered astronomers. Today, he is known for two things: his steadfast refusal to accept the heliocentric model, and for the irony of having a crater on the Moon named after him. (Clavius did not believe Galileo's account of craters on the moon.)

You will recognize the name Marin Mersenne from the prime numbers that were named after him. This mathematician  published a paper in 1623 that pointed out the difficulties in the Copernican theory.

Descartes (from whom we get the phrase "I think, therefor I am", and "Cartesian coordinates") probably believed in the Copernican theory, but was carefully mute on the subject.

Even Copernicus’ pupils, Georg Joachim Rheticus and Erasmus Reinhold, both adherents to the heliocentric model, were forbid by Wittenberg University to teach Copernicanism.

Adherents to Copernicanism

It is stated by A. R. Hall (The Scientific Revolution 1500 - 1800) that there were only six people in the time between 1543 and 1560 who were adherents to Copernicanism. Among these were the disciple Rheticus, a bishop and a small group of mathematician / astronomers in England including John Dee, Thomas Digges, John Field and Thomas Recorde.

Giordano Bruno was a mystic philosopher who was a forceful advocate of heliocentricity. Bruno was burned at the stake in 1600. There are some accounts that say that he was executed for his Copernican views. While he did raise a ruckus in advocating the Copernican universe, there were more serious heresies that were his downfall.

Bruno preached that the universe is infinite, whereas, Copernicus had firmly held to the Aristotelian notion of a finite sphere of stars. But, the Copernican view falls out quite naturally from an infinite universe, since an infinite universe can have no center; and thus no special place for the Earth. Another consequence of an infinite universe is that there would be an infinite number of worlds just like the Earth, some of which may have people!

The displacement of the Earth from the center of the universe was difficult enough for the Church to accept, since it diminished the glory of Man. The idea that there are other children of God was just too much to take. 

Galileo was another early adherent to Copernicus' idea of placing the Sun at the center. His persecution by the Catholic Church is grist for another blog post.
"We shall sell no doctrines about heliocentricity before their time." [1]

A Preponderance of evidence

Speaking of Galileo, he built a telescope and pointed it into the skies. There he saw that Venus had phases, much like the phases we see of the moon. Whether this contradicts the Ptolemaic model is confusing, but it does show that Venus does not produce its own light. This in itself was heresy, just like Galileo's report of craters on the moon.

The next person to bring forth evidence against geocentricity was Kepler. He developed a set of three laws that pretty much require a heliocentric view of our dear solar system. The path of Mars, for example, is very neatly described as an ellipse instead of the complicated Spirograph curve of Ptolemy.

A Do-It-Yourself Ptolemaic Universe Kit

And then came Newton and his great colligation [2]. Newton brought together the laws of physics, the art of calculus, Kepler's laws and this new concept, the inverse square law of gravity, to describe the motions of the planets. A beautiful thing it was. Alexander Pope penned this epitaph for Newton:

"Nature and Nature’s laws lay hid in night;
God said Let Newton be! and all was light."

And yet... 

There are still some religious naysayers:

"This site is devoted to the historical relationship between the Bible and astronomy. It assumes that whenever the two are at variance, it is always astronomy—that is, our "reading" of the "Book of Nature," not our reading of the Holy Bible—that is wrong."
http://www.geocentricity.com/

"Observation and correct mathematics have proven geocentricity - that the earth is the center of the universe, with the sun revolving around the earth once each day."
http://www.genesis-creation-proof.com/geocentricity.html

"Many attempts were made to prove that heliocentricity was true and geocentricity was false, right up until the early 1900's. All such attempts were unsuccessful."
http://www.icr.org/article/geocentricity-creation/

"Dr Walter van der Kamp ... decided to examine the scientific evidence that the earth is not, indeed stationary at the centre of the universe. Perhaps to his surprise he found none. He found only flawed reasoning and experimental failure."
http://reformation.edu/scripture-science-stott/geo/index.htm


I have a simple message for you guys. You have a choice between giving up the notion that every single word in the Bible must be treated as literal fact, or giving up all the beautiful physics that has occurred since the time of Galileo.

------------------------
[1] For those who didn't catch this, the image at the left is Galileo. At the right is Orson Welles, who made a commercial for Paul Masson in which he said in a very Orson Wellesian voice "We will serve no wine before its time". Too bad it wasn't Gallo-leo wine.

[2] Colligation means "to subsume (isolated facts) under a general concept". Here are a few other definitions:

"Colligation, according to Whewell, is the mental operation of bringing together a number of empirical facts by “superinducing” upon them a conception which unites the facts and renders them capable of being expressed by a general law."
http://plato.stanford.edu/entries/whewell/

"The ancient Greek, Ptolemy developed a set of equations that could be used to predict the positions of the planets at any time. The equations were based on a lot of wrong assumptions like the Earth is in the center, and all the rest of the celestial bodies move in circles that revolved around circles. The model worked, at least to an extent.

"A millennium or so later, Copernicus decided that the Sun belonged at the center. (I hope everyone celebrated his birthday yesterday?) Then Kepler came along and decided that ellipses made the whole thing simpler, and then Newton provided the big colligation. The inverse square law of gravity was the grand unifying theory that explained the whole enchilada."
http://johnthemathguy.blogspot.com/2013/02/followup-to-spectrophotometric-romance.html






Wednesday, January 29, 2014

Gee whiz, it's cold!

A friend posted on Facebook something to the effect that the temperature outside had risen from 2 degrees all the way up to 4. Being a mathematician and a smart ass, my natural response was to say that it is twice as warm. You can only imagine the intense ripples of laughter as this comment echoed through the facebookiverse!

For all the silliness of my statement, there is something of a serious question buried in there. What does it mean to be twice as hot?

Let's review the original question, but in Celsius. 2 degrees F is -16.67 degrees C, and 4 degrees F is -15.56 degrees C. So... If I take the ratio in Celsius, I get 0.93. If I do the computation in Celsius, then 4 degrees F is 0.93 times as hot as 2 degrees F. That's just silly.

The problem is that both the Fahrenheit and Celsius scales are offset. Zero is not zero, so to speak. More precisely, zero thermal energy does not occur at 0 degrees F, or at 0 degrees C for that matter. Zero thermal energy occurs at absolute zero, which is -459.67 degrees F or -273.15 degrees C. At that point, there is no thermal energy.

So, let's repeat the computation. 2 degrees F is 461.67 degrees above absolute zero. 4 degrees F is 463.67 degrees above absolute zero. The ratio is now 1.004. Thus 4 degrees F is 0.4% hotter than 2 degrees F. It has 0.4% more thermal energy.

But then, I got thinking about it some more. The difference between 2 and 4 degrees F pretty minimal. I might not even notice it. Being from Wisconsin, I would wear a tee shirt, shorts and sandals at either temperature. While drinking a beer named after a cow.
A real Wisconsin drink for when it gets above 2 degrees F

But there is a big difference between 2 degrees and 32 degrees. At 32 degrees F, I would typically start sweating profusely. But according to the previous formula, I would divide 491.67 (32 degrees F) by 461.67, to get 1.065. 32 degrees F has only 6.5% more heat than 2 degrees F. Now that just doesn't seem right!

Then I remembered something that my buddy Jean-Baptiste Fourier told me. The rate of flow of heat is proportional to the difference in temperature. Like, if I set my thermostat to 20 degrees above the outdoor temperature, my gas bill will be twice as high than if I set it to 10 degrees above the outdoor temperature.
Winner of the 1819 Green Bay Flyfishing contest
and author of "Théorie analytique de la chaleur"
  
Let's say that my thermostat is set to a greedy 72 degrees F. When the outside temp is 2 degrees F, the temperature differential is 70 degrees. When it is a tropical 32 degrees F, the differential is only 40 degrees F. The house will loose heat 70 / 40 times as fast at the lower temperature. In other words, for a house at 72 degrees F, 2 degrees is 1.75 times as cold as 32 degrees F. That is more or less the difference I would expect to see in heating bills.

And if I compare 4 degrees F to 2 degrees F?  If I set the thermostat to 68 degrees F, then the ratio (68 - 2) / (68 - 4) is the answer. In terms of the utility bill, 4 degrees F is 3% warmer than 2 degrees F.

I have three answers so far:

1. If I just do dumb arithmetic, then 4 degrees F is twice as warm as 2 degrees F .
2. If we look at the total amount of heat energy, then 4 degrees F is 0.3% hotter than 2 degrees F.
3. My utility bill says that 4 degrees F is 3% warmer than 2 degrees F.

Of course, there is one other way to look at it. How cold does it feel?

I would be tempted to start with the temperature differential thing, but I am not sure what to use for the temperature of skin. My hands are pretty much always warmer than my wife's hands. Now think this through carefully... When we are outside making snowmen, the temperature differential between my skin and the cold air is thus bigger than her own temperature differential. So, it follows that it is colder out for me than it is for her.

I really don't know why she is always the one complaining that we need to move to California. 

Wednesday, December 18, 2013

76 shades of gray, part 1

The book got it wrong. E. L. James missed 26 of the shades of gray. And the CIE?  You know, the International Commission on Illumination, the good folks who brought you CIELAB? They got too many shades. In 1976, they said that there are 100 shades of gray. The truth lies somewhere in the middle, almost exactly in the middle. There are 76 shades of gray.

The book that everyone has read, but none will admit to reading
The plot

I am gonna do a little gedanken here. Gedanken is the German word for "thought", which is something Germans are pretty good at. When I use this word, I refer to a "thought experiment". Thought experiments are ones that occur just inside your head. Generally, gedankens are cheaper than super-colliders and NASA probes.

Suppose I were to start with a bucket of white paint and a bucket of black paint. Let's just pretend that the white paint is absolutely the purest, brightest white that is possible. Driven snow and all that. And let's just say that the black paint is panther-drinking-double-espresso-in-a-coal-mine-at-midnight black. Remember, this is a gedanken so I am allowed to use paints made of non-obtanium.

I start by painting one little tile with the white paint, and another with the black paint. Oh, did I mention? I also have an unlimited stock of little tiles along with my impossibly white and black paint.

Next I fill a cup with the black paint and add one tiny drop of white paint. I mix this up, and use it to paint another tile. Can I tell the difference between the black tile and the one-drop-of-white black tile? Probably not. But with the infinite patience that I am only capable of in a thought experiment, I do this exercise one drop of white paint at a time until I can just barely tell the difference between the black and the slightly contaminated black. I discard all the in between tiles, so that I now have three tiles: pure white, pure black, and almost pure black.

Now, with the infinity squared patience that I am only capable of imagining in a gedanken, I continuing adding white paint, one drop at a time, saving out those tiles that are just noticeably different from the ones I already have. When I reach the stage of a tile that is so white as to be indistiguishable from the pure-as-the-driven-snow white, I stretch my back and put away my paints. After all this, how many tiles do I have? In other words, how many shades of gray are there?

A few of the gray tiles from my collection

I did this, and came up with 76 shades, including pure white and pure black. Well, I didn't actually do the physical experiment. To be perfectly honest, I got bored before I even finished the gedanken. I asked my computer to do that for me. It didn't seem to mind. Of course, I did notice that my computer didn't get me a birthday present this year. Maybe I'm just reading too much into that. I'm sure that there will be a great big package under the Christmas tree with a tag signed "With love from John's Laptop".

Details please?

Let me put a little more meat on that turkey. The CIEDE2000 [1] color difference between L*a*b* = {0, 0, 0} and (1, 0, 0) is 0.575. That means if I add just enough white to my pure black to bring the L* up to 1, then the color difference is 57.5% of a "just noticeable difference". It would follow, then, that I need a bit larger jump to make it noticeable, like almost twice as big. As a second guess, I take 1 / 0.575, which is 1.739, and that comes out pretty close. A few more interations, and I get L* = 1.734. If I believe in CIEDE2000, then this L* value is just noticeably lighter than pure black.

I can repeat this process. L* = 3.442 is just noticeably lighter than L* of 1.734. The sequence goes: 0.000, 1.734, 3.442, 5.124, 6.782, 8.814, ...

Plot of the 76 just noticeably different gray values

The plot above is getting dangerously close to something that is dangerously interesting. If we look at it correctly, it is one dimension of a uniform color space (UCS). To explain what that means, let me start by giving an example of a not-so-uniform color space: CIELAB. As I explained in my post What difference does it make, the perceptible size of a unit step in CIELAB varies depending on where you are.

Here's what we have to do to make a UCS from the plot above. In the graph above, the y axis is the L* values, going from 0 to 100. The x axis is just the count, that is, the first L* value in the list, the second L* value, the third, and so on. Let's give the x axis a name: L00, meaning an L* like thingie that is based on CIEDE2000.

What do I mean when I say it is based on CIEDE2000?  By definition, the difference between L00 of 47 and L00 of 48 is 1.0 Î”E00. By extension, the difference between L00 of 43 and L00 of 53 is 10.0 Î”E00. Once you have created the magic look up table, the complicated formula for computing CIEDE2000 is gone.

I have zoomed in on the graph above to illustrate finding L00 and computing a color difference. We can determine the L00 value of 35, by tracing along the red line from the y xis at 35, over to the curve, and then down to the x axis to get an L00 of approximately 24. Similarly the blue line tells us that an L* of 41 is about an L00 value of 29.

If I want to compute the color difference between the two L* values 35 and 42, then you take the difference between their respective L00 values: 29 in 24 is 5 Î”E00.

Computing CIEDE2000 with a nomograph

This provides a way to compute CIEDE2000 without going to the ugly formula [2]. This in itself is perhaps convenient, but not really all that exciting. The thing that is a tiny bit exciting is that this method allows us to get around the warranty for calculation of CIEDE2000. We can compute the color difference when  Î”Eab is greater than 5.0.

I know that you are excited, and are fixing to send me an email to ask for a spreadsheet with this lookup table, but hold off until the second part of this post, in which I unveil a simple formula to do the L* part of the CIEDE2000 calculation.

---------------------
[1] Wondering about CIEDE2000? Visit a previous post of mine.

[2] Caveat - this only takes the L* value into account. This simple method will not work when a* and b* are involved!

Wednesday, December 4, 2013

Visual accuity and color

As the only John the Math Guy around, you can imagine that I get a lot of questions.  I do. Thousands of questions a month. Normally they start out with "when are you gonna..." and end with "pick up your dirty socks?" or "get home from the bar?" or "fix the door knob?" But every so often, I get a question that isn't a thinly veiled command. Here is an example.

"How does visual perception of sharpness (acutance, resolution, and contrast all considered) vary with color?"

    - if fine marks need to be visually evaluated and black is not an option, what other color is the next best choice?
    - where has an MTF at one frequency vs wavelength plot been published?

    My usual references; Wyzecki and Stiles, Hunt, Zakia and Todd, etc.
    don't seem to address this particular issue. A new edition by
    Lambrecht and Woodhouse gets tantalizing close, but their emphasis is
    primarily black and white photography.

    Any suggestions?
Larry

Wow! An intelligent and interesting question! And I think I can provide a decent answer!

I am sure you have noticed that when you look at yellow halftones with the naked eye, you really can't see the dots, even when you can see the color. This fact leads to your question, since it implies that visual acuity somehow depends on wavelength.

The sensors in the eye are either rods or cones. The rods are largely active when old guys like me get up in the middle of the night to go to the bathroom. In normal daylight, these are pretty much saturated, so they don't have much effect on vision.

The cones are the sensors in the eye that are most important under daylight. If I were haughty, I would say something like "under photopic rather than scotopic conditions." And I would likely slip those words into casual conversation whenever possible. Much like ice cream cones, the cones in the eye come in several flavors. Not quite as many as Baskin Robbins, though. There are only three flavors of sensors in our eyes: cherry, mint, and blueberry.


Unretouched photomicrograph of Burt Baskins' retina

Some sadly mistaken people call the sensors in our eyes "red, green, and blue". Real color scientists who don't like ice cream call them L, M, and S for long, medium, and short wavelength. Red, green, and blue are not quite appropriate since the cones don't exactly line up with what we would think of as red, green, and blue. The L cone (the reddish one) overlaps quite a bit with the M cone (the greenish one).

The spectral response of the S, M, and L cones

Here comes the important part. There are more of certain types of cones per square millimeter than there are of others. In the fovea (that's the very central part of the retina in the center of our field of view), only about 5% of the cones are S cones. So... these cones are less tightly packed than others. So... our resolution (visual acuity) is less with the S cones. 

Look at the spectra of yellow ink. 

The reflectance of yellow ink is down at 5% to 10% in the 400 nm to 500 nm range, and close to the reflectance of paper above 500 nm. The S cones are the only cones that are sensitive in this range, so our ability to see yellow halftone dots is because of the sparsity of S cones in the fovea. And that, my friends, is why you can't see yellow halftone dots without a magnifier.

By the way... there is this company called Beta Industries that sells this really cool microscope that illuminates a sample with blue light so that you can look at yellow ink with just your S cones. You can illuminate with red light to see cyan, and green light to see magenta as well. But the really fun one is yellow ink and blue light.

Let's get back to the original question. Clearly yellow would be the worst possible choice for making dots on the paper that are just barely visible. Clearly, black is the best ink. Of the other two, which is preferred?

Generally speaking, there are twice as many M cones as there are L cones, but this varies from individual to individual. This means that, in general, the eye has better visual acuity in the green region of the spectrum, and somewhat less visual acuity in the red.

Let's say we are considering what is going on in the green region of the spectrum, from 500 nm to roughly 600 nm. Which ink shows the most contrast against white?  In other words, which ink has the lowest reflectance in this region? If we are limited to the four basic inks, both black and magenta have low reflectance in this region. So, if we want a single ink, then magenta would be the second choice if black is unavailable.

Cyan ink shows a bit of contrast against white in the green region (look at cyan ink under green illumination to see this), but has a fairly decent contrast in the red region. Thus, one would expect that cyan would have decent visual acuity, but not quite so much as the magenta.

But, as I said: 1) there is a wide overlap between the spectral range of the L and M cones, so we can't really think of there being a sharp distinction between L and M in terms of wavelength, and 2) there is quite a bit of variability in the relative number of L and M cones in different people, so one rule may not apply to all people.

If you are allowed a bit larger range of inks, then blue ink would be best, since it has good contrast both in the green and red regions of the spectrum. But if blue is being made by overprinting cyan and magenta inks, then register could cause problems.

One more consideration is the strength of the ink. Obviously, if you print at a higher density, you have better contrast. This would tend to favor black ink over cyan and magenta (which are typically printed at comparable densities), and both would be favored over yellow.

So, all in all, I would go with magenta ink, if all you have available is CMYK. If you have a spot color available, I would go for a dark blue. You can quickly check the contrast by viewing the ink under green illumination.