<?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>Next Door Hacker &#187; math</title>
	<atom:link href="http://www.nextdoorhacker.com/tag/math/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nextdoorhacker.com</link>
	<description>I&#039;m just your friendly neighborhood hacker</description>
	<lastBuildDate>Mon, 05 Apr 2010 09:44:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Jacobian Algorithm for Multidimensional Continued Fractions</title>
		<link>http://www.nextdoorhacker.com/2008/11/jacobian-algorithm-for-multidimensional-continued-fractions/</link>
		<comments>http://www.nextdoorhacker.com/2008/11/jacobian-algorithm-for-multidimensional-continued-fractions/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 09:35:58 +0000</pubDate>
		<dc:creator>Prasanna</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[continued fractions]]></category>
		<category><![CDATA[dynamic programming]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.nextdoorhacker.com/?p=30</guid>
		<description><![CDATA[Just a great example of Dynamic programming.
#!/usr/bin/env pythonfrom math import floorA = [ 1, 0, 0]B = [ 0, 1 ,0]C = [0 , 0 ,1]p = []q = []&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; u = [17]v = [44]w = [13]i = 0DEBUG = Truewhile (u[-1] != 0):&#160;&#160;&#160; p.append(int(floor(v[-1]/u[-1])))&#160;&#160;&#160; q.append(int(floor(w[-1]/u[-1])))&#160;&#160;&#160; A.append(q[-1]*A[-1] +p[-1]*A[-2] +A[-3])&#160;&#160;&#160; B.append(q[-1]*B[-1]+p[-1]*B[-2] + B[-3])&#160;&#160;&#160; C.append(q[-1]*C[-1]+p[-1]*C[-2] + C[-3])&#160;&#160;&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Just a great example of Dynamic programming.</p>
<p>#!/usr/bin/env python<br />from math import floor<br />A = [ 1, 0, 0]<br />B = [ 0, 1 ,0]<br />C = [0 , 0 ,1]<br />p = []<br />q = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />u = [17]<br />v = [44]<br />w = [13]<br />i = 0<br />DEBUG = True<br />while (u[-1] != 0):<br />&nbsp;&nbsp;&nbsp; p.append(int(floor(v[-1]/u[-1])))<br />&nbsp;&nbsp;&nbsp; q.append(int(floor(w[-1]/u[-1])))<br />&nbsp;&nbsp;&nbsp; A.append(q[-1]*A[-1] +p[-1]*A[-2] +A[-3])<br />&nbsp;&nbsp;&nbsp; B.append(q[-1]*B[-1]+p[-1]*B[-2] + B[-3])<br />&nbsp;&nbsp;&nbsp; C.append(q[-1]*C[-1]+p[-1]*C[-2] + C[-3])<br />&nbsp;&nbsp;&nbsp; u.append(v[-1] &#8211; p[-1]*u[-1])<br />&nbsp;&nbsp;&nbsp; v.append(w[-1] &#8211; q[-1]*u[-2])<br />&nbsp;&nbsp;&nbsp; w.append(u[-2])<br />&nbsp;&nbsp;&nbsp; i+=1<br />&nbsp;&nbsp;&nbsp; if DEBUG:<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print i, u[-1], v[-1], w[-1], p[-1], q[-1], A[-1], B[-1], C[-1]</p>
<p>if DEBUG: <br />&nbsp;&nbsp;&nbsp; print p, q<br />for k in range(i-1):<br />&nbsp;&nbsp;&nbsp; print (p[k],q[k]),</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nextdoorhacker.com/2008/11/jacobian-algorithm-for-multidimensional-continued-fractions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
