Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: where is the mistake Date: Sun, 27 Feb 2011 11:30:23 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 14 Message-ID: <ikdckf$c3g$1@fred.mathworks.com> References: <ikbqin$4gr$1@fred.mathworks.com> <ikbtod$q12$1@fred.mathworks.com> <ikcln2$k52$1@fred.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: www-03-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1298806223 12400 172.30.248.48 (27 Feb 2011 11:30:23 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Sun, 27 Feb 2011 11:30:23 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1187260 Xref: news.mathworks.com comp.soft-sys.matlab:712674 "Nena Kabranski" wrote in message <ikcln2$k52$1@fred.mathworks.com>... > Thank you very much for your response. It was very thorough and clear. I hope you teach somewhere so that more people benefit from your ability to explain. - - - - - - - - - It should be pointed out that one way around your round-off error problem is to compute your iteration backwards. This way the effect of initial errors will decrease rather than increase as the iteration proceeds. Of course the difficulty with that is not knowing what initial value to use to start the iteration. The remedy for that is to start a number of entries beyond the point where sufficiently accurate results are to be obtained and begin with an initial zero. It can be shown that by abandoning the top 18, the remaining p values will be accurate out to something like 14 or 15 decimal places. (Actually 18 may be overly cautious.) You can use the following code to get p values from p(1) to p(n) for an arbitrary n: p = zeros(n+18,1); % The zero at the top end initiates the iteration for k = n+17:-1:1 p(k) = (exp(1)-p(k+1))/(k+1); % Your iteration going backwards end p = p(1:n); % Discard the top 18 entries With regard to teaching, many years ago I did give lectures in some college-level math courses but I have been retired for a long time now, so this newsgroup acts as a substitute to keep the little octogenarian "gray cells" active. Roger Stafford