<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Poblador i Garcia &#187; tshirt</title>
	<atom:link href="http://davidpoblador.com/tag/tshirt/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidpoblador.com</link>
	<description>SRE Team Lead at Spotify</description>
	<lastBuildDate>Wed, 11 Apr 2012 15:53:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How did I win Google Treasure 2008? (1)</title>
		<link>http://davidpoblador.com/how-did-i-win-google-treasure-2008-1/</link>
		<comments>http://davidpoblador.com/how-did-i-win-google-treasure-2008-1/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 00:53:12 +0000</pubDate>
		<dc:creator>David Poblador i Garcia</dc:creator>
				<category><![CDATA[just for fun]]></category>
		<category><![CDATA[brute force]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google treasure hunt]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[tshirt]]></category>

		<guid isPermaLink="false">http://davidpoblador.com/blog/?p=7</guid>
		<description><![CDATA[It&#8217;s been 2 months since a nice girl at Google told me I won the Google Treasure Hunt 2008. One week ago, I got my present: a T-shirt and an engraved iPod Nano stating &#8220;Google Treasure Hunt &#8217;08 Winner&#8221;. I &#8230; <a href="http://davidpoblador.com/how-did-i-win-google-treasure-2008-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been 2 months since a nice girl at Google told me I won the <a href="http://treasurehunt.appspot.com/">Google Treasure Hunt 2008</a>. One week ago, I got my present: a T-shirt and an engraved iPod Nano stating &#8220;Google Treasure Hunt &#8217;08 Winner&#8221;. I must admit I&#8217;m really surprised. I could have never imagined I had a single chance to be one of the winners. I can&#8217;t figure out how many people took part in the contest.</p>
<p>It&#8217;s particularly suprising given the fact that I&#8217;m not that good at maths and my prime number &#8220;skills&#8221; are scarce nowadays. It&#8217;s time now to try to explain how I managed to solve out <a href="http://google-au.blogspot.com/2008/05/google-treasure-hunt.html">the &#8220;games&#8221;</a>.</p>
<p><a href="http://treasurehunt.appspot.com/historic/robot/"><strong>The robot</strong></a></p>
<blockquote><p>A robot is located at the top-left corner of a <strong>X</strong> x <strong>Y</strong> grid (marked &#8216;Start&#8217; in the diagram below).</p>
<p>The robot can only move either down or right at any point in time.        The robot is trying to reach the bottom-right corner of the grid        (marked &#8216;Finish&#8217; in the diagram below).</p>
<p>How many possible unique paths are there?</p></blockquote>
<p>Quick facts:</p>
<ul>
<li>2&#215;2 grid: 2 possible ways</li>
<li>3&#215;2 grid: 3 possible ways</li>
</ul>
<p>So far, so good&#8230; What about a 30&#215;40 grid?</p>
<p>I bet I was not the only naive guy who tried to get it by using a bruteforce 4 line Python script&#8230; OK&#8230; it took me less than a minute to realise that it wouldn&#8217;t work out (before 2040).</p>
<p>So&#8230;</p>
<p>What the heck? Let&#8217;s make use of some combinatorics.</p>
<p>In a 4&#215;4 grid, the robot must move exactly 3 times to the right and 3 times downwards&#8230; So&#8230;</p>
<p>DDDRRR<br />
DRDRDR<br />
&#8230;</p>
<p>So&#8230; &lt;hint&gt;how many ways you can permute 3 R and 3 D in an 6 move set?&lt;/hint&gt; I expanded that to the big grid, <em>et voilà</em>!</p>
<blockquote><p><em><span class="huge">Simplicity is prerequisite for reliability.</span></em><br />
<span class="bodybold"> Edsger Dijkstra</span></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://davidpoblador.com/how-did-i-win-google-treasure-2008-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

