<?xml version="1.0" encoding="utf-8"?>
<!-- If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/ -->
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:lj="http://www.livejournal.com">
  <id>urn:lj:livejournal.com:atom1:atheorist</id>
  <title>Idle Speculations</title>
  <subtitle>atheorist</subtitle>
  <author>
    <name>atheorist</name>
  </author>
  <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/"/>
  <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom"/>
  <updated>2009-11-16T04:54:06Z</updated>
  <lj:journal userid="1552183" username="atheorist" type="personal"/>
  <link rel="service.feed" type="application/x.atom+xml" href="http://atheorist.livejournal.com/data/atom" title="Idle Speculations"/>
  <link rel="hub" href="http://pubsubhubbub.appspot.com/"/>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:175806</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/175806.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=175806"/>
    <title>The sensation of causation</title>
    <published>2009-11-16T04:29:48Z</published>
    <updated>2009-11-16T04:54:06Z</updated>
    <content type="html">There's a scene in the very beginning of Brutal Legend (I understand it's also in the demo) where Jack Black puts his hands on a (hellish) religiously-powered vehicle, and gets it to move by praising generic dark/S&amp;M/goth/leather powers. There's a gimmick associated with this scene - if you stop driving the vehicle forward, Jack Black mumbles and stammers, and can't think of what to say next.&lt;br /&gt;&lt;br /&gt;This gimmick is basically intended to create a sensation of causation. Hume argued that there is no such thing, but I think he's wrong. Our brains parse some kind of combination of "active intention" and sufficiently-immediate, highly-correlated feedback as "I caused that". &lt;a href="http://www.rifters.com/"&gt;Peter Watts&lt;/a&gt; might imagine a creature with fast enough reflexes to hijack this sensation, reading your active intention off your nerves and moving so that you think you're causing it's motion.&lt;br /&gt;&lt;br /&gt;At work, there were two mice, and I wasn't sure which one controlled the pointer that I wanted to control. I reached out to them and, without really thinking, "felt" which one controlled the pointer that I was looking at. That is, something about the timing of the muscle-movement and the motion felt causal. &lt;br /&gt;&lt;br /&gt;Another gimmick is the "magician's choice" - a trope in interactive fiction and games generally - two options that seem different, but lead to the same outcome. Zarf's game "&lt;a href="http://www.eblong.com/zarf/zplet/huntdark.html"&gt;Hunter, In Darkness&lt;/a&gt;" is always the example that I think of. There's a fork in a cavern, and in either path you (seemingly coincidentally) encounter something that prevents you from returning back to the fork. Your path onward is the same, whichever branch you took. The artistic point of doing this is to offer a particular sensation of choosing, despite the user not actually having control.&lt;br /&gt;&lt;br /&gt;When feedback is sufficiently delayed, humans cannot lean on that (inbuilt, heuristic) sensation of causation, and have to stumble around with our (supposedly) general-purpose reasoning abilities instead. Showers, when there is a delay between turning the knob and the temperature changing, are an example. I understand the dynamics of some aircraft (gliders) are like this, too.&lt;br /&gt;&lt;br /&gt;If you'd like to see a concrete example, &lt;a href="http://www.kongregate.com/games/mofunzone/adventurous-eric"&gt;Adventurous Eric&lt;/a&gt;, a mouse-avoider game, has some "sensation of causation" effects. Alternately, &lt;a href="http://www.megadev.co.uk/t4c.htm"&gt;Time 4 Cat&lt;/a&gt; is another mouse-avoider (with a feline protagonist) which (eventually, be patient) has something like a "sensation of causation" effect.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:175461</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/175461.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=175461"/>
    <title>adjusting covariance</title>
    <published>2009-11-15T21:45:20Z</published>
    <updated>2009-11-15T21:45:20Z</updated>
    <content type="html">There's an excellent recipe (Poli and McPhee 2008) for bloat control of genetic programming that requires computing the covariance between fitness and size in the population.&lt;br /&gt;&lt;br /&gt;I'm using steady-state genetic programming, so at each step, exactly one element of the population gets dropped and replaced with something else. It's straightforward to compute the new mean of the population from the old and new values, so I thought it was likely possible to compute a new covariance from the old and new fitnesses and sizes.&lt;br /&gt;&lt;br /&gt;With a little (okay, a lot) of help from Mathematica, I created a formula for the change in the covariance. Reading it makes me think of mathemagicians ritually chanting, dancing a complicated intertwining step, in a procedure intended to invoke great numerical stability. (Note: I have no idea whether this is numerically stable in any sense).&lt;br /&gt;&lt;br /&gt;We're changing a point (oldX, oldY) into a point (newX, newY), inside a set of size N, and we want to compute the change in the covariance of X and Y. oldmeanX and oldmeanY are the previous means of the set of Xs and the set of Ys respectively.&lt;blockquote&gt;&lt;pre&gt;
delta = 0.0
delta += newX * oldY;
delta -= oldY * oldX;
delta += oldX * newY;
delta -= newY * newX;
delta /= N;
delta += newY * newX;
delta -= newX * oldmeanY;
delta += oldmeanY * oldX;
delta -= oldX * oldY;
delta += oldY * oldmeanX;
delta -= oldmeanX * newY;
delta /= N;
&lt;/pre&gt;&lt;/blockquote&gt;Carefully alternate, brothers and sisters! First the square... and now the hexagon!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:175223</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/175223.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=175223"/>
    <title>Teh intarwebs make me cry, but in a good way</title>
    <published>2009-11-12T04:07:21Z</published>
    <updated>2009-11-12T04:07:21Z</updated>
    <content type="html">&lt;a href="http://www.viruscomix.com/page500.html"&gt;weird&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:174907</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/174907.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=174907"/>
    <title>stacking technologies</title>
    <published>2009-11-01T05:06:10Z</published>
    <updated>2009-11-01T05:38:54Z</updated>
    <content type="html">Here is a simple stack of technologies:&lt;br /&gt;&lt;br /&gt;1. Genetic Programming - generate (mutate, cross-over) roughly tree-shaped things.&lt;br /&gt;&lt;br /&gt;2. Counterexample Finding - from a (roughly tree-shaped) specification, find a (possibly graph-shaped) &lt;a href="http://en.wikipedia.org/wiki/Structure_(mathematical_logic)"&gt;structure&lt;/a&gt; that satisfies the specification. E.g. &lt;a href="http://www.cs.unm.edu/~mccune/prover9/"&gt;mace4&lt;/a&gt;, or &lt;a href="http://en.wikipedia.org/wiki/Answer_set_programming"&gt;answer set programming&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;3. Control Theory and Block Diagrams - If we wanted a (pretty smooth) controller for a (pretty smooth) plant, then it is probably going to be expressible using standard block diagram primitives like integrators, scalar gain (including negative gain), sum of signals, and delay.&lt;br /&gt;&lt;br /&gt;Maybe using these technologies to attack the standard reinforcement learning tasks (cart-pole,  mountain car, acrobot) would be an appropriate final project.&lt;br /&gt;&lt;br /&gt;The idea is that introducing a counter-example finding step in between the genetic programming and the actual controller might make crossover and mutation more sensible things to do. If the chromosome is a list of properties that the block diagram graph ought to have, then crossing it over might make some sense. Block diagrams seem like they might well be able to handle stateful controllers (that is, non-Markov environments), without having to go to finite automata or explicit read/write actions.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:174846</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/174846.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=174846"/>
    <title>abstract interpreter for human procedures?</title>
    <published>2009-10-31T00:58:47Z</published>
    <updated>2009-10-31T00:58:47Z</updated>
    <content type="html">Genetic programming (or simple brute-force search) can put together interesting code.&lt;br /&gt;&lt;br /&gt;We can model some aspects of human thought with an abstract machine. For example, the working memory (seven plus or minus two) is something like a limited set of registers. Long term memory is like a pointer machine model in that pointer arithmetic isn't possible. Writes to long-term memory take much longer than reads (factor of 10?), and erases aren't really possible. Humans make errors and get distracted and have to re-find the thread of the procedure.&lt;br /&gt;&lt;br /&gt;What would code evolved (or brute forced) this abstract machine look like? Could we create awesome techniques for, say, systematic multi-objective search? Mental quadratic programming?&lt;br /&gt;&lt;br /&gt;And then, if this abstract machine were built and there were a procedure that you wanted inside your head, how would you put it into your head?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:174422</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/174422.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=174422"/>
    <title>sculptor/sculpture unpacking</title>
    <published>2009-10-14T22:41:05Z</published>
    <updated>2009-10-14T22:41:05Z</updated>
    <content type="html">This is an odd idea.&lt;br /&gt;&lt;br /&gt;Suppose that (perhaps for compression), instead of sending a (software) sculpture somewhere, you instead sent a sculptor. The sculptor, given a standard blank piece of clay, modifies the clay (manipulation). The clay, on the other hand, modifies the sculptor (perception). This process iterates until the sculptor is done.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:174106</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/174106.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=174106"/>
    <title>atheorist @ 2009-10-11T17:55:00</title>
    <published>2009-10-11T22:08:54Z</published>
    <updated>2009-10-11T22:08:54Z</updated>
    <content type="html">Okay, here is a simplistic AI design idea.&lt;br /&gt;&lt;br /&gt;1. Start with a collection of untrusted agents.&lt;br /&gt;2. Give them all some "money" (just a number) and (here's the unusual bit) some "shares" (another number).&lt;br /&gt;3. Each round (consisting of observation, action, reward):&lt;br /&gt;3.1. Tell them all your observations.&lt;br /&gt;3.2. For each of your possible actions, ask them what they think the fair price for a share WOULD be, if that action were taken.&lt;br /&gt;3.3. For each of your possible actions, compute what the market-clearing price would be.&lt;br /&gt;3.4. Perform the action with the highest market-clearing price.&lt;br /&gt;3.5. Clear the market, moving money and shares around at the market price, to get to equilibrium.&lt;br /&gt;3.6. Allocate reward to the agents, sharing it out proportional to their number of shares.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:173879</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/173879.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=173879"/>
    <title>atheorist @ 2009-10-10T10:39:00</title>
    <published>2009-10-10T15:11:36Z</published>
    <updated>2009-10-10T15:11:36Z</updated>
    <category term="logical uncertainty"/>
    <category term="rants"/>
    <content type="html">Suppose that two really big numbers were being multiplied in a big exhibition hall, something like a sporting event. Really big supercomputers, the best in the world, are multiplying them, and they will be done in twenty minutes or so.&lt;br /&gt;&lt;br /&gt;A dumb bookie comes up to you and says to you "Would you like to bet on whether the answer will be even or odd? Double your money if you're right!". You glance up at the numbers displayed on the board and see that one of them ends with the digit 4. Can you make a profit?&lt;br /&gt;&lt;br /&gt;More generally, suppose a bookie comes up to you with a lot of different sets of the integers - for example, the evens, the odds, the primes, the composites, the powers of two, the block of numbers with between 100 million and 1 billion digits - and a lot of different listed odds. It seems reasonable that you might be able to find some blocks which are currently mispriced and bet on them.&lt;br /&gt;&lt;br /&gt;If you're able to bet on these things, then you must have a probability distribution over the possible answers. If you run a computation (a divisibility test, say), then you might update your probability distribution. In some sense, this is very odd, because the answer is logically certain - it already exists in the realm of Platonic forms. &lt;br /&gt;&lt;br /&gt;However, there are a lot of ways that the &lt;a href="http://en.wikipedia.org/wiki/Prime_number_theorem"&gt;prime number theorem&lt;/a&gt; is similar to a "probability of a number being prime", and the prime number theorem is certainly useful.&lt;br /&gt;&lt;br /&gt;It's entirely reasonable to talk about the probability that a random propositional formula (constructed with a particular stochastic process) is a tautology - google tells me the experiment's been &lt;a href="http://kazimirmajorinc.blogspot.com/2009/09/probability-that-random-propositional.html"&gt;done&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you had a finite model of propositional logic (a small boolean algebra, say) and you checked that the random propositional formula is true on that finite model, then you would certainly increase your subjective probability that the random propositional formula is a tautology.&lt;br /&gt;&lt;br /&gt;Combining the distribution of tautologies (parameterized by size of the formula) with the finite model has resulted in a probabilistic approximation to the truth. I'm sure things like this are useful somehow, in theorem proving and other places.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:173677</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/173677.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=173677"/>
    <title>Singularity Summit</title>
    <published>2009-10-06T12:17:37Z</published>
    <updated>2009-10-06T12:17:37Z</updated>
    <content type="html">Went to Singularity Summit. Was pretty awesome. Here are my extremely brief memory-cues regarding the first day speakers, for my own use.&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;&lt;br /&gt;Itamar Arel - enthusiast of AI&lt;br /&gt;Ben Goertzel - enthusiast of AI&lt;br /&gt;Stuart Hameroff - kook of consciousness&lt;br /&gt;Michael Nielsen - basic quantum computing&lt;br /&gt;Ned Seeman - builds things out of DNA the molecule&lt;br /&gt;Juergen Schmidhuber - compression is important&lt;br /&gt;Stephen Wolfram - naturalism of small programs is cool&lt;br /&gt;David Chalmers - arguments re:self-improvement followed by unfounded speculation&lt;br /&gt;Gary Drescher - deterministic choice still makes sense&lt;br /&gt;Ed Boyden - scientist of neuron dynamics&lt;br /&gt;Marcus Hutter - mathematician of AI&lt;br /&gt;William Dickens - The Flynn Effect is caused by environment&lt;br /&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:173392</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/173392.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=173392"/>
    <title>atheorist @ 2009-09-10T14:32:00</title>
    <published>2009-09-10T18:34:49Z</published>
    <updated>2009-09-10T18:34:49Z</updated>
    <content type="html">&lt;blockquote&gt;"The Book of Causes shows, when opened at the name of a factor or intervention, (i) on the left (verso) side of the opening, all the things which are known to be able to cause it, in some circumstances; and (ii) on the right (recto) side, all the things which it can cause. Since the BofC is a virtual book, you have to create these pages, using all your resources for the required literature/Internet search."&lt;br /&gt;&amp;mdash; Michael Scriven&lt;br /&gt;&lt;/blockquote&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:173136</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/173136.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=173136"/>
    <title>atheorist @ 2009-09-03T23:31:00</title>
    <published>2009-09-04T04:05:30Z</published>
    <updated>2009-09-04T04:05:30Z</updated>
    <content type="html">How do I actually create designs? What is my actual workflow? Well, I think I spend a lot of time wandering around a graph of ideas. Sometimes, depending on the discipline and the context, the graph is also a graph of objects (or classes or functions or tables or processes or propositions or nodes in a syntax tree ET CETERA ET CETERA). Anyway, visiting a node may cause a nearby change to the graph (a new node or two, an edge added or removed). It seems like I have to do multiple passes to get a design that is reasonably complete and thoughtful, which contradicts the systematic top-down/refinement-calculus methodologies. Often it seems helpful, after one pass of drawing circles and arrows to throw that piece of paper away and start over with another piece of paper.&lt;br /&gt;&lt;br /&gt;How can I take this workflow description and turn it into a tool for this kind of workflow? Suppose that we forget about the graph structure of these ideas and just consider the design to be a set of ideas with descriptions, something like a pile of index cards. The verb that the tool has at its disposal is prompting the user with a pre-existing idea, and asking them to revise it or elaborate on it (that is, introduce new related ideas). Sometimes prompting the user with an idea will be productive (that is, will cause a revision or elaboration). Prompting the user with the same idea twice in a short amount of time doesn't seem like a good idea. Ideas that have been productive in the past are somewhat likely to be productive in the future, but we should expect all ideas to decay in productivity as they are used. &lt;br /&gt;&lt;br /&gt;Is there an elegant mathematical way to model the "human cache"? I'm pretty sure that prompting the user with a recently-prompted item may be unproductive due to hitting a previously cached (and inputted) answer. However, I'm not sure how big the cache is, nor what the rules are for items moving in and out of the cache.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:173045</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/173045.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=173045"/>
    <title>making your future problems look like your past successes</title>
    <published>2009-09-02T06:43:51Z</published>
    <updated>2009-09-02T06:43:51Z</updated>
    <content type="html">I've played a bit over the weekend with an old combinatorial optimization problem (job shop scheduling), and surprised myself with how much progress I made. Normally, I have enthusiasm for something, initial successes, followed by setbacks, discouragement, slow progress, boredom, and then dropping the project.&lt;br /&gt;&lt;br /&gt;I think one major difference between this task and other tasks that I've attempted is that I used a body of existing problems, inputs. Some of my other successes that surprised me also had this feature.&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;&lt;br /&gt;Possibly I can generalize this to:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;bold&gt;&lt;center&gt;JOHNICHOLAS, GENERATE TEST DATA YOU IDIOT!&lt;/center&gt;&lt;/bold&gt;&lt;/em&gt;&lt;br /&gt;Possibly there's a further generalization, which is, when attempting to improve your problem-solving processes, consider adding a "preprocessing" step to the beginning of your process, trying to adjust the problem that you're facing so that it has structural features similar to your previous successes.&lt;br /&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:172577</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/172577.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=172577"/>
    <title>Echoblog</title>
    <published>2009-09-02T06:10:57Z</published>
    <updated>2009-09-02T06:10:57Z</updated>
    <content type="html">&lt;a href="http://twitter.com/mogwai_poet"&gt;mogwai_poet&lt;/a&gt; said: Where Chip Delany writes: a non-euclidean hell dimension, &lt;a href="http://www.whereiwrite.org/delany.php"&gt;evidently&lt;/a&gt;.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:172350</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/172350.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=172350"/>
    <title>atheorist @ 2009-08-30T23:47:00</title>
    <published>2009-08-31T03:50:35Z</published>
    <updated>2009-08-31T03:50:35Z</updated>
    <content type="html">I have read Charlie Stross's &lt;a href="http://en.wikipedia.org/wiki/Glasshouse_(novel)"&gt;Glasshouse&lt;/a&gt; and it is indeed awesome.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:172189</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/172189.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=172189"/>
    <title>atheorist @ 2009-08-29T22:00:00</title>
    <published>2009-08-30T02:07:46Z</published>
    <updated>2009-08-30T02:07:46Z</updated>
    <content type="html">Over the last few days, I wrote a strange little &lt;a href="http://www.johnicholas.com/job_shop_scheduling.tar.bz2"&gt;tool&lt;/a&gt; for &lt;em&gt;manually&lt;/em&gt; solving job-shop-scheduling problems. "What?" you say "Isn't job-shop-scheduling a family of NP-complete problems? Why would you want to solve them manually?". You're entirely correct - there are no users for this tool.&lt;br /&gt;&lt;br /&gt;However, the task of writing such a tool was interesting as an object-oriented software design problem - something like discrete event simulation crossed with user threads. Anyway, it was a fun exercise. My focus was on solving it at all, rather than using good TDD practices, so it's pretty bad code. Maybe sometime I'll use it as a starting point of a refactoring exercise.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:171936</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/171936.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=171936"/>
    <title>atheorist @ 2009-08-25T16:04:00</title>
    <published>2009-08-25T20:03:50Z</published>
    <updated>2009-08-25T20:03:50Z</updated>
    <content type="html">I watched the sun rise in the purple armchair with the poodle this morning. It was pretty awesome. Like - you look across the field, and it's misty and bright, and then you sit there doing nothing for a while which is pleasant. And then BANG the sun rises over the trees and it is all glarey and the poodle sprawled across your lap looks interested.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:171754</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/171754.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=171754"/>
    <title>atheorist @ 2009-08-22T11:14:00</title>
    <published>2009-08-22T15:32:06Z</published>
    <updated>2009-08-22T15:32:06Z</updated>
    <content type="html">Every once in a while, I code little practice class libraries.&lt;br /&gt;&lt;br /&gt;This was trying to create a little interpreter, for if-then-else-plus-straight-line programs. It seems like sometimes one needs to have internet protocols which allow (untrusted) remote entities to send little proxies or agents representing policies to be executed locally. Some kinds of auctions, for example.&lt;br /&gt;&lt;br /&gt;This time, I was pleased with how the stats came out.&lt;br /&gt;~8 hours coding spread over two days.&lt;br /&gt;~300 lines of code excluding mocks and tests (500 including).&lt;br /&gt;(So that's ~35 or ~60 loc/hour. I'd be happy with anything between 20 and 100.)&lt;br /&gt;100% statement coverage.&lt;br /&gt;Maximum cyclomatic complexity per method: 2&lt;br /&gt;(Which means probably 100% path coverage, though I don't have a tool to measure that.)&lt;br /&gt;Maximum statements per method: 9&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.johnicholas.com/simple_agents.tar.bz2"&gt;http://www.johnicholas.com/simple_agents.tar.bz2&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:171418</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/171418.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=171418"/>
    <title>human algorithms</title>
    <published>2009-08-15T22:27:30Z</published>
    <updated>2009-08-15T22:27:30Z</updated>
    <content type="html">I want more &amp;quot;the computer helps you solve what you're thinking about&amp;quot; applications.&lt;br /&gt;&lt;br /&gt;For example, I can imagine one person working through an annoying &amp;quot;exhaustive&amp;quot; or &amp;quot;by cases&amp;quot; puzzle, and someone else (who doesn't know the puzzle that well) helping them, something like this:&lt;blockquote&gt;Puzzler: Aaaah!&lt;br /&gt;Helper: Okay, calm down and back up. What is the first step?&lt;br /&gt;Puzzler: Well, first X makes a move, in one of nine squares.&lt;br /&gt;Helper: Okay, what is the first of the squares?&lt;br /&gt;Puzzler: I guess we can do the upper left corner first.&lt;br /&gt;Helper: Okay, so suppose X makes a move in the upper left corner. What next?&lt;br /&gt;Puzzler: Well, O makes a move in one of eight squares. No wait, this will take too long, we have to eliminate symmetries!&lt;br /&gt;Helper: Okay, back to the first step - how many choices for the first step, after we eliminate symmetries?&lt;br /&gt;Puzzler: Three choices, middle, corner, or side.&lt;br /&gt;Helper: Suppose we look at middle first.&lt;br /&gt;Puzzler: Then O can go on a side or a corner.&lt;br /&gt;...&lt;/blockquote&gt;Anyway, the idea is that one person is the domain expert, concentrating on the domain, and the other is the depth-first-search expert, concentrating on the bookkeeping involved in depth-first-search. A computer could be the helper. This is different from most &amp;quot;the computer helps you solve puzzles&amp;quot; applications, because the conversation is pre-formalization. Clearly, if the puzzler could hold the problem in their head, they could write down a constraint logic program - and there are lots of very powerful solvers for that sort of thing.&lt;br /&gt;&lt;br /&gt;Depth-first-search is not univerally applicable, of course; but you could have conversational helpers for a lot of different generic strategies.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:171117</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/171117.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=171117"/>
    <title>atheorist @ 2009-07-31T02:08:00</title>
    <published>2009-07-31T06:29:48Z</published>
    <updated>2009-07-31T06:29:48Z</updated>
    <content type="html">I purchased and read "&lt;a href="http://www.wilmccarthy.com/bloom.htm"&gt;Bloom&lt;/a&gt;" by Wil McCarthy today, and it was pretty awesome. In one part, he describes the Game of Life. I'd be curious to know what someone who hasn't played with CAs would make of that description. I can recognize-and-remember, but I'm sure that's different.&lt;br /&gt;&lt;br /&gt;One of my "idee fixes" is that there are a lot of "secrets" in the world; experiences that can be alluded to but not actually communicated via speech or text. If a book contains a particularly beautiful, poetic allusion, it can have a powerful effect on someone who has had that experience. However, to someone who has not yet had any experience close enough, it reads like flowery nothings.&lt;br /&gt;&lt;br /&gt;Robin Hanson has a colorful notion of a world with a vast number of emulated humans; all working for wages and paying for their own compute time, hardware, whatever. If one individual is doing very well (very profitable for their employer, perhaps) - they might replicate (or be replicated) rapidly, homogenizing the population of emulated humans. Of course, being one of these copies doesn't mean safety - you're competing against your equals. I'd love to read some fiction that explores the notion more in-depth. Maybe something like the Russ from David Marusek's "&lt;a href="http://www.marusek.com/pages/CH-Reviews.html"&gt;Counting Heads&lt;/a&gt;"?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:170826</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/170826.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=170826"/>
    <title>atheorist @ 2009-07-28T14:36:00</title>
    <published>2009-07-28T19:16:20Z</published>
    <updated>2009-07-28T19:16:20Z</updated>
    <content type="html">I'm convinced that too much fuss is made of absolute, white-or-black TRUTH.&lt;br /&gt;&lt;br /&gt;An engineer, in building a useful device, also constructs (in parallel) an EXPLANATION of why the device works. My favorite such explanation, from a delightful book called "A Near Thing for Captain Najork":&lt;blockquote&gt;"What makes it go?" asked Aunt Bundlejoy. "Jam" said Tom. "When the anti-sticky plate hits the sticky it bounces back. The spring keeps it going, the connecting-rods move up and down, the wheels go round and the frog jumps."&lt;/blockquote&gt;Aside: Many of the differences between evolved and human-designed mechanisms can be explained by the "growing" vs. "assembled" distinction, but most of the remaining differences can be attributed to the EXPLANATION-BLINDNESS of evolution.&lt;br /&gt;&lt;br /&gt;But back to the main point. An important part of the quality of the explanation is how much it simplifies the system. That is, we sacrifice true complexity for useful approximations. Outside of particle physics, theory-building work rarely makes claims of absolute TRUTH. Mostly, it's about about searching for good, general, explanations; far more valuable than a true, yet uselessly complex understanding. In reading about philosophy of science, you might get the notion that once a theory is falsified it collapses into dust, like a vampire from Buffy. However, most theories are already known to be false!&lt;br /&gt;&lt;br /&gt;Clearly, there is some sort of challenge-response social game going on here, but it's something more subtle than the "Buffy" philosophy of science. I should read more Lakatos; he will explain it to me!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:170545</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/170545.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=170545"/>
    <title>atheorist @ 2009-07-22T11:36:00</title>
    <published>2009-07-22T16:33:49Z</published>
    <updated>2009-07-22T16:33:49Z</updated>
    <content type="html">Rhyme schemes might be an excellent toy domain to play with notions like linking and scope.&lt;br /&gt;&lt;br /&gt;There's an operation, which you might call rhyme scheme normalization, that takes a list of integers and returns a list of integers, something like this:&lt;br /&gt;111, 222, 333 each become 111&lt;br /&gt;112, 113, 221, 223, 331, 332 each become 112&lt;br /&gt;123, 132, 312, 321, 231, 213 each become 123&lt;br /&gt;et cetera&lt;br /&gt;&lt;br /&gt;One might be interested in connecting together two rhyme schemes. One way you could do it is simply concatenating their representations (11221+11221 = 1122111221). This might correspond to programmers who use the global namespace trying to work together. Another way you could do it is by renaming to avoid clashes (11221+11221 = 1122133443). This avoids clashes, but it prevents anything from one side meshing with anything from the other side.&lt;br /&gt;&lt;br /&gt;One possible solution is to make the "connect" operator take three things; a left side, a right side, and a binding. (11221 + 11221 + {2-&amp;gt;1}) would be a ternary operation, binding the left 2 to the right 1, resulting in 1122122332.&lt;br /&gt;&lt;br /&gt;What would an elegant class library capturing this nonsense look like?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:170388</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/170388.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=170388"/>
    <title>cheating</title>
    <published>2009-07-19T07:50:00Z</published>
    <updated>2009-07-19T07:50:00Z</updated>
    <content type="html">There's various experiences that I draw on when I write code, and I think the naive notion is that I would be drawing on various educational experiences, such as lectures, reading, homework, and projects. I do that. However, one of the interesting experiences that is not mentioned on that list is cheating at video games.&lt;br /&gt;&lt;br /&gt;Let me give you a concrete example. There is a rounding error in computing the prices of cheap objects in Morrowind. If you buy a stack of cheap objects, and then sell individual items back, then you can make a small income. The small income can be leveraged, via the Bargaining skill, into a larger income (up to a cap). Another example: By picking up an item, and then all that you can carry of a large stack of pennies (mowgles), you can (or could) weigh an item in Batmud to four digits of precision. By precise weighing, you can sometimes identify what an item is made out of.&lt;br /&gt;&lt;br /&gt;The interesting thing about cheating in games is that it models the requirements-capturing or problem-formulating aspect of programming. There are many goals in the game, and there is a rich structure of actions. Often it is possible to chop out and capture formally a specific sub-problem, and then solve it. But which sub-problem to chop out is fully up in the air. A good choice of sub-problem can produce a vastly easier-to-solve task, the solution of which nonetheless helps with the larger-scope goals.&lt;br /&gt;&lt;br /&gt;I think there should be more games where "cheating" via macros and/or other coding is encouraged. There are programming games (E.g. Core Wars or Robocode, but for some reason, people don't put as much effort into creating a rich, interesting, and gradually-difficult world when they're creating programming games as when they expect humans to be playing.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:170229</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/170229.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=170229"/>
    <title>GMap</title>
    <published>2009-07-16T12:35:39Z</published>
    <updated>2009-07-16T12:35:39Z</updated>
    <content type="html">A charming section from a recent CS arXiv preprint (&lt;a href="http://arxiv.org/abs/0907.2585"&gt;GMap: Drawing Graphs as Maps&lt;/a&gt;):&lt;blockquote&gt;&lt;br /&gt;    Americana: Somewhat surprisingly, George Orwell’s 1984 along with Animal Farm ended up in the west corner of a region populated mostly by American writers. Britain is also represented by William Golding’s The Lord of the Flies and Aldous Huxley’s Brave New World along with Anthony Burgess’s Clockwork Orange, which connect the British corner of the region to the main part dominated by 20th century American classics. Ray Bradbury’s Fahrenheit 451 and Salinger’s Catcher in the Rye provide a transition to a variety of well-known novels: Steinbeck’s Grapes of Wrath and Of Mice and Men, Ernest Hemingway’s For Whom the Bell Tolls and The Old Man and the Sea, F. Scot Fitzgerald’s Great Gatsby, Harper Lee’s To Kill a Mockingbird and Ralph Ellison’s Invisible Man, Joseph Heller’s Catch 22, Kurt Vonnegut’s Slaughterhouse Five, Ken Kesey’s One Flew Over a Cuckoo’s Nest. Some 19th century novels can also be found here: Nathaniel Hawthorne’s Scarlet Letter and Mark Twain’s Adventures of Huckleberry Finn.&lt;br /&gt;&lt;br /&gt;    Victoriana: To the southwest of Americana is a region dominated by Dickens, Austen and Bronte novels. Starting with A Tale of Two Cities, Great Expectations and Oliver Twist in the north and going through Jane Eyre, Pride and Prejudice, Sense and Sensibility and Wuthering Heights in the middle, the region ends with more Dickens’ books in the southwest (The Pickwick Papers) and George Elliot novels in the southeast (Middlemarch).&lt;br /&gt;&lt;br /&gt;    Russiana: To the north of Americana lies one of the largest countries in BookLand, dominated by Russian literature and history. The core contains classic novels by Dostoyevsky (Crime and Punishment, The Brothers Karamazov), Tolstoy (War and Peace, Anna Karenina), and Solzhenitsyn (The Gulag Archipelago, Cancer Ward). In the northern part of the region is a collection of books about Russia and Russian history: Stalin: The Court of the Red Tsar, Khrushchev: The Man and His Era and Potemkin: Catherine the Great’s Imperial Partner. In the west there is a cluster of Albert Camus books (The Stranger, The Plague, The Fall), all well connected with the Russian classics.&lt;br /&gt;&lt;br /&gt;    Graecoromania: Another large region to the west of Americana contains a diverse collection of Graeco-Roman books. History books by Thucydides, Plutarch, Livy, Suetonius, Salust share the region with philosophy by St. Augustine, Plato, Socrates, and Aristotle. Greek theater is represented by Aristophanes, Aeschylus, Euripides, Sophocles and epic poetry by Homer and Virgil.&lt;br /&gt;&lt;br /&gt;    Mythium: Close to Graecoromania, on the southwest coast, lies the the legendary land of Mythium. Aesop’s Fables, Greek Myths for Young Children and The Gods and Goddesses of Olympus are next door to D’Aulaires’ Book of Trolls, D’Aulaires’ Book of Animals and D’Aulaires’ Book of Norse Myths.&lt;br /&gt;&lt;br /&gt;    Shakespearea: Very centrally located, neighboring Victoriana, Americana, Russiana, Graecoromania, and Mythium lies the land of Shakespeare. It is not surprising that nearly all tragedies, comedies and histories are present but it is interesting to observe what non-Shakespeare books are in this region: Chaucer’s Canterbury Tales, Tennyson’s Idyls of the King, Dante’s Divine Comedy, One Thousand and One Arabian Nights, Beowulf and The Adventures of Robin Hood.&lt;/blockquote&gt;The raw data for the graph, before it was rendered as a map, was the "Customers Who Bought This Item Also Bought" data from Amazon. The map itself is &lt;a href="http://www.research.att.com/~yifanhu/GMap/Amazon_1984_depth_9.png"&gt;here&lt;/a&gt;.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:169937</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/169937.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=169937"/>
    <title>ridiculousness</title>
    <published>2009-06-24T13:36:08Z</published>
    <updated>2009-06-24T13:36:08Z</updated>
    <content type="html">I think &lt;a href="http://picoeconomics.com/"&gt;hyperbolic discounting&lt;/a&gt; is pretty awesome.&lt;br /&gt;&lt;br /&gt;Could possible use that as part of a Sims-like AI? If I understand correctly, the Sims AI has a very simple find-best-action core. The core accepts "advertisements" of possible actions from objects, describing why someone might want to, say, sit on the couch (it's comfortable). In the actual sims game, the language of the advertisments come in the form of quantities of various needs (comfort, social, food, bladder).&lt;br /&gt;&lt;br /&gt;The difference here would be that the "currencies" would be happiness at various delays. Then the sims could choose between actions like eat ice cream (happiness now, unhappiness later) and throw out all icecream (unhappiness now, happiness later), and evaluate them according to their own discounting schedule. &lt;br /&gt;&lt;br /&gt;I doodled a little bit of code related to this idea, but I didn't get very far. &lt;br /&gt;&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;&lt;br /&gt;&lt;code&gt;&lt;pre&gt;
// Beware of bugs in this code, I have rewritten it since the last time I tried it.
// forward declaration
class Action;
// A callback interface used by Action.
class ActionSubscriber {
protected:
  // Constructor.
  ActionSubscriber() {}
public:
  // The reason for this interface to exist.
  virtual void ActionAvailability(Action* who, bool available);
  // Destructor.
  virtual void ActionSubscriber() {}
};
// Publishes availability of an action.
class Action {
public:
  // Constructor.
  Action(bool starting_availability)
    : subscribers(),
    current_availability(starting_availability)
  {
  }
  // Mutator.
  void Subscribe(ActionSubscriber* to_subscribe) {
    subscribers.insert(to_subscribe);
  }
  // Mutator.
  void Unsubscribe(ActionSubscriber* to_unsubscribe) {
    subscribers.erase(to_unsubscribe);
  }
  // Do the Thing!
  virtual void Run() = 0;
  // Accessor.
  bool GetAvailability() {
    return current_value;
  }
protected:
  // Mutator.
  void SetAvailability(bool new_availability) {
    if (new_availability == current_availability) {
      // no need to announce anything
      return;
    }
    current_availability = new_availability;
    Publish(current_availability);
  }
  // Sends availability to all the subscribers.
  // Normally, one would use SetAvailability instead.
  void PublishAvailability() {
    // Take a copy, publishing can influence subscribing.
    subscribers_type local_copy(subscribers);
    for (subscribers_type::iterator i = subscribers.begin();
      i != subscribers.end();
      ++i) {
      (*i)-&amp;gt;ActionAvailabilityChanged(this, to_publish);
    }
  }
private:
  typedef std::set&amp;lt;ActionSubscriber*&amp;gt; subscribers_type;
  subscribers_type subscribers;
  bool current_availability;
};
// Represents a prioritized list of actions.
class PriorityList : public Action {
public:
  // Constructor.
  PriorityList()
    : Action(false),
    helper(this),
    priorities(),
    available()
  {
  }
  // Mutator.
  // Client guarantees that no two actions have the same priority.
  void Add(Action* to_add, int priority, bool currently_available) {
    to_add.Subscribe(helper);
    priorities[to_add] = priority;
    if (currently_available) {
      available[priority] = to_add;
    }
  }
  // From Action.
  void Run() {
    assert(!available.empty());
    available.begin()-&amp;gt;second-&amp;gt;Run();
  }
private:
  // Keeps PriorityList from having to be an ActionSubscriber.
  class Helper : public ActionSubscriber {
  public:
    // Constructor.
    Helper(PriorityList* to_help)
      : to_help(to_help)
    {
    }
    void ActionAvailability(Action* who, bool available) {
      to_help-&amp;gt;PrivateActionAvailability(who, available);
    }
  private:
    PriorityList* to_help;
  } helper;

  std::map&amp;lt;Action*, int&amp;gt; priorities;
  std::map&amp;lt;int, Action*&amp;gt; available;

  void PrivateActionAvailability(Action* who, bool is_available) {
    assert(priorities.find(who) != priorities.end());
    int priority = priorities[who];
    if (is_availabile) {
      available[priority] = who;
    } else {
      available.erase(priority);
    }
    SetAvailability(!availabile.empty());
  }
};
&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:atheorist:169609</id>
    <link rel="alternate" type="text/html" href="http://atheorist.livejournal.com/169609.html"/>
    <link rel="self" type="text/xml" href="http://atheorist.livejournal.com/data/atom/?itemid=169609"/>
    <title>atheorist @ 2009-05-18T00:48:00</title>
    <published>2009-05-18T04:48:40Z</published>
    <updated>2009-05-18T04:48:40Z</updated>
    <content type="html">We have a puppy!</content>
  </entry>
</feed>
