tag:blogger.com,1999:blog-5772872.post114944110263044681..comments2022-10-24T22:40:12.576-05:00Comments on Fanciful Magic: A DareUnknownnoreply@blogger.comBlogger5125tag:blogger.com,1999:blog-5772872.post-1151524818320121012006-06-28T15:00:00.000-05:002006-06-28T15:00:00.000-05:00http://users.impulse.net.au/dragoncity/smalltalk_f...http://users.impulse.net.au/dragoncity/smalltalk_for_mere_mortals.pdf<BR/><BR/><BR/>Contains a reasonable example of recursion in the chapter titled PROGRAMMING WITH RECURSION.Brodyhttps://www.blogger.com/profile/07447518231163024586noreply@blogger.comtag:blogger.com,1999:blog-5772872.post-1151457372519453392006-06-27T20:16:00.000-05:002006-06-27T20:16:00.000-05:00There's an online book "http://users.impulse.net.a...There's an online book "http://users.impulse.net.au/dragoncity/smalltalk_for_mere_mortals.pdf" that has a decent example of recusion. The example on recursion is to print a check amount as text. i.e: $10.00 prints as Ten Dollars and zero cents.<BR/><BR/>I haven't looked closely at the code, but there ya go. A non-Fibonacci example.Brodyhttps://www.blogger.com/profile/07447518231163024586noreply@blogger.comtag:blogger.com,1999:blog-5772872.post-1149454559025665232006-06-04T15:55:00.000-05:002006-06-04T15:55:00.000-05:00And if memory serves right, this is how I found th...And if memory serves right, this is how I found that<BR/><BR/>F(p^n) ? p (100)<BR/><BR/>Some friends extended the full precision calculator into a mod calculator, applied the mu and lamdba algorithm as shown in Knuth's books, and found that there were MANY OTHER SUCH CONGRUENCES...Andréshttps://www.blogger.com/profile/06869059697843349034noreply@blogger.comtag:blogger.com,1999:blog-5772872.post-1149454187498373652006-06-04T15:49:00.000-05:002006-06-04T15:49:00.000-05:00Also, it would be much more interesting to show ho...Also, it would be much more interesting to show how some of the properties of the Fibonacci sequence could be used to calculate very large F numbers quite efficiently. For example, it is well known that<BR/><BR/>F(a+b) = F(a+1) F(b) + F(a) F(b-1)<BR/><BR/>This may say nothing at first, until you want to calculate F(n) and break n in halves. Assuming n = 2k, then<BR/><BR/>F(n) = F(k+k) = F(k+1) F(k) + F(k) F(k-1)<BR/><BR/>or<BR/><BR/>F(n) = F(k) (F(k+1) + F(k-1))<BR/><BR/>So if you break n in "good" values of k, you can cache those triplets around say powers of two, and then you're cooking with gas.<BR/><BR/>A long time ago, I had implemented fibonacci as the naive sum of terms, and F16525 took so long I had to stop it. With this new algorithm, it took only 10 seconds the first time, and 1.5 seconds the next time. Simple examples also hide this kind of stuff away.<BR/><BR/>Think, Luke... use the force but do not be brute!Andréshttps://www.blogger.com/profile/06869059697843349034noreply@blogger.comtag:blogger.com,1999:blog-5772872.post-1149446696886838122006-06-04T13:44:00.000-05:002006-06-04T13:44:00.000-05:00Interestingly, mathematics suffers from the same d...Interestingly, mathematics suffers from the same disease. Typically, books will describe all this beautiful theory and finish it off with the next to simplest possible example or application. No good.Andréshttps://www.blogger.com/profile/06869059697843349034noreply@blogger.com