<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Ryan Bright - Latest Comments</title><link>http://ryanbright.disqus.com/</link><description>Engineering, product, and NYC startups.</description><atom:link href="https://ryanbright.disqus.com/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 17 Aug 2010 21:49:02 -0000</lastBuildDate><item><title>Re: Algorithms Revisited: Fibonacci Sequence</title><link>http://ryanbright.me/algorithms-revisited-fibonacci-sequence/#comment-69464497</link><description>&lt;p&gt;Thanks for the insights! That's a much more efficient way of going about it than what I have listed above.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ryan Bright</dc:creator><pubDate>Tue, 17 Aug 2010 21:49:02 -0000</pubDate></item><item><title>Re: Algorithms Revisited: Fibonacci Sequence</title><link>http://ryanbright.me/algorithms-revisited-fibonacci-sequence/#comment-69454285</link><description>&lt;p&gt;As I explained in my reddit comment, the matrix version is logarithmic only if you perform exponentiation by repeated squarings. So, when you show M^4 being calculated by doing M * M^3, you are actually doing doing a linear time algorithm.&lt;/p&gt;&lt;p&gt;What you should instead be doing is: M^513 = M * M^512 = M * (M^256)^2 = M * ((M^128)^2)^2 = ... = M * ((((((((M^2)^2)^2)^2)^2)^2)^2)^2)^2&lt;/p&gt;&lt;p&gt;Notice how a total of 10 matrix multiplications are required.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kanak</dc:creator><pubDate>Tue, 17 Aug 2010 19:41:51 -0000</pubDate></item><item><title>Re: Algorithms Revisited: Fibonacci Sequence</title><link>http://ryanbright.me/algorithms-revisited-fibonacci-sequence/#comment-69213903</link><description>&lt;p&gt;Are you referring to the iterative solution or the matrix solution? The upper bound of the matrix solution will depend on the matrix multiplication algorithm used by the programming language, and all we're doing in our own algorithm is grabbing the lower right-hand value from the resulting matrix. Since we're not iterating, we won't need to know the values of previous Fibonacci numbers in the sequence.&lt;/p&gt;&lt;p&gt;If you're referring to the iterative solution, I might know what you're getting at. In most languages, we would need to store the value of f[0] + f[1] into a third variable before assigning new values to f[0] and f[1]. However, Ruby allows us to circumvent that redundancy through its parallel assignment operator. This operator will cause all right-hand values to be evaluated before assigning to the left-hand values, so the statement f[0] + f[1] will be evaluated with the original value of f[0] instead of the one being assigned by f[0] = f[1]. This might have nothing to do with your question, but I figured I'd clarify this for anyone that was curious!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ryan Bright</dc:creator><pubDate>Mon, 16 Aug 2010 19:20:36 -0000</pubDate></item><item><title>Re: Algorithms Revisited: Fibonacci Sequence</title><link>http://ryanbright.me/algorithms-revisited-fibonacci-sequence/#comment-69195281</link><description>&lt;p&gt;The matrix version is wasteful, unless you always also want the current plus the last 2 values of the sequence.   fib (a, b, cur, n) = if cur == n then b else fib (b, a + b, cur + 1, n) should be better, shouldn't it? fib (1, 1, 1, 8)  for the 8th number in the sequence.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">josh</dc:creator><pubDate>Mon, 16 Aug 2010 17:22:58 -0000</pubDate></item><item><title>Re: Algorithms Revisited: Fibonacci Sequence</title><link>http://ryanbright.me/algorithms-revisited-fibonacci-sequence/#comment-69119586</link><description>&lt;p&gt;I think it might be fair to call it a dynamic programming algorithm.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Tantalo</dc:creator><pubDate>Mon, 16 Aug 2010 10:34:21 -0000</pubDate></item><item><title>Re: Algorithms Revisited: Fibonacci Sequence</title><link>http://ryanbright.me/algorithms-revisited-fibonacci-sequence/#comment-69116981</link><description>&lt;p&gt;I suppose referring to the algorithm as iterative instead of "memoization" would be more accurate. The main reason I used an array instead of two variables was purely for syntactic reasons rather than efficiency. I preferred to write f[0] and f[1] instead of fp and f when I threw the script together. :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ryan Bright</dc:creator><pubDate>Mon, 16 Aug 2010 10:16:23 -0000</pubDate></item><item><title>Re: Algorithms Revisited: Fibonacci Sequence</title><link>http://ryanbright.me/algorithms-revisited-fibonacci-sequence/#comment-69115029</link><description>&lt;p&gt;That's not memoization between nothing is remembered between calls. Also, why do you use an array when two variables would suffice?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Tantalo</dc:creator><pubDate>Mon, 16 Aug 2010 10:01:43 -0000</pubDate></item><item><title>Re: Algorithms Revisited: Fibonacci Sequence</title><link>http://ryanbright.me/algorithms-revisited-fibonacci-sequence/#comment-69089934</link><description>&lt;p&gt;Very useful article&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Renga</dc:creator><pubDate>Mon, 16 Aug 2010 05:28:06 -0000</pubDate></item><item><title>Re: 5 Resources for Refining Your Programming Skills</title><link>http://ryanbright.me/5-resources-for-refining-your-programming-skills/#comment-32537921</link><description>&lt;p&gt;This is a good list to practice our programming skills. I am a member of CodeChef and it has a good way of allowing programmers to choose the level of problems to solve.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kevin</dc:creator><pubDate>Fri, 22 Jan 2010 22:12:39 -0000</pubDate></item><item><title>Re: I’d Like Some Jelly with my Coworking</title><link>http://ryanbright.me/id-like-some-jelly-with-my-coworking/#comment-32537927</link><description>&lt;p&gt;Yup, I'm looking forward to the meeting. I just recently began working with Flash and Flex, so I don't expect to be able to follow along quite yet. However, it will be interesting to see what everyone else is doing and also to derive some inspiration.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ryan Bright</dc:creator><pubDate>Mon, 14 Dec 2009 16:12:18 -0000</pubDate></item><item><title>Re: I’d Like Some Jelly with my Coworking</title><link>http://ryanbright.me/id-like-some-jelly-with-my-coworking/#comment-32537926</link><description>&lt;p&gt;Ryan! I've never met you I think but I hope to at the upcoming Flashcoders meet.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">@storypixel</dc:creator><pubDate>Mon, 14 Dec 2009 15:13:14 -0000</pubDate></item><item><title>Re: 5 Resources for Refining Your Programming Skills</title><link>http://ryanbright.me/5-resources-for-refining-your-programming-skills/#comment-32537920</link><description>&lt;p&gt;Thanks for mentioning CodeChef, if you have any ways we can make the site better, please let us know :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">@codechef</dc:creator><pubDate>Mon, 02 Nov 2009 08:14:32 -0000</pubDate></item><item><title>Re: 5 Resources for Refining Your Programming Skills</title><link>http://ryanbright.me/5-resources-for-refining-your-programming-skills/#comment-32537919</link><description>&lt;p&gt;Good List, maybe the code Kata by Chad Fowler may fit into this list.  &lt;br&gt;See &lt;a href="http://codekata.pragprog.com/" rel="nofollow noopener" target="_blank" title="http://codekata.pragprog.com/"&gt;http://codekata.pragprog.com/&lt;/a&gt; for details.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lutz Hankewitz</dc:creator><pubDate>Mon, 02 Nov 2009 07:45:27 -0000</pubDate></item><item><title>Re: 5 Resources for Refining Your Programming Skills</title><link>http://ryanbright.me/5-resources-for-refining-your-programming-skills/#comment-32537918</link><description>&lt;p&gt;Good list. I will be bookmarking this for later.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel H</dc:creator><pubDate>Fri, 30 Oct 2009 18:13:43 -0000</pubDate></item></channel></rss>