<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Solving Project Euler Problems 161 (Trominoes Tiling) and 185 (Number Mind) with ZDDs</title>
	<atom:link href="http://ashutoshmehra.net/blog/2009/03/solving-project-euler-problems-with-zdds/feed/" rel="self" type="application/rss+xml" />
	<link>http://ashutoshmehra.net/blog/2009/03/solving-project-euler-problems-with-zdds/</link>
	<description>Notes on Math, Computer Science &#38; Programming</description>
	<lastBuildDate>Thu, 29 Jul 2010 04:20:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ashutosh</title>
		<link>http://ashutoshmehra.net/blog/2009/03/solving-project-euler-problems-with-zdds/comment-page-1/#comment-371</link>
		<dc:creator>Ashutosh</dc:creator>
		<pubDate>Mon, 18 May 2009 09:37:44 +0000</pubDate>
		<guid isPermaLink="false">http://ashutoshmehra.net/blog/?p=157#comment-371</guid>
		<description>@foobar, thanks! Re: 245, think of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Fundamental_theorem_of_arithmetic&quot; rel=&quot;nofollow&quot;&gt;fundamental theorem of arithmetic&lt;/a&gt;. I must not say more lest I should get reprimanded by the fellow programmers to whom the competitive spirit/score of Project Euler is important.</description>
		<content:encoded><![CDATA[<p>@foobar, thanks! Re: 245, think of the <a href="http://en.wikipedia.org/wiki/Fundamental_theorem_of_arithmetic" rel="nofollow">fundamental theorem of arithmetic</a>. I must not say more lest I should get reprimanded by the fellow programmers to whom the competitive spirit/score of Project Euler is important.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: foobar</title>
		<link>http://ashutoshmehra.net/blog/2009/03/solving-project-euler-problems-with-zdds/comment-page-1/#comment-369</link>
		<dc:creator>foobar</dc:creator>
		<pubDate>Mon, 18 May 2009 07:19:32 +0000</pubDate>
		<guid isPermaLink="false">http://ashutoshmehra.net/blog/?p=157#comment-369</guid>
		<description>interesting stuff. and nice blog!

currently stuck on the problem 245, mind shedding some light? :p

thanks,</description>
		<content:encoded><![CDATA[<p>interesting stuff. and nice blog!</p>
<p>currently stuck on the problem 245, mind shedding some light? :p</p>
<p>thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashutosh</title>
		<link>http://ashutoshmehra.net/blog/2009/03/solving-project-euler-problems-with-zdds/comment-page-1/#comment-24</link>
		<dc:creator>Ashutosh</dc:creator>
		<pubDate>Tue, 31 Mar 2009 16:16:36 +0000</pubDate>
		<guid isPermaLink="false">http://ashutoshmehra.net/blog/?p=157#comment-24</guid>
		<description>Thanks Srihari, Nathan!

@Nathan: Here&#039;s one hint from my solution to &lt;a href=&quot;http://projecteuler.net/index.php?section=problems&amp;id=208&quot; rel=&quot;nofollow&quot;&gt;Project Euler Problem 208 (Robot Walks)&lt;/a&gt;:  In order to return back to the starting point, the geometry of the situation demands an equal number of each of the 5 &quot;type&quot; of arcs be used. This is essentially because of the Sin/Cos of 72 degree and other angles may not have forced this (more formal proofs of this is presented in the forum). You can also see from the figure given in the problem description. Starting northwards, number the 5 arcs as (a,b,c,d,e) for counter-clockwise movement and (A,B,C,D,E) for clockwise movement (a-A arcs are mirror images etc.) Then, the arcs encountered on the path in problem figure are:

aEabcCDEAeABdBdeabDbcCcde.

Notice that each of a-e appear thrice and each of A-E twice.

Now for the dynamic programming solution, just count all paths that begin with a/A (northward) given that there are $$r$$ occurrences of arcs a-e each and $$70/5 - c$$ = $$14 - c$$ occurrences of arcs A-E each. In fact, with this information, you can do away with dynamic programming altogether, and find a simple summation in terms of binomial coefficients etc.

I hope I didn&#039;t give too much away to spoil the fun for you!

While I was glad on having solved it with dynamic programming more of less efficiently (~8 sec), I was really impressed with the purely combinatorial solutions posted by some members in the forum (do make sure to see them once you gain access to the forum).</description>
		<content:encoded><![CDATA[<p>Thanks Srihari, Nathan!</p>
<p>@Nathan: Here&#8217;s one hint from my solution to <a href="http://projecteuler.net/index.php?section=problems&amp;id=208" rel="nofollow">Project Euler Problem 208 (Robot Walks)</a>:  In order to return back to the starting point, the geometry of the situation demands an equal number of each of the 5 &#8220;type&#8221; of arcs be used. This is essentially because of the Sin/Cos of 72 degree and other angles may not have forced this (more formal proofs of this is presented in the forum). You can also see from the figure given in the problem description. Starting northwards, number the 5 arcs as (a,b,c,d,e) for counter-clockwise movement and (A,B,C,D,E) for clockwise movement (a-A arcs are mirror images etc.) Then, the arcs encountered on the path in problem figure are:</p>
<p>aEabcCDEAeABdBdeabDbcCcde.</p>
<p>Notice that each of a-e appear thrice and each of A-E twice.</p>
<p>Now for the dynamic programming solution, just count all paths that begin with a/A (northward) given that there are <img src="http://ashutoshmehra.net/blog/wp-content/plugins/easy-latex/cache/tex_a07424e1b964b5a44e36e13c98909b75.png" title="r" style="vertical-align:-20%;" class="tex" alt="r" /> occurrences of arcs a-e each and <img src="http://ashutoshmehra.net/blog/wp-content/plugins/easy-latex/cache/tex_9490552f32a98f8904a49785c346fcf4.png" title="70/5 - c" style="vertical-align:-20%;" class="tex" alt="70/5 - c" /> = <img src="http://ashutoshmehra.net/blog/wp-content/plugins/easy-latex/cache/tex_46189db4a50292118fab5756311da4fa.png" title="14 - c" style="vertical-align:-20%;" class="tex" alt="14 - c" /> occurrences of arcs A-E each. In fact, with this information, you can do away with dynamic programming altogether, and find a simple summation in terms of binomial coefficients etc.</p>
<p>I hope I didn&#8217;t give too much away to spoil the fun for you!</p>
<p>While I was glad on having solved it with dynamic programming more of less efficiently (~8 sec), I was really impressed with the purely combinatorial solutions posted by some members in the forum (do make sure to see them once you gain access to the forum).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan Loden</title>
		<link>http://ashutoshmehra.net/blog/2009/03/solving-project-euler-problems-with-zdds/comment-page-1/#comment-23</link>
		<dc:creator>Nathan Loden</dc:creator>
		<pubDate>Mon, 30 Mar 2009 19:01:31 +0000</pubDate>
		<guid isPermaLink="false">http://ashutoshmehra.net/blog/?p=157#comment-23</guid>
		<description>Really impressed with your solutions here.  I was wondering if you could give me any tips to solving problem 208 of Project Euler.  I&#039;m new to DP and its application to specific problems.  Anything would be greatly appreciated.</description>
		<content:encoded><![CDATA[<p>Really impressed with your solutions here.  I was wondering if you could give me any tips to solving problem 208 of Project Euler.  I&#8217;m new to DP and its application to specific problems.  Anything would be greatly appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srihari (srihri)</title>
		<link>http://ashutoshmehra.net/blog/2009/03/solving-project-euler-problems-with-zdds/comment-page-1/#comment-20</link>
		<dc:creator>Srihari (srihri)</dc:creator>
		<pubDate>Sun, 08 Mar 2009 15:43:41 +0000</pubDate>
		<guid isPermaLink="false">http://ashutoshmehra.net/blog/?p=157#comment-20</guid>
		<description>Nice post. Keep them coming. :)</description>
		<content:encoded><![CDATA[<p>Nice post. Keep them coming. :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
