Science

You want to do what with my tax dollars?

In 1961, the world was at war.  The United States and then U.S.S.R. were locked in the dead heat of Mutual Assured Destruction.  In the midst of this silent conflict, great strides were being made in science and technology.  The Russians had beaten us into space; but our nation, captained by JFK, focused and set its sights on a much loftier goal: to put a man on the moon.

On May 25, 1961, as part of a special address to Congress, Kennedy called upon the American people to commit their nation’s wealth to the exploration of space.

First, I believe that this nation should commit itself to achieving the goal, before this decade is out, of landing a man on the moon and returning him safely to the earth. No single space project in this period will be more impressive to mankind, or more important for the long-range exploration of space; and none will be so difficult or expensive to accomplish.

To this end, Kennedy proposed that the Senate commit a staggering volume of tax-payer dollars: $531 million in fiscal year 1962, and an additional $7 to 9 billion over the course of the following five years.

That figure, my friends, was in 1962 dollars. Adjusted for inflation in 2008, that sum would have been equivalent to nearly $67 billion dollars.

In times like our own, figures like these are important, because the goals being set by the Obama administration are long-term and expensive:

  • provide an entire nation of people with access to health care, and boost preventive medicine
  • force the domestic automobile industry to stop producing products that exert a dramatic downward pull upon our economic stability and energy independence
  • pump liquidity and cash into domestic and international economies

That’s a lot of dough to be spent. In fact, one reasonable estimate places the total amount of money “spent, lent, or committed” at about $13 trillion dollars: about 200 times what Kennedy pledged only five decades ago, and roughly equivalent to our GDP.  All told, we’ve actually spent about $2 trillion, which is still roughly 30 times the price tag placed on exploring local space.

Thirteen trillion dollars is such a large amount of money, that it exists somewhere beyond our capacity to relate it to anything and reveal its true magnitude.  So instead of focusing on the actual dollar amount, what we could do is focus on results.

If I lend you a dollar and all you do is buy a candy bar, then I’ve wasted my dollar.  But if with my dollar you buy a pack of seeds, plant a row of tomatoes, and sell the produce for a dollar a pound, I am certain to see a return on my investment.

The greater mission of NASA was to innovate – to use science to benefit mankind.  In it’s 60 year history NASA has filed 6,300 patents, and the technologies it developed have been the basis for many every-day products: scratch-resistant lenses, memory foam, long-distance telecommunications, and one of my favorites – cordless power tools, just to name a few.

History has demonstrated that government spending in the interest of innovation – sometimes known as “meddling” or simply “waste” – doesn’t always end in disaster. I’m not arguing that every dollar spent on my behalf since 2008 has been in my best interest – some of it has definitely been pork.

What I am saying is that sometimes change must be forced.  Unlike an individual’s motivations, our nation is guided by a system.  It has rules and hosts a grand scheme of expectations, some of them more bloated than others. And sometimes the rules must be brought again into balance with the expectations.

Case in point: the domestic auto industry. To date, a combination of free market principals and labor laws have produced a domestic automobile industry that is in the business of producing cars many Americans don’t want and none need.  To compound this problem, their system of production has grown prohibitively expensive and absolutely uncompetitive.

The current global recession, which we began to feel in 2008, was the last coffin nail for two of the Big 3 US automakers.  Although it is not the first time that the Federal Government has gone to the aid of the auto industry, the 2008 bailout and subsequent soft bankruptcy for Chrysler differs both in terms of scale and the accompaniment of public policy that will force the industry to retool.

That public policy to which I refer was announced today: that by 2016, the national standard for fuel economy will be 35.5 MPG.  The estimates as announced by the President himself are that the fuel savings accrued between 2012 and 2016 will be 1.8 billion barrels of crude.

Now, that’s just a fraction of our total consumption (7.5 billion barrels in 2007), and those savings are spread out over four years.  But the policy is a monumentally important step for a couple of reasons.  First and foremost, it capitalizes on the current economic situation.  When times are “good,” change is an irrelevant topic, as no one looks for stability much further beyond the end of the fiscal year.

Second, the new public policy (which will certainly become legislation, if the Democrat-controlled Senate has anything to say about it) is the first policy to set a national standard for fuel economy.  A national standard dramatically reduces the complexity for automakers in manufacturing a scalable product.

So the automakers get to go back to work, and will do so driven to produce the next generation of automobiles. The environmentalists get their reduction in emissions. The green energy proponents get a first step toward an energy-independent United States.  And the world bears witness to a democratic government not afraid to take charge of its economy and society and propel it in the direction it needs to travel.

And all this is possible only because of a willingness to spend when spending made sense.

I can only hope that in the end, I get a tomato, not a lemon.

Calculate the distance between two U.S. zip codes

Every once in a while a Web developer gets the opportunity to use those math skills he honed in college.  (I suppose this is only theoretical, since I didn’t go to college.)

We’re working on a project that calls for restricting search results to those occurring within a fixed distance from a user-supplied zip code.  The premise is simple enough: discover the geographical location of two zip codes and calculate the distance between them.  Of course, there are a few prerequisites:

  • a database of geocoded zip codes
  • a formula for calculating the distance between them

I thought the first resource would be difficult to find, especially considering my budget for this project is exactly $0.  But lo and behold, much to my surprise and delight, the folks over at PopularData.com provide such a resource, and it’s free!  (As well it should be, since it’s probably based on the U.S. Census data collected in 2000 or earlier.)  They claim that the database is mostly complete, except for a few dropouts (most of which, they say, are military stations, and not too useful to our application.)

I had built an application similar to this one in the past, so I knew somewhere someone had written down the formula for calculating the distance.  Remember that it’s not just a simple point to point calculation.  No, that would be too easy.  You see, the Earth is round.  (No, really.)  And the curvature of the Earth increases the distance between two points.  Oh, if only Columbus had been wrong: think of how much gas we’d save!

In fact, the formula for calculating this distance is known as the Haversine formula. You can read more about it, if you wanna; but it basically goes like this (in JavaScript):

var R = 6371; // circumference of the Earth, in kilometers
var dLat = (lat2-lat1).toRad();
var dLon = (lon2-lon1).toRad();
var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(lat1.toRad()) * Math.cos(lat2.toRad()) *
Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c;
copy code

For our application, we basically want a view of our zip code data that represents the set of zip codes within X miles (or kilometers) of a given zip code origin.  We’ll use that view to filter our other records before returning those to the end-user.  To achieve this, I’ve written three MySQL procedures:

  • function km, which performs the calculation between two sets of latitude and longitude coordinates
  • function miles, which relies on km to do the calculation, and then converts the result to miles
  • procedure inside, which accepts two parameters: a zip code origin, and a maximum distance with units (km for kilometers, and mi for miles)

So, to query those zip codes within a ten mile radius of my home, the SQL looks something like this:

CALL inside('22601', '10mi');
copy code

And the results are a bit like this:

"22601",39.1697,-78.1686,"WINCHESTER","VA",0
"22604",39.1676,-78.1686,"WINCHESTER","VA",0.142347455024719
"22655",39.1634,-78.2462,"STEPHENS CITY","VA",4.17041921615601
"22656",39.2137,-78.0901,"STEPHENSON","VA",5.17398071289062
"22602",39.1501,-78.269,"WINCHESTER","VA",5.53605270385742
"22603",39.264,-78.1989,"WINCHESTER","VA",6.70094060897827
"22638",39.2369,-78.2885,"WINCHESTER","VA",7.90875339508057
"22624",39.2719,-78.0998,"CLEAR BROOK","VA",7.94622468948364
"22622",39.2543,-78.0664,"BRUCETOWN","VA",7.98962259292603
"22611",39.1357,-77.9919,"BERRYVILLE","VA",9.72859001159668
copy code

To increase the usefulness of the result set, we sort the results of the stored procedure by their distance from the origin: least to greatest.

I hope this turns out to be as useful for you as it is for us.  If you’d like to get a head start, feel free to download our source files:

Extensively drug-resistant tuberculosis

James Nachtwey’s TED Wish? To inform the world about a potential pandemic.

You can also read about XDRTB on Wikipedia.

I, for one, was not aware that XDRTB was the direct result of the improper administration of the drugs that treat the currable strains of TB.  This makes sense in the same way super bugs could be created through the flushing of all that antibacterial soap into our sewers and waterways: kill the weaker strains, and the bad bugs will flourish.

Through the XDRTB Web site, you can send a form letter to the 2008 candidates for President of the United States.  This approach to exercising our right to the ears of our leaders does work.  Please consider taking a moment to reach out and touch your candidate, whomever he (or she!) may be.

Incidentally, of the words pandemic and epidemic, pandemic is the more serious of the two.

Mystery found in search for inspiration

I’m a big fan of TED.  TED stands for “Technology, Entertainment, Design,” and is an organized effort to unite thinkers and doers with an audience for their ideas.  Some of the ideas are merely interesting, but a few are revolutionary.  And all are staged for the advancement of our species and the improvement of our world.

Once per year, the TED conference awards three “TED Prizes:” $100,000 given to three extraordinary individuals towards the advancement of their revolutionary ideas or TED wishes.  The TED prize also symbolizes the full weight of the TED community, uniting behind the goals of the prize winners.

In 2007, James Nachtwey was one of the three recipients.  A distinguished photojournalist, Nachtwey’s wish was to to receive help from the TED community to gain access to and report on an as of yet untold story with broad implications.  The video at the bottom of this page is Nachtwey’s presentation at the 2007 TED conference in which he exhibits many of his breathtaking (in the horror they convey) photos and makes his “wish.”

The results of his prize are to be announced on Oct. 3, and will be revealed through a series of dramatic venues (like bilboards in Union Square, New York City).  If I had to guess, the subject of his reporting will be the horrors of war, particularly as they relate to our (the United States’) recent wars in Afghanistan and Iraq.  But only time will tell.

Subscribe to Perseverance Trumps Talent