Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
LREtools[REtoproc] - convert a recurrence into a procedure
Calling Sequence
REtoproc(problem, options)
Parameters
problem
-
options
optional arguments described below
Description
This procedure returns a Maple procedure that, given a non-negative integer n as input, gives the nth term of the linear recurrence.
If the argument 'remember' or 'remember'=true is specified, then the procedure will compute the sequence via a recursive procedure using option remember. By default, 'remember'=false and the sequence is computed iteratively.
The argument 'remember' should be given when one needs a large number of values of the sequence.
When 'remember'=false and the coefficients of the recurrence are nonconstant polynomials, the returned procedure will run in a straight loop, using a linear number of arithmetic operations and without wasting extra space.
When 'remember'=false and the coefficients are constant, the procedure will employ a binary-based optimization strategy (for large index values only), and runs with a logarithmic number of arithmetic operations. This optimization can be disabled by specifying constantoptimize=false.
When 'remember'=false, by default the initial terms of the recurrence are embedded in the code. This can be changed to put the initial terms of the recurrence in the remember table by specifying initialremember=true.
When the first terms of the recurrence are not explicitly supplied, they are represented symbolically.
The command with(LREtools,REtoproc) allows the use of the abbreviated form of this command.
Examples
fib := REtoproc(f(i)=f(i-1)+f(i-2),f(i),{f(0)=0,f(1)=1});
fib2 := REtoproc(f(i)=f(i-1)+f(i-2),f(i),{f(0)=0,f(1)=1},'remember');
rec := REtoproc(f(i)=i^2*f(i-1)+f(i-2),f(i),{},'remember');
See Also
LREtools[REcreate], RESol, rsolve
Download Help Document