Sunday, January 31, 2010

The Future Atlantes Part I

I made a module to plot locations of where, around the world, there would be the greatest probability of inundation with an onset of rising sea levels.

My simple algorithm:

Select all cities which have Coordinates and Elevation; use those to create a rule with the following format: Coordinates->Elevation (in this part of the code, I highly suggest that you reverse the coordinate points since it's given in (latitude, longitude) or (y, x) when you need (x, y)). Then, create a module which accepts the rule as its one and only parameter.

In the module:
Make the argument and make it a list. Then, using an if statement, assign an empty list to itself except Appended the cities with a sea level of under 10 meters. Else, do Null.

Out of the module:
Map the module with the rules of all cities' Coordinates->Elevation. Then, plot the points on top of the plotted world map (I recommend using the "Polygon" property of CountryData).

The Map:



Credits: CityData[], CountryData[], Map[], Graphics[], FreeQ.

Part II: When I get some more time, I'll post up the final, stunning update!

Wednesday, January 27, 2010

School Life Survey 1

This is a survey I made in order to see if there is any validity in what many adults claim to be correlations in teenagers' social lives. I don't want to show my hypothesis here, but I'll save a page right now of my hypothesis. By the way, there are several questions but I'm going to use them in pairs to find correlations. Also, this is a completely anonymous survey so please respond with all honesty.



Thanks.

Monday, January 25, 2010

The Biofuel Fantasy

The title above links to my final research paper I wrote for a biotech class I took at a nearby community college. It explains the improbability of ethanol as a biofuel. However, nowadays, biofuels are much more probable from what I've read recently, from jatropha to sugar cane; corn is a bygone impossibility since it is a complete loss of food and, well, all that is in the paper.

It's a bit on the long side and it is definitely dry. Enjoy. :)

Global Warming

This is a response to Andrew's "Research: Global Warming Hoax?" from his blog: http://www.path-of-a-songbird.blogspot.com/

Hi Andrew,

Your rhetoric was impressive but I found the opinion you held of global warming alarming to say the least. (And this post is in no way meant to attack you, but rather to challenge your mindset on global warming).

Global warming is a positive feedback loop.
Every degree the world goes up--or even a fraction of a degree--so does the water. This in itself is not so worrisome since, well, a few centimeters can't hurt... But the bigger problem is that ice reflects much sunlight which gives our planet a relatively hospitable clime. Unfortunately, when we lose some ice, then we lose some of that reflecting surface area, which earth's bodies of water are forced to absorb. At first, water temps don't rise that much because of its high specific heat, but with more heating than normal, its temperature still rises, which then causes more ice to melt due to the combined factors of warmer water and the greenhouse effect (I recognize that the greenhouse effect is necessary for human survival, but humans have augmented its deteriorating effects with sulfur dioxide--a byproduct of gasoline combustion--and other forms of pollution like nitrous oxide).

From "HowStuffWorks":
In 1995 the Intergovernmental Panel on Climate Change issued a report which contained various projections of the sea level change by the year 2100. They estimate that the sea will rise 50 centimeters (20 inches) with the lowest estimates at 15 centimeters (6 inches) and the highest at 95 centimeters (37 inches). The rise will come from thermal expansion of the ocean and from melting glaciers and ice sheets. Twenty inches is no small amount -- it could have a big effect on coastal cities, especially during storms.

Also, according to my data, which was much less than yours (I used the WeatherData for 1935 not 1940), out of 20 stations, 19 showed definitive warming and only 1 showed a sort of gradual decline. (BTW, I also used 3650 running average instead of 365 to smooth the graph more). Of course, all this is occurring at a slow rate, but, in relation to the geologic time scale, this is happening in warp speed, and we must act to stop global warming.


Just as Elie Wiesel warned against indifference for the global catastrophe WWII, it too applies to one of the next, global warming.

Now why did I write this? Wiesel also said, “Words can sometimes, in moments of grace, attain the quality of deeds.”
It's because I was too lazy to fight against it so I decided to write against it.

Cheers,

Will

Sunday, January 24, 2010

The Entrepreneur

I've just finished reading "Sure Thing" by Malcolm Gladwell in The New Yorker about entrepreneurs. Completely redefines "entrepreneurial." An entrepreneur, one thinks, would be a gambler, one who takes enormous risks and, with great charisma, pulls off a stunt we'd never have dared to even think about. This is almost never the case, however. Ted Turner, the television mogul who started NBC, seemed like a nonchalant guy who threw money into whatever he wanted, but in actuality, he took the safest bets, and, the one true defining trait of an entrepreneur, had the mindset of a predator. Predators are not gamblers, they like the safest, most successful route, even at a lower profit than by gambling. Sociologists Hongwei Xu and Martin Ruef took a large sample of entrepreneurs and non-entrepreneurs and asked them to choose between: a) a business with a potential profit of 5 million dollars with 20% chance success, b) profit of 2 million dollars with 50% chance success and c) a profit of only 1.25 million but 80% chance of success. Entrepreneurs, the study suggested, were more likely to take the third, safest, lowest potential profit choice. Why? They're predators and "a bird in the hand is better than two in the bush."

Earthy Explorations

My teacher a few weeks back talked about one Economist writer who had noted a positive correlation of latitude to GDP per Capita, so I decided to put the idea to the test (Mathematica has functions which can give data--the most recent, up-to-date data--on all countries who will give it. I hypothesized the same, because when I though about it: Africa and South America suffered much the same at the hands of colonizers; their wealth of resources made them prime targets for the European, resource-depleted powers (in the 19th and 20th century).

My algorithm:

Make a Module assigned to a Function to do this first part, where the variable is a country.

Take the first part of all of the country's coordinates (the latitude). Average it, then take the absolute value (it's quite important to take the absolute value after the summation, since otherwise, places right on the equator, instead of positive and negative latitudes negating each other, would keep adding to each other and give the wrong average latitude). Then, after getting their average, get the country's GDP per Capita. Finally, create for the country its point, {Latitude, GDP per Capita}.

Map all the countries with CountryData[] to the Function, which will take a wee bit long (I had to run it when I went to sleep).

ListPlot[] the points and use Tooltip[] to label each and every point.

Data:


Conclusion: There's definitely some correlation, which supports my previous hypothesis that Latitude and GDP per Capita would correlate. There are a few outliers, obviously, like Greenland which is at the very pole, but has a relatively low GDP per Capita, and Singapore which is near the equator but has a high GDP per Capita.

Credits: Map[], ListPlot[], Tooltip[], Module[], CountryData[]

Language Comparisons

Recently have been comparing languages:

-avg. word length
-longest word
-number of words
-plot of how many words (x) have certain length (y)

My algorithm:

I first assigned a module to a function which took two arguments: the two compared languages.

In the module:
Using DictionaryLookup[], I got all the words (which Mathematica has) in each of the two languages. Inside, I created another function which made rules where it got the length of each word in the language and associated that number with the word (you'll soon see the whole point of that function). Then, I made it print data for the number of words, the average word length, the longest words, and then a plot of words to the length of each word of both languages.

Out of the module:
Using the module I created, I could compare any two languages of Arabic, BrazilianPortuguese, Breton, BritishEnglish, Catalan, Croatian, Danish, Dutch, English, Esperanto, Faroese, Finnish, French, Galician, German, Hebrew, Hindi, Hungarian, IrishGaelic, Italian, Latin, Polish, Portuguese, Russian, ScottishGaelic, Spanish, Swedish simply by typing:

languageComparisons["Portuguese", "Spanish"]

Isn't it tantalizing?

Wolfram Mathematica

I'm assuming that this blog will be devoted primarily to my traverse through Mathematica. I'll be posting up my code and it'll be assumed unless stated otherwise that it's Wolfram Mathematica.