<?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:ru_linux_geek</id>
  <title>Rack | rrenaud | Rob | Robert Renaud's LiveJournal</title>
  <subtitle>Rob Renaud</subtitle>
  <author>
    <name>Rob Renaud</name>
  </author>
  <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/"/>
  <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom"/>
  <updated>2009-04-09T19:44:12Z</updated>
  <lj:journal userid="2864795" username="ru_linux_geek" type="personal"/>
  <link rel="service.feed" type="application/x.atom+xml" href="http://ru-linux-geek.livejournal.com/data/atom" title="Rack | rrenaud | Rob | Robert Renaud's LiveJournal"/>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:40096</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/40096.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=40096"/>
    <title>Worst TED talk ever?</title>
    <published>2009-04-09T19:44:12Z</published>
    <updated>2009-04-09T19:44:12Z</updated>
    <content type="html">Does the graph of 5 people, with 5 choose 2 = 10 connections bug you when he says 120?  What about when he shows 10 people, with 10 choose 2 = 45 connections, and then says 10 factorial is approximately 3.6 million?  Does it irk you that he never actually describes what an "interaction" is?  Skip to 6 minutes and 30 seconds if you are lazy or bored.&lt;br /&gt;&lt;br /&gt;&lt;lj-embed id="3" /&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:39800</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/39800.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=39800"/>
    <title>Funny and insulting correlation</title>
    <published>2009-03-02T19:15:06Z</published>
    <updated>2009-03-02T19:15:06Z</updated>
    <content type="html">Someone had the idea to look at people's favorite books and bands and correlate that with the average SAT score of the university that the person attended.  The details are &lt;a href="http://blogs.wsj.com/digits/2009/02/27/books-and-music-that-make-you-dumb/"&gt;here&lt;/a&gt;.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:39439</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/39439.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=39439"/>
    <title>Larry started a board gaming blog</title>
    <published>2008-12-10T23:14:17Z</published>
    <updated>2009-03-12T02:02:15Z</updated>
    <category term="probability"/>
    <category term="dynamic programming"/>
    <category term="race"/>
    <content type="html">The name, &lt;a href="http://bgholic.com"&gt;Board Game Holic&lt;/a&gt; is probably quite fitting for me ;).&lt;br /&gt;&lt;br /&gt;My first article written reasons about winning the &lt;a href="http://www.bgholic.com/story/race-galaxy-all-abilities-coder-challenge-6"&gt;all abilities goal in a probabilistic manner&lt;/a&gt;.  And who doesn't like a combination of probability, Race for the Galaxy, and dynamic programming?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:39318</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/39318.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=39318"/>
    <title>A little bit of bragging</title>
    <published>2008-12-08T18:46:22Z</published>
    <updated>2008-12-08T18:46:22Z</updated>
    <category term="rftg"/>
    <content type="html">The picture is not nearly as bad as I expected.  But maybe that's just because I am used to looking at my currently insanely unkempt hair.&lt;br /&gt;&lt;br /&gt;The report for the &lt;a href="http://boardgamers.org/yearbook/rfgpge.htm"&gt;2008 Race for the Galaxy World Boardgaming Championship&lt;/a&gt; has been posted.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:39073</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/39073.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=39073"/>
    <title>A nifty little election time dynamic program</title>
    <published>2008-10-23T03:51:37Z</published>
    <updated>2008-11-10T19:22:42Z</updated>
    <category term="election"/>
    <category term="algorithms"/>
    <category term="xkcd"/>
    <category term="dynamic programming"/>
    <content type="html">Take a look at &lt;a href="http://www.xkcd.com/intrade"&gt;xkcd's election predictor&lt;/a&gt;.  It scrapes a bunch of election outcome probabilities per state from intrade and uses them to provide a prediction for the overall election.  It does so by using a Monte Carlo simulation, given the probabilities, it runs a mock election assuming each state outcome is independent a whole bunch of times with those probabilities and see what happens.  In his code, he runs the simulation 100,000 times.  On my laptop, this takes about 4 seconds and yields only an approximation with error of about .001.  Aww, poor physicist, if only Randall was a computer scientist, maybe he'd see how to compute it exactly and much more quickly.&lt;br /&gt;&lt;br /&gt;So, how can we compute this efficiently?  The key to my program running quickly is that total number of electoral votes (538) is much smaller than the total number of possible election outcomes (2^50).  &lt;br /&gt;&lt;br /&gt;Imagine we have a partially computed an election in which &lt;i&gt;k&lt;/i&gt; states have already voted, and that &lt;i&gt;p&lt;sub&gt;k,i&lt;/sub&gt;&lt;/i&gt; is the probability that the democrats have won exactly &lt;i&gt;i&lt;/i&gt; electoral votes after the first &lt;i&gt;k&lt;/i&gt; elections have run. Furthermore, let &lt;i&gt;v&lt;sub&gt;k&lt;/sub&gt;&lt;/i&gt; be the number of electoral votes for state &lt;i&gt;k&lt;/i&gt; and &lt;i&gt;e&lt;sub&gt;k&lt;/sub&gt;&lt;/i&gt; be the probability state that state &lt;i&gt;k&lt;/i&gt; elects a democrat.&lt;br /&gt;&lt;br /&gt;How can we compute &lt;i&gt;p&lt;sub&gt;k,i&lt;/sub&gt;&lt;/i&gt;?  Well, this simple little recurrence will do it.&lt;br /&gt;&lt;i&gt;p&lt;sub&gt;k,i&lt;/sub&gt; = e&lt;sub&gt;k&lt;/sub&gt; * p&lt;sub&gt;k-1,i - v&lt;sub&gt;k&lt;/sub&gt;&lt;/sub&gt; + (1 - e&lt;sub&gt;k&lt;/sub&gt;) * p&lt;sub&gt;k-1, i&lt;/sub&gt;&lt;/i&gt;.  Basically, with probability &lt;i&gt;e&lt;sub&gt;k&lt;/sub&gt;&lt;/i&gt; the state votes democrat and has &lt;i&gt;i - v&lt;sub&gt;k&lt;/sub&gt;&lt;/i&gt; votes left, otherwise, with probability &lt;i&gt;1 - e&lt;sub&gt;k&lt;/sub&gt;&lt;/i&gt; it votes republican (assuming two party system), and the democrat still has &lt;i&gt;i&lt;/i&gt; votes left.  For this problem, we only need about 539 * 51 table entries (we could even do something clever and push the needed space down to 539 entries, but I'll leave that as an exercise for the reader).&lt;br /&gt;&lt;br /&gt;After I implemented this, the computation runs much more quickly than one second and provides an exact answer.&lt;br /&gt;&lt;br /&gt;Looking at the code a bit more, I found a (slightly refactored) snippet of code like this.  I assume the code is supposed to output the outcomes in order.  Take a look at the comment, is it simpler than sorting?  Is it even correct?  I challenge both accounts.&lt;br /&gt;&lt;br /&gt;&lt;pre style="color:#000000;background:#ffffff;"&gt;&lt;span style="color:#800000; font-weight:bold; "&gt;def&lt;/span&gt; render_outcome&lt;span style="color:#808030; "&gt;(&lt;/span&gt;pdem&lt;span style="color:#808030; "&gt;,&lt;/span&gt; prep&lt;span style="color:#808030; "&gt;,&lt;/span&gt; ptie&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;:&lt;/span&gt;
    dstring&lt;span style="color:#808030; "&gt;=&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"Obama:  &amp;lt;span style=\"color: #0000FF\"&amp;gt;"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;str&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;round&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;pdem&lt;span style="color:#808030; "&gt;,&lt;/span&gt;&lt;span style="color:#008c00; "&gt;1&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"&amp;lt;/span&amp;gt;"&lt;/span&gt;
    rstring&lt;span style="color:#808030; "&gt;=&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"McCain: &amp;lt;span style=\"color: #FF0000\"&amp;gt;"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;str&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;round&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;prep&lt;span style="color:#808030; "&gt;,&lt;/span&gt; &lt;span style="color:#008c00; "&gt;1&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"&amp;lt;/span&amp;gt;"&lt;/span&gt;
    tstring&lt;span style="color:#808030; "&gt;=&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"Tie: &amp;lt;span style=\"color: #888888\"&amp;gt;"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;str&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;round&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;ptie&lt;span style="color:#808030; "&gt;,&lt;/span&gt; &lt;span style="color:#008c00; "&gt;1&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"&amp;lt;/span&amp;gt;"&lt;/span&gt;

    &lt;span style="color:#800000; font-weight:bold; "&gt;if&lt;/span&gt; pdem&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;prep &lt;span style="color:#800000; font-weight:bold; "&gt;and&lt;/span&gt; prep&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;ptie&lt;span style="color:#808030; "&gt;:&lt;/span&gt;
        &lt;span style="color:#800000; font-weight:bold; "&gt;return&lt;/span&gt; dstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;rstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;tstring
    &lt;span style="color:#800000; font-weight:bold; "&gt;if&lt;/span&gt; prep&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;pdem &lt;span style="color:#800000; font-weight:bold; "&gt;and&lt;/span&gt; pdem&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;ptie&lt;span style="color:#808030; "&gt;:&lt;/span&gt;
        &lt;span style="color:#800000; font-weight:bold; "&gt;return&lt;/span&gt; rstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;dstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;tstring
    &lt;b&gt;&lt;span style="color:#000000; "&gt;#just in case ... (easier to do this than a sort)&lt;/span&gt;&lt;/b&gt;
    &lt;span style="color:#800000; font-weight:bold; "&gt;if&lt;/span&gt; pdem&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;ptie &lt;span style="color:#800000; font-weight:bold; "&gt;and&lt;/span&gt; ptie&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;prep&lt;span style="color:#808030; "&gt;:&lt;/span&gt;
        &lt;span style="color:#800000; font-weight:bold; "&gt;return&lt;/span&gt; dstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;tstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;rstring
    &lt;span style="color:#800000; font-weight:bold; "&gt;if&lt;/span&gt; prep&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;ptie &lt;span style="color:#800000; font-weight:bold; "&gt;and&lt;/span&gt; ptie&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;pdem&lt;span style="color:#808030; "&gt;:&lt;/span&gt;
        &lt;span style="color:#800000; font-weight:bold; "&gt;return&lt;/span&gt; rstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;tstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;dstring
    &lt;span style="color:#800000; font-weight:bold; "&gt;if&lt;/span&gt; ptie&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;pdem &lt;span style="color:#800000; font-weight:bold; "&gt;and&lt;/span&gt; pdem&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;prep&lt;span style="color:#808030; "&gt;:&lt;/span&gt;
        &lt;span style="color:#800000; font-weight:bold; "&gt;return&lt;/span&gt; tstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;dstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;rstring
    &lt;span style="color:#800000; font-weight:bold; "&gt;if&lt;/span&gt; ptie&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;prep &lt;span style="color:#800000; font-weight:bold; "&gt;and&lt;/span&gt; prep&lt;span style="color:#808030; "&gt;&amp;gt;&lt;/span&gt;pdem&lt;span style="color:#808030; "&gt;:&lt;/span&gt;
        &lt;span style="color:#800000; font-weight:bold; "&gt;return&lt;/span&gt; tstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;rstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;dstring
    &lt;span style="color:#800000; font-weight:bold; "&gt;return&lt;/span&gt; tstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;rstring&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"\n"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;dstring&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here is my alternative implementation.&lt;br /&gt;&lt;br /&gt;&lt;pre style="color:#000000;background:#ffffff;"&gt;&lt;span style="color:#800000; font-weight:bold; "&gt;def&lt;/span&gt; render_outcome2&lt;span style="color:#808030; "&gt;(&lt;/span&gt;pdem&lt;span style="color:#808030; "&gt;,&lt;/span&gt; prep&lt;span style="color:#808030; "&gt;,&lt;/span&gt; ptie&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;:&lt;/span&gt;
    dstring&lt;span style="color:#808030; "&gt;=&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"obama:  &amp;lt;span style=\"color: #0000ff\"&amp;gt;"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;str&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;round&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;pdem&lt;span style="color:#808030; "&gt;,&lt;/span&gt;&lt;span style="color:#008c00; "&gt;1&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"&amp;lt;/span&amp;gt;"&lt;/span&gt;
    rstring&lt;span style="color:#808030; "&gt;=&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"mccain: &amp;lt;span style=\"color: #ff0000\"&amp;gt;"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;str&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;round&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;prep&lt;span style="color:#808030; "&gt;,&lt;/span&gt; &lt;span style="color:#008c00; "&gt;1&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"&amp;lt;/span&amp;gt;"&lt;/span&gt;
    tstring&lt;span style="color:#808030; "&gt;=&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"tie: &amp;lt;span style=\"color: #888888\"&amp;gt;"&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;str&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;&lt;span style="color:#e34adc; "&gt;round&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;ptie&lt;span style="color:#808030; "&gt;,&lt;/span&gt; &lt;span style="color:#008c00; "&gt;1&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;+&lt;/span&gt;&lt;span style="color:#0000e6; "&gt;"&amp;lt;/span&amp;gt;"&lt;/span&gt;
    l &lt;span style="color:#808030; "&gt;=&lt;/span&gt; &lt;span style="color:#808030; "&gt;[&lt;/span&gt;&lt;span style="color:#808030; "&gt;(&lt;/span&gt;pdem&lt;span style="color:#808030; "&gt;,&lt;/span&gt; dstring&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;,&lt;/span&gt; &lt;span style="color:#808030; "&gt;(&lt;/span&gt;prep&lt;span style="color:#808030; "&gt;,&lt;/span&gt; rstring&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;,&lt;/span&gt; &lt;span style="color:#808030; "&gt;(&lt;/span&gt;ptie&lt;span style="color:#808030; "&gt;,&lt;/span&gt; tstring&lt;span style="color:#808030; "&gt;)&lt;/span&gt;&lt;span style="color:#808030; "&gt;]&lt;/span&gt;
    &lt;span style="color:#800000; font-weight:bold; "&gt;return&lt;/span&gt; &lt;span style="color:#0000e6; "&gt;'\n'&lt;/span&gt;&lt;span style="color:#808030; "&gt;.&lt;/span&gt;join&lt;span style="color:#808030; "&gt;(&lt;/span&gt;pair&lt;span style="color:#808030; "&gt;[&lt;/span&gt;&lt;span style="color:#008c00; "&gt;1&lt;/span&gt;&lt;span style="color:#808030; "&gt;]&lt;/span&gt; &lt;span style="color:#800000; font-weight:bold; "&gt;for&lt;/span&gt; pair &lt;span style="color:#800000; font-weight:bold; "&gt;in&lt;/span&gt; sorted(l, reverse=True))
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Mine definitely seems simpler.  It relies on the natural sorting order of python tuples to get the messages sorted in the right order.&lt;br /&gt;&lt;br /&gt;Is his implementation correct?  Well.. notice all of those &amp;lt; operators (not &amp;lt;=).  What happens with ties?&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
&amp;gt;&amp;gt;&amp;gt; print states.render_outcome(.4, .3, .3)
Tie: &lt;span style="color: #888888"&gt;0.3&lt;/span&gt;
McCain: &lt;span style="color: #FF0000"&gt;0.3&lt;/span&gt;
Obama:  &lt;span style="color: #0000FF"&gt;0.4&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Uh oh..&lt;br /&gt;&lt;br /&gt;In all fairness, quoting the page, Randall says "&lt;i&gt;I made this tool to help me understand the race, especially on election night&lt;/i&gt;."  I am sure he just wanted to get things done, and not have some nerd nitpick at all of the code.  The Monte Carlo simulation is a bit easier to code than the dynamic program I posted and it gets things done. His code basically works.  I don't think he actually sucks at programming, I just wanted to put some blood on the pages for reddit.  Furthermore, I was thinking about using this problem as an interview question, but after trying it on a few of my coworkers (who all have at least a BS in computer science from a nice university), I think it's a bit too hard.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:38672</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/38672.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=38672"/>
    <title>TrainLogic, you suck</title>
    <published>2008-10-22T02:12:21Z</published>
    <updated>2008-10-22T02:12:21Z</updated>
    <category term="trainlogic"/>
    <content type="html">I was in New Brunswick and I wanted to know when the next train was this Sunday.  As anyone with a blackberry knows, the New Jersey transit website sucks on the blackberry browser.  So I install this blackberry app from TrainLogic that seems useful. &lt;br /&gt;&lt;br /&gt;Wow, what a giant waste of time.  Ugh.  Installing it involves copying a serial number from the application onto an online form and solving a case sensitive captcha (this is miserable on the auto text completing blackberry).  Don't worry, if you screw up a single input, your input will be erased and you will need to start over, painfully retyping that 10 character serial and inputting another the 5 character random captca.  If you unlock the app this far it will finally tell you that it is "randomly changing the train times."  You can go online again and give them $7 for 6 month access to a schedule.  No thanks.  I feel like I should be getting paid for dealing with so much bullshit.  It took me about 15 minutes to get here.  Miserable!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:38616</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/38616.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=38616"/>
    <title>Regina Spektor is amazing</title>
    <published>2008-08-21T03:47:18Z</published>
    <updated>2008-08-21T03:47:18Z</updated>
    <content type="html">&lt;lj-embed id="2" /&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:38361</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/38361.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=38361"/>
    <title>[Gamers-ny] Rob "Crackhead" Renaud Wins RftG World Championship, Positively Reinforces Addiction</title>
    <published>2008-08-12T16:02:36Z</published>
    <updated>2008-08-12T16:02:36Z</updated>
    <category term="rftg"/>
    <content type="html">&lt;blockquote&gt;&lt;br /&gt;Rob's reign as world-champion was, however, short-lived.  Peter Schmitt, yesterday, with his masterful employ of the dreaded Galatic Federation / Trade League combo, served Rob a slice of humble pie.  The price for this delicious mocel of baked good:  Rob's RftG World Championship Belt.  Down, but not out, Rob has pledged to remain addicted to RftG to the exclusion of his hair's kemptness.&lt;br /&gt;&lt;br /&gt;Games Night.  6 PM.  5BB.  RftG Intercontinental Championship up for grabs.  No hitting other players with metal chairs please.&lt;br /&gt;&lt;/blockquote&gt; &lt;br /&gt;&lt;br /&gt;- Ross Fairgrieve&lt;br /&gt;&lt;br /&gt;Of course, it wasn't a title match.  For that, only next year's &lt;a href="http://boardgamers.org/"&gt;World Boardgaming Championship&lt;/a&gt; will suffice.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:38047</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/38047.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=38047"/>
    <title>A favorable ratio</title>
    <published>2008-06-24T04:00:08Z</published>
    <updated>2008-06-24T04:00:08Z</updated>
    <category term="ani difranco"/>
    <category term="kimya dawson"/>
    <content type="html">I am not looking, and even if I was, perhaps a Kimya Dawson/Ani DiFranco concert isn't the best place to find straight women, but this is impressive.  These are people who have confirmed they are going to the concert on iLike.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;img src="http://ruslug.rutgers.edu/~rrenaud/ani_kimya_favorable_ratio.jpg"&gt;&lt;/center&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:37651</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/37651.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=37651"/>
    <title>Amazon MP3 download service</title>
    <published>2008-04-18T05:28:59Z</published>
    <updated>2008-04-18T05:28:59Z</updated>
    <category term="amazon"/>
    <category term="jaymay"/>
    <content type="html">Has anyone tried it?  I just bought &lt;a href="http://www.myspace.com/jaymay"&gt;Jaymay's&lt;/a&gt; Autumn Fallin', mostly on the strength of the single "Gray or Blue."  The Amazon download service is kind of weird, they insist you download a (proprietary, but at least one exists for Linux) client to download the songs, and then they won't let you redownload songs you've purchased.  But at least you get unencumbered mp3s.  Oggs would have been nice, but I guess you can't ask for too much.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:37555</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/37555.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=37555"/>
    <title>Travelling salesman, xkcd, and a month old reddit post.</title>
    <published>2008-03-21T07:09:26Z</published>
    <updated>2008-03-21T17:51:25Z</updated>
    <category term="reddit"/>
    <category term="algorithms"/>
    <category term="xkcd"/>
    <category term="tsp"/>
    <content type="html">From a &lt;a href="http://reddit.com/info/694m3/comments/c037rlt"&gt;reddit post&lt;/a&gt; I made a month ago.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;There are n! paths in a graph of size n. I can find the optimal TSP solution in O(n^2 2^n) time. Therefore, it is possible to do better than examine every path to find a TSP solution.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.algorithmist.com/index.php/Traveling_Salesperson_Problem"&gt;http://www.algorithmist.com/index.php/Traveling_Salesperson_Problem&lt;/a&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;And today's xkcd comic.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://xkcd.com/399/"&gt;&lt;img src="http://imgs.xkcd.com/comics/travelling_salesman_problem.png"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Suspicious?&lt;br /&gt;&lt;br /&gt;I just wish I had a modicum of artistic ability, I swear I've got about five ideas for good xkcd style comics.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:37237</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/37237.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=37237"/>
    <title>Hidden public information in board games, you suck</title>
    <published>2008-03-08T05:28:16Z</published>
    <updated>2008-03-08T05:28:16Z</updated>
    <category term="hidden public information"/>
    <category term="chess"/>
    <category term="board game design"/>
    <category term="el grande"/>
    <category term="board games"/>
    <category term="ingenious"/>
    <content type="html">Chess and go are two great games, they have no hidden information.  Ingenious is a great game with no hidden public information.  Simon is a terrible game.  Board game designers, every time you make your games include hidden public information, you make your games less like chess and more like simon.  This is clearly a step in the wrong direction.  Why, oh why do you do this?  Remembering things is not fun.  Making informed decisions between two options is.  Stop making memory necessary for informed decisions.  Please!  El Grande, I am looking at you.&lt;br /&gt;&lt;br /&gt;Will anyone take the position that hidden public information is actually a good thing?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:37002</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/37002.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=37002"/>
    <title>February, month of the 33rd floor walkup?</title>
    <published>2008-01-29T05:04:43Z</published>
    <updated>2008-01-29T05:17:24Z</updated>
    <content type="html">I am debating whether I should try going the month of February without using an elevator&lt;sup&gt;*&lt;/sup&gt;.  I figure it would be a good source of mandatory exercise, and it would create some fun stories.  Much like walking 4.5 miles (and 4.5 miles back) from Manhattan to Brooklyn over the Manhattan Bridge just for dinner is both good story and good exercise.&lt;br /&gt;&lt;br /&gt;* I will use the elevator if I am with other people, or carrying skis.  Newport has this stupid policy that the entrance to the stairs is locked going in, so I'll have to wait for the elevator and get out on the second floor anyway.  This is a big disincentive to taking the stairs.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:36774</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/36774.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=36774"/>
    <title>The greatest song ever</title>
    <published>2008-01-21T06:31:22Z</published>
    <updated>2008-01-21T06:33:33Z</updated>
    <category term="jeffrey lewis"/>
    <category term="chelsea hotel"/>
    <content type="html">So my sister complained that I haven't posted in two weeks.  This is what you get.&lt;br /&gt;&lt;br /&gt;The Chelsea Hotel Oral Sex Song by Jeffrey Lewis.  The youtube link has poor audio and will force you to sit through annoying banter for a minute and a half, but you'll see his "low budget video."  &lt;a href="http://www.mediafire.com/?4xzx3ymmaim"&gt;Here is a link&lt;/a&gt; to recording the song, which is much better quality.&lt;br /&gt;&lt;br /&gt;&lt;lj-embed id="1" /&gt;&lt;br /&gt;&lt;br /&gt;Okay, so this isn't the greatest song ever.  Hell, it's probably terrible.  But I am going to see him live at the Mercury Lounge anyway.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:36522</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/36522.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=36522"/>
    <title>The right way to understand repeated squaring</title>
    <published>2008-01-06T08:04:49Z</published>
    <updated>2008-01-06T15:23:11Z</updated>
    <category term="repeated squaring"/>
    <category term="algorithms"/>
    <category term="dreams"/>
    <content type="html">So, I wish I could say I was over &lt;a href="http://ru-linux-geek.livejournal.com/35777.html"&gt;this&lt;/a&gt;, but I am still having bouts of sadness and self-induced frustration.  But at least I am having dreams about algorithms, which you know, kind of rocks.  Even if my ability to reason in my dreams is laughably bad.&lt;br /&gt;&lt;br /&gt;In my most recent dream, I was arguing in a classroom about the "right" way to understand repeated squaring.  This was the argument that I wanted to make, but failed to express clearly in my dream.&lt;br /&gt;&lt;br /&gt;I wrote most of the algorithmist article on &lt;a href="http://www.algorithmist.com/index.php/Repeated_Squaring"&gt;repeated squaring&lt;/a&gt; awhile ago.  The way I used to understand repeated squaring is explained by example in the write up.  It basically comes down to writing the exponent in binary, accumulating the appropriate terms for each position the binary expansion of the exponent by repeatedly squaring the last position, and then finally multiplying out all the terms where there is a bit set.  This works and provides some insight into how the algorithm works.&lt;br /&gt;&lt;br /&gt;However, this is the wrong way to understand the algorithm.  &lt;br /&gt;&lt;br /&gt;The right way is expressed beautifully by this equation.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://ruslug.rutgers.edu/~rrenaud/repeated_squaring.png" alt="x^y = (x^{y~{\rm div}~2})^2 \cdot x^{y\bmod 2}"&gt;&lt;br /&gt;&lt;br /&gt;What does the first part equation say?  &lt;br /&gt;&lt;br /&gt;&lt;img src="http://ruslug.rutgers.edu/~rrenaud/divide_repeated_squaring.png" alt="(x^{y~{\rm div}~2})"&gt;&lt;br /&gt;&lt;br /&gt;Well, it says divide the problem into problem of approximately half the size.  This smaller problem can be solved recursively.  The division here is the C-style truncating integer division.  The square then uses the information from the subproblem to compute the larger problem.  The last part of the equation,&lt;br /&gt;&lt;br /&gt;&lt;img src="http://ruslug.rutgers.edu/~rrenaud/conquer_repeated_squaring.png" alt="x^{y\bmod 2}"&gt;&lt;br /&gt;&lt;br /&gt;Simply handles the case that the division truncated exponent and we would have otherwise lost a multiple of the base.&lt;br /&gt;&lt;br /&gt;On a technical note, from either view of the algorithm, it's pretty easy to &lt;br /&gt;see that the number of total number of multiplications required is no worse than 2lg(y).&lt;br /&gt;&lt;br /&gt;What is the key difference between the two views of the algorithm?  The first is iterative, understanding the computation involves understanding every minute detail of the accumulation loop and it's relation to the binary expansion of the exponent.  The second view uses recursion to leverage abstraction.  Instead of understanding the whole process, you simply need to understand how to make the problem smaller and how to put the pieces together on a high level.  There is really a parallel here between iterative and functional programming.  Ironically, I am coming out on the functional programming side.&lt;br /&gt;&lt;br /&gt;So why is the second view better than the first view?  The higher level, more abstracted view is much easier to generalize.  Instead of computing x^y efficiently, let's consider the problem of computing a^b * x^y.  Let n = max(b, y).  This can be done straight-forwardly with two applications of the repeated squaring algorithm in 4lg(n) + some constant k multiplications.  However, a modified algorithm can solve the problem with 2lg(n) + k multiplications.  &lt;font size="=1"&gt;Credit for this problem goes to my sister's "Reasoning about Computation" class.  It's the best class I never took.  Sigh, sometimes I wish I did CS at Princeton.&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;How do you do it?&lt;br /&gt;&lt;br /&gt;Here is some empty space in case you want to try to figure it out yourself.  Hint:  Try to use divide and conquer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Well, to compute a^b * x^y, first compute a^(b/2) * x^(y/2) recursively.  Now square it.  There are just 4 cases depending on the truncation of b and y.  If b and y were both truncated, we need an additional multiple of a * x, which can be precomputed ahead of time for cost of a single multiplication at this recursive step.  Otherwise, if only b was truncated, we just need an additional multiple of a.  Likewise, if only y was truncated, we need an additional multiple of x.  Otherwise, no additional multiplications are needed.  Simple, elegant, clever.  Gotta love it.&lt;br /&gt;&lt;br /&gt;Exercise for the readers:  Further generalize the algorithm.  Show how to compute a_1 ^ b_1 * a_2 ^ b_2 * ... a_j ^ b_j in 2 lg(n) + 2^j + k multiplications, where n = max(b_1, b_2, ... b_j) and k is a constant.&lt;br /&gt;&lt;br /&gt;I spent quite a bit of time trying to solve this problem, mostly stuck because I was trying to use the first understanding of the problem and I couldn't see how to leverage the binary expansion of both exponents simultaneously.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:36160</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/36160.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=36160"/>
    <title>Something is wrong with New York</title>
    <published>2008-01-02T01:00:30Z</published>
    <updated>2008-01-02T01:00:30Z</updated>
    <content type="html">So I log into facebook and see this.  There is something wrong with New York when Coldplay is as popular as entire music genres.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://ruslug.rutgers.edu/~rrenaud/something_wrong_with_ny.png"&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:36089</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/36089.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=36089"/>
    <title>What to do when you can't sleep?</title>
    <published>2007-12-31T08:55:16Z</published>
    <updated>2008-01-01T23:29:24Z</updated>
    <content type="html">Why not attempt to &lt;a href="https://www.blogger.com/comment.g?blogID=2811876938195306723&amp;amp;postID=1865119672488336896"&gt;write proofs about computable numbers&lt;/a&gt;?  I guess I'll see if I really understood my &lt;a href="http://ru-linux-geek.livejournal.com/2175.html"&gt;formal languages class&lt;/a&gt;.  But anything labeled a paradox is probably pretty tricky, so I am not too confident that I right.&lt;br /&gt;&lt;br /&gt;Edit:  Apparently, I am good enough to write correct proofs without sleep ;).</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:35777</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/35777.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=35777"/>
    <title>"Ask me a question"</title>
    <published>2007-12-31T03:11:36Z</published>
    <updated>2007-12-31T03:11:36Z</updated>
    <content type="html">... :(</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:35523</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/35523.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=35523"/>
    <title>A proof I will never forget: An algorithms story</title>
    <published>2007-12-26T08:10:56Z</published>
    <updated>2007-12-26T08:16:29Z</updated>
    <content type="html">Many moons ago, I was taking computer science 344, Design and Analysis of Computer Algorithms at Rutgers.  The simplicity and beauty of the subject matter was unmatched by anything else I'd studied except Newtonian mechanics, and algorithms, being based on mathematical formalisms rather than the messy physical universe, actually have the nice property of not being wrong.&lt;br /&gt;&lt;br /&gt;We were studying median finding and sorting.  The professor asked if we could come up with an algorithm to determine if an array of n elements had no duplicates using only comparisons in better than O(n log n) time.  This is a classic problem in Computer Science, dubbed &lt;a href="http://en.wikipedia.org/wiki/Element_uniqueness_problem"&gt;element uniqueness&lt;/a&gt;.  Surely, as a professor of theoretical computer science, he knew this was impossible.&lt;br /&gt;&lt;br /&gt;I, however, did not know it was impossible.  I had even come up with an algorithm that I thought worked.  I sent an email to the professor containing my algorithm.  I omit the email from the body of this post to save myself embarrassment, but needless to say it was clearly wrong in retrospect. He told me to present the algorithm in class, knowing I was attempting the provably impossible.&lt;br /&gt;&lt;br /&gt;So what happens?  I get up in the front of class and present my bogus algorithm.  The professor asks the students if anyone sees anything wrong with the algorithm and then someone comes and points out how it doesn't actually work.  I make an ass out of myself.  &lt;br /&gt;&lt;br /&gt;Fast forward to my latest semester at NYU, where I decide to take Fundamental Algorithms.  This is basically 344 all over.  Although letting my dating life influence my class selection is probably not something I'll do again (I totally wussed out of taking an advanced algorithms class, which would have probably been challenging and worthwhile but taken enough time to making trying to date n girls simultaneously impossible), it wasn't a total waste of time.  After dominating the midterm and spotting a couple errors in the homework writeup, the professor offers to turn the class into independent study.  For topics to study, I suggest the proof of the element uniqueness lowerbound in the comparison model of computation.  Alan Siegel sends me this nice proof in email.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;The E. U. LB is trivial.&lt;br /&gt;&lt;br /&gt;You need to know what it says: given a set of n numbers, a&lt;br /&gt;comparison-based algorithm that can solve EU does enough comparisons&lt;br /&gt;to determine the sorted order of the data.&lt;br /&gt;&lt;br /&gt;Proof in a nutshell. An adversary covers up the numbers but&lt;br /&gt;performs all comparisons and tells the truth (which can be checked&lt;br /&gt;at termination time.)&lt;br /&gt;&lt;br /&gt;The data is distinct, so there are no equalities, but the adversary&lt;br /&gt;is free to change the data as long as all of the tested comparisons&lt;br /&gt;are still as stated.&lt;br /&gt;&lt;br /&gt;So the EU program runs, decides it is done, and halts with the claim that&lt;br /&gt;the data elts are distinct.   Waaalllll ... let each comparison&lt;br /&gt;be a directed edge between data elements.  So the EU program builds a&lt;br /&gt;DAG.  If the DAG has a unique topologincal sort, the comparisons&lt;br /&gt;determine the sort. If not, there are two elements that could be equal.&lt;br /&gt;&lt;br /&gt;(Run the old fashion ready set---blocked set Top Sort). If there are&lt;br /&gt;ever two elts in the ready set they could be made equal since there is&lt;br /&gt;no path from one to the other. (Technically, reducing $x$ just changes&lt;br /&gt;all of its predecessors in the DAG by the same value.)&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Basically the idea is that you are an adversary, you force the algorithm to discover enough information to sort the elements, and then you apply the sorting lower bound to show that it must have made O(n log n) comparisons.  The proof is nice and elegant.&lt;br /&gt;&lt;br /&gt;So thank you, Martin Farach-Colton, for letting me make a fool out of myself in front of ~100 people, so now I understand a proof that I'll never let myself forget.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:34995</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/34995.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=34995"/>
    <title>My recent obsession, French toast</title>
    <published>2007-12-09T06:03:09Z</published>
    <updated>2007-12-09T06:03:09Z</updated>
    <content type="html">How does French toast manage to be so awesome?  Seriously.  I just don't understand.  Bread, pretty good.  Eggs, good.  French toast, amazing.  The goodness function for eggs and bread is definitely non-linear, reaching it's maximum at an overly soaked eggy bread.&lt;br /&gt;&lt;br /&gt;And what's good with bread?  Peanut butter and bananas.  So what about a peanut butter and banana French toast sandwich?  Let's just hope these third and fourth variables don't ruin the magic; experiment to be run tomorrow.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:34701</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/34701.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=34701"/>
    <title>South Korea, don't destroy that which makes you great</title>
    <published>2007-11-18T16:45:25Z</published>
    <updated>2007-11-18T16:45:25Z</updated>
    <category term="korea"/>
    <category term="starcraft"/>
    <content type="html">Because I am sure that not all of my 2.5 readers read BoingBoing or slashdot.  In South Korea, there are now &lt;a href="http://www.nytimes.com/2007/11/18/technology/18rehab.html?_r=2&amp;amp;hp=&amp;amp;adxnnl=1&amp;amp;oref=slogin&amp;amp;pagewanted=all&amp;amp;adxnnlx=1195402137-siZ77ybKsZRSazhdPKcTOQ"&gt;internet addiction rehab boot camps&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://youtube.com/watch?v=ishS4ifP9zQ"&gt;Kang Min fighting!&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:34441</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/34441.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=34441"/>
    <title>Representative pictures of Googlers</title>
    <published>2007-11-09T03:30:40Z</published>
    <updated>2007-11-09T03:33:14Z</updated>
    <content type="html">My roommate just came into my room complaining that the number one Google images result for &lt;a href="http://images.google.com/images?q=%22terry%20tai%22"&gt;"Terry Tai"&lt;/a&gt; was a picture of the Ticket to Ride cover.  Google quickly wised up, however, and is now returning an image of Carcassonne.  This led me to query for other Googlers who attended Columbia games night.  Unfortunately, Hubert Chao is way too cool and has a few of pictures of himself, but is mostly drowned out by utexas results.  David Held also lacked any Columbia board game images.  However, &lt;a href="http://images.google.com/images?q=%22rob%20renaud%22"&gt;my number one result&lt;/a&gt; is Blue Moon City.  &lt;a href="http://images.google.com/images?q=%22ross%20fairgrieve%22"&gt;Ross Fairgrieve&lt;/a&gt; returns Ticket to Ride at #5 and Tigris &amp; Euphrates at #6.  &lt;a href="http://images.google.com/images?q=%22michael%20grigoriev%22"&gt;Michael Grigoriev&lt;/a&gt; has Majaraja at #1 and Diplomacy at #2.&lt;br /&gt;&lt;br /&gt;I an quite a fan of Blue Moon City, and Ross liked both Tigris and Ticket to Ride.  &lt;br /&gt;&lt;br /&gt;And of course, I can't let things like rankings changes remove the greatness of these results, so here are some screen caps that will live forever, or at least until I rm -rf my home directory on ruslug.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://images.google.com/images?q=%22terry%20tai%22"&gt;"&lt;img src="http://ruslug.rutgers.edu/~rrenaud/ttai_image_search.jpg"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://images.google.com/images?q=%22rob%20renaud%22"&gt;&lt;img src="http://ruslug.rutgers.edu/~rrenaud/rrenaud_image_search.jpg"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://images.google.com/images?q=%22ross%20fairgrieve%22"&gt;&lt;img src="http://ruslug.rutgers.edu/~rrenaud/fairgr_image_search.jpg"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://images.google.com/images?q=%22michael%20grigoriev%22"&gt;&lt;img src="http://ruslug.rutgers.edu/~rrenaud/mag_image_search.jpg"&gt;&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:34196</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/34196.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=34196"/>
    <title>My sister is famous</title>
    <published>2007-11-05T14:11:11Z</published>
    <updated>2007-11-08T07:15:52Z</updated>
    <category term="icpc"/>
    <category term="acm"/>
    <category term="greater new york"/>
    <content type="html">Or at least, the Star Ledger quoted &lt;a href="http://www.nj.com/starledger/stories/index.ssf?/base/news-8/119424122975880.xml&amp;amp;coll=1"&gt;Kate Renaud&lt;/a&gt; about why she does programming contests.  &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;"My friends ask, 'Why would you do that?'" said Kaitlin Renaud, 20, a Princeton junior, admitting it's difficult to explain to non-programmers the allure of rising early on a Sunday morning to do battle on a screen. "I really can't tell them. ... But it's fun."&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I guess that's better than "because my brother makes me."&lt;br /&gt;&lt;br /&gt;Apparently, she finished 13th with a 2 person team.  Rutgers places were somewhat disappointing, its best team at 12th. Cornell absolutely dominated the contest, finishing all the problems with more than half the time remaining.  The &lt;a href="http://www.acmgnyr.org/year2007/standings.shtml"&gt;2007 standings are here&lt;/a&gt;.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:33892</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/33892.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=33892"/>
    <title>In praise of Ubuntu</title>
    <published>2007-11-03T19:17:40Z</published>
    <updated>2007-11-03T19:17:40Z</updated>
    <category term="ubuntu"/>
    <content type="html">I just bought a music CD (gasp, the horror!).  Ubuntu made ripping it to ogg so incredibly easy that I had extracted the first song before I even knew what format I was writing in.  Literally it was 10 seconds between right clicking the CD icon on my desktop to starting the rip.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:ru_linux_geek:33728</id>
    <link rel="alternate" type="text/html" href="http://ru-linux-geek.livejournal.com/33728.html"/>
    <link rel="self" type="text/xml" href="http://ru-linux-geek.livejournal.com/data/atom/?itemid=33728"/>
    <title>iLike, you have eaten my metaphorical lunch</title>
    <published>2007-11-03T19:14:33Z</published>
    <updated>2007-11-03T19:14:56Z</updated>
    <category term="ilike"/>
    <category term="pandora"/>
    <category term="hacking"/>
    <content type="html">I discovered a pretty cool and useful Facebook app named &lt;a href="http://www.ilike.com/"&gt;iLike&lt;/a&gt; a few days ago.  It implements the "show me bands I like who are touring near me" very well, and it has all other nice kinds of social features built in.  It's done way better than something that I could hack up in my spare time, and hence, I quit!  &lt;br /&gt;&lt;br /&gt;My only complaint is that it's very much designed for itunes and it doesn't provide a way to automatically import data from anywhere else.  The interface does support a comma separated line input for favorite bands, however.  So I hacked up a &lt;a href="http://ruslug.rutgers.edu/~rrenaud/pandora_parser.py"&gt;Pandora scraper&lt;/a&gt;.  The Pandora scraper will get not just favorites, but also bands that you simply thumbed up more than once.  As a bonus, it will print scores for each artist that are in your stations.  It will run with any non-ancient version of Python, I tested with 2.4.&lt;br /&gt;&lt;br /&gt;Here are the top 5 scores for me.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
rob:~/code/more_live_music/src$ python pandora_parser.py rrenaud@gmail.com | head -n 5
Alanis Morissette 30
The Doors 28
Foo Fighters 26
Oasis 20
Red Hot Chili Peppers 18
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The scores are simply the number thumbed up songs + 10 bonus for being in favorites.  &lt;br /&gt;&lt;br /&gt;Speaking of Pandora, please, please get a clue with your ads.  I was listening to a station titled "Brett Dennen Radio", my location is set to New York, NY, and Brett had a show in New York in 3 days.  What kind of ads was I seeing?  McDonald's ads.  Hint, I am a vegetarian, that's also in my profile.  With ads targeted that poorly, maybe they just don't want to earn any money?</content>
  </entry>
</feed>
