Article View: comp.lang.pascal.borland
Article #654Re: WHAT COULD BE WRONG?
From: Dr John Stockton
Date: Fri, 19 May 2000 00:00
Date: Fri, 19 May 2000 00:00
36 lines
2484 bytes
2484 bytes
JRS: In article <8g1qgd$bmh$1@news.IAEhv.nl> of Fri, 19 May 2000 00:36:45 seen in news:comp.lang.pascal.borland, Huub van Dooren <hvdooren@iae.nl> wrote: >>Argh! That has to be the absolutely worst example for recursion. >It >>takes exponential time to solve a linear problem when one uses >>recursion with Fibonacci numbers. >> > >You're right. Bad example. But almost every textbook uses this >as an introduction to (the problems of using) recursion. BTW >I never found any use for them in all of programs anyhow. ;-) They are useful if you have a function known to have a single maximum (and no minima) within a given range, and you wish to locate that maximum to within a predefined accuracy while using the minimum number of function evaluations. At each step, you are considering two evaluated points within the remaining range, dividing the range into three, and the maximum cannot lie between the smaller and its nearer end-of-range. The larger point is reused in the next step, and Fibonacci-based positioning ensures that each step reduces the range as much as possible. In the final step, the points are at 1/3 & 2/3 of possible range. They are also useful in the design of sunflowers and pine-cones. -- � John Stockton, Surrey, UK. jrs@merlyn.demon.co.uk Turnpike v4.00 MIME. � Web <URL: http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links. Proper 4-line sig. separator is as above, a line exactly "-- " (SonOfRFC1036) Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
Technical Details
Message-ID:
<Lb$OqFEz6TJ5Ewlk@merlyn.demon.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<D0OU4.6707$C9.118410@news1.online.no> <8g100h$hj5$1@news.iaehv.nl> <8g1g4a$p63$1@kruuna.Helsinki.FI> <8g1qgd$bmh$1@news.IAEhv.nl>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 1097b9,1d4aea8798c741f5 X-Google-Attributes: gid1097b9,public X-Google-Thread: 111659,1d4aea8798c741f5 X-Google-Attributes: gid111659,public From: Dr John Stockton <jrs@merlyn.demon.co.uk> Subject: Re: WHAT COULD BE WRONG? Date: 2000/05/19 Message-ID: <Lb$OqFEz6TJ5Ewlk@merlyn.demon.co.uk> X-Deja-AN: 625492238 Content-Transfer-Encoding: 8bit X-NNTP-Posting-Host: merlyn.demon.co.uk:158.152.233.145 References: <D0OU4.6707$C9.118410@news1.online.no> <8g100h$hj5$1@news.iaehv.nl> <8g1g4a$p63$1@kruuna.Helsinki.FI> <8g1qgd$bmh$1@news.IAEhv.nl> Content-Type: text/plain;charset=iso-8859-1 X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 958759010 nnrp-06:27850 NO-IDENT merlyn.demon.co.uk:158.152.233.145 Organization: Home, 'Surrey', UK MIME-Version: 1.0 Newsgroups: comp.lang.pascal.borland,dk.edb.programmering.pascal