<?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; google treasure hunt</title>
	<atom:link href="http://davidpoblador.com/tag/google-treasure-hunt/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidpoblador.com</link>
	<description>#sysadmin, #SEO, #freesoftware, #entrepreneur</description>
	<lastBuildDate>Fri, 15 Jul 2011 07:48:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Google Treasure Hunt: Network Question</title>
		<link>http://davidpoblador.com/google-treasure-hunt-network-question/</link>
		<comments>http://davidpoblador.com/google-treasure-hunt-network-question/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 22:20:53 +0000</pubDate>
		<dc:creator>David Poblador i Garcia</dc:creator>
				<category><![CDATA[just for fun]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google treasure hunt]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">http://davidpoblador.com/blog/?p=37</guid>
		<description><![CDATA[The network question was by far the easiest one in GTH 2008 contest. Sample question: Below is a diagram of a computer network. The nodes are hosts on the network, and the lines between them are links. A packet is sent out from host N with a destination of 201.107.56.70. Which nodes does the packet [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption aligncenter" style="width: 410px"><img title="Network Problem" src="http://treasurehunt.appspot.com/images/network.png" alt="Network Problem" width="400" height="210" /><p class="wp-caption-text">Network Problem</p></div>
<p>The <a href="http://treasurehunt.appspot.com/historic/network/">network question</a> was by far the easiest one in <a href="http://googleblog.blogspot.com/2008/05/google-treasure-hunt-update.html">GTH 2008 contest</a>.</p>
<p>Sample question:</p>
<blockquote><p>Below is a diagram of a computer network.  The nodes are hosts on the     network, and the lines between them are links.  A packet is sent out     from host <strong>N</strong> with a destination of     <strong>201.107.56.70</strong>.  Which nodes does the packet pass     through on its way to the destination?  (include start and final node in     your answer)</p></blockquote>
<p>After that, Google presented a list of nodes with their <a href="http://en.wikipedia.org/wiki/IP_address">IP addresses</a>, 3 different <a href="http://en.wikipedia.org/wiki/Static_routing">static routes</a> and a <a href="http://en.wikipedia.org/wiki/Default_gateway">default gateway</a>. This is the entry for host <strong>N</strong>:</p>
<table style="border: 1px solid black;" border="1" width="100%">
<tbody>
<tr style="border: 1px solid black;"></tr>
<tr style="border: 1px solid black;">
<td style="border: 1px solid black;">N</td>
<td style="border: 1px solid black;">97.134.15.173</td>
<td style="border: 1px solid black;">88.42.227.237 =&gt; 53.138.73.76</td>
<td style="border: 1px solid black;">201.107.56.70 =&gt; 179.138.156.133</td>
<td style="border: 1px solid black;">68.190.198.0/24 =&gt; 248.194.205.8</td>
<td style="border: 1px solid black;">246.10.120.232</td>
</tr>
</tbody>
</table>
<p>Pretty easy:</p>
<ol>
<li>A packet going to 201.107.56.70 arrives at node N</li>
<li>Does it match 88.42.227.237 destination host? No&#8230; next try</li>
<li>Does it match 201.107.56.70 destination host? Yes!</li>
<li>The packet is forwarded to the host having 179.138.156.133 IP address (which is host B):</li>
</ol>
<table style="border: 1px solid black;" border="1" width="100%">
<tbody>
<tr style="border: 1px solid black;">
</tr>
<tr style="border: 1px solid black;">
<td style="border: 1px solid black;">B</td>
<td style="border: 1px solid black;">179.138.156.133</td>
<td style="border: 1px solid black;">31.114.20.211 =&gt; 248.194.205.8</td>
<td style="border: 1px solid black;">53.138.73.76 =&gt; 97.134.15.173</td>
<td style="border: 1px solid black;">248.194.205.0/24 =&gt; 67.244.46.98</td>
<td style="border: 1px solid black;">53.138.73.76</td>
</tr>
</tbody>
</table>
<p>And so forth&#8230;</p>
<p>&lt;bonus&gt;</p>
<p>How would route table at host B look like?</p>
<pre>devel@stewie:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
31.114.20.211   248.194.205.8   255.255.255.255 U     0      0        0 eth0
53.138.73.76    97.134.15.173   255.255.255.255 U     0      0        0 eth0
248.194.205.0   67.244.46.98    255.255.255.0   U     0      0        0 eth0
0.0.0.0         53.138.73.76    0.0.0.0         UG    100    0        0 eth0</pre>
<p>&lt;/bonus&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://davidpoblador.com/google-treasure-hunt-network-question/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Treasure Winners announced (and I&#8217;m among them)</title>
		<link>http://davidpoblador.com/google-treasure-winners-announced-and-im-among-them/</link>
		<comments>http://davidpoblador.com/google-treasure-winners-announced-and-im-among-them/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 07:30:37 +0000</pubDate>
		<dc:creator>David Poblador i Garcia</dc:creator>
				<category><![CDATA[just for fun]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google treasure hunt]]></category>
		<category><![CDATA[meta]]></category>

		<guid isPermaLink="false">http://davidpoblador.com/blog/?p=35</guid>
		<description><![CDATA[Google Treasure Hunt winners abound from Official Google Blog.]]></description>
			<content:encoded><![CDATA[<p><a href="http://googleblog.blogspot.com/2008/10/google-treasure-hunt-winners-abound.html">Google Treasure Hunt winners abound</a> from <a href="http://googleblog.blogspot.com/">Official Google Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidpoblador.com/google-treasure-winners-announced-and-im-among-them/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<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 must admit I&#8217;m really surprised. I could have never imagined I had a single chance [...]]]></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>

