2 * Introduction to zeilberger::
3 * Functions and Variables for zeilberger::
6 @node Introduction to zeilberger, Functions and Variables for zeilberger, zeilberger-pkg, zeilberger-pkg
7 @section Introduction to zeilberger
9 @code{zeilberger} is an implementation of Zeilberger's algorithm
10 for definite hypergeometric summation, and also
11 Gosper's algorithm for indefinite hypergeometric
14 @code{zeilberger} makes use of the "filtering" optimization method developed by Axel Riese.
16 @code{zeilberger} was developed by Fabrizio Caruso.
18 @code{load ("zeilberger")} loads this package.
20 @opencatbox{Categories:}
21 @category{Sums and products}
22 @category{Share packages}
23 @category{Package zeilberger}
26 @subsection The indefinite summation problem
28 @code{zeilberger} implements Gosper's algorithm for indefinite hypergeometric summation.
29 Given a hypergeometric term @math{F_k} in @math{k} we want to find its hypergeometric
30 anti-difference, that is, a hypergeometric term @math{f_k} such that
33 $$F_k = f_{k+1} - f_k.$$
36 @math{F_k = f_(k+1) - f_k}.
39 @subsection The definite summation problem
41 @code{zeilberger} implements Zeilberger's algorithm for definite hypergeometric summation.
42 Given a proper hypergeometric term (in @math{n} and @math{k})
49 and a positive integer @math{d} we want to find a @math{d}-th order linear
50 recurrence with polynomial coefficients (in @math{n}) for
57 and a rational function @math{R} in @math{n} and @math{k} such that
60 $$a_0 \, F_{n,k} + \ldots + a_d \, F_{n+d}, ~ k = \Delta_K \left(R\left(n,k\right) F_{n,k}\right),$$
63 @math{a_0 F_(n,k) + ... + a_d F_(n+d),k = Delta_k(R(n,k) F_(n,k))},
76 is the @math{k}-forward difference operator, i.e.,
78 $\Delta_k \left(t_k\right) \equiv t_{k+1} - t_k$.
81 @math{Delta_k(t_k) := t_(k+1) - t_k}.
84 @subsection Verbosity levels
86 There are also verbose versions of the commands
87 which are called by adding one of the following prefixes:
91 Just a summary at the end is shown
93 Some information in the intermediate steps
97 Even more information including information on
98 the linear system in Zeilberger's algorithm
102 @code{GosperVerbose}, @code{parGosperVeryVerbose},
103 @code{ZeilbergerExtra}, @code{AntiDifferenceSummary}.
106 @node Functions and Variables for zeilberger, , Introduction to zeilberger, zeilberger-pkg
107 @section Functions and Variables for zeilberger
109 @anchor{AntiDifference}
110 @deffn {Function} AntiDifference (@math{F_k}, @var{k})
112 Returns the hypergeometric anti-difference of @math{F_k}, if it exists.@*
113 Otherwise @code{AntiDifference} returns @code{no_hyp_antidifference}.
115 @opencatbox{Categories:}
116 @category{Package zeilberger}
122 @deffn {Function} Gosper (@math{F_k}, @var{k})
123 Returns the rational certificate @math{R(k)} for @math{F_k}, that is,
124 a rational function such that
126 $F_k = R\left(k+1\right) \, F_{k+1} - R\left(k\right) \, F_k$,
129 @math{F_k = R(k+1) F_(k+1) - R(k) F_k},
132 Otherwise, @code{Gosper} returns @code{no_hyp_sol}.
134 @opencatbox{Categories:}
135 @category{Package zeilberger}
141 @deffn {Function} GosperSum (@math{F_k}, @var{k}, @var{a}, @var{b})
143 Returns the summation of @math{F_k} from @math{@var{k} = @var{a}} to @math{@var{k} = @var{b}}
144 if @math{F_k} has a hypergeometric anti-difference.
145 Otherwise, @code{GosperSum} returns @code{nongosper_summable}.
150 @c load ("zeilberger")$
151 @c GosperSum ((-1)^k*k / (4*k^2 - 1), k, 1, n);
152 @c GosperSum (1 / (4*k^2 - 1), k, 1, n);
153 @c GosperSum (x^k, k, 1, n);
154 @c GosperSum ((-1)^k*a! / (k!*(a - k)!), k, 1, n);
155 @c GosperSum (k*k!, k, 1, n);
156 @c GosperSum ((k + 1)*k! / (k + 1)!, k, 1, n);
157 @c GosperSum (1 / ((a - k)!*k!), k, 1, n);
160 (%i1) load ("zeilberger")$
162 (%i2) GosperSum ((-1)^k*k / (4*k^2 - 1), k, 1, n);
163 Dependent equations eliminated: (1)
167 (%o2) - ------------------ - -
172 (%i3) GosperSum (1 / (4*k^2 - 1), k, 1, n);
176 (%o3) -------------- + -
181 (%i4) GosperSum (x^k, k, 1, n);
188 (%i5) GosperSum ((-1)^k*a! / (k!*(a - k)!), k, 1, n);
191 (%o5) - ------------------------- - ----------
192 a (- n + a - 1)! (n + 1)! a (a - 1)!
195 (%i6) GosperSum (k*k!, k, 1, n);
196 Dependent equations eliminated: (1)
200 (%i7) GosperSum ((k + 1)*k! / (k + 1)!, k, 1, n);
201 (n + 1) (n + 2) (n + 1)!
202 (%o7) ------------------------ - 1
206 (%i8) GosperSum (1 / ((a - k)!*k!), k, 1, n);
207 (%o8) NON_GOSPER_SUMMABLE
211 @opencatbox{Categories:}
212 @category{Package zeilberger}
219 @deffn {Function} parGosper (@math{F_{n,k}}, @var{k}, @var{n}, @var{d})
221 Attempts to find a @var{d}-th order recurrence for
226 The algorithm yields a sequence @math{[s_1, s_2, ..., s_m]} of solutions.
227 Each solution has the form
230 $$\left[R\left(n, k\right), \left[a_0, a_1, \ldots, a_d\right]\right].$$
233 @code{parGosper} returns @code{[]} if it fails to find a recurrence.
235 @opencatbox{Categories:}
236 @category{Package zeilberger}
244 @deffn {Function} parGosper (@math{F_(n,k)}, @var{k}, @var{n}, @var{d})
246 Attempts to find a @var{d}-th order recurrence for @math{F_(n,k)}.
248 The algorithm yields a sequence @math{[s_1, s_2, ..., s_m]} of solutions.
249 Each solution has the form
251 @math{[R(n, k), [a_0, a_1, ..., a_d]].}
253 @code{parGosper} returns @code{[]} if it fails to find a recurrence.
255 @opencatbox{Categories:}
256 @category{Package zeilberger}
264 @deffn {Function} Zeilberger (@math{F_{n,k}}, @var{k}, @var{n})
266 Attempts to compute the indefinite hypergeometric summation of
271 @code{Zeilberger} first invokes @code{Gosper}, and if that fails to find a solution, then invokes
272 @code{parGosper} with order 1, 2, 3, ..., up to @code{MAX_ORD}.
273 If Zeilberger finds a solution before reaching @code{MAX_ORD},
274 it stops and returns the solution.
276 The algorithms yields a sequence @math{[s_1, s_2, ..., s_m]} of solutions.
277 Each solution has the form
280 $$\left[R\left(n, k\right), \left[a_0, a_1, \ldots, a_d\right]\right].$$
283 @code{Zeilberger} returns @code{[]} if it fails to find a solution.
285 @code{Zeilberger} invokes @code{Gosper} only if @code{Gosper_in_Zeilberger} is @code{true}.
287 @opencatbox{Categories:}
288 @category{Package zeilberger}
296 @deffn {Function} Zeilberger (@math{F_(n,k)}, @var{k}, @var{n})
298 Attempts to compute the indefinite hypergeometric summation of @math{F_(n,k)}.
300 @code{Zeilberger} first invokes @code{Gosper}, and if that fails to find a solution, then invokes
301 @code{parGosper} with order 1, 2, 3, ..., up to @code{MAX_ORD}.
302 If Zeilberger finds a solution before reaching @code{MAX_ORD},
303 it stops and returns the solution.
305 The algorithms yields a sequence @math{[s_1, s_2, ..., s_m]} of solutions.
306 Each solution has the form
308 @math{[R(n,k), [a_0, a_1, ..., a_d]].}
310 @code{Zeilberger} returns @code{[]} if it fails to find a solution.
312 @code{Zeilberger} invokes @code{Gosper} only if @code{Gosper_in_Zeilberger} is @code{true}.
314 @opencatbox{Categories:}
315 @category{Package zeilberger}
323 @section General global variables
326 @defvr {Global variable} MAX_ORD
329 @code{MAX_ORD} is the maximum recurrence order attempted by @code{Zeilberger}.
331 @opencatbox{Categories:}
332 @category{Package zeilberger}
337 @anchor{simplified_output}
338 @defvr {Global variable} simplified_output
339 Default value: @code{false}
341 When @code{simplified_output} is @code{true},
342 functions in the @code{zeilberger} package attempt
343 further simplification of the solution.
345 @opencatbox{Categories:}
346 @category{Package zeilberger}
351 @anchor{linear_solver}
352 @defvr {Global variable} linear_solver
353 Default value: @code{linsolve}
355 @code{linear_solver} names the solver which is used to solve the system
356 of equations in Zeilberger's algorithm.
358 @opencatbox{Categories:}
359 @category{Package zeilberger}
365 @defvr {Global variable} warnings
366 Default value: @code{true}
368 When @code{warnings} is @code{true},
369 functions in the @code{zeilberger} package print
370 warning messages during execution.
372 @opencatbox{Categories:}
373 @category{Package zeilberger}
378 @anchor{Gosper_in_Zeilberger}
379 @defvr {Global variable} Gosper_in_Zeilberger
380 Default value: @code{true}
382 When @code{Gosper_in_Zeilberger} is @code{true},
383 the @code{Zeilberger} function calls @code{Gosper} before calling @code{parGosper}.
384 Otherwise, @code{Zeilberger} goes immediately to @code{parGosper}.
386 @opencatbox{Categories:}
387 @category{Package zeilberger}
392 @anchor{trivial_solutions}
393 @defvr {Global variable} trivial_solutions
394 Default value: @code{true}
396 When @code{trivial_solutions} is @code{true},
397 @code{Zeilberger} returns solutions
398 which have certificate equal to zero, or all coefficients equal to zero.
400 @opencatbox{Categories:}
401 @category{Package zeilberger}
406 @section Variables related to the modular test
409 @defvr {Global variable} mod_test
410 Default value: @code{false}
412 When @code{mod_test} is @code{true},
413 @code{parGosper} executes a
414 modular test for discarding systems with no solutions.
416 @opencatbox{Categories:}
417 @category{Package zeilberger}
422 @anchor{modular_linear_solver}
423 @defvr {Global variable} modular_linear_solver
424 Default value: @code{linsolve}
426 @code{modular_linear_solver} names the linear solver used by the modular test in @code{parGosper}.
428 @opencatbox{Categories:}
429 @category{Package zeilberger}
435 @defvr {Global variable} ev_point
436 Default value: @code{big_primes[10]}
438 @code{ev_point} is the value at which the variable @var{n} is evaluated
439 when executing the modular test in @code{parGosper}.
441 @opencatbox{Categories:}
442 @category{Package zeilberger}
447 @anchor{mod_big_prime}
448 @defvr {Global variable} mod_big_prime
449 Default value: @code{big_primes[1]}
451 @code{mod_big_prime} is the modulus used by the modular test in @code{parGosper}.
453 @opencatbox{Categories:}
454 @category{Package zeilberger}
459 @anchor{mod_threshold}
460 @defvr {Global variable} mod_threshold
463 @code{mod_threshold} is the
464 greatest order for which the modular test in @code{parGosper} is attempted.
466 @opencatbox{Categories:}
467 @category{Package zeilberger}