Re: Recursion problem in SymbolicSum
- To: mathgroup at smc.vnet.net
- Subject: [mg60705] Re: [mg60693] Recursion problem in SymbolicSum
- From: Pratik Desai <pdesai1 at umbc.edu>
- Date: Sun, 25 Sep 2005 02:36:14 -0400 (EDT)
- References: <200509240655.CAA13410@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
D.J. Wischik wrote:
>I was surprised to get problems (recursion limit exceeded) when executing
>a symbolic sum. The terms in the sum depend on a parameter mu. When I
>leave mu unspecified and calculate the sum and then substitute a numerical
>value for mu, I get the right answer. When I specify mu in the sum, the
>symbolic sum fails. (The sum definitely exists and is finite.) I would be
>grateful if anyone could explain this behaviour.
>
>PoissonProb[mu_, k_] = Exp[-mu] mu^k / k!;
>
>Sum[PoissonProb[mu, k] (k + 1 - 9)/(k + 1), {k, 9, Infinity}] /.
> {mu -> 1.05}
>
>[returns the answer 1.82353 * 10^(-7) as expected]
>
>Sum[PoissonProb[1.05, k](k + 1 - 9)/(k + 1), {k, 9, Infinity}]
>
>[ $RecursionLimit::reclim: Recursion depth of 256 exceeded.
>$IterationLimit::itlim: Iteration limit of 4096 exceeded.
>and then it returns the following. ]
>
>\!\(0.34993774911115527`\ \((4.298654386611213`*^-6 -
> 7.999999999999789`\ \
>Hold[If[MatchQ[Numerator[SymbolicSum`InfiniteDump`expr1$214],
>SymbolicSum`a$_ \
>+ SymbolicSum`b$_ /; \(!
> FreeQ[SymbolicSum`a$,
> K$94]\) && \(! FreeQ[SymbolicSum`b$, K$94]\)], \
>\((SymbolicSum`InfiniteDump`infinitesum[#1, K$94, 0] &)\) /@
> Expand[SymbolicSum`InfiniteDump`expr1$214],
> SymbolicSum`InfiniteDump`HypergeometricSeries[
> 1, SymbolicSum`InfiniteDump`expr1$214, \
>SymbolicSum`InfiniteDump`expr2$214, K$94, 0, SymbolicSum`eps$214]]])\)\)
>
>Damon.
>
>
>
This is indeed strange, it seems that your expression gives the
Recursion Limit message only for the value 1.05. Infact if I give
mu=105/100 then it will evaluate. It will evaluate for 1.06 too! Here is
the code I have been using
Clear[mu, k]
Remove["Global`*"]
f[k_] = ((k + 1) - 9)/(k + 1)
PoissonProb[mu_, k_] := PoissonProb[mu, k] = (Exp[-mu]* mu^k)/k!*f[k];
sol[mu_, k_] := sol[mu, k] = Sum[PoissonProb[mu, k], {k, 9, Infinity}]
sol[1.03, k] // N
PS: It even evaluates for
mu=1.04999->1.8235339756733727*^-7.............Most peculiar indeed :)
Hope this helps
Pratik Desai
--
Pratik Desai
Graduate Student
UMBC
Department of Mechanical Engineering
Phone: 410 455 8134
- References:
- Recursion problem in SymbolicSum
- From: djw1005@cus.cam.ac.uk (D.J. Wischik)
- Recursion problem in SymbolicSum