Monday, July 23, 2012

Consumer Math - Unit Cost


The Atlantic has a great article titled The 11 Ways That Consumers Are Hopeless at Math which will be the basis of my blogs this week.

Would you rather get a 33% discount off the price or 33% more product (more coffee, more cereal, etc)?

It turns out these are not the same. When you compare two products it's not enough just to say, product A is cheaper than B. What if B contains twice as much as A but only costs 50% more? Then B is the bargain. The trick to comparing different sizes of the same product is to use UNIT COST, that is dollars per quantity where quantity is some common unit of measurement like cups or pounds.
UNIT COST =  $cost / quantity
Now lets return to the original question. Which is better: a 33% discount or 33% more product?
The 33% discount reduces the top part of unit cost by 1/3 and new unit cost is 2/3 of the old.
The 33% more product  increases the bottom part of unit cost by 1 1/3,  or an increase of 4/3 in the denominator. We invert that number to find the new unit cost is 3/4.   And since fractions are difficult to compare let's convert everything back to percentages:
33% discount means a new unit cost 64% of the old
33% more product means a new unit cost that is 75% of the old
Discount wins!
"This is your brain on shopping, and it's not very smart" - The Atlantic

Labels: , , ,

Thursday, July 12, 2012

Birthday Paradox

Discounting leap-year there are 365 days in a year. If you gather 57 people at random, what are the odds that two of them share a birthday? Doesn't seem very likely since there are 7 times more days in the year than the 57 people so lots of space in the calendar to be unique. And yet the answer is surprising....

The odds are 99% that two people in 57 will share a birthday. This is known as the birthday paradox.

For just 23 people the odds are still 50% of a common birthday.

How can this be?

The math works like this...

Let's calculate what must happen for every birthday to be unique.

Person 1 declares his day. It can be any day and he'll be unique so far.  365/365 = 1
Person 2 declares a day different than person one. He/She has the option of 364 days so the odds are 1 * 354/365 = 99.7 % of no match.
Person 3 has the pick of 353 days.
Person 4 has 352 days available
and so on.

With 23 people the odds of all unique birthdays is
365/356 * 364/356 * 363/356 * 362/356 * ... * 343/356 = 49.2%

The opposite of this, 100% - 49.2% = 50.8%, is the odds of a shared birthday amongst 23 people.

Labels:

Tuesday, July 3, 2012

A real no-where man?

From a letter to the London Times, June 17, 1978:


Some years ago I was bringing a Destroyer home from the Far East and was required to report my position twice a day.


One evening, I saw that we would be passing close to where the Greenwich Meridian cuts the Equator so arranged to arrive there dead on midnight. Once there I altered course to due North and stopped engines so my position signal read:


At 00:00 my position Latitude 00°00′N, Longitude 00°00′E. Course 000°. Speed 0.


I had considered saying I was Nowhere but thought (probably correctly) that Their Lordships would not be amused.

Labels: , ,

Tuesday, June 12, 2012

ZF

My current commuting lecture series is about life in the Medieval Ages and like a Connecticut Yankee in King Author's Court I thought about how I would explain my job (computer programming) to someone Medieval. Instead of describing computers I decided I would call myself a philosopher of algorithms, or meta-thinking about how we think and prove things. This was the core of my university graduate training which then led me to realize how much I've forgotten.

It turns out in mathematics that foundations are really important and the simple concepts we take for granted are not so simple after all. Consider this story, There is a town where the barber shaves every man who does not shave himself. The barber is male. Who shaves the barber?  Think about it....

Mathematically this is equivalent to the set Z which includes all sets that don't include themselves.  Is Z in Z?
Suppose yes. Then by definition Z is not is Z.  Suppose no. Then by definition Z is in Z. Either way you get a contradiction so Z is impossible.

Suppose you argue that it's silly for a set to include itself and ban all such sets. This does not prevent Z described above, the set of all "legal" sets which don't contain themselves. Logicians realized that the problem was with the definition of "set". Just what is a set?

In 1908 Ernst Zermelo proposed a set of rules for defining legal sets. It was revised in 1922 by Abraham Fraenkel. Today we call this the Zermelo-Fraenkel axiomatic set theory or ZF for short.

0 Axiom of Existence. The empty collection is a set.
Optional. Some like this rule, some feel it is not necessary or assumed.

1. Axiom of Extensionality.  Two sets are equal if they have the same elements
Well, duh!

2. Axiom of Regularity or Foundation. For every non-empty set X, there is a member y such that X and y have NO elements in common.
This one sounds weird but it prevents sets from containing themselves. Let A be set. Consider {A} the set containing A. Since A is non-empty and only has one element, by rule 2 {A} and A must be "disjoint" meaning no elements in common. Since A is in {A}, disjoint means A is not in A.

3. Axiom of Regularity  If B is a set and f is a property on elements of B then the collection of elements x of B such that f(x) is true is a set.
Note that this new set is equal to or a subset of B and the role of B as a boundary is vital. The collection of all x such that f(x) is true with no boundary on x need not be a set like Z defined above.

4. Axiom of Pairing  if X and Y are sets then there exists a set containing X and Y
In other words, if X, Y are sets, then so is {X,Y}

5. Axiom of Union.  Let F be a set containing sets. Then there exists a set A that contains all the elements from each set of F.   If F is {B,C} then A = B  U  C with U as the Union symbol

6. Axiom of schema replacement. Given set B and f a function on B. Let Y equal all y such that y = f(x) where x in B. Then Y is a set.
Basically this says a set is not dependent on the symbols or values used. If we map symbols in set B to unique symbols in Y then Y is as set.

7. Axiom of Infinity. Define S(X) =  X U {X} for sets X.  Then there exists a set N such that the empty set is in N and for all Y in N, S(Y) is also in N.
What this means is that the collection of integers is a set. Take the empty set to be zero and define X+1 as S(X). Then N represents the integers 0, 1, 2, ....

8. Axiom of the Power Set. For any set X there is a set Y which contains ALL the subsets of X.
This is an important rule for making bigger sets. If  X = {1,2,3} then the power set of X, the set of all subsets = { {},  {1}, {2}, {3}, {1,2}, {2,3}, {1,3}, {1,2,3} }

Clear as mud? No wonder I did not remember all this from college.

Labels:

Wednesday, March 14, 2012

Happy Pi Day

I would have sworn I'd written about this holiday in the past, but I did not find it while searching.

March 14 (03/14) is Pi Day, in honor of the amazing number pi = 3.1459....

Pi is the ratio of a circle's circumference to its diameter, or in other words a circle is about 3 times around in length as it is across. But not exactly three and that little difference is very important.

In ancient Greece all the cool mathematicians did geometry and tried to accomplish everything with just a straight edge and compass. One goal that had them stumped was creating a square with the same area as a given circle. Since the area of a circle is pi * radius squared, a square with equal area would have sides of length = radius r  * square root (pi).  Today we know that pi and sqrt(pi) are impossible to construct manually.

For 2000 years after the Greeks, pi was only known to 10 decimals. The first major European contribution since Archimedes was made by the German mathematician Ludolph van Ceulen (1540–1610), who used a geometric method to give an estimate of π that is correct to 35 decimal digits. He was so proud of the calculation, which required the greater part of his life, that he had the digits engraved into his tombstone. (wikipedia)

In 1882 Ferdinand von Lindemann proved that pi is transcendental. This means its decimals never repeat, that it cannot be exactly expressed by any fraction and that it can never be created with a finite number of steps from integers or fractions. This is one reason we always refer to it by name or symbol because it can never be written down exactly using numbers like 3 or 3.1 or 3.1.4.

Bottom Line

Enjoy some pie on pi day!

Labels: ,

Wednesday, February 22, 2012

Putting the Cart Before the Horse

Lecture 11 in the course "Argumentation" that I'm listening to as I commute is titled, Moving from Cause to Effect. During an argument you might try to prove B by claiming A is true and that A causes B. This is perfectly valid if A really does cause B but often we're wrong. It could be that A is just a sign  for B. For example a Robin is correlated with Spring but not the cause. It would be wrong to claim spring is occurring in December just because I see a robin. Professor Zarefsky gives five common ways that Cause is misapplied.

1. Has a Correlation been confused with a Cause?
A robin is a sign or correlated with Spring

2. Is there a common cause behind A & B?
Perhaps C causes both A & B so it would be wrong to claim A causes B. It's popular to say guns cause crime but actually criminals cause crime and might use a gun (or a knife, or ...)

3. Post Hoc Fallacy - did B just happen to occur after A?
An example given was a tax cut passed by congress and soon thereafter tax revenue declined. See, we told you so said the opponents, a tax cut caused less taxes gathered. Post Hoc replied the other side, the tax law has not yet gone into effect so it could not have effected revenue, there must be some other cause.

4. Have Cause & Effect been reversed?
Instead of guns causing crime it may be that an upsurge in gun sales is a result of people wanting protection from an increase in local crimes and muggings.

5. Are there significant intervening or counteracting causes?
Reality is rarely as simple as A -> B. Typically there are many different causes for B as well as some causes that mute or cancel B.  'A' might also have many side effects other than B. An example given was that companies want to make the most profit but also have to obey laws and regulations such as environment, equal opportunity, etc. One might argue, Joe can't be incompetent because his company has not fired him. But the company may be afraid of a lawsuit and keeps paying Joe even though he is a waste of money.

Bottom Line

Interesting how something as simple a concept as cause and effect can actually be quite tricky to get right.

Labels: ,

Tuesday, April 5, 2011

Freakomonics

"It ain't necessarily so"
- song from Porgy & Bess

Last week I attended a kickoff meeting for a Science Book Club at the local library. What book was selected as our first read?  SuperFreakonomics, the sequel to Freakonomics. In both books the authors apply numbers to our daily life and come up with some surprising results.

For example, did you know it is 5 to 8 times more dangerous to WALK while drunk than DRIVE while drunk? Yes, there are far more deaths caused by drunk drivers but when you look at the odds of dying per mile traveled, it's much worse for drunk walkers who fall asleep on roads, reckless attempt to cross busy streets, etc.

Another statistic that surprised me was this: in the 1980's during peacetime up to twice as many soldiers died than in the late 2000's with the Iraq war.  How can this be? One obvious reason is:
1. There were more soldiers in the 1980's because Clinton reduced the size of the military by 30% or so.
2. Service men (& women) don't just die in combat.

If you dig deeper into the data you'll discover that the combined military death rate for 1980 and 2007 (peak of Iraq)  are quite similar but that soldiers died for different reasons. The rate of accidental deaths was MUCH higher in the 80's; from a high of 72 soldiers out of 100,000 to a low of 22.5 per 100K in 2010.

In 1980 a soldier was more likely to die of an accident (72/100K) vs the worst of combat (52.7/100K in 2007). In 1980 the death rates for illness and homicide (murdered outside of combat) were also higher than at present. Apparently the discipline of War teaches safety first!

How deadly is modern combat to US soldiers? This is hard to say because most comparisons are not apples to apples. The top killers in the general population, heart attack 204/100K, cancer 187/100K, stroke 45/100K and lung disease 40/100K typically affect people later in life. Most soldier are young and healthy and are less likely to die of illness (10 to 20 out of 100K). So what else kills young adults?  Suicide at 10-17 per 100K. But even worse - traffic accidents (drunk driving & motorcycles) with a crude death rate of 30/100K from ages 15 to 25.

We could conclude that the war in Iraq was, at its worst, 50% more dangerous for young men/women than traveling in a car. Does this mean that war causalities are not so horrific or that young-adult driving is MUCH worse than imagined. No wonder rental car companies are reluctant to rent to college students.

Bottom Line

Life is complicated. Schools and the media do a terrible job of looking at the big picture and sorting fact from fallacy. While many are opposed to war, who do you know that is raising an alarm over teenage and young adult driving? I have to give MADD (Mothers Against Drunk Drivers) credit. They may save more lives than War protesters.

Labels: , ,

Monday, March 14, 2011

Comparing Apples to Oranges

“Our progress as a nation can be no swifter than our progress in education. The human mind is our fundamental resource.”
- John F. Kennedy
I've been closely following events in Wisconsin regarding Governor Walker vs the Public Sector Unions (notably Teachers) but have resisted blogging about it because it's a hot button topic for many people. What did catch my eye that I would like to share is the battle over statistics. Both sides have their talking points and "facts" to back them up. And when "facts" are challenged, neither side is eager to cede the point and admit error. So bad "facts" persist and keep being used in arguments.

A blog post by IowaHawk takes to task Paul Krugman, Nobel Winning Economist, who writes for The New York Times. Krugman wrote,
Only 5 states do not have collective bargaining for educators and have deemed it illegal. Those states and their ranking on ACT/SAT scores are as follows:
South Carolina – 50th
North Carolina – 49th
Georgia – 48th
Texas – 47th
Virginia – 44th
This is very damming evidence and a popular statistic used by pro-Union teachers. But IowaHawk dives deeper into the numbers. He notes that a student's race is a bigger factor on SAT scores than teacher performance.
A state's "average ACT/SAT" is, for all intents and purposes, a proxy for the percent of white people who live there.
Statistically, on average, white students get higher ACT/SAT scores.This has nothing to do with innate ability or genetics or aptitude of individuals. Instead economic differences (poverty), racism, family environment, and other society biases are to blame.

Wisconsin is 4% Black and 4% Hispanic. Texas is 12% black and 30% Hispanic. Since race influences average ACT/SAT scores, to make a fair comparison, students in the two states should be compared by race.

Here are numbers from the National Assessment of Educational Progress (NAEP), an annual standardized test given to 4th and 8th graders around the country to measure proficiency in math, science, and reading.

2009 8th Grade Math
White students: Texas 301, Wisconsin 294 (national 294)
Black students: Texas 272, Wisconsin 254 (national 260)
Hispanic students: Texas 277, Wisconsin 268 (national 260)

There are more stats at IowaHawk for 4th grade & 8th grade Math, Reading and Science but the numbers displayed here are typical. Within racial groups, all Texas students are above the national average and score better than Wisconsin. In Wisconsin the White students perform at or slightly above the national average, Hispanics above the average, and Black students below the average.

So instead of showing that Union Teachers are better, a nationalized 4th/8th grade test shows that Wisconsin produces average White students and poorly scoring Black students. Is this the final answer? Perhaps not. Perhaps a better Statistician will analyze the scores a different way to show something new and revealing.

For example other blogs point out another interesting difference in the SAT scores for Wisconsin vs Texas.
In 2010 Wisconsin placed 3rd in the nation on SAT scores. But only 4% of Wisconsin students took the SAT. This is known as selection bias. When only the best take a test, of course they perform better. 67% of Wisconsin students took the ACT and this dropped Wisconsin to 13th place. Still very, very good but it shows the difference that can occur in ranking depending on which students are tested.  In Texas 53% of all students took the SAT and 30% took the ACT.

Katherine Levin, a College Board spokeswoman for SAT calls comparisons between states "invalid" since the students taking the test are self-selected.
Levin, Feb. 25: Media and others often rank states, districts and schools on the basis of SAT scores despite repeated warnings that such rankings are invalid. The SAT is a strong indicator of trends in the college-bound population, but it should never be used alone for such comparisons because demographics and other nonschool factors can have a strong effect on scores. If ranked, schools and states that encourage students to apply to college may be penalized because scores tend to decline with a rise in percentage of test-takers.
Yet another factor to consider is poverty. Texas ranks 8th in most residents living below the poverty line. Wisconsin is 38th. So instead of saying Union teachers produce better college scores, we could use WI vs TX to prove that rich kids score better than poor kids.

Bottom Line

Beware of any argument based upon comparing "averages" without knowing the population mix behind the average. For example I could compare two colleges and show that students at A are on average shorter than B; so B must be biased against short people. What I don't reveal is that A is an all-girl school and B is not. Since girls are shorter on average than boys, this will pull down the total height average for school A.

Suppose the Ivy League schools argued that they had the most talented professors because their students (on average) get more of the most prestigious and well-paying jobs. The professors would be ignoring the fact that many of the brightest students, and students from the richest and best socially connected families, attend Harvard & Yale. So teaching ability could be just average and yet selection bias and social advantages give the students a preference in hiring. Some Wall Street firms hire ONLY from the Ivy League and look what resulted - a near collapse of the Financial System in 2008.

Update

A report showing it's the student, not the college, that determines success.
http://washingtonexaminer.com/blogs/beltway-confidential/2011/03/more-evidence-going-fancy-college-doesnt-pay

Labels: , , ,

Thursday, February 3, 2011

All things great and small

All things bright and beautiful,
All creatures great and small,
All things wise and wonderful,
The Lord God made them all.
- Cecil Frances Alexander
Recently the Astronomy Picture of the Day website featured a classic science film from the 1960's that is now available on YouTube. http://apod.nasa.gov/apod/ap110201.html  The film is called Powers of 10 and zooms out at a steady pace to show the universe and then zooms in again down to the subatomic level. It's a wonderful thing to watch for a sense of scale.

When watching note the following.

1. It takes many powers of 10 beyond the solar system until the stars in the background begin to move. The empty space between stars is immense.

2. Once the stars do move, we quickly reach the level of galaxy and just another power of ten or so for nearby galaxies. The universe is dense with galaxies.

3. Since the 1960's science has expanded its view of the universe by quite a bit. Today the film could go on for a few more powers of 10 and show the amazing weblike filaments that galaxies form when viewed from far away.

4. On the small scale note the empty space from 10^-9 to 10^-13, from the electron shell to the inner nucleus. The nucleus is like our solar system, busy locally, then a LOT of nothing until we reach the next atom/solar system, at which point things appear crowded again.

Bottom Line

The film notes at the end that it traveled 40 orders of magnitude from quarks to the known universe. How curious that we fall in the middle with approximately 20 powers of 10 below us and above us.

Labels: , , ,

Tuesday, November 23, 2010

Truth is stranger than fiction

“Space flights are merely an escape, a fleeing away from oneself, because it is easier to go to Mars or to the moon than it is to penetrate one's own being” - Carl Jung
Here are two pictures from one of my favorite websites, Astronomy Picture of the Day. What is it about orbiting particles that they flatten out and form a disk? Consider the solar system - the planets, asteroids, and most comets all lie in the same flat plane aligned with the equator of the sun. Why not spin about the sun at all angles? Two other examples are easier to visualize. The rings of Saturn are very thin as show in this photo. Note also the cool shadow of the rings on the planet.



Here's a photo of a distant galaxy that we see exactly on edge instead of the typical view from above with spirals. Observe how thin the galaxy is with a thin ribbon of bright stars.



Bottom Line

In college I studied mathematics up to a Doctoral Candidate level. (I did not complete a thesis, though I tried twice over two years. Both times another university disproved what I was asked to prove by my advisor.)  And yet the hardest "math" classes I attended were physics classes. One class used tensor (i.e. 3-D) calculus to study the curvature of space about black holes. Reality can get very weird when gravity and spinning are combined.

Last night I saw a film clip of the famous physicist, Richard Feynman, who was asked "why" magnets push on each other. He said he could not explain it unless you already had a solid grounding of physics. Not because he was a poor teacher but because the magnetic force is so fundamentally an aspect of the universe that there was nothing to compare it to as an example. One could compare it to the push/pull of the electrical force but physicists now know that magnets and electricity are the same force so this is merely comparing magnets to itself. He could over-simplify and say the force was like rubber bands. But then if you were to ask him why rubber bands snap back he'd have to admit that, at the lowest level, it was the electrical force behind the pull so we're back to explaining in circles.

This reminds me of the conundrum, how do you explain the taste of salt? What can you compare it to? 

Often we paint Science and Religion as opposites but as Feynman observed, science is built upon basic principles, statements of reality that must be accepted in order to work at higher levels of reality. One could think of these principles as a type of "faith". For example, do we really know that quarks exist? By theory they can never be observed in isolation only through their interaction. How different is this from Faith when defined as belief in something unseen (but felt)? Believers will say they have felt the interaction of God.

I was going to appease scientists by saying that Science differs from Religion in that the fundamental principles change over time as we learn more about reality through experiments and observations. We no longer believe that everything is made of earth, fire, air and water. We've moved from a particle theory of atoms to wave-particle duality. There is some evidence that the physical constants of the universe may not be constant after all but change over time or space. Scientists see themselves as willing to change theories when presented with the "facts".

But what is truth? Science, like Religion, can be influenced by majority opinions - is global warming real? If real is it man made? Scientists argue over this just like theologians with conflicting evidence and with as much venom and anger and emotions. Is string theory real? Is the universe 11 dimensions? What exactly is gravity? We don't really know how the universe works at its lowest levels but one can pick a theory and choose to believe it. Much like picking a Church to follow with its own unique rules and explanations for reality.

Labels: , , , , ,

Monday, August 2, 2010

Tax the Rich! Fails again.

Taxation with representation ain't so hot either. ~Gerald Barzan

What a topic today - I get to discuss government, sports and mathematics!

Since April, foreign sports stars competing in Britain have been liable for a top income tax rate of 50%. Now this is unpleasant but it gets even worse. Controversially, the tax is charged not just on the money they earn in Britain but on a proportion of their worldwide sponsorship income.

Many sports stars are voting with their feet and refusing to complete in Britain. The impact is being felt in Olympic type sports like track and field as well as tennis and golf. The organizers of UK sports are asking the government to repeal this tax.

A year ago I wrote about the unintended consequences of raising taxes on the rich,
Actions have consequences. The rich either move or declare a house in another state as their primary residence and the net tax revenue collected declines! The Financial Times reports that the number of Americans giving up their citizenship to protect their families from America’s tax system has jumped rapidly.

The idea that people flee from high taxes is captured in the Laffer Curve; a key part of Reganomics and much criticised by opponents who claim it has been discredited. Actually the stories above show exactly the opposite. It is politicians who are discredited by not understanding the Laffer Curve and negatively impacting the revenue collected with over taxation.

The theory goes like this. When the tax rate is 0%, the tax revenue is zero. Now consider the other extreme; when the tax rate is 100% what happens? Why would anyone work when all the money goes to the government? They'll opt out, collect unemployment, work off the books, use barter, leave the country, or find tax shelters. The end result is very few, if any, will choose to work for non-existent pay and the revenue collected is again zero (or very small).

From calculus you learn that a curve that crosses zero at two points must have a high point, a maximum value. (see image above) To the left of the max, raising taxes increases revenue to the government; but on the right side of the max, raising taxes results in less total revenue.

Bottom Line

Sadly the Laffer Curve is much misunderstood. It does not promise that revenue will always go up when the tax rate falls. It depends on which side of the maximum the current tax rate is. And unfortunately the Laffer Curve does not tell us where that max revenue value is. You have to find it by trial and error to get the perfect tax rate - neither too high nor too low.

http://www.vistech.net/users/rsturge/laffercu.html
http://en.wikipedia.org/wiki/Laffer_curve

Labels: , , ,

Thursday, February 18, 2010

Where the People Live

"An election cannot give a country a firm sense of direction if it has two or more national parties which merely have different names but are as alike in their principles and aims as two peas in the same pod"-Franklin D. Roosevelt

Years ago I worked with an Irish programmer who could not see the difference between the U.S. Republican and Democratic parties. You're crazy I told him and then pointed out the differences as I saw them. Now a decade later I'm less sure that he was wrong. Regardless of who's in office we see the same behavior of graft, corruption, lobbying, and business as usual. Not much changes.

But that is not what I wanted to talk about today. The site http://www.fakeisthenewreal.org/ has published a map for Electoral College reform to avoid the "bucket effect"; i.e. if you win California by just one vote you get all 55 electoral votes of the state. The reform map creates 50 new electoral districts of equal population (5.6 million) - if you win the district, you get that one vote. I do not see this happening. A much easier system is percentage distribution- if you get 55% of the vote you get 55% of the electoral votes. Of course if this happens then there is not much point to the electoral college and you can just use the popular vote to elect.

But once again, I'm off topic. What impressed me about the map is the population distribution within America. Look at how much land is needed to gather 5 million people in the mid-west and mountain west. While California is chopped into 6 zones . It's hard to see on the map, but cities like LA, and San Francisco are huge population zones onto themselves. FakeIsTheNewReal has another graphic comparing relative populations of states - but with a twist. Metropolitan regions are pulled out of each state and included in the comparison on their own merit. The top three US population areas are NY metro, LA metro, and Chicago metro, with the state of Texas taking fourth (after Houston, Dallas, etc are removed). California is fifth and to my surprise, North Carolina is sixth. There must be a lot of people in NC outside of large cities. Sounds pleasantly bucolic.

Bottom Line

While I live in a crowded region of a blue state (NY metro), my roots come from an uncrowded red state (Idaho), so my conservative views are in the minority here. Ironically my father, who has retired to his Idaho home, has become very liberal - making him a minority view there. I believe the reality of the blue-red political maps (metro areas vote liberal, "country" regions vote conservative). I'm just not convinced that either political party is actually representing the views of either red or blue. I also fear that our electoral college system is biased in favor of metropolitan zones. The upper half of NY state is red/conservative/country but is nearly always overwhelmed in votes by the blue NY city region. So blue takes all and the votes from upstate NY have no influence at all at the national level.

Update

The Amazon book review for "In Search of Self-Governance" by Scott W. Rasmussen shares the notion about our two political parties acting too much alike:

"Today, Americans are united. United in the belief that our political system is broken, that politicians are corrupt, and that neither major political party has the answers. Add to this the growing disdain for the unholy alliance between the largest corporations and our government, and there's a lot of frustration festering in our country."

Labels: , , ,

Wednesday, December 30, 2009

World Maps

“A road map always tells you everything except how to refold it”- anon

What’s the “best” way to flatten a globe into a map? This question has haunted Cartographers (map makers) for centuries. The worldview most of us have grown up with is called the Mercator projection from 1569. It has conformal properties that make it perfect for sea voyages by preserving scale and angles for small regions. However there are large distortions near the poles. Greenland and Antarctica are inflated. So are Canada and Russia, making the northern hemisphere continents appear much bigger than the southern.

A different map, the Gall-Peters projection is popular with scholars but not a big seller with the public. James Gall proposed the idea in 1855 of a map which preserves the true size of continents at the expense of their shape. In 1973 Arno Peters created a new version of this projection and popularized the idea that this map corrected for northern bias and displayed the true size of Africa and South America. North America and Europe look so tiny on this map (and rightly so).


The "Dymaxion Map" was created by architect Buckminster Fuller over the years 1927-1954. This map preserves the shape AND size of the continents by cleverly cutting across the oceans. The image shown here uses hundreds of images acquired from the NOAA weather satellites to fill in the continents. Notice how small Greenland is here. (Don't confuse it with the much bigger Arctic ice sheet right next to it!)

Bottom Line

Why bring this up now? Because there is a series of new world maps that look great. See the video Clever folds in a globe give new perspectives on Earth. The "Myriahedral projection" was developed by Jack van Wijk, a computer scientist at the Eindhoven University of Technology in the Netherlands. His algorithm divides the globe's surface into small polygons that are unfolded into a flat map, just as a cube can be unfolded into six squares. Earlier map makers have used this technique with a few dozen polygons (like the "Dymaxion” map above.) van Wijk uses thousands of polygons and a computer to calculate thousands of cut lines based upon parameters like “preserve the continents” or “separate the continents from the ocean as far as possible”. The image shown here was weighted for “preserve the oceans”.

Labels: , , ,

Thursday, December 17, 2009

Mandelbrot Set

“There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy.”- Hamlet

I’ve been a math geek most of my life; for example reading math books for fun in High School. During my college years, the Mandelbrot set was hot (see picture at right). Beautiful images of the set combined Art, Math, and Computer Science. Michigan State held talks on fractals and opened a gallery of images in the Computer department. I attended a Fractal Conference in Providence, Rhode Island. I tweaked computer programs trying to get images to display faster on my Macintosh.

What are fractals? Take a look at the Dow Jones average graph in a newspaper or online. It is a jagged line regardless of the time scacle. The average over decades – jagged; over years – jagged; over days - jagged; over hours – jagged. Time does not smooth it out and it is impossible to guess the time scale by looking at the graphed line. We call this behavior – fractal. Another example is coast lines. The edge of any continent has inlets and protrusions. If you zoom in on the coast you’ll find the pattern repeats with large bays, small bays, local beaches, etc.

Fractals are quite common in nature. In the early days of computer animation, it was easy to create a nature scene – to make a mountain start with a pyramid. Add medium size pyramids at random points, then add smaller pyramids on top of those and so on. After serveral iterations of this the result is quite realistic looking. Trees and rivers and clouds are also fractal. People are NOT fractal – it is very difficult to model humans and get the skin tones right. The movie Toy Story worked so well because the toys did not have to look “alive”.

So what is the Mandelbrot set and why is it such a big deal? After Newton published his laws on Gravity, scientists viewed the Universe as a giant mechanism that could be completely predicted given enough accurate measurements. This view was challenged in the early 20th century. Heisenberg’s Uncertainly Principle said that some measurements are mutually incompatible like speed and position. You can know one accurately but not both. Many scientists refused to accept this and continued to work on creating perfect mathematical models to predict the stock market and weather conditions.

As computers increased in power, researchers noticed two things:

1. There is a lot of positive feedback in the models. A small breeze can start a major storm with the right conditions. This became known as the Butterfly effect. A butterfly flaps its wings and changes the weather across the world.

2. Because of positive feedback, a small measuring error can grow into serious wrong results over time. This is called Sensitivity to Initial Conditions.

Benoît Mandelbrot decided to step away from the complex stock market models he was studying and examine a simple postive feedback loop. His formula was F(n+1) = F(n) ^2 + c which means the new function value F(n+1) is equal to the previous value F(n) squared plus a fixed constant. The first value F(0) is always zero.

Let’s look at some different values for c:
C=0. F(1) = 0^2 + 0 = 0 = F(0) so the values stay at zero forever.
C=1. F(1) = 0^2 + 1 = 1, F(2) = 1^2 + 1 = 2, F(3) = 2^2 + 1 = 5. This sequence grows to infinity.
C= -1. F(1) = 0^2 + -1 = -1, F(2) = (-1)^2 + -1 = 0 = F(0). This series jumps forever between 0 and -1.

Not very exciting so far. What Mandelbrot did next is move the function to two dimensions by using imaginary numbers on the x and y axis of a graph. Each point on the graph represents a value of c = x + i*y. Imaginary numbers are multplied like this (a +bi)^2 = (a^2 – b^2 +2abi). A point c is “in” the Mandelbrot set if the F(n) series does not go to infinity like (1+0i) does. When creating an image of the set on a computer, we can not wait for F(n) to grow to infinity so we pick a cut off point and say if F(n) gets this big then it will go all the way so we can stop computing. A good cutoff point is [a+bi] = sqrt(a^2+b^2) > 1. That means the size of the imaginary number result is greater than one. We also pick a cutoff point for n. Let’s say if F(n) is smaller than one after n=1000 calculations then we assume the number series will stay small forever and c is in our set.

Now we do something clever and artistic. We apply different colors to how fast the sequence built on c grows bigger than one. For example:

F(n) <= 1 after n=1000, color the point c black and consider it in the set F(n) >1 before n=100, color it dark blue
F(n) >1 before n=500, color it lighter blue
F(n) >1 before n=1000, color it white

Wow! A lot of background to describe the picture at the top. Now I’ll explain why this matters. Take a close look at the white fringe on the set. It represents numbers that almost made it in but grew too big just before our cutoff at n=1000. When the border fringe is magnified a thousand times or a billion times, it stays just as lacy or becomes an even more complicated fringe. The border of this set is a fractal that never becomes smooth. The smallest imaginable difference (in say the trillionth decimal place) can change if the series built on C will go to infinity or stay small.

In practicable terms, this means we can never hope for 100% accuracy in our weather and stock models. There will always be “fringe” events where errors smaller than our ability to measure will have huge impact on the results.

Bottom Line

Why bring this up now? One key idea that made the Mandelbrot set possible was placing the constant c in two dimensions as x + yi. For 20 years, scientists have been trying to find a way to extend the set to three dimensions but nothing worked – until this year. Here is a picture of a 3D fractal set. Details can be found at The Mandelbulb: first 'true' 3D image of famous fractal.

Labels: , ,