<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2813489246992645284</id><updated>2011-07-07T13:11:38.342-07:00</updated><title type='text'>wellons</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-2910080112562334813</id><published>2008-07-06T14:29:00.000-07:00</published><updated>2008-07-06T14:30:47.155-07:00</updated><title type='text'>Wordpress Blog</title><content type='html'>I'm experimenting with &lt;a href="http://wellons.wordpress.com/"&gt;a Wordpress blog&lt;/a&gt;.  So far the key advantage is that it does not impose the black boxes on my images.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-2910080112562334813?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/2910080112562334813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=2910080112562334813&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/2910080112562334813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/2910080112562334813'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2008/07/wordpress-blog.html' title='Wordpress Blog'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-2290859590391910508</id><published>2008-07-04T18:54:00.000-07:00</published><updated>2008-07-04T19:27:54.981-07:00</updated><title type='text'>Publishing Latex to the Web</title><content type='html'>It's gross.&lt;br /&gt;&lt;br /&gt;With that in mind, I'll say a few words about how I got &lt;a href="http://snollew.blogspot.com/2008/07/barrels-of-gold-problem-brian-marion.html"&gt;somewhat nice-looking mathematical notation into blogspot&lt;/a&gt; a few days ago.  I originally wrote that entry in &lt;a href="http://www.uoregon.edu/~koch/texshop/"&gt;TexShop&lt;/a&gt; and put in on my website as a PDF file.  While this shares it with my fans, there are some disadvantages to PDfs as opposed to HTML in a blog entry:&lt;br /&gt;&lt;br /&gt;* As a blog entry, it is intregrated into my blog and it benefits from the search engine crawling, incoming links, tags and appearing with the rest of my recent writings.&lt;br /&gt;&lt;br /&gt;* PDFs are less accessible than HTML.  It's often more work for the reader to download it if your browser doesn't display PDFs inline and it can be harder to search or cut and paste.&lt;br /&gt;&lt;br /&gt;Let me mention two of my workflow principles:&lt;br /&gt;&lt;br /&gt;* There must be one master version of a document.  All edits should be made to this copy, and changes are propagated to all other formats and versions as automatically as possible.&lt;br /&gt;&lt;br /&gt;* The master version should be the format where is the easiest and most natural to express oneself.  For example, LaTeX makes it many times easier to create equations such as those appearing in my most recent posting mentioned above.&lt;br /&gt;&lt;br /&gt;It was clear I had to do the editing in LaTeX, and develop a way to publish to Blogspot.  Below is the Bash script I came up with.  It has very rough edges.  I believe in programming with a focus on a particular problem.  As I use the programs in this entry in the future, they will doubtlessly improve greatly.  In the meantime, any comments are welcome.  Be warned that Blogspot's narrow text column may be wrapping some of the lines.&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;&lt;font color="#c00000"&gt;#!/bin/bash &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#008080"&gt;tex_file&lt;/font&gt;=&lt;font color="#c000c0"&gt;&lt;b&gt;$1&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color="#008080"&gt;name&lt;/font&gt;=&lt;font color="#008080"&gt;&lt;b&gt;`cut -f1 -d&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt; &amp;lt;&amp;lt;&amp;lt; &lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$tex_file&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;`&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;echo&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt; Operating on &lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;...&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;rm&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;&lt;b&gt;-f&lt;/b&gt;&lt;/font&gt; -- &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;-trimmed.html.txt temp.html links.sh&lt;br /&gt;latex2html  -no_navigation -auto_prefix &lt;font color="#008080"&gt;&lt;b&gt;-split&lt;/b&gt;&lt;/font&gt; &lt;font color="#c00000"&gt;&lt;b&gt;0&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;&lt;b&gt;-info&lt;/b&gt;&lt;/font&gt; &lt;font color="#804000"&gt;&lt;b&gt;&amp;quot;&amp;quot;&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;&lt;b&gt;-noaddress&lt;/b&gt;&lt;/font&gt; &lt;font color="#c000c0"&gt;&lt;b&gt;$tex_file&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;xmllint &lt;font color="#008080"&gt;&lt;b&gt;--format&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;&lt;b&gt;--html&lt;/b&gt;&lt;/font&gt; &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;/index.html &lt;font color="#804000"&gt;&lt;b&gt;&amp;gt;&lt;/b&gt;&lt;/font&gt; index.html.new&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;mv&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;&lt;b&gt;-f&lt;/b&gt;&lt;/font&gt; index.html.new &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;/index.html&lt;br /&gt;&lt;font color="#008080"&gt;arg&lt;/font&gt;=&lt;font color="#804000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'s/src=&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;&amp;quot;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;-img/src=&amp;quot;http:\/\/jonathanwellons.com\/&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;\/&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;-img/g&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;echo&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt; &lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$arg&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;echo&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt; perl -pi -e &lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$arg&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt; &lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;/index.html &lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;&amp;gt;&amp;gt;&lt;/b&gt;&lt;/font&gt; links.sh&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;chmod&lt;/b&gt;&lt;/font&gt; &lt;font color="#c00000"&gt;&lt;b&gt;755&lt;/b&gt;&lt;/font&gt; links.sh&lt;br /&gt;./links.sh&lt;br /&gt;purge-html.pl &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;/index.html &lt;font color="#804000"&gt;&lt;b&gt;&amp;gt;&amp;gt;&lt;/b&gt;&lt;/font&gt; &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;-trimmed.html.txt&lt;br /&gt;rsync &lt;font color="#008080"&gt;&lt;b&gt;-vaz&lt;/b&gt;&lt;/font&gt; &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;/  jonathan@my_servers_ip:/var/www/jonathan/&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Let's step through the lines one by one. &lt;br /&gt;&lt;br /&gt;&lt;tt&gt;&lt;br /&gt;&lt;font color="#c00000"&gt;#!/bin/bash &lt;/font&gt;&lt;/tt&gt;&lt;br /&gt;This tells the shell to use bash to run the script.&lt;br /&gt;&lt;tt&gt;&lt;br /&gt;&lt;font color="#008080"&gt;tex_file&lt;/font&gt;=&lt;font color="#c000c0"&gt;&lt;b&gt;$1&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color="#008080"&gt;name&lt;/font&gt;=&lt;font color="#008080"&gt;&lt;b&gt;`cut -f1 -d&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt; &amp;lt;&amp;lt;&amp;lt; &lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$tex_file&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;`&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;echo&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt; Operating on &lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;...&lt;/b&gt;&lt;/font&gt;&lt;/tt&gt;&lt;br /&gt;This segment takes in a variable &lt;tt&gt;&lt;font color="#008080"&gt;tex_file&lt;/font&gt;&lt;/tt&gt; that holds the name of the Latex file to convert.  It then trims off the extension and saves it as the &lt;tt&gt;&lt;font color="#008080"&gt;name&lt;/font&gt;&lt;/tt&gt; of the project.&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;&lt;font color="#804000"&gt;&lt;b&gt;rm&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;&lt;b&gt;-f&lt;/b&gt;&lt;/font&gt; -- &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;-trimmed.html.txt temp.html links.sh&lt;/tt&gt;&lt;br /&gt;This clears out the temporary files we'll use later.&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;latex2html  -no_navigation -auto_prefix &lt;font color="#008080"&gt;&lt;b&gt;-split&lt;/b&gt;&lt;/font&gt; &lt;font color="#c00000"&gt;&lt;b&gt;0&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;&lt;b&gt;-info&lt;/b&gt;&lt;/font&gt; &lt;font color="#804000"&gt;&lt;b&gt;&amp;quot;&amp;quot;&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;&lt;b&gt;-noaddress&lt;/b&gt;&lt;/font&gt; &lt;font color="#c000c0"&gt;&lt;b&gt;$tex_file&lt;/b&gt;&lt;/font&gt;&lt;/tt&gt;&lt;br /&gt;This is the most important part.  There is actually a pre-existing program called latex2html that does just what it suggests.  It doesn't do a perfect job, and blogspot has a number of idiosyncrasies, most of the rest of the script is accommodating the personality of this wonderful (seriously) program. &lt;br /&gt;&lt;br /&gt;&lt;tt&gt;xmllint &lt;font color="#008080"&gt;&lt;b&gt;--format&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;&lt;b&gt;--html&lt;/b&gt;&lt;/font&gt; &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;/index.html &lt;font color="#804000"&gt;&lt;b&gt;&amp;gt;&lt;/b&gt;&lt;/font&gt; index.html.new&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;mv&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;&lt;b&gt;-f&lt;/b&gt;&lt;/font&gt; index.html.new &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;/index.html&lt;/tt&gt;&lt;br /&gt;xmllint is an excellent program that cleans up XML and HTML.  I use it here to make the HTML much nicer to look at and process later.&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;&lt;font color="#008080"&gt;arg&lt;/font&gt;=&lt;font color="#804000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'s/src=&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;&amp;quot;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;-img/src=&amp;quot;http:\/\/jonathanwellons.com\/&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;\/&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;-img/g&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;'&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;echo&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt; &lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$arg&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;echo&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt; perl -pi -e &lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$arg&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt; &lt;/b&gt;&lt;/font&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;/index.html &lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;&amp;gt;&amp;gt;&lt;/b&gt;&lt;/font&gt; links.sh&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;chmod&lt;/b&gt;&lt;/font&gt; &lt;font color="#c00000"&gt;&lt;b&gt;755&lt;/b&gt;&lt;/font&gt; links.sh&lt;br /&gt;./links.sh&lt;/tt&gt;&lt;br /&gt;One of Blogspot's weaknesses (to me) is image uploading.  It seems that you can only upload five at a time, and even without that restriction, I wouldn't put up with the hassle of uplaoding the dozens of images needed for a blog entry generated from Latex.  This is especially true because many of them could change as the source document is corrected or refined. Instead, I host the images on my personal site and change the links produced by latex2html to use these new URLs.&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;purge-html.pl &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;/index.html &lt;font color="#804000"&gt;&lt;b&gt;&amp;gt;&amp;gt;&lt;/b&gt;&lt;/font&gt; &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;-trimmed.html.txt&lt;/tt&gt;&lt;br /&gt;Much of the HTML tags produced by Latex2html are redundant or interact poorly with Blogspot.  This is a program I wrote to strip most HTML tags, which can be found at the end of the file.  I originally set out to use Perl's HTML::Parser module, but this turned out to be easier to do myself.  This leaves a file that can be opened in any text editor and copied into the Blogspot editing interface.  For my &lt;a href="http://snollew.blogspot.com/2008/07/barrels-of-gold-problem-brian-marion.html"&gt;last entry&lt;/a&gt;, it was barrels-of-gold-trimmed.html.txt.&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;rsync &lt;font color="#008080"&gt;&lt;b&gt;-vaz&lt;/b&gt;&lt;/font&gt; &lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;/  jonathan@my_servers_ip:/var/www/jonathan/&lt;font color="#c000c0"&gt;&lt;b&gt;$name&lt;/b&gt;&lt;/font&gt;&lt;/tt&gt;&lt;br /&gt;Finally, push all the images produced by latex2html up to &lt;a href="http://jonathanwellons.com/"&gt;my server&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Any comments or ways to improve are welcome (I am sure there are many).  In particular, if someone knows a way to better clean up the spacing and get rid of the borders on the images that Blogspot's CSS adds, that would be helpful.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt; Appendix: purge-html.pl&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;&lt;font color="#c000c0"&gt;&lt;b&gt;#!/usr/bin/perl -w&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;use strict&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;use &lt;/b&gt;&lt;/font&gt;HTML::Parser;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;use &lt;/b&gt;&lt;/font&gt;Data::Dumper;&lt;br /&gt;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$file&lt;/font&gt; = &lt;font color="#804000"&gt;&lt;b&gt;shift&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$okay_tags&lt;/font&gt; = {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;img&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; =&amp;gt; &lt;font color="#c00000"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/font&gt;, &lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;table&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; =&amp;gt; &lt;font color="#c00000"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/font&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;td&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; =&amp;gt; &lt;font color="#c00000"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/font&gt;, &lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;i&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; =&amp;gt; &lt;font color="#c00000"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/font&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;tr&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; =&amp;gt; &lt;font color="#c00000"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/font&gt;, &lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;div&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; =&amp;gt; &lt;font color="#c00000"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/font&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;a&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; =&amp;gt; &lt;font color="#c00000"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/font&gt;, &lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;h2&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; =&amp;gt; &lt;font color="#c00000"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/font&gt;,&lt;br /&gt;};&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$no_content_tags&lt;/font&gt; = {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;title&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; =&amp;gt; &lt;font color="#c00000"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/font&gt;, &lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;h1&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; =&amp;gt; &lt;font color="#c00000"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/font&gt;,&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;open&lt;/b&gt;&lt;/font&gt;(&lt;font color="#008080"&gt;IN&lt;/font&gt;, &lt;font color="#c00000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;lt;&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;$file&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;) &lt;font color="#804000"&gt;&lt;b&gt;or&lt;/b&gt;&lt;/font&gt; &lt;font color="#804000"&gt;&lt;b&gt;die&lt;/b&gt;&lt;/font&gt; &lt;font color="#c00000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;Couldn't open &lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;$file&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;: &lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;$!&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;undef&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$/&lt;/font&gt;;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$data&lt;/font&gt; = &lt;font color="#008080"&gt;&amp;lt;IN&amp;gt;&lt;/font&gt;;&lt;br /&gt;&lt;font color="#008080"&gt;$data&lt;/font&gt; =~ &lt;font color="#804000"&gt;&lt;b&gt;s/&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;lt;!--&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;[^&amp;gt;]*&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;gt;&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;//gs&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$lines&lt;/font&gt; = [ &lt;font color="#804000"&gt;&lt;b&gt;split&lt;/b&gt;&lt;/font&gt;(&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;lt;&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;, &lt;font color="#008080"&gt;$data&lt;/font&gt;) ];&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$result&lt;/font&gt; = &lt;font color="#c00000"&gt;&lt;b&gt;''&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;foreach&lt;/b&gt;&lt;/font&gt; &lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$line&lt;/font&gt; (&lt;font color="#008080"&gt;@$lines&lt;/font&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008080"&gt;$line&lt;/font&gt; = &lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;lt;&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; . &lt;font color="#008080"&gt;$line&lt;/font&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (&lt;font color="#008080"&gt;$line&lt;/font&gt; =~&lt;font color="#804000"&gt;&lt;b&gt; /&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;^&amp;lt;$&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;/&lt;/b&gt;&lt;/font&gt;) {&lt;font color="#804000"&gt;&lt;b&gt;next&lt;/b&gt;&lt;/font&gt;;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (&lt;font color="#008080"&gt;$line&lt;/font&gt; =~&lt;font color="#804000"&gt;&lt;b&gt; /&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;^&amp;lt;!&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;/&lt;/b&gt;&lt;/font&gt;) {&lt;font color="#804000"&gt;&lt;b&gt;next&lt;/b&gt;&lt;/font&gt;;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008080"&gt;$line&lt;/font&gt; =~&lt;font color="#804000"&gt;&lt;b&gt; /&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;lt;&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;\/&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;?)([^ &amp;gt;]*)([^&amp;gt;]*)&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;gt;&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;(.*)&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;/s&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$end&lt;/font&gt; = &lt;font color="#008080"&gt;$1&lt;/font&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$tag&lt;/font&gt; = &lt;font color="#008080"&gt;$2&lt;/font&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$rest&lt;/font&gt; = &lt;font color="#008080"&gt;$3&lt;/font&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$content&lt;/font&gt; = &lt;font color="#008080"&gt;$4&lt;/font&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$temp_result&lt;/font&gt; = &lt;font color="#c00000"&gt;&lt;b&gt;''&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (&lt;font color="#008080"&gt;$tag&lt;/font&gt; =~&lt;font color="#804000"&gt;&lt;b&gt; /&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;^a$&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;/&lt;/b&gt;&lt;/font&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (&lt;font color="#008080"&gt;$rest&lt;/font&gt; =~&lt;font color="#804000"&gt;&lt;b&gt; /&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;(.*&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;)(.*)(&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;#&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;.*)&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;/&lt;/b&gt;&lt;/font&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008080"&gt;$rest&lt;/font&gt; = &lt;font color="#c00000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;$1$3&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;quot;&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008080"&gt;$result&lt;/font&gt; =~ &lt;font color="#804000"&gt;&lt;b&gt;s/&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;\n&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;$&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;/&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt; &lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;/&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (&lt;font color="#008080"&gt;$okay_tags&lt;/font&gt;-&amp;gt;{&lt;font color="#008080"&gt;$tag&lt;/font&gt;}) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008080"&gt;$temp_result&lt;/font&gt; = &lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;lt;&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; . &lt;font color="#008080"&gt;$end&lt;/font&gt; . &lt;font color="#008080"&gt;$tag&lt;/font&gt; . &lt;font color="#008080"&gt;$rest&lt;/font&gt; .&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;&amp;gt;&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;unless&lt;/b&gt;&lt;/font&gt;(&lt;font color="#008080"&gt;$no_content_tags&lt;/font&gt;-&amp;gt;{&lt;font color="#008080"&gt;$tag&lt;/font&gt;}) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008080"&gt;$temp_result&lt;/font&gt; .= &lt;font color="#008080"&gt;$content&lt;/font&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#804000"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (&lt;font color="#008080"&gt;$tag&lt;/font&gt; =~&lt;font color="#804000"&gt;&lt;b&gt; /&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;^a$&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;/&lt;/b&gt;&lt;/font&gt; || &lt;font color="#008080"&gt;$content&lt;/font&gt; =~&lt;font color="#804000"&gt;&lt;b&gt; /&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;^$&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;/&lt;/b&gt;&lt;/font&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008080"&gt;$temp_result&lt;/font&gt; =~ &lt;font color="#804000"&gt;&lt;b&gt;s/&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;\n&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;//g&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008080"&gt;$result&lt;/font&gt; .= &lt;font color="#008080"&gt;$temp_result&lt;/font&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;font color="#008080"&gt;$result&lt;/font&gt; =~ &lt;font color="#804000"&gt;&lt;b&gt;s/&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;\n\n&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;*&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;/&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;\n&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;/sg&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&lt;font color="#008080"&gt;$result&lt;/font&gt; =~ &lt;font color="#804000"&gt;&lt;b&gt;s/&lt;/b&gt;&lt;/font&gt;&lt;font color="#c00000"&gt;&lt;b&gt;^&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt;&lt;b&gt;\n&lt;/b&gt;&lt;/font&gt;&lt;font color="#804000"&gt;&lt;b&gt;//g&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;print&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$result&lt;/font&gt;;&lt;br /&gt;&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-2290859590391910508?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/2290859590391910508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=2290859590391910508&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/2290859590391910508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/2290859590391910508'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2008/07/publishing-latex-to-web_04.html' title='Publishing Latex to the Web'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-4332303109972259814</id><published>2008-07-01T19:49:00.000-07:00</published><updated>2008-07-05T20:11:40.033-07:00</updated><title type='text'>Barrels of Gold</title><content type='html'>&lt;h2&gt;&lt;a name="SECTION00001000000000000000"&gt;Problem&lt;/a&gt;&lt;/h2&gt;&lt;br /&gt; My friend Brian Marion posed a variant of the following problem:&lt;br /&gt;Suppose I just robbed Fort Knox.  I was in a rush and I put the gold in what I had available: 3 large barrels.  I didn't keep track of how much I put in each one, I just threw bars into whichever was closest until the klaxons drove my nerves over the edge.  Then I hammered down their lids and bailed - I can't even be sure that a particular barrel has anything in it.&lt;br /&gt;Since you helped plan the heist, I'll let you have any one of these three sealed barrels that you want.  Of course, even an empty barrel is too heavy to lift by hand, so it's hard to tell which has the most gold.  The only way you can measure their contents is to see if the forklift can lift them.  As a safety feature, our forklift can be calibrated to a certain weight, which it will lift no more than.  However we can only set this once because changing it a second time requires retooling and a visit from the manufacturer, which would blow our cover.&lt;br /&gt;We know this: these barrels are holding between 0 and 1000 pounds of gold, with a uniform, random distribution.  You get to pick a weight, any weight you'd like and test which barrels are heavier than that, and which are lighter.  If just one is heavier and two are lighter - great!  You found the one with the most gold.  If there's a tie for heaviest, you'll just have to pick one.  But hey, you might eliminate the lightest one and that's better than no information, right?&lt;br /&gt;Suppose the forklift's zero calibration is the weight of an empty barrel, so we can ignore that number.  Therefore, if you set it to 500 pounds, you have exactly a 1/2 chance of getting a particular barrel too heavy to lift, but a 3/8 chance of getting one too heavy and two too light.  On the other hand, you might get two too heavy, and you'll wish you had set it higher.  Obviously, there's a tradeoff: higher weights are less likely to have a tie among several barrels being the heaviest, but on the other hand they risk overshooting all the barrels and you'll be stuck just picking one of the three.&lt;br /&gt;What is the weight capacity you should set on the forklift to maximize your average expected gain?&lt;br /&gt;&lt;h2&gt;&lt;a name="SECTION00002000000000000000"&gt;Solution&lt;/a&gt;&lt;/h2&gt;&lt;br /&gt;First we'll solve a more general problem, then plug in the numbers to solve this one.  Without loss of generality, say the amount of gold in a barrel ranges from 0 to 1.  Suppose there are &lt;img width="6" height="11" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img1.png" alt="$b$"&gt; barrels and &lt;img width="7" height="10" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img2.png" alt="$g$"&gt; (for guesses) calibrations available to us.  Suppose the set &lt;img width="11" height="11" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img3.png" alt="$C$"&gt; is the set of calibrations, which we'll write as &lt;br /&gt;&lt;img width="131" height="16" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img4.png" alt="$C = \{c_{i} \hspace{.3em} \vert \hspace{.3em} i \in [1,g]\}$"&gt;.  &lt;img width="12" height="12" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img5.png" alt="$c_{g}$"&gt; will be the biggest one and they descend from there, so this equation is true:&lt;br /&gt;&lt;div align="CENTER"&gt;&lt;a name="eqn:order"&gt;&lt;/a&gt;&lt;table align="CENTER" cellpadding="0" width="100%"&gt;&lt;tr valign="MIDDLE"&gt;&lt;td nowrap align="RIGHT"&gt;&lt;img width="192" height="15" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img6.png" alt="$\displaystyle 0 &amp;lt; c_{1} &amp;lt; ... &amp;lt; c_{g-1} &amp;lt; c_{g} &amp;lt; 1$"&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td width="10" align="RIGHT"&gt;&lt;br /&gt;(1)&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;Finally, add the two constants &lt;img width="57" height="15" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img7.png" alt="$c_{g+1} = 1$"&gt; and &lt;img width="42" height="13" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img8.png" alt="$c_{0} = 0$"&gt; to make our formulas cleaner.  Each barrel can fall into any of the &lt;img width="34" height="14" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img9.png" alt="$g + 1$"&gt; ranges: less than the smallest calibration, bigger than the largest, or between any pair of consecutive calibrations.&lt;br /&gt;To find the expected value of a set of calibrations, we can find the expected values of each of these gaps and multiply those values by their probabilities, then sum up the products.  The average value of a barrel between &lt;img width="26" height="11" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img10.png" alt="$c_{i+1}$"&gt; and &lt;img width="10" height="9" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img11.png" alt="$c_{i}$"&gt; is &lt;br /&gt;&lt;img width="47" height="20" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img12.png" alt="$\frac{c_{j+1}+c_{j}}{2}$"&gt; and the only way you'll end up with that as the amount of gold you get is if the largest barrel is in that range.  Fortunately, that probability is easy to calculate: the chance of all the barrels being less than &lt;img width="26" height="11" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img10.png" alt="$c_{i+1}$"&gt; is &lt;img width="26" height="19" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img13.png" alt="$c_{i+1}^{b}$"&gt; and the chance of them all being smaller than &lt;img width="10" height="9" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img11.png" alt="$c_{i}$"&gt; is &lt;img width="11" height="17" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img14.png" alt="$c_{i}^{b}$"&gt;, so we can simply subtract these two powers to get the probability that &lt;i&gt;all the barrels are less than &lt;img width="26" height="11" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img10.png" alt="$c_{i+1}$"&gt;, but not all are less than &lt;img width="10" height="9" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img11.png" alt="$c_{i}$"&gt;&lt;/i&gt;.&lt;br /&gt;Then the expected value is&lt;br /&gt;&lt;div align="CENTER"&gt;&lt;a name="eqn:value"&gt;&lt;/a&gt;&lt;table align="CENTER" cellpadding="0" width="100%"&gt;&lt;tr valign="MIDDLE"&gt;&lt;td nowrap align="RIGHT"&gt;&lt;img width="35" height="16" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img15.png" alt="$\displaystyle E(C)$"&gt;&lt;/td&gt;&lt;td align="CENTER" nowrap&gt;&lt;img width="10" height="4" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img16.png" alt="$\textstyle =$"&gt;&lt;/td&gt;&lt;td align="LEFT" nowrap&gt;&lt;img width="165" height="46" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img17.png" alt="$\displaystyle \sum_{j = 0}^{g}\frac{c_{j+1}+c_{j}}{2}(c_{j+1}^{b} - c_{j}^{b})$"&gt;&lt;/td&gt;&lt;td width="10" align="RIGHT"&gt;&lt;br /&gt;(2)&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="MIDDLE"&gt;&lt;td nowrap align="RIGHT"&gt;&amp;nbsp;&lt;/td&gt;&lt;td align="CENTER" nowrap&gt;&lt;img width="10" height="4" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img16.png" alt="$\textstyle =$"&gt;&lt;/td&gt;&lt;td align="LEFT" nowrap&gt;&lt;img width="202" height="57" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img18.png" alt="$\displaystyle \frac{1}{2} \left[\sum_{j = 0}^{g}(c_{j+1}+c_{j})(c_{j+1}^{b} - c_{j}^{b}) \right]$"&gt;&lt;/td&gt;&lt;td width="10" align="RIGHT"&gt;&lt;br /&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="MIDDLE"&gt;&lt;td nowrap align="RIGHT"&gt;&amp;nbsp;&lt;/td&gt;&lt;td align="CENTER" nowrap&gt;&lt;img width="10" height="4" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img16.png" alt="$\textstyle =$"&gt;&lt;/td&gt;&lt;td align="LEFT" nowrap&gt;&lt;img width="269" height="57" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img19.png" alt="$\displaystyle \frac{1}{2} \left[\sum_{j = 0}^{g}(c_{j+1}^{b+1} - c_{j+1}c_{j}^{b} +c_{j}c_{j+1}^{b} - c_{j}^{b+1}) \right]$"&gt;&lt;/td&gt;&lt;td width="10" align="RIGHT"&gt;&lt;br /&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="MIDDLE"&gt;&lt;td nowrap align="RIGHT"&gt;&amp;nbsp;&lt;/td&gt;&lt;td align="CENTER" nowrap&gt;&lt;img width="10" height="4" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img16.png" alt="$\textstyle =$"&gt;&lt;/td&gt;&lt;td align="LEFT" nowrap&gt;&lt;img width="304" height="57" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img20.png" alt="$\displaystyle \frac{1}{2} \left[\sum_{j = 0}^{g}(c_{j}c_{j+1}^{b} - c_{j+1}c_{j}^{b}) +\sum_{j = 0}^{g}(c_{j+1}^{b+1}- c_{j}^{b+1}) \right]$"&gt;&lt;/td&gt;&lt;td width="10" align="RIGHT"&gt;&lt;br /&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="MIDDLE"&gt;&lt;td nowrap align="RIGHT"&gt;&amp;nbsp;&lt;/td&gt;&lt;td align="CENTER" nowrap&gt;&lt;img width="10" height="4" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img16.png" alt="$\textstyle =$"&gt;&lt;/td&gt;&lt;td align="LEFT" nowrap&gt;&lt;img width="198" height="57" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img21.png" alt="$\displaystyle \frac{1}{2} \left[\sum_{j = 0}^{g}(c_{j}c_{j+1}^{b} - c_{j+1}c_{j}^{b}) + 1 \right]$"&gt;&lt;/td&gt;&lt;td width="10" align="RIGHT"&gt;&lt;br /&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;The maximum value of &lt;img width="35" height="16" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img22.png" alt="$E(C)$"&gt; can be found by taking partial derivatives with respect to each &lt;img width="43" height="13" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img23.png" alt="$c_{i} \in C$"&gt;, setting these expressions to zero, and solving them simultaneously.  The constant 1 will not survive differentiation and the &lt;img width="6" height="19" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img24.png" alt="$\frac{1}{2}$"&gt; is superfluous.  A variable &lt;img width="10" height="9" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img11.png" alt="$c_{i}$"&gt; appears in 4 terms, namely&lt;br /&gt;&lt;div align="CENTER"&gt;&lt;br /&gt;&lt;img width="221" height="19" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img25.png" alt="\begin{eqnarray*}c_{i}c_{i+1}^{b}-c_{i}^{b}c_{i+1} + c_{i-1}c_{i}^{b}-c_{i-1}^{b}c_{i}\end{eqnarray*}"&gt;&lt;/div&gt;&lt;br /&gt;with derivative, &lt;br /&gt;&lt;div align="CENTER"&gt;&lt;br /&gt;&lt;img width="243" height="19" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img26.png" alt="\begin{eqnarray*}c_{i+1}^{b}-bc_{i}^{b-1}c_{i+1} + bc_{i-1}c_{i}^{b-1}-c_{i-1}^{b}\end{eqnarray*}"&gt;&lt;/div&gt;&lt;br /&gt;Thus the solution can be found by solving the equations:&lt;br /&gt;&lt;div align="CENTER"&gt;&lt;a name="eqn:simple"&gt;&lt;/a&gt;&lt;table align="CENTER" cellpadding="0" width="100%"&gt;&lt;tr valign="MIDDLE"&gt;&lt;td nowrap align="RIGHT"&gt;&lt;img width="345" height="19" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img27.png" alt="$\displaystyle c_{i+1}^{b}-bc_{i}^{b-1}c_{i+1} + bc_{i-1}c_{i}^{b-1}-c_{i-1}^{b} = 0, \forall i \in [1, g]$"&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td width="10" align="RIGHT"&gt;&lt;br /&gt;(3)&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2&gt;&lt;a name="SECTION00003000000000000000"&gt;Finally, If &lt;i&gt;g = 1&lt;/i&gt; and &lt;i&gt;b = 3&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;&lt;br /&gt;Returning to our original problem, if there are 3 barrels and 1 calibration &lt;img width="62" height="16" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img28.png" alt="$C = \{c_{1}\}$"&gt;, the Equations (&lt;a href="#eqn:simple"&gt;3&lt;/a&gt;) require that we solve &lt;div align="CENTER"&gt;&lt;br /&gt;&lt;img width="100" height="17" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img29.png" alt="\begin{eqnarray*}1 - 3c_{1}^{2} &amp;amp; = &amp;amp; 0\end{eqnarray*}"&gt;&lt;/div&gt;&lt;br /&gt;Therefore, the solution is &lt;br /&gt;&lt;img width="141" height="22" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img30.png" alt="$c_{1} = \frac{1}{\sqrt{3}} = 0.57735... $"&gt;, meaning the best calibration is 577 lbs.  This has &lt;a name="tex2html1" href="http://www.google.com/search?hl=en&amp;amp;q=3+*+.57735%5E2+*+%281+-+.57735+%29+%5E+1"&gt;a nice 42% chance &lt;/a&gt;of isolating the heaviest barrel and &lt;a name="tex2html2" href="http://www.google.com/search?hl=en&amp;amp;q=.57735%5E3+%2B+%281+-+.57735+%29+%5E+3"&gt;a mere 27% chance &lt;/a&gt;of not separating the barrels at all.  You must be wondering what your payout is.  By Equation &lt;a href="#eqn:value"&gt;2&lt;/a&gt; it is  &lt;a name="tex2html3" href="http://www.google.com/search?hl=en&amp;amp;q=%281+%2B+.57735%29+%2F+2++*+%281+-+.57735%5E3+%29%2B+.57735+*+%28.57735+%5E3%29"&gt;748 pounds of Gold&lt;/a&gt;.&lt;br /&gt;&lt;h2&gt;&lt;a name="SECTION00004000000000000000"&gt;Another Example, &lt;i&gt;g = 3&lt;/i&gt; and &lt;i&gt;b = 4&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;&lt;br /&gt;As another example, for 3 calibrations &lt;br /&gt;&lt;img width="104" height="16" align="BOTTOM" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img31.png" alt="$C = \{c_{1}, c_{2}, c_{3}\}$"&gt; and 4 barrels, Equations (&lt;a href="#eqn:simple"&gt;3&lt;/a&gt;) are&lt;div align="CENTER"&gt;&lt;br /&gt;&lt;img width="210" height="65" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img32.png" alt="\begin{eqnarray*}c_{2}^{4}-4c_{1}^{3}c_{2} &amp;amp; = &amp;amp; 0 \\c_{3}^{4}-4c_{2}^{3}c_{3......{4} &amp;amp; = &amp;amp; 0 \\1-4c_{3}^{3} + 4c_{2}c_{3}^{3}-c_{2}^{4} &amp;amp; = &amp;amp; 0\end{eqnarray*}"&gt;&lt;/div&gt;&lt;br /&gt;This might be pretty tricky to solve by hand, but the mathematical software &lt;a name="tex2html4" href="http://www.sagemath.org/"&gt;Sage &lt;/a&gt;gives the numerical solution:&lt;div align="CENTER"&gt;&lt;br /&gt;&lt;img width="122" height="61" border="0" src="http://jonathanwellons.com/barrels-of-gold/barrels-of-gold-img33.png" alt="\begin{eqnarray*}c_{3} &amp;amp; = &amp;amp; 0.83463... \\c_{2} &amp;amp; = &amp;amp; 0.64395... \\c_{1} &amp;amp; = &amp;amp; 0.40566...\end{eqnarray*}"&gt;&lt;/div&gt;&lt;br /&gt;In fact, &lt;a name="tex2html5" href="http://www.sagemath.org/"&gt;Sage &lt;/a&gt;finds 57 solutions but only 5 are real. Of these 5, only 1 satisfies the ordering in Inequalities (&lt;a href="#eqn:order"&gt;1&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-4332303109972259814?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/4332303109972259814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=4332303109972259814&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/4332303109972259814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/4332303109972259814'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2008/07/barrels-of-gold-problem-brian-marion.html' title='Barrels of Gold'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-8285876784349097398</id><published>2008-06-13T15:28:00.000-07:00</published><updated>2008-06-13T15:41:11.841-07:00</updated><title type='text'>The Factorial Base II</title><content type='html'>After my &lt;a href="http://snollew.blogspot.com/2008/06/factorial-base.html"&gt;factorial base post&lt;/a&gt;, a commenter asked about multiplication and it turns out multiplication is hard in factoradix, as far as I know.  A natural question is, what does factoradix make easy?  Here's an example: testing for divisibility.&lt;br /&gt;&lt;br /&gt;In fact, this can be downright awesome by comparison.  In decimal, testing if a number n divides into m takes time about equal to the length of m.  Checking if 3 divides into a billion digit decimal number will take your computer about one billion cycles, within some constant factor of time spent.&lt;br /&gt;&lt;br /&gt;Checking if m divides n in factoradix takes time proportional only to m.  Checking if 3 divides a billion digit number in factoradix (which would be about a 9 billion digit number in decimal because of decimal's less efficient use of digits), only requires looking at the last 2 places!&lt;br /&gt;&lt;br /&gt;Let me give an example.  Does 3 divide into 9a0a4023220011?&lt;br /&gt;&lt;br /&gt;Recall that each of the places corresponds to a certain number of factorials.  Well, every factorial greater than 2! contains 3 as a factor, by definition.  Therefore, the values of any digit other that the two rightmost, is irrelevant, because it could only change the value of the number by a multiple of three.  This is sort of like how you can tell if a decimal number is divisible by ten only by looking at the last digit (all the other digits cannot affect the divisibility by ten).&lt;br /&gt;&lt;br /&gt;Getting back to 9a0a4023220011, we need only check 11.  Sure enough 11(factoradix) = 1 * 2! + 1 * 1! = 3.  So yes, 3 does divide 9a0a4023220011.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-8285876784349097398?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/8285876784349097398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=8285876784349097398&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/8285876784349097398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/8285876784349097398'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2008/06/factorial-base-ii.html' title='The Factorial Base II'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-3285922027481075749</id><published>2008-06-12T21:23:00.001-07:00</published><updated>2008-06-13T13:41:12.833-07:00</updated><title type='text'>Is No One Rational?</title><content type='html'>I ran into a math subproblem in the course of a bigger problem.  I thought I'd give the Internet a shot before posting the answer.  Here it is:&lt;br /&gt;&lt;br /&gt;Show that for any finite set of positive real numbers, there must exist some number &lt;i&gt;x&lt;/i&gt; such that &lt;i&gt;x&lt;/i&gt; times each of the numbers in the set produces an irrational number.&lt;br /&gt;&lt;br /&gt;Or rephrased:&lt;br /&gt;&lt;br /&gt;If &lt;i&gt;n&lt;/i&gt; runners start out together on an infinite race, each at a constant speed, which is different from the others' speeds, show that at some time each one will be an irrational distance from the start line.&lt;br /&gt;&lt;br /&gt;Just a reminder: irrational numbers are those that cannot be written as a fraction &lt;i&gt;a/b&lt;/i&gt; with &lt;i&gt;a&lt;/i&gt; and &lt;i&gt;b&lt;/i&gt; both whole numbers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-3285922027481075749?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/3285922027481075749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=3285922027481075749&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/3285922027481075749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/3285922027481075749'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2008/06/is-no-one-rational.html' title='Is No One Rational?'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-7987632184239893255</id><published>2008-06-08T13:56:00.000-07:00</published><updated>2008-06-08T18:13:46.211-07:00</updated><title type='text'>The Factorial Base</title><content type='html'>We've all heard of binary and decimal as systems to represent integers.  The idea is simple: In the decimal number 328, 3 reflects three hundreds, 2 reflects two tens and the 8 adds in eight ones.&lt;br /&gt;&lt;br /&gt;The same number is 101001000 in binary.  Specifically, one 256, one 64 and one 8.  256, 64 and 8 are the eighth, sixth and third powers of two, and those occur as ones that many spaces over from the right side of the number.&lt;br /&gt;&lt;br /&gt;Clearly, numbers are longer in binary than they are in decimal, but the digits are much simpler in binary.  If all we cared about was reducing the number of digits, we could use base 20, or 2008 or the largest number we could think of.&lt;br /&gt;&lt;br /&gt;Of course the tradeoff that comes is that it can be hard to make up and keep straight all the extra digits we would need.  For example, the decimal number 1330 only needs three digits in base 11, but each of those digits is the digit "10", because 1330 = 10 * 11&lt;sup&gt;2&lt;/sup&gt; + 10 * 11 + 10.  How would we write this?  One option is the hexadecimal system where 10 is a, 11 is b and so on.  Then 1330 (base 10) = aaa (base 11).  We can take this all the way up to base 36 using all 26 letters, in which case a long decimal number like 2621102907451 (base 10) compacts down to xg48zv3v (base 36).&lt;br /&gt;&lt;br /&gt;But for a small number like 10, it seems unreasonable to write it as "a" just to save one digit.  What if there was some way to have small digits for small numbers and compact representations for large numbers?  It turns out there is a way to do this using the "factorial base" or "factoradix".&lt;br /&gt;&lt;br /&gt;In factoradix, the rightmost digit is base 2, the next one is base 3, and so on.   As an example, here's how you would calculate the factoradix notation for 99:&lt;br /&gt;&lt;br /&gt;First we notice that 99 gives a remainder of 1 when divided by 2.  The quotient is 49. We keep both of these numbers: 1 because it is the rightmost digit of the factoradix representation of 99 and 49 because we need it for the next steps.  Next, 49 divided by 3 is 16 with remainder 1.  So 1 is the next digit and so far we have _11 as our representation with the _ part still to be filled in (we can't know how many digits it will be, yet).  Divide 16 by 4, quotient: 4, remainder: 0.  Last, divide 4 by 5 to get a remainder of 4 and quotient of 0 (0 means the algorithm is finished).     Combining all the remainders, 4011 ends up as the factoradix notation for  99.  Longer yes, but with a simpler choice of digits.&lt;br /&gt;&lt;br /&gt;We don't need to go through the details, but larger numbers make the opposite tradeoff in factoradix.  A 1 with 47 zeros behind it becomes 4z7,h0x,ipf,5gr,0bc,l7l,977,460,068,952,315,551,220 which is only 39 digits long.  A 1 with 100 zeros is only 69 digits long, but we need some way to encode digits like "58".&lt;br /&gt;&lt;br /&gt;What do some more of these representations look like?  First, the Perl function below encapsulates the algorithm above.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="#804000"&gt;&lt;b&gt;sub&lt;/b&gt;&lt;/font&gt;&lt;font color="#008080"&gt; &lt;/font&gt;&lt;font color="#008080"&gt;factoradix&lt;/font&gt;&lt;font color="#008080"&gt; &lt;/font&gt;{&lt;br /&gt;    &lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$n&lt;/font&gt; = &lt;font color="#804000"&gt;&lt;b&gt;shift&lt;/b&gt;&lt;/font&gt;;&lt;br /&gt;    &lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;$base&lt;/font&gt; = Math::BigInt-&amp;gt;&lt;font color="#804000"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;(&lt;font color="#c00000"&gt;&lt;b&gt;2&lt;/b&gt;&lt;/font&gt;);&lt;br /&gt;    &lt;font color="#804000"&gt;&lt;b&gt;my&lt;/b&gt;&lt;/font&gt; (&lt;font color="#008080"&gt;@digits&lt;/font&gt;, &lt;font color="#008080"&gt;$digit&lt;/font&gt;);&lt;br /&gt;    &lt;font color="#804000"&gt;&lt;b&gt;while&lt;/b&gt;&lt;/font&gt; (&lt;font color="#008080"&gt;$n&lt;/font&gt;-&amp;gt;bcmp(&lt;font color="#c00000"&gt;&lt;b&gt;0&lt;/b&gt;&lt;/font&gt;)) {&lt;br /&gt;        (&lt;font color="#008080"&gt;$n&lt;/font&gt;, &lt;font color="#008080"&gt;$digit&lt;/font&gt;) = &lt;font color="#008080"&gt;$n&lt;/font&gt;-&amp;gt;bdiv(&lt;font color="#008080"&gt;$base&lt;/font&gt;);&lt;br /&gt;        &lt;font color="#804000"&gt;&lt;b&gt;unshift&lt;/b&gt;&lt;/font&gt; &lt;font color="#008080"&gt;@digits&lt;/font&gt;, &lt;font color="#008080"&gt;$digit&lt;/font&gt;-&amp;gt;bstr();&lt;br /&gt;        &lt;font color="#008080"&gt;$base&lt;/font&gt;-&amp;gt;binc();&lt;br /&gt;    }&lt;br /&gt;    &lt;font color="#804000"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt; [ &lt;font color="#008080"&gt;@digits&lt;/font&gt; ];&lt;br /&gt;} &lt;/pre&gt;&lt;br /&gt;Using this function, here's how the powers of ten start out in factoradix:&lt;br /&gt;For 10&lt;sup&gt;0&lt;/sup&gt;, we get 1&lt;br /&gt;For 10&lt;sup&gt;1&lt;/sup&gt;, we get 120&lt;br /&gt;For 10&lt;sup&gt;2&lt;/sup&gt;, we get 4,020&lt;br /&gt;For 10&lt;sup&gt;3&lt;/sup&gt;, we get 121,220&lt;br /&gt;For 10&lt;sup&gt;4&lt;/sup&gt;, we get 1,651,220&lt;br /&gt;For 10&lt;sup&gt;5&lt;/sup&gt;, we get 23,551,220&lt;br /&gt;For 10&lt;sup&gt;6&lt;/sup&gt;, we get 266,251,220&lt;br /&gt;For 10&lt;sup&gt;7&lt;/sup&gt;, we get 2,750,051,220&lt;br /&gt;For 10&lt;sup&gt;8&lt;/sup&gt;, we get 25,551,151,220&lt;br /&gt;For 10&lt;sup&gt;9&lt;/sup&gt;, we get 210,564,451,220&lt;br /&gt;For 10&lt;sup&gt;10&lt;/sup&gt;, we get 1,7a5,726,651,220&lt;br /&gt;For 10&lt;sup&gt;15&lt;/sup&gt;, we get 2d,caa,584,234,451,220&lt;br /&gt;For 10&lt;sup&gt;20&lt;/sup&gt;, we get 1k2,13c,54a,a81,881,151,220&lt;br /&gt;For 10&lt;sup&gt;25&lt;/sup&gt;, we get g2i,h8c,8f7,bc3,5b8,250,051,220&lt;br /&gt;For 10&lt;sup&gt;30&lt;/sup&gt;, we get 3,7mf,cdg,584,64c,f8b,c01,182,251,220&lt;br /&gt;For 10&lt;sup&gt;35&lt;/sup&gt;, we get c,4tr,pn8,9ef,g2b,d3f,34b,225,975,551,220&lt;br /&gt;For 10&lt;sup&gt;40&lt;/sup&gt;, we get x,tkt,18i,jep,8bh,g9j,f7e,1bb,652,056,651,220&lt;br /&gt;For 10&lt;sup&gt;64&lt;/sup&gt;, we get g,lqd,ila,9ii,ju0,a5m,bas,91k,7l5,m66,1ii,4h5,462,7a5,726,651,220&lt;br /&gt;&lt;br /&gt;Every power of ten larger than 10&lt;sup&gt;64&lt;/sup&gt; seems to use a digit that we don't have a letter for (and I checked up to 10&lt;sup&gt;1400&lt;/sup&gt;!).  Of course, all we need to do is add more symbols, maybe hearts or that thing The Artist Formerly Known as Prince uses...&lt;br /&gt;&lt;br /&gt;What do you think is the next factoradix question to investigate?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-7987632184239893255?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/7987632184239893255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=7987632184239893255&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/7987632184239893255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/7987632184239893255'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2008/06/factorial-base.html' title='The Factorial Base'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-781082949945735477</id><published>2008-03-02T16:11:00.000-08:00</published><updated>2008-03-10T11:58:50.024-07:00</updated><title type='text'>From the Outbox: a Balanced Diet</title><content type='html'>From:   Me&lt;br /&gt;Subject: Re: The 20 Worst Foods in America]&lt;br /&gt;Date: March 1, 2008 5:44:56 PM CST&lt;br /&gt;To:   xxxxxxx@xxxxx.xxx&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On Feb 29, 2008, at 9:48 AM, Xxxxx Xxxxxxx wrote:&lt;br /&gt;&lt;br /&gt;&gt; Thought this was interesting.&lt;br /&gt;&lt;br /&gt;&gt; Xxxxx&lt;br /&gt;&lt;br /&gt;&gt; &gt; 1. The Worst Food in America&lt;br /&gt;&gt; &gt; Outback Steakhouse Aussie Cheese Fries with Ranch Dressing&lt;br /&gt;&lt;br /&gt;&gt; &gt; &lt;mime-attachment.jpeg&gt;&lt;br /&gt;&lt;br /&gt;&gt; &gt; 2,900 calories &lt;br /&gt;&gt; &gt; 182 g fat 240 g carbs &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Of course, there's nothing inherently wrong with calories taken out of context of all food one eats.  The Outback Steakhouse Aussie Cheese Fries with Ranch Dressing is a perfect complement to some diet, somewhere.  For instance, if the only other thing we ate was grasses and roots that we dug up on the hllls, the aussie cheese fries might balance it out nicely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-781082949945735477?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/781082949945735477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=781082949945735477&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/781082949945735477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/781082949945735477'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2008/03/from-outbox-balanced-diet.html' title='From the Outbox: a Balanced Diet'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-2207020503235650352</id><published>2008-02-25T12:29:00.001-08:00</published><updated>2008-02-25T12:30:06.036-08:00</updated><title type='text'>Clothing's destiny?</title><content type='html'>If you ran a shirt through the dryer sufficiently many times, would it eventually turn completely into lint?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-2207020503235650352?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/2207020503235650352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=2207020503235650352&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/2207020503235650352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/2207020503235650352'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2008/02/clothings-destiny.html' title='Clothing&apos;s destiny?'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-1768889472001159914</id><published>2008-02-13T17:44:00.000-08:00</published><updated>2008-11-15T09:33:54.545-08:00</updated><title type='text'>The Computer Scientific Method</title><content type='html'>I was sent a presentation called &lt;a href="www.cs.berkeley.edu/~pattrsn/talks/BadCareer.pdf"&gt;How to Have a Bad Career in Research/Academia&lt;/a&gt; by &lt;a href="http://www.cs.berkeley.edu/~pattrsn/"&gt;David A. Patterson&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The best slide concerns the "Computer Scientific Method;" funny because it's true...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Y6hChhnAEcc/R7Od9rJZhhI/AAAAAAAAAAc/6aQQOauxNVA/s1600-h/cs-method.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Y6hChhnAEcc/R7Od9rJZhhI/AAAAAAAAAAc/6aQQOauxNVA/s400/cs-method.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5166646880403818002" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-1768889472001159914?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/1768889472001159914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=1768889472001159914&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/1768889472001159914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/1768889472001159914'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2008/02/computer-scientific-method.html' title='The Computer Scientific Method'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Y6hChhnAEcc/R7Od9rJZhhI/AAAAAAAAAAc/6aQQOauxNVA/s72-c/cs-method.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-4537463972993266864</id><published>2008-02-12T14:10:00.000-08:00</published><updated>2008-02-12T15:40:08.176-08:00</updated><title type='text'>Physics Question: Leaky Inflatable Chair</title><content type='html'>At &lt;a href="http://conferences.oreillynet.com/os2006/"&gt;OSCON 2006&lt;/a&gt;, some O'Reilly developers and I were lounging in the expansive round upper-level of the &lt;a href="http://www.oregoncc.org/"&gt;Oregon Convention Center&lt;/a&gt;.  It turns out that the someone had spread around a bunch of inflatable chairs  which were molded after an overstuffed cushy easy chair.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/profile/14329280406283683610"&gt;Ryan Grimm&lt;/a&gt; had claimed a partially-deflated one.  As I eyed it, I posed the following question:&lt;br /&gt;&lt;br /&gt;Suppose that the air-filled chair had a pinhole leak on the side.  Could it deflate faster depending on how you sat on it?  In other words, would the air leave faster, slower or at the same rate if you spread your weight out as evenly as possibly in a wide slouch compared to if you stood on one foot and put all your weight on a few square inches?&lt;br /&gt;&lt;br /&gt;I posed this to a handful of people, and none of them ever agreed with my answer.  Maybe we can put this to rest now.  What do you think and why?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Update with Legal Fine Print&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;All your weight is on the chair.  You're not blocking the pinhole.  In both scenarios, your weight is the same.  The question is about over how wide of a space your weight is distributed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Updated Example&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;You could rephrases this problem as something like:&lt;br /&gt;"Will your inflatable mattress retain its pressure longer if you curl up in a cannonball or if you spread out like a pancake?"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-4537463972993266864?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/4537463972993266864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=4537463972993266864&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/4537463972993266864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/4537463972993266864'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2008/02/physics-question-leaky-inflatable-chair.html' title='Physics Question: Leaky Inflatable Chair'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-3855570299745051024</id><published>2008-02-10T16:16:00.000-08:00</published><updated>2008-11-15T09:33:55.027-08:00</updated><title type='text'>Cookie Recipe</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Y6hChhnAEcc/R6-xbrJZhgI/AAAAAAAAAAU/UzyPPP53S30/s1600-h/cookies-before.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_Y6hChhnAEcc/R6-xbrJZhgI/AAAAAAAAAAU/UzyPPP53S30/s320/cookies-before.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5165542386613978626" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This recipe has served me well for the last 15 years.&lt;br /&gt;&lt;br /&gt;3/4 cup butter&lt;br /&gt;1 cup brown sugar&lt;br /&gt;1/2 cup sugar&lt;br /&gt;teaspoon vanilla&lt;br /&gt;2 eggs&lt;br /&gt;3 cups flour&lt;br /&gt;1 teaspoon baking soda&lt;br /&gt;1 teaspoon salt&lt;br /&gt;2 cups chocolate chips&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; The butter must be softened, but not melted.  Melting it was a disastrous mistake I made a number of times.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; The line suggesting 1 teaspoon baking soda is a pack of lies.  You must use at least 2.5 teaspoons.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Don't overbake.  I would tell you how long, but ovens vary so you will have to eyeball it.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Y6hChhnAEcc/R6-xbLJZhfI/AAAAAAAAAAM/M2if5S9L8pA/s1600-h/cookies-after.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_Y6hChhnAEcc/R6-xbLJZhfI/AAAAAAAAAAM/M2if5S9L8pA/s320/cookies-after.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5165542378024044018" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-3855570299745051024?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/3855570299745051024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=3855570299745051024&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/3855570299745051024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/3855570299745051024'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2008/02/cookie-recipe.html' title='Cookie Recipe'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Y6hChhnAEcc/R6-xbrJZhgI/AAAAAAAAAAU/UzyPPP53S30/s72-c/cookies-before.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-3774951558626988250</id><published>2007-11-30T10:57:00.000-08:00</published><updated>2007-12-02T11:36:21.935-08:00</updated><title type='text'>2008 Election Correctly Predicted</title><content type='html'>Three European scientists have &lt;a href="http://www.win.tue.nl/hashclash/Nostradamus/"&gt;produced a document which correctly states who will win the 2008 US presidential election&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;They don't need to give you the document (although they do) because they can give you the MD5 checksum.  A checksum, which is a kind of fingerprint for the document, accordingly to the conventional wisdom can only come from that one document.  In principle, other documents may exist with the same fingerprint, but are technically infeasible to find.  Then, after the election is over, they will make the PDF available and invite you to measure its MD5.  If it matches, that proves it has to have been the same one they fingerprinted back in Nov 30, 2007.&lt;br /&gt;&lt;br /&gt;The fingerprint analogy goes pretty far.  Imagine that they had said,&lt;br /&gt;&lt;i&gt;We know who will win the 2008 presidential election.  To prove it, we found someone with his name and fingerprinted him.  Here's the fingerprint ....&lt;br /&gt;&lt;br /&gt;On the morrow of Election day, the person will visit your house, let you take his fingerprints and show his driver's license to prove his name is that of the person who won.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The catch, of course if that MD5s aren't really as good as fingerprints, despite widespread belief, even among experts.  Marc Stevens, Arjen Lenstra and Weger have simply found an appealing way to exploit duplicatability of MD5s, constructing 12 documents with the same MD5, each with the name of different candidate (and some non-candidates).  In our metaphor, this is coming up with 12 different people named after the candidates and then bioengineering them to have the same fingerprints.  No matter who wins in 2008, they are "correct," simply by choosing which one to reveal.&lt;br /&gt;&lt;br /&gt;Excellent work!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-3774951558626988250?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/3774951558626988250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=3774951558626988250&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/3774951558626988250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/3774951558626988250'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2007/11/2008-election-correctly-predicted.html' title='2008 Election Correctly Predicted'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-6379208893987692991</id><published>2007-11-25T22:20:00.000-08:00</published><updated>2007-11-26T09:19:41.924-08:00</updated><title type='text'>My best way to get out of bed in the morning</title><content type='html'>Something I wrote in a chat log&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;12:17:34 AM: I was wondering once what would be the best possible way to wake up&lt;br /&gt;12:17:57 AM: but which would force you to get up&lt;br /&gt;12:17:58 AM: and I decided that if I was the richest person alive&lt;br /&gt;12:18:11 AM: I would have a bed built so that when the alarm clock went off&lt;br /&gt;12:18:34 AM: it would unhinge in the middle so the two halves would swing down and gently drop me&lt;br /&gt;12:18:36 AM: into a hot tub&lt;br /&gt;12:19:00 AM: which would be a great way to start the day, and there's no going back to sleep&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-6379208893987692991?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/6379208893987692991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=6379208893987692991&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/6379208893987692991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/6379208893987692991'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2007/11/my-best-way-to-get-out-of-bed-in.html' title='My best way to get out of bed in the morning'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-5632014069562612469</id><published>2007-11-13T16:56:00.000-08:00</published><updated>2007-11-13T17:58:26.350-08:00</updated><title type='text'>Women's Rights are Human Rights</title><content type='html'>Maybe one day &lt;a href="http://www.jordanmatter.com/exhibits/default.asp?name=nudes"&gt; this will be reality&lt;/a&gt;, when women have the same definition of decency as men do.&lt;br /&gt;&lt;br /&gt;The next step is naturally for social acceptability, then dare we entertain it, for it to be just as acceptable for men to wear bras and dresses.  MLK had a dream too!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-5632014069562612469?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/5632014069562612469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=5632014069562612469&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/5632014069562612469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/5632014069562612469'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2007/11/womens-rights-are-human-rights.html' title='Women&apos;s Rights are Human Rights'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-4705422235718344228</id><published>2007-11-13T09:39:00.001-08:00</published><updated>2007-11-13T16:28:09.806-08:00</updated><title type='text'>Starbucks' 87,000 options</title><content type='html'>I picked up a nutrition facts pamphlet at Starbucks that promises that with all the choices of creamer, syrup, spices, etc. "87,000" different beverages are possible.&lt;br /&gt;&lt;br /&gt;Here's a computer science/reverse engineering problem.  Find the number that is most likely to be the exact value of the number of options as Starbucks calculates it.  Some things you might assume:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It's likely to be within 500 of 87,000.&lt;/li&gt;&lt;li&gt;It's factorization makes it look the most like the product of 2's, 3's or other small numbers reflecting many choices.  For instance, it's unlikely to be 87011, which is prime.  However, 87480 is a candidate since 87480 = 2 * 2 * 2 * 3 * 3 * 3 * 3 * 3 * 3 * 3 * 5.  It's possible that there are 3 ingredients which you can have or not, explaining the 3 twos.  Maybe there are 3 sizes, 2 types of toppings (and the option to have nothing), 2 kinds of creamer (or none), something else with 5 options, and finally 27 (3*3*3) different beverages.  I don't know if this is how the Starbucks menu works and it doesn't matter: 87480 is definitely more likely than 87011. &lt;/li&gt;&lt;/ol&gt;I'd like to hear of good algorithms to solve this problem, and if anyone who reads this knows more about Starbucks, that's a fine way to answer too.&lt;br /&gt;&lt;br /&gt;If we can't figure it out, let's not sweat it.  I'm pretty sure that 87,000 is way too low anyway...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-4705422235718344228?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/4705422235718344228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=4705422235718344228&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/4705422235718344228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/4705422235718344228'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2007/11/starbucks-87000-options.html' title='Starbucks&apos; 87,000 options'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2813489246992645284.post-8391443550515419226</id><published>2007-09-29T16:28:00.000-07:00</published><updated>2007-09-29T16:31:59.604-07:00</updated><title type='text'>Woods</title><content type='html'>&lt;a href="http://www.theotherpages.org/poems/books/longfellow/evangeline00.html"&gt;This is the forest primeval.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2813489246992645284-8391443550515419226?l=snollew.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snollew.blogspot.com/feeds/8391443550515419226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2813489246992645284&amp;postID=8391443550515419226&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/8391443550515419226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813489246992645284/posts/default/8391443550515419226'/><link rel='alternate' type='text/html' href='http://snollew.blogspot.com/2007/09/woods.html' title='Woods'/><author><name>wellons</name><uri>http://www.blogger.com/profile/14739749154115935212</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
