<?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: DX. Dumb Robots</title>
	<atom:link href="http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/feed/" rel="self" type="application/rss+xml" />
	<link>http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/</link>
	<description>The Math Factor Podcast Site</description>
	<pubDate>Wed, 20 Aug 2008 12:59:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Eric</title>
		<link>http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-329</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Mon, 19 May 2008 05:18:02 +0000</pubDate>
		<guid isPermaLink="false">http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-329</guid>
		<description>For an added challenge, it turns out you can solve the puzzle using only one direction of travel.

Hint:
[spoiler]
You will need to assume that each instruction requires some amount of time, even when the robot does not travel.
[/spoiler]

Solution:
[spoiler]
1 - Go Left
2 - If you are standing on a parachute, go to instruction 4
3 - Go to instruction 1
4 - Go Left
5 - Go to instruction 4
[/spoiler]</description>
		<content:encoded><![CDATA[<p>For an added challenge, it turns out you can solve the puzzle using only one direction of travel.</p>
<p>Hint:<br />
<a href="javascript:void(null);" onclick="s_toggleDisplay(document.getElementById('SID783104317'), this, 'Show &#9660;', 'Hide &#9650;');">Show &#9660;</a></p>
<div id='SID783104317' style='display:none;'>
<p>You will need to assume that each instruction requires some amount of time, even when the robot does not travel.</p>
</div>
<p>Solution:<br />
<a href="javascript:void(null);" onclick="s_toggleDisplay(document.getElementById('SID1342001399'), this, 'Show &#9660;', 'Hide &#9650;');">Show &#9660;</a></p>
<div id='SID1342001399' style='display:none;'>
<p>1 - Go Left<br />
2 - If you are standing on a parachute, go to instruction 4<br />
3 - Go to instruction 1<br />
4 - Go Left<br />
5 - Go to instruction 4</p>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: jpincott</title>
		<link>http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-324</link>
		<dc:creator>jpincott</dc:creator>
		<pubDate>Mon, 19 May 2008 04:34:37 +0000</pubDate>
		<guid isPermaLink="false">http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-324</guid>
		<description>For the robot puzzle, if we label the commands thus:

L = Move left one step
R = Move right one step
Gn = Goto instruction n
Cn = Conditional goto - Gn iff currently standing on a parachute

then the following program will suffice:

&lt;spoiler&gt;
1. R
2. L
3. R
4. C6
5. G1
6. R
7. G6
&lt;/spoiler&gt;</description>
		<content:encoded><![CDATA[<p>For the robot puzzle, if we label the commands thus:</p>
<p>L = Move left one step<br />
R = Move right one step<br />
Gn = Goto instruction n<br />
Cn = Conditional goto - Gn iff currently standing on a parachute</p>
<p>then the following program will suffice:</p>
<p><a href="javascript:void(null);" onclick="s_toggleDisplay(document.getElementById('SID307524396'), this, 'Show &#9660;', 'Hide &#9650;');">Show &#9660;</a></p>
<div id='SID307524396' style='display:none;'>
<p>1. R<br />
2. L<br />
3. R<br />
4. C6<br />
5. G1<br />
6. R<br />
7. G6</p>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: nklein</title>
		<link>http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-323</link>
		<dc:creator>nklein</dc:creator>
		<pubDate>Mon, 19 May 2008 04:12:12 +0000</pubDate>
		<guid isPermaLink="false">http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-323</guid>
		<description>DUMB ROBOTS SPOILER

The shortest algorithm I am sure of has 7 instructions.
&lt;spoiler&gt;
1. Go Left
2. If Parachute, Skip to 6
3. Go Left
4. Go Right
5. Skip to 1
6. Go Left
7. Skip to 6

Thus, both progress left at one square every three moves until the one who landed on the right hits the other robot's parachute.  After that, the robot that landed on the right speeds up to one square leftward every move.

&lt;/spoiler&gt;

I had assumed instruction time was negligible compared to moving time in arriving at the algorithm. If every instruction takes equal time, we can eliminate 3 and 4.  Both robots move leftward one space every three ticks until the rightmost robot finds the other parachute. Then, the rightmost robot accelerates to one square leftward every two ticks.</description>
		<content:encoded><![CDATA[<p>DUMB ROBOTS SPOILER</p>
<p>The shortest algorithm I am sure of has 7 instructions.<br />
<a href="javascript:void(null);" onclick="s_toggleDisplay(document.getElementById('SID1324809602'), this, 'Show &#9660;', 'Hide &#9650;');">Show &#9660;</a></p>
<div id='SID1324809602' style='display:none;'>
<p>1. Go Left<br />
2. If Parachute, Skip to 6<br />
3. Go Left<br />
4. Go Right<br />
5. Skip to 1<br />
6. Go Left<br />
7. Skip to 6</p>
<p>Thus, both progress left at one square every three moves until the one who landed on the right hits the other robot&#8217;s parachute.  After that, the robot that landed on the right speeds up to one square leftward every move.</p>
</div>
<p>I had assumed instruction time was negligible compared to moving time in arriving at the algorithm. If every instruction takes equal time, we can eliminate 3 and 4.  Both robots move leftward one space every three ticks until the rightmost robot finds the other parachute. Then, the rightmost robot accelerates to one square leftward every two ticks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cstarbi</title>
		<link>http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-335</link>
		<dc:creator>cstarbi</dc:creator>
		<pubDate>Mon, 19 May 2008 02:07:10 +0000</pubDate>
		<guid isPermaLink="false">http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-335</guid>
		<description>Something that I found interesting:  Find out if this code is the fastest way to cause a collision, and, if not, what code is?  (I assumed in my solution that travel time is much much longer than the time it takes to detect a parachute or perform a goto)</description>
		<content:encoded><![CDATA[<p>Something that I found interesting:  Find out if this code is the fastest way to cause a collision, and, if not, what code is?  (I assumed in my solution that travel time is much much longer than the time it takes to detect a parachute or perform a goto)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: strauss</title>
		<link>http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-330</link>
		<dc:creator>strauss</dc:creator>
		<pubDate>Fri, 16 May 2008 11:12:42 +0000</pubDate>
		<guid isPermaLink="false">http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-330</guid>
		<description>(* Man, 27 by hand is quite a treat! Here's the same result in Mathematica; I love the compactness of this language! *)

Collatz[1] = 1;

Collatz[n_] := If[EvenQ[n], n/2, 3 n + 1];

DoCollatz[n_] := (Print[Length[#] - 1, " steps: ", #, "\n"]) &#038;@ FixedPointList[Collatz, n]

(* so typing in DoCollatz[27] spits out the sequence starting at 27; 

DoCollatz /@ Range[1,200] spits out results for 1 through 200 *)

</description>
		<content:encoded><![CDATA[<p>(* Man, 27 by hand is quite a treat! Here&#8217;s the same result in Mathematica; I love the compactness of this language! *)</p>
<p>Collatz[1] = 1;</p>
<p>Collatz[n_] := If[EvenQ[n], n/2, 3 n + 1];</p>
<p>DoCollatz[n_] := (Print[Length[#] - 1, &#8221; steps: &#8220;, #, &#8220;\n&#8221;]) &#038;@ FixedPointList[Collatz, n]</p>
<p>(* so typing in DoCollatz[27] spits out the sequence starting at 27; </p>
<p>DoCollatz /@ Range[1,200] spits out results for 1 through 200 *)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cybersekkin</title>
		<link>http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-328</link>
		<dc:creator>cybersekkin</dc:creator>
		<pubDate>Fri, 16 May 2008 05:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-328</guid>
		<description>#I (being a dumb chemical robot) made an error going by hand 
#so put this together as a simple test for a single number (27))

#!/usr/bin/perl
#
#
my $num = 27;
my $count = 0;
my $test3 = 0;

until( $test3  == 1 )
{
   print "$count number is: $num\n";
   
   if($num eq 1)
   {
      $test3 = 1;
   }
   #get last digit if even divide by 2
   if(!($num % 2))
   {
      $num = $num / 2;
   }
   #if not multiply by 3 and add 1
   else
   {
      $num = (($num * 3) + 1)
   }
   $count++;
}</description>
		<content:encoded><![CDATA[<p>#I (being a dumb chemical robot) made an error going by hand<br />
#so put this together as a simple test for a single number (27))</p>
<p>#!/usr/bin/perl<br />
#<br />
#<br />
my $num = 27;<br />
my $count = 0;<br />
my $test3 = 0;</p>
<p>until( $test3  == 1 )<br />
{<br />
   print &#8220;$count number is: $num\n&#8221;;</p>
<p>   if($num eq 1)<br />
   {<br />
      $test3 = 1;<br />
   }<br />
   #get last digit if even divide by 2<br />
   if(!($num % 2))<br />
   {<br />
      $num = $num / 2;<br />
   }<br />
   #if not multiply by 3 and add 1<br />
   else<br />
   {<br />
      $num = (($num * 3) + 1)<br />
   }<br />
   $count++;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: intchanter</title>
		<link>http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-322</link>
		<dc:creator>intchanter</dc:creator>
		<pubDate>Wed, 14 May 2008 22:16:24 +0000</pubDate>
		<guid isPermaLink="false">http://mathfactor.uark.edu/2008/05/13/dx-dumb-robots/#comment-322</guid>
		<description>I whipped up some Python code that any of you can hack on to try out the Collatz function.  By posting it here, I am releasing it into the public domain, so have fun with it.

-------------
#!/usr/bin/env python

def collatz(start):
&#160;&#160;&#160;&#160;&apos;&apos;&apos;
&#160;&#160;&#160;&#160;Run through the collatz series for a given number and return the number of
&#160;&#160;&#160;&#160;iterations and the largest number found.
&#160;&#160;&#160;&#160;&apos;&apos;&apos;
&#160;&#160;&#160;&#160;current = start
&#160;&#160;&#160;&#160;iter = 0
&#160;&#160;&#160;&#160;max = start
&#160;&#160;&#160;&#160;while current != 1:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;iter += 1
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if current % 2: # odd
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;current = current * 3 + 1
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;else: # even
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;current = current / 2
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if current &#62; max:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;max = current
&#160;&#160;&#160;&#160;return (iter, max)

if __name__ == &#34;__main__&#34;:
&#160;&#160;&#160;&#160;target = 1000
&#160;&#160;&#160;&#160;max_tuple = (0, 0, 0)
&#160;&#160;&#160;&#160;iter_tuple = (0, 0, 0)
&#160;&#160;&#160;&#160;for start in xrange(1, target + 1):
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;(iter, max) = collatz(start)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if max &#62; max_tuple[2]:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;max_tuple = (start, iter, max)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if iter &#62; iter_tuple[1]:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;iter_tuple = (start, iter, max)
&#160;&#160;&#160;&#160;print &apos;Largest integer hit:&apos;, max_tuple
&#160;&#160;&#160;&#160;print &apos;Longest series hit:&apos;, iter_tuple
-------------</description>
		<content:encoded><![CDATA[<p>I whipped up some Python code that any of you can hack on to try out the Collatz function.  By posting it here, I am releasing it into the public domain, so have fun with it.</p>
<p>&#8212;&#8212;&#8212;&#8212;-<br />
#!/usr/bin/env python</p>
<p>def collatz(start):<br />
&nbsp;&nbsp;&nbsp;&nbsp;&apos;&apos;&apos;<br />
&nbsp;&nbsp;&nbsp;&nbsp;Run through the collatz series for a given number and return the number of<br />
&nbsp;&nbsp;&nbsp;&nbsp;iterations and the largest number found.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&apos;&apos;&apos;<br />
&nbsp;&nbsp;&nbsp;&nbsp;current = start<br />
&nbsp;&nbsp;&nbsp;&nbsp;iter = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;max = start<br />
&nbsp;&nbsp;&nbsp;&nbsp;while current != 1:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iter += 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if current % 2: # odd<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;current = current * 3 + 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else: # even<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;current = current / 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if current &gt; max:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;max = current<br />
&nbsp;&nbsp;&nbsp;&nbsp;return (iter, max)</p>
<p>if __name__ == &quot;__main__&quot;:<br />
&nbsp;&nbsp;&nbsp;&nbsp;target = 1000<br />
&nbsp;&nbsp;&nbsp;&nbsp;max_tuple = (0, 0, 0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;iter_tuple = (0, 0, 0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;for start in xrange(1, target + 1):<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(iter, max) = collatz(start)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if max &gt; max_tuple[2]:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;max_tuple = (start, iter, max)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if iter &gt; iter_tuple[1]:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iter_tuple = (start, iter, max)<br />
&nbsp;&nbsp;&nbsp;&nbsp;print &apos;Largest integer hit:&apos;, max_tuple<br />
&nbsp;&nbsp;&nbsp;&nbsp;print &apos;Longest series hit:&apos;, iter_tuple<br />
&#8212;&#8212;&#8212;&#8212;-</p>
]]></content:encoded>
	</item>
</channel>
</rss>
