Emile comments on Open Thread: November 2009 - Less Wrong

3 [deleted] 02 November 2009 01:18AM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (539)

You are viewing a single comment's thread. Show more comments above.

Comment author: Emile 03 March 2010 03:28:14PM *  3 points [-]

Yup, Kolmogorov complexity is only concerned with the length of the shortest algorithm. There are other measures (more rarely used, it seems) that take into account things like memory used, or time (number of steps), though I can't remember their name just now.

Note that usually the complexity of X is the size of the program that outputs X exactly, not the program that outputs a lot of things including X. Otherwise you can write a quite short program that outputs, say, all possible ascii texts, and claim that it's size is an upper bound of the complexity of the Bible. Actually, the information needed to generate the Bible is the same as the information to locate the Bible in all those texts.

Example in Python:

chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'+\
'"!#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r'
def iter_strings_of_size(n):
if n <= 0:
yield ''
else:
for string in iter_strings_of_size(n-1):
for char in chars:
yield string + char
def iter_all_strings():
n = 0
while True:
for string in iter_strings_of_size(n):
yield string
n = n + 1
Comment author: Liron 17 March 2010 08:14:58AM 1 point [-]

This has improved my understanding of the Python "yield" statement.

Comment author: Emile 17 March 2010 10:14:43AM 1 point [-]

Glad I could be of use !

Understanding the Power of Yield was a great step forwards for me, afterwards I was horrified to reread some old code that was riddled with horrible classes like DoubleItemIterator and IteratorFilter that my C++-addled brain had cooked up, and realized half my classes were useless and the rest could have there linecount divided by ten.

And some people still cound "lines of code" as a measure of productivity. Sob.

Comment author: Mitchell_Porter 17 March 2010 11:30:44AM 3 points [-]

And some people still count "lines of code" as a measure of productivity.

So that's why my self-enhancing AI keeps getting bogged down!

Comment author: NancyLebovitz 17 March 2010 03:30:20PM 1 point [-]

Voted up for being really funny.

Comment author: Hook 03 March 2010 04:35:10PM *  1 point [-]

"Actually, the information needed to generate the Bible is the same as the information to locate the Bible in all those texts."

Or to locate it in "The Library of Babel".