Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.maple > #995
| Newsgroups | comp.soft-sys.math.maple |
|---|---|
| Date | 2014-10-22 05:43 -0700 |
| References | <3f0622a5-d660-4828-b5fe-16792b13d206@googlegroups.com> |
| Message-ID | <d57f8a2c-64f1-4a37-b6dd-b05cf2af3c4c@googlegroups.com> (permalink) |
| Subject | Re: The value of binomial(-1, r) |
| From | acer <maple@rogers.com> |
Le lundi 20 octobre 2014 06:18:37 UTC-4, peter....@gmail.com a écrit :
> I am interested in the value of binomial(-1, r).
>
> The docs say: In the case that n is a negative integer,
> binomial(n,r) is defined by this limit:
>
> binomial(n,r) = limit(GAMMA(n+t+1)/(GAMMA(r+1)*GAMMA(n+t-r+1), t=0)
>
> OK, so let's try the definition:
>
> n := -1;
> limit(GAMMA(n+t+1)/(GAMMA(r+1)*GAMMA(n+t-r+1)), t=0);
>
> [1] Maple out: undefined
>
> Now let's execute
>
> seq(binomial(-1, r), r=-5..5);
>
> [2] Maple out: 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1
>
> [1] contradicts [2]. Are the docs or is the value in error?
>
> Or better asked:
>
> What is a good definition of binomial(-1, r) (r real, r >= 0) in terms
> of the Gamma function?
>
> Peter
You seem to have missed the bit in the documentation about the case that just n and n-r are negative integers.
http://www.maplesoft.com/support/help/Maple/view.aspx?path=binomial
That says,
In the case that exactly two of the expressions n, r, and n-r
are negative integers, Maple also signals the invalid_operation
numeric event, allowing the user to control this singular
behavior by catching the event. See ?numeric_events for more
information.
Using the first example from the help-page for the numeric event handler,
http://www.maplesoft.com/support/help/Maple/view.aspx?path=NumericEventHandler
one can handle the cases you're considering.
restart:
formula:=(n,r)->limit(GAMMA(n+t+1)/(GAMMA(r+1)*GAMMA(n+t-r+1)),t=0):
seq( formula(-1,i), i=-5..5);
Error, (in GAMMA) numeric exception: division by zero
MyHandler := proc(operator,operands,default_value)
NumericStatus( division_by_zero = false );
return default_value;
end proc:
NumericEventHandler(division_by_zero=MyHandler):
seq( formula(-1,i), i=-5..5);
0, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1
The example in the help had an event handler that also issued a warning. You are, of course, free to make it do what you wish. The key is that it's been set up to provide programmatic control.
Back to comp.soft-sys.math.maple | Previous | Next — Previous in thread | Find similar
The value of binomial(-1, r) peter.luschny@gmail.com - 2014-10-20 03:18 -0700
Re: The value of binomial(-1, r) "Nasser M. Abbasi" <nma@12000.org> - 2014-10-20 06:00 -0500
Re: The value of binomial(-1, r) peter.luschny@gmail.com - 2014-10-21 02:44 -0700
Re: The value of binomial(-1, r) acer <maple@rogers.com> - 2014-10-22 05:43 -0700
csiph-web