genfunc - Maple Programming Help

Home : Support : Online Help : Mathematics : Algebra : Rational Expressions : Rational Generating Functions : genfunc/rgf_simp

genfunc

 rgf_simp
 simplify an expression involving a rational generating function sequence

 Calling Sequence rgf_simp(expr, Fz, z, F, n, options)

Parameters

 expr - expression to simplify Fz - rational generating function z - name, generating function variable F - name of function encoded by Fz n - name, index variable of F options - optional arguments

Description

 • This function simplifies occurrences of sequence F in expr. If F is defined by an order k recurrence then all occurrences of F whose index differs from n by an integer amount are simplified to expressions involving $F\left(n\right),...,F\left(n-k+1\right)$.
 • The function name argument F can have a parameter of the form $an+b$, where a is a positive integer and b is an integer.  This pattern represents the index of the nth term in the sequence.  Simplification will be done relative to the nth occurrence of this pattern. If the pattern is invalid or does not match any sequence occurrence in the expression, the unmodified expression is returned. The defaults are $a=1$ and $b=0$.
 • The simplified expression is expanded and the coefficients of $F\left(an+b\right),...,F\left(a\left(n-k+1\right)+b\right)$ are collected.
 • A procedure may be passed as an optional argument and is applied to each coefficient of the collected result.
 • An expression may be passed as an optional argument. Occurrences of F are matched against the pattern to determine a value for n. If this value for n differs from the optional argument by an integer amount, the term is simplified relative to the expression.
 • The command with(genfunc,rgf_simp) allows the use of the abbreviated form of this command.

Examples

 > $\mathrm{with}\left(\mathrm{genfunc}\right):$
 > $\mathrm{Fz}≔\frac{z}{1-z-{z}^{2}}:$
 > $\mathrm{ex}≔{n}^{2}F\left(n+1\right)+\left({n}^{2}+1\right)F\left(n\right)+\left({n}^{2}-2n\right)F\left(n-1\right)+{\left(n+3\right)}^{2}F\left(n-2\right)$
 ${\mathrm{ex}}{≔}{{n}}^{{2}}{}{F}{}\left({n}{+}{1}\right){+}\left({{n}}^{{2}}{+}{1}\right){}{F}{}\left({n}\right){+}\left({{n}}^{{2}}{-}{2}{}{n}\right){}{F}{}\left({n}{-}{1}\right){+}{\left({n}{+}{3}\right)}^{{2}}{}{F}{}\left({n}{-}{2}\right)$ (1)
 > $\mathrm{rgf_simp}\left(\mathrm{ex},\mathrm{Fz},z,F,n\right)$
 $\left({3}{}{{n}}^{{2}}{+}{6}{}{n}{+}{10}\right){}{F}{}\left({n}\right){+}\left({{n}}^{{2}}{-}{8}{}{n}{-}{9}\right){}{F}{}\left({n}{-}{1}\right)$ (2)
 > $\mathrm{rgf_simp}\left(\mathrm{ex},\mathrm{Fz},z,F,n,n-1\right)$
 $\left({3}{}{{n}}^{{2}}{+}{6}{}{n}{+}{10}\right){}{F}{}\left({n}{-}{2}\right){+}\left({4}{}{{n}}^{{2}}{-}{2}{}{n}{+}{1}\right){}{F}{}\left({n}{-}{1}\right)$ (3)
 > $\mathrm{rgf_simp}\left(\mathrm{ex},\mathrm{Fz},z,F,n,n+1\right)$
 $\left({{n}}^{{2}}{-}{8}{}{n}{-}{9}\right){}{F}{}\left({n}{+}{1}\right){+}\left({2}{}{{n}}^{{2}}{+}{14}{}{n}{+}{19}\right){}{F}{}\left({n}\right)$ (4)
 > $\mathrm{rgf_simp}\left(\mathrm{ex},\mathrm{Fz},z,F,n,n+1,\mathrm{factor}\right)$
 $\left({n}{+}{1}\right){}\left({n}{-}{9}\right){}{F}{}\left({n}{+}{1}\right){+}\left({2}{}{{n}}^{{2}}{+}{14}{}{n}{+}{19}\right){}{F}{}\left({n}\right)$ (5)
 > $\mathrm{Fz}≔\frac{1-z+{z}^{2}}{1-4z-{z}^{2}}:$
 > $\mathrm{rgf_simp}\left(F\left(3n-2\right)+F\left(3n-11\right),\mathrm{Fz},z,F\left(3n-2\right),n\right)$
 ${-}{3}{}{F}{}\left({3}{}{n}{-}{2}\right){+}{17}{}{F}{}\left({3}{}{n}{-}{5}\right)$ (6)
 > $\mathrm{rgf_simp}\left(,\mathrm{Fz},z,F\left(3n-2\right),n,n+1\right)$
 ${-}{71}{}{F}{}\left({3}{}{n}{-}{2}\right){+}{17}{}{F}{}\left({3}{}{n}{+}{1}\right)$ (7)
 > $\mathrm{rgf_simp}\left(F\left(3km-11\right),\mathrm{Fz},z,F\left(3n-2\right),n,km\right)$
 ${17}{}{F}{}\left({3}{}{k}{}{m}{-}{5}\right){-}{4}{}{F}{}\left({3}{}{k}{}{m}{-}{2}\right)$ (8)