A recent Ted talk, by Susan Blackmore, discusses the idea of memetics. She offers the best explanation of memetics that I've heard yet, and goes on to make the claim that the idea of evolution (Darwin's) is the best idea anyone ever had. I really have to agree with her: it is a beautifully elegant way to describe an incredibly powerful process. She also lays out a very concise description of the requirements for evolution, which I will paraphrase:
"A system in which information is copied, with variance, followed by selection, must produce evolution."
For clarity, a definition of terms is warrented. Evolution is a universal process, and is not specific to biology, so I'll use the word "unit" rather than "organism" to describe a packet of information, which participates in the evolutionary process. I use the word "population" to describe a collection of units (similar to the idea of "species").
Evolution is the process of adaptation to a selection process. Multiple diverse units, where each is equally adapted to a static selection process, are no more or less evolved with respect to each other. Winners and losers emerge only when the selection process changes, thus "evolving" the population.
Variance means that the information is not copied perfectly, but there is some (low) probability of a small copying error, during each copy operation. If the copying process leads to too high of an error rate, then the new units will be so different from their parents that they will be poorly adapted to the subsequent selection process.
Selection is the process by which units are selected for inclusion in the subsequent population, as a function of their characteristics. The selection process must be slowly time varying with respect to the copying rate of the units, in order for them to adapt. Otherwise, a new set of copies may be adapted to a very different (older) selection process than the one currently in place. A perfectly static selection process (one which does not change over time) will not result in evolution. The units will adapt to it, and then will remain equally adapted from then on. Their information may appear to change over time, due to the gradual accumulation of copying errors, but they will remain equally adapted to the selection process. A biologist might say that this is an example where the genotype varies, but produces a static phenotype. Of course, there may be instances where multiple phenotypes are equally adapted to a given selection process, but that's more detail than I want to get into. Periods of selection stasis lead to the accumulation of variance. If the selection process suddenly changes, a population's variance gives it the resources to quickly adapt to the new selection process, thus squeezing it through the "evolutionary bottleneck". The absence of sufficient variance, in such a scenario, results in extinction.
This blog is devoted to everything under the sun, minus the things that don't interest me, such as pop culture, pseudo-science, superstition, and other wastes of time. Attempting to group this blog under a neat little classification, like "science" or "politics", will prove to be an act of futility. You have been warned.
Saturday, December 20, 2008
Friday, December 12, 2008
P vs NP for dummies
One of the "great" outstanding problems in computer science is the question of P vs NP. In layman's terms, P represents all problems whose solution can be found in polynomial time. NP represents all problems whose solutions can be verified in polynomial time. Polynomial time just means that the time to find the solution has a polynomial relationship with the size of the problem. For instance, a particularly terrible sorting algorithm may take n^2 seconds to sort an arbitrary list of names, where n is the number of names in the list. This is a second-order polynomial of the form a+b*n+c*n^2, where a = b = 0, and c = 1.
The question, does N = NP? asks whether all problems which can be solved in polynomial time, can also be verified in polynomial time. Back to the list sorting example, verifying that a list is indeed sorted properly may only take n seconds, so this is also polynomial. In this single example, the problem was solvable in polynomial time, and its solution was verified in polynomial time.
For further reading, take a look at Wikipedia's entry on this topic. It also addresses the topics of NP-hard and NP-complete.
The question, does N = NP? asks whether all problems which can be solved in polynomial time, can also be verified in polynomial time. Back to the list sorting example, verifying that a list is indeed sorted properly may only take n seconds, so this is also polynomial. In this single example, the problem was solvable in polynomial time, and its solution was verified in polynomial time.
For further reading, take a look at Wikipedia's entry on this topic. It also addresses the topics of NP-hard and NP-complete.
Tuesday, December 9, 2008
Crap is King
I've heard this song many times, but tonight was the first time I truly listened to it. I never realized it was a critique of mass media, specifically, journalism. Due to mass-media consolidation, it isn't too often that you hear lyrics these days which criticize such powerful institutions. I hope that the internet can one day support a fluorishing "ecosystem" of musical expression, where critical messages can be conveyed un-molested by the powers that be. Recent legislation has been preventing this from happening, and I'm uncertain as to the potential of current movements to enact any meaningful change.
Saturday, November 22, 2008
Bash Tab Completion
For all you Linux users out there, I just discovered something wonderfully useful at the Bash command line: tab completion suggestions. See this pic to get a better idea what I'm talking about:

For the above example, I typed "to", then hit the "tab" key. As expected, my computer beeped, indicating "hey, dummy there are a bunch of matches, how am I supposed to figure out which one you want?". To get a list of the possible matches, hit the "tab" key again. Then it prints out all of the available choices. Why hadn't I discovered this sooner?
Oh, and if you think my custom cursor is nifty, here's the line of code to put in your ~/.bashrc file:
PS1='\n================================\n\[\033[01;32m\]\h\[\033[00m\]:\n \[\033[01;34m\]\w\[\033[00m\]\n > '
I like having a nice separation between command outputs. It also gives me a double-clickable path (for quick copying), I never have to type "pwd" to remind myself where I am, and can quickly see which machine I'm logged into. Uber handy.

For the above example, I typed "to", then hit the "tab" key. As expected, my computer beeped, indicating "hey, dummy there are a bunch of matches, how am I supposed to figure out which one you want?". To get a list of the possible matches, hit the "tab" key again. Then it prints out all of the available choices. Why hadn't I discovered this sooner?
Oh, and if you think my custom cursor is nifty, here's the line of code to put in your ~/.bashrc file:
PS1='\n================================\n\[\033[01;32m\]\h\[\033[00m\]:\n \[\033[01;34m\]\w\[\033[00m\]\n > '
I like having a nice separation between command outputs. It also gives me a double-clickable path (for quick copying), I never have to type "pwd" to remind myself where I am, and can quickly see which machine I'm logged into. Uber handy.
Tuesday, November 11, 2008
Election 2008 Probability Analysis
Ok, the results are in. I finally gave up on Missouri, and called it for McCain, since the returns are leaning in that direction. As an interesting little side project, I analyzed the prediction accuracy of www.fivethirtyeight.com vs www.intrade.com by computing the probability of the observed outcome based on the predictions by the two websites. Intrade predicted a 0.19% probability of this election outcome, while 538 predicted a 2.4% probability of this outcome. Note that by "this outcome" I am referring to the state-by-state results. There are a very large number of possible outcomes, and some of them have infinitesimally small probabilities. For instance, all states voting for either candidate would have an extremely low probability. The small probability from Intrade is due to the cascaded probabilities of many estimates which were significantly smaller than 100% (lots of ~90% predictions). Things would look very different if a single one of 538's 100% predictions had gone the other way. The cascaded probabilities would then be 0%, while Intrade's would still be much greater than 0% (Intrade predicted no 0% or 100% outcomes, while 538 predicted many).
Another way to look at the prediction accuracy is simply as a function of the number of correct state outcome predictions. Intrade only missed one (Indiana), while 538 missed two (Indiana and Missouri).
I have not analyzed this from an electoral-vote-weighted perspective. I took the perspective that each state behaves like a weighted coin toss, and each website has its own method for estimating the odds of the result. I simply wanted to understand the accuracy of that prediction, not the accuracy of the composite prediction (the overall winner). The sites themselves gave their predictions for the winner: 538 predicted a 98% probability of an Obama win, while Intrade predicted a 90% probability. If I were to construct a Monte Carlo simulation based on the state-by-state predictions, I'd have very similar results. However, this wouldn't be sufficient to assess the accuracy of the predictions. We'd need many more trials.
In conclusion, although Intrade more accurately predicted the results, it appears that 538 is a more accurate estimator of outcome probabilities.
Another way to look at the prediction accuracy is simply as a function of the number of correct state outcome predictions. Intrade only missed one (Indiana), while 538 missed two (Indiana and Missouri).
I have not analyzed this from an electoral-vote-weighted perspective. I took the perspective that each state behaves like a weighted coin toss, and each website has its own method for estimating the odds of the result. I simply wanted to understand the accuracy of that prediction, not the accuracy of the composite prediction (the overall winner). The sites themselves gave their predictions for the winner: 538 predicted a 98% probability of an Obama win, while Intrade predicted a 90% probability. If I were to construct a Monte Carlo simulation based on the state-by-state predictions, I'd have very similar results. However, this wouldn't be sufficient to assess the accuracy of the predictions. We'd need many more trials.
In conclusion, although Intrade more accurately predicted the results, it appears that 538 is a more accurate estimator of outcome probabilities.
Tuesday, October 7, 2008
When Bad Things Happen to Good Oranges
Check it out, I dun blowed me up some oranges!
How did I do it? I waited till dusk, wrapped a firecracker in saran wrap, then poked a hole in an orange and inserted the firecracker so just the fuse was sticking out. Then, with my camera on a tripod (bulb mode, F8.0, ISO 100), I lit the fuse, opened the shutter, waited for the bang, then closed the shutter. TADA!... a cool photo, using only the light from the firecracker to expose the photograph. I did it three times, and each came out looking cool, but different:


How did I do it? I waited till dusk, wrapped a firecracker in saran wrap, then poked a hole in an orange and inserted the firecracker so just the fuse was sticking out. Then, with my camera on a tripod (bulb mode, F8.0, ISO 100), I lit the fuse, opened the shutter, waited for the bang, then closed the shutter. TADA!... a cool photo, using only the light from the firecracker to expose the photograph. I did it three times, and each came out looking cool, but different:



Saturday, September 27, 2008
The Second Great Depression
To give you an idea of what to look for to know if we have experienced anything similar to the first Great Depression:
August 30, 1929 : Dow @ 382
July 8, 1932 : Dow @ 42
So after ~3 years, the Dow was at ~11% of its peak value.
What would this look like in modern times? The Dow peaked at 14093 on October 12th, 2007. If we experience a similar plummet, then sometime in September of 2010, the Dow would bottom out around 1550.
This gives you an idea of just how bad a "real" depression is. That is an average decline of 6.1% per month. The worst we've seen, since our recent peak of 14093, is about a 3% decline per month, over a 9 month period. Yes, this is quite bad, but it is (so far) only half as bad as the slide experienced during the Great Depression.
It could be worse. A lot worse.
August 30, 1929 : Dow @ 382
July 8, 1932 : Dow @ 42
So after ~3 years, the Dow was at ~11% of its peak value.
What would this look like in modern times? The Dow peaked at 14093 on October 12th, 2007. If we experience a similar plummet, then sometime in September of 2010, the Dow would bottom out around 1550.
This gives you an idea of just how bad a "real" depression is. That is an average decline of 6.1% per month. The worst we've seen, since our recent peak of 14093, is about a 3% decline per month, over a 9 month period. Yes, this is quite bad, but it is (so far) only half as bad as the slide experienced during the Great Depression.
It could be worse. A lot worse.
Subscribe to:
Posts (Atom)