<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Google Treasure Hunt 2008: the bot in the checkerboard problem</title>
	<atom:link href="http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/feed/" rel="self" type="application/rss+xml" />
	<link>http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/</link>
	<description>We only do fun stuff.</description>
	<pubDate>Sun, 12 Oct 2008 20:06:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Oleg</title>
		<link>http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/#comment-522725</link>
		<dc:creator>Oleg</dc:creator>
		<pubDate>Tue, 20 May 2008 00:04:55 +0000</pubDate>
		<guid isPermaLink="false">http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/#comment-522725</guid>
		<description>&lt;p&gt;Javascript solution:&lt;/p&gt;

&lt;p&gt;http://olegkikin.com/robots.html&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Javascript solution:</p>

<p><a href="http://olegkikin.com/robots.html" rel="nofollow">http://olegkikin.com/robots.html</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rudd-O</title>
		<link>http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/#comment-522432</link>
		<dc:creator>Rudd-O</dc:creator>
		<pubDate>Mon, 19 May 2008 15:45:54 +0000</pubDate>
		<guid isPermaLink="false">http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/#comment-522432</guid>
		<description>&lt;p&gt;adrian,&lt;/p&gt;

&lt;p&gt;You are absolutely right.  My combinatorics skills are more than ten years old, that must be why I probably didn't spot that way of solving the problem.&lt;/p&gt;

&lt;p&gt;About the Excel usage: you could also use OO.o Calc, which is exactly what I did to discover the series and find an arithmetic algorithm instead of a recursive function.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>adrian,</p>

<p>You are absolutely right.  My combinatorics skills are more than ten years old, that must be why I probably didn&#8217;t spot that way of solving the problem.</p>

<p>About the Excel usage: you could also use OO.o Calc, which is exactly what I did to discover the series and find an arithmetic algorithm instead of a recursive function.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: volte</title>
		<link>http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/#comment-522291</link>
		<dc:creator>volte</dc:creator>
		<pubDate>Mon, 19 May 2008 09:59:45 +0000</pubDate>
		<guid isPermaLink="false">http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/#comment-522291</guid>
		<description>&lt;p&gt;mul=lambda a,b:a&lt;em&gt;b;
x=rows+cols-1;y=cols;
print reduce(mul, xrange(2,x))/(reduce(mul, xrange(2,y))&lt;/em&gt;reduce(mul, xrange(2,x-y+1)))&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>mul=lambda a,b:a<em>b;
x=rows+cols-1;y=cols;
print reduce(mul, xrange(2,x))/(reduce(mul, xrange(2,y))</em>reduce(mul, xrange(2,x-y+1)))</p>]]></content:encoded>
	</item>
	<item>
		<title>By: adrian</title>
		<link>http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/#comment-521966</link>
		<dc:creator>adrian</dc:creator>
		<pubDate>Sun, 18 May 2008 18:02:37 +0000</pubDate>
		<guid isPermaLink="false">http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/#comment-521966</guid>
		<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Having read the discussion in reddit and this page, I think people are overthinking this too much.
I see 2 ways to solve this:
1) Mathematically. If you think in paths instead of cells, you can realize that:
 All paths are the same length, and have the (n-1) moves down, and (m-1) moves right.
 If for example you have a 5x7 grid, any path you do is going to have 4 moves down and 6 right. 
 Some possible moves:
   DDDDRRRRRR
   RRRRRRDDDD
   RDRDRDRDRR
   ...&lt;/p&gt;

&lt;p&gt;So the problem is now how to combine a set of 4 D from 10 elements:
  http://en.wikipedia.org/wiki/Combination
  and the solution:
  http://www.google.es/search?q=10!+%2F+(4!+*+6!)&#38;ie=UTF-8&lt;/p&gt;

&lt;p&gt;if you want to know a 45x48 grid:
http://www.google.es/search?hl=en&#38;q=%2845+-1+%2B+48+-+1%29%21+%2F+%28%2845+-+1%29%21+*+%2848+-+1%29%21%29&#38;btnG=Search&#38;meta=&lt;/p&gt;

&lt;p&gt;ok, it will not give you the exact decimal result (since google calculator uses doubles), but you get the idea.&lt;/p&gt;

&lt;p&gt;2) By computing. You need to realize that, as you said, C(n,m) = C(n-1, m) + C(n, m - 1)
That is, all the paths that come to cell (n,m) are the sum of the paths that come from the cell at the right, and the paths that come from the cell at the top. 
But, really, you don't need to "memoize" anything, not even use recursion to solve this. You can even do it in Excel! (and it will take far less than a second to calculate)
Start by writing 1 in cell A1. Copy this value int row 1 and in column A. Then in cell B2 write: = A2 + B1. And copy the cell to the right and down. Automatically you will get a grid with all the paths that pass for each cell, and if you look at cell N,M you will see the answer to the puzzle.&lt;/p&gt;

&lt;p&gt;Note (again) that doing this in Excel will give you a floating number, so you need to use a programming language to do the matrix. But &lt;em&gt;anything&lt;/em&gt; will work, you can do this in GWBasic for dos if you want to. No need for a CS degree. Just 2 for loops one inside the other. Just stat filling the array from (1,1) and move right then down, and you will need just one pass (order nxm), with a single in each iteration (c(n,m) = c(n-1, m) + c(n, m-1)) where c(n-1,m) and c(n,m-1) are already calculated. This will not take mor than a second in any computer/programming language, but you can over optimize it anyway by realizing that c[n,m] = c[m,n], and that you just need to keep one row of results (row n-1), not the whole matrix.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi,</p>

<p>Having read the discussion in reddit and this page, I think people are overthinking this too much.
I see 2 ways to solve this:
1) Mathematically. If you think in paths instead of cells, you can realize that:
 All paths are the same length, and have the (n-1) moves down, and (m-1) moves right.
 If for example you have a 5&#215;7 grid, any path you do is going to have 4 moves down and 6 right. 
 Some possible moves:
   DDDDRRRRRR
   RRRRRRDDDD
   RDRDRDRDRR
   &#8230;</p>

<p>So the problem is now how to combine a set of 4 D from 10 elements:
  <a href="http://en.wikipedia.org/wiki/Combination" rel="nofollow">http://en.wikipedia.org/wiki/Combination</a>
  and the solution:
  <a href="http://www.google.es/search?q=10" rel="nofollow">http://www.google.es/search?q=10</a>!+%2F+(4!+*+6!)&amp;ie=UTF-8</p>

<p>if you want to know a 45&#215;48 grid:
<a href="http://www.google.es/search?hl=en&amp;q=%2845+-1+%2B+48+-+1%29%21+%2F+%28%2845+-+1%29%21+" rel="nofollow">http://www.google.es/search?hl=en&amp;q=%2845+-1+%2B+48+-+1%29%21+%2F+%28%2845+-+1%29%21+</a>*+%2848+-+1%29%21%29&amp;btnG=Search&amp;meta=</p>

<p>ok, it will not give you the exact decimal result (since google calculator uses doubles), but you get the idea.</p>

<p>2) By computing. You need to realize that, as you said, C(n,m) = C(n-1, m) + C(n, m - 1)
That is, all the paths that come to cell (n,m) are the sum of the paths that come from the cell at the right, and the paths that come from the cell at the top. 
But, really, you don&#8217;t need to &#8220;memoize&#8221; anything, not even use recursion to solve this. You can even do it in Excel! (and it will take far less than a second to calculate)
Start by writing 1 in cell A1. Copy this value int row 1 and in column A. Then in cell B2 write: = A2 + B1. And copy the cell to the right and down. Automatically you will get a grid with all the paths that pass for each cell, and if you look at cell N,M you will see the answer to the puzzle.</p>

<p>Note (again) that doing this in Excel will give you a floating number, so you need to use a programming language to do the matrix. But <em>anything</em> will work, you can do this in GWBasic for dos if you want to. No need for a CS degree. Just 2 for loops one inside the other. Just stat filling the array from (1,1) and move right then down, and you will need just one pass (order nxm), with a single in each iteration (c(n,m) = c(n-1, m) + c(n, m-1)) where c(n-1,m) and c(n,m-1) are already calculated. This will not take mor than a second in any computer/programming language, but you can over optimize it anyway by realizing that c[n,m] = c[m,n], and that you just need to keep one row of results (row n-1), not the whole matrix.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: R</title>
		<link>http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/#comment-521957</link>
		<dc:creator>R</dc:creator>
		<pubDate>Sun, 18 May 2008 17:39:55 +0000</pubDate>
		<guid isPermaLink="false">http://rudd-o.com/archives/2008/05/18/google-treasure-hunt-2008-the-bot-in-the-checkerboard-problem/#comment-521957</guid>
		<description>&lt;p&gt;Elegant!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Elegant!</p>]]></content:encoded>
	</item>
</channel>
</rss>
