GEB alternates dialogues and essays on the author's staggering range of fixations and obsessions in which Hofstadter adds his own remarkable insights and comparisons on topics including music, art, mathematics, genetics and philosophy. GEB's sprawling nature follows tangled paths but eventually loops back to the question of intelligence, souls, free will and self-awareness.
The unorthodox structure is what sets the book apart, but the braiding of ideas may lead to a takeaway of: "Ok, that's interesting, and you're clever, but what is the chief takeaway here?"
This is a common criticism which led led Hofstadter to author the psuedo-sequel "I Am a Strange Loop" (which I haven't read), in which he distills his arguments more directly and concisely (and personally -- he imagines a low-resolution "simulation" of his wife's mind within his own after her death).
Anyone who completes GEB comes away with an honorary computer science degree, as there's a heavy focus on computability theory, data and data structures, natural language processing, AI, recursion, memory, hardware, software, all under the guise of philosophy and investigating what gives rise to self-awareness and intelligence.
On top of this, the GEB reader receives an introduction to the art of Escher, Magritte, Bach, John Cage, as well as some basics of neuroscience, boolean logic, zen philosophy, number theory, music theory and molecular biology.
Although the number theory and biology chapters dragged, I was fascinated by the discussion of the Goedel incompleteness proof and the implications it had for the mathematics community at the turn of the century. There is also a fascinating section on AI that starts with Turing tests and pattern recognition and ends with the remarkable conclusion that a truly AI may be terrible at all the things that people may struggle with as well, such as rapid computation or chess playing.
At the least, GEB presents a multitude of ideas and food for thought. At its best, it instills lucid notions of how our minds work and what gives rise to life, language and intelligence.
If you blog it they will come?
Saturday, November 7, 2009
Thursday, September 17, 2009
Zip those lists
A lot of people know about zip() in python but did you know it operates on a variable argument list?
Don't roll your own list transposition functions....
It's also useful for iterating over a couple of related lists:
a = [1,2,3]
b = [4,5,6]
c = [7,8,9]
>>zip(a, b, c)
[(1, 4, 7), (2, 5, 8), (3, 6, 9)]
Don't roll your own list transposition functions....
It's also useful for iterating over a couple of related lists:
for message, email in (messages, emails):
hdrs, body = parse_email(email)
assert message in body
Sunday, August 16, 2009
When a band I like comes to town, I'll know
The List is a comprehensive listing of all the known shows coming to the Bay Area listed by artist and by venue.
There are hundreds of concerts and nearly 1500 bands in the list so I threw together a script to scrape it and intersect those bands with the artists in my iTunes library.
The result is, I now know that these acts are playing in the near future:
The next step is to scrape the concert details as well, use fuzzy matching, run it automatically, and set up alerts.
But this only took 15 minutes to write in python and it would have taken me way longer to parse manually.
EDIT:
Instead of doing a set intersect, I now use difflib to find "close matches." It's slower but still runs start to finish in about 10 seconds, which is fine considering especially that the data changes infrequently.
I also unescape the ampersand in the iTunes xml, and filter out "The " because:
...an exact match preceded by 'the' is penalized more than a suffix. So 'pixies' would match 'pixiestickers' instead of 'the pixies' in the case where I only select the top match (since ideally there's a one-to-one mapping).
Instead of writing my own fuzzy matching algorithm, for now I'll just chop off 'The ' and live with the results. Although some of the matches aren't useful, it does better at finding bands such as ...and you will know us by the trail of dead and The Ting Tings.
There are hundreds of concerts and nearly 1500 bands in the list so I threw together a script to scrape it and intersect those bands with the artists in my iTunes library.
The result is, I now know that these acts are playing in the near future:
atmosphere
bat for lashes
beirut
blink 182
butthole surfers
calexico
cat power
collective soul
dan deacon
deerhoof
deerhunter
dropkick murphys
elvis costello
fever ray
flipper
ghostface killah
girl talk
green day
grizzly bear
in flames
kenny rogers
lil wayne
m.i.a.
mastodon
meat puppets
mirah
modest mouse
mstrkrft
no age
nofx
pearl jam
placebo
porcupine tree
sunny day real estate
tenacious d
thievery corporation
tv on the radio
weezer
yo la tengo
The next step is to scrape the concert details as well, use fuzzy matching, run it automatically, and set up alerts.
But this only took 15 minutes to write in python and it would have taken me way longer to parse manually.
EDIT:
Instead of doing a set intersect, I now use difflib to find "close matches." It's slower but still runs start to finish in about 10 seconds, which is fine considering especially that the data changes infrequently.
I also unescape the ampersand in the iTunes xml, and filter out "The " because:
>>> import difflib
>>> difflib.get_close_matches('foo', ['the foo', 'foods'], n=1)
['foods']
...an exact match preceded by 'the' is penalized more than a suffix. So 'pixies' would match 'pixiestickers' instead of 'the pixies' in the case where I only select the top match (since ideally there's a one-to-one mapping).
Instead of writing my own fuzzy matching algorithm, for now I'll just chop off 'The ' and live with the results. Although some of the matches aren't useful, it does better at finding bands such as ...and you will know us by the trail of dead and The Ting Tings.
Tuesday, August 11, 2009
timsort visualization
This blog post is quite effective at illustrating the timsort algorithm, found in python (and soon java)
Saturday, August 8, 2009
vim zen moment
There comes a certain time in one's life to put aside the variety of editors they might use or sometimes dabble in, and perhaps choose one they like best, or see the most potential with down the road, and work monogamously toward advanced proficiency in this editor, regardless of the bumps in the road or hardships which may provoke longing for other editors along the way.
I've made this commitment to vim recently and I'm still a novice.
But I just had what may be my first true zen moment with the editor!
The problem:
* I needed to fix a single spacing annoyance in a set of over 40 php files.
The solution:
* Open all php files rooted in foo, luckily 90% were all at the same leaf level
* Start recording a macro in register a
* Make edits
* Write changes
* Open next file
* Stop recording
After pressing
I've always wanted to be able to do this sort of thing so easily, but it's elusive or cumbersome with most GUI editors. Many UNIX text munging tools exist too, but it's often easier to take direct route ofshowing the machine what you want, rather than, say, building a DFA.
So, I'm liking the taste of vim kool-aid thus far.
I've made this commitment to vim recently and I'm still a novice.
But I just had what may be my first true zen moment with the editor!
The problem:
* I needed to fix a single spacing annoyance in a set of over 40 php files.
The solution:
* Open all php files rooted in foo, luckily 90% were all at the same leaf level
vim /foo/*/*/*\.php* Start recording a macro in register a
qa* Make edits
[a fair bit of jj and dd and i etc.]* Write changes
:w* Open next file
:bn* Stop recording
qAfter pressing
@a a few times to execute the macro, or :bn if the file could be left alone, I was done.I've always wanted to be able to do this sort of thing so easily, but it's elusive or cumbersome with most GUI editors. Many UNIX text munging tools exist too, but it's often easier to take direct route of
So, I'm liking the taste of vim kool-aid thus far.
Sunday, July 19, 2009
Smack talkin' D.R. Hofstadter delivers sick iceburn on R. Kurzweil
This is a profound interview with Douglas Hofstadter, author of Goedel Escher Bach and I Am a Strange Loop.
Money Quote/Excerpt:
Hopefully you're hooked by now, so read the rest!
Money Quote/Excerpt:
I think Ray Kurzweil is terrified by his own mortality and deeply longs to avoid death. I understand this obsession of his and am even somehow touched by its ferocious intensity, but I think it badly distorts his vision. As I see it, Kurzweil's desperate hopes seriously cloud his scientific objectivity.
...Kurzweil sees technology as progressing so deterministically fast (Moore's Law, etc.) that inevitably, within a few decades, hardware will be so fast and nanotechnology so advanced that things unbelievable to us now will be easily doable. A key element in this whole vision is that no one will need to understand the mind or brain in order to copy a particular human's mind with perfect accuracy, because trillions of tiny “nanobots” will swarm through the bloodstream in the human brain and will report back all the “wiring details” of that particular brain, which at that point constitute a very complex table of data that can be fed into a universal computer program that executes neuron-firings, and presto — that individual's mind has been reinstantiated in an electronic medium...
Rather ironically, this vision totally bypasses the need for cognitive science or AI, because all one needs is the detailed wiring plan of a brain and then it's a piece of cake to copy the brain in other media. And thus, says Kurzweil, we will have achieved immortal souls that live on (and potentially forever) in superfast computational hardware — and Kurzweil sees this happening so soon that he is banking on his own brain being thus “uploaded” into superfast hardware and hence he expects (or at least he loudly proclaims that he expects) to become literally immortal — and not in the way Chopin is quasi-immortal, with just little shards of his soul remaining, but with his whole soul preserved forever.
Well, the problem is that a soul by itself would go crazy; it has to live in a vastly complex world, and it has to cohabit that world with many other souls, commingling with them just as we do here on earth. To be sure, Kurzweil sees those things as no problem, either — we'll have virtual worlds galore, “up there” in Cyberheaven, and of course there will be souls by the barrelful all running on the same hardware. And Kurzweil sees the new software souls as intermingling in all sorts of unanticipated and unimaginable ways.
Well, to me, this “glorious” new world would be the end of humanity as we know it.
Hopefully you're hooked by now, so read the rest!
Thursday, July 16, 2009
Loblaw's law
When you have numbers that are really really really big, you can stop talking about probabilities and start talking about laws.
Statistics are often unintuitive for people, and the Monty Hall Problem is a famous example of that un-intuition in action.
And of course, as humans, we distrust machines. And statistics are, so far, the best tool machines have for imitating humans in areas such as language and vision. How we hate these machines, with their statistics.
Yes, so if you are a human reading this, you may feel a certain amount of smugness knowing that language is a built-in feature for you; you can read an article and comprehend with absolute certainty its key points and discuss it in an intelligent and natural way. Even if a computer were able to analyze the same article, it could only offer up soulless suggestions of meaning with varying degrees of certainty, and with little or no actual intelligence.
But as it turns out, you and I live in a crazy universe not governed by laws so much as statistics.
Mandatory Djikstra quote: The question of whether a computer can think is no more interesting than the question of whether a submarine can swim.
On their own, atoms can be in several possible states, each with varying probabilities, where the most probable state has lowest energy.
With more heat added to a closed system such as a gas, the likelihood that each atom is in a higher energy state increases. Each macro state view of the entire system is equally likely, keeping in mind that particles are coaxed from lower micro energy levels with likelihood directly linked to the work performed on the system. All arrangements of molecules in the container are equally likely and they are all interchangeable with one another.
Now if you were to take each of these equally likely macro energy states and group them in buckets by total energy level of the system, the distribution would produce a bell curve. So, looking at this bell curve, you could state with some amount of certainty the likely range of energy (temperature actually).
EXCEPT, that's not how the universe actually works!!
The contradiction arises because the number of particles is on the order of 10^23.
So there's still a bell curve, but it's not really a curve so much as an extremely tall spike with almost zero width and almost no variance. Temperature and entropy and the first and second "laws" of thermodynamics all work because 10^23 is an enormous, enormous number, and the expected value (the center of the curve) is the only value anyone actually ever experiences.
To illustrate I'll create a law right now, named after a brilliant attorney, called Loblaw's law. Loblaw's law states that it is not possible to flip a (normal) coin 10^23 times and produce only heads each time. You may say, well technically that is still possible, so how can it be a law?
Well, technically it is (sort of) also possible for the entropy of the universe to decrease for a few minutes. Technically, it is also possible that heat could flow from a cold object to a hot object. Technically, a broken egg could assemble itself from the floor and leap back into my hand...blah blah blah, Loblaw's law is a law because these events are so unlikely that it they will never happen.
That's the way it goes with ginormous numbers, and that's why we can call them the laws of thermodyamics, although a better name for the field is actually Statistical Mechanics.
Back to computers, the point is that statistics is a strength, not a weakness of computers which may perform natural language processing, image recognition, or other tasks wherein humans naturally have the upper hand. Feed a somewhat sophisticated AI a few petabytes of salient data and I believe suddenly that Dijkstra quote will ring true.
Statistics are often unintuitive for people, and the Monty Hall Problem is a famous example of that un-intuition in action.
And of course, as humans, we distrust machines. And statistics are, so far, the best tool machines have for imitating humans in areas such as language and vision. How we hate these machines, with their statistics.
Yes, so if you are a human reading this, you may feel a certain amount of smugness knowing that language is a built-in feature for you; you can read an article and comprehend with absolute certainty its key points and discuss it in an intelligent and natural way. Even if a computer were able to analyze the same article, it could only offer up soulless suggestions of meaning with varying degrees of certainty, and with little or no actual intelligence.
But as it turns out, you and I live in a crazy universe not governed by laws so much as statistics.
Mandatory Djikstra quote: The question of whether a computer can think is no more interesting than the question of whether a submarine can swim.
On their own, atoms can be in several possible states, each with varying probabilities, where the most probable state has lowest energy.
With more heat added to a closed system such as a gas, the likelihood that each atom is in a higher energy state increases. Each macro state view of the entire system is equally likely, keeping in mind that particles are coaxed from lower micro energy levels with likelihood directly linked to the work performed on the system. All arrangements of molecules in the container are equally likely and they are all interchangeable with one another.
Now if you were to take each of these equally likely macro energy states and group them in buckets by total energy level of the system, the distribution would produce a bell curve. So, looking at this bell curve, you could state with some amount of certainty the likely range of energy (temperature actually).
EXCEPT, that's not how the universe actually works!!
The contradiction arises because the number of particles is on the order of 10^23.
So there's still a bell curve, but it's not really a curve so much as an extremely tall spike with almost zero width and almost no variance. Temperature and entropy and the first and second "laws" of thermodynamics all work because 10^23 is an enormous, enormous number, and the expected value (the center of the curve) is the only value anyone actually ever experiences.
To illustrate I'll create a law right now, named after a brilliant attorney, called Loblaw's law. Loblaw's law states that it is not possible to flip a (normal) coin 10^23 times and produce only heads each time. You may say, well technically that is still possible, so how can it be a law?
Well, technically it is (sort of) also possible for the entropy of the universe to decrease for a few minutes. Technically, it is also possible that heat could flow from a cold object to a hot object. Technically, a broken egg could assemble itself from the floor and leap back into my hand...blah blah blah, Loblaw's law is a law because these events are so unlikely that it they will never happen.
That's the way it goes with ginormous numbers, and that's why we can call them the laws of thermodyamics, although a better name for the field is actually Statistical Mechanics.
Back to computers, the point is that statistics is a strength, not a weakness of computers which may perform natural language processing, image recognition, or other tasks wherein humans naturally have the upper hand. Feed a somewhat sophisticated AI a few petabytes of salient data and I believe suddenly that Dijkstra quote will ring true.
Subscribe to:
Posts (Atom)