Newsgroups: comp.sys.handhelds
Path: utzoo!utgpu!watserv1!watdragon!dahlia.waterloo.edu!dwrfielder
From: dwrfielder@dahlia.waterloo.edu (Dave Fielder)
Subject: Re: COMB(X,Y) function on 48sx
Message-ID: <1991Jun25.171406.17170@watdragon.waterloo.edu>
Sender: news@watdragon.waterloo.edu (News Owner)
Organization: University of Waterloo
References: <3238343@cc.sfu.ca>
Date: Tue, 25 Jun 1991 17:14:06 GMT
Lines: 67

In article <3238343@cc.sfu.ca> Dan_Ciarniello@cc.sfu.ca writes:
>>Does anyone know as to why the 48sx does not like negatives
>>in the COMB function.  They should be valid.
>>
>>eg. COMB(-8,4) should return (-8)(-9)(-10)(-11)/(4!) = 330.
>>
>HP didn't screw up on this function.  COMB(x,y) returns the number of 
>possible combinations of x distinct objects taken y at a time.  In 
>this context negative numbers make no sense (how many objects are 
>-8).
> 
>Also, the factorial function is defined only for the positive integers
>(including 0).  It is not defined for the negative integers.  The gamma
>function *is* defined for negative numbers but it is undefined for the 
>negative integers (the 48 gives an Infinite Result error).
> 

Well, perhaps then COMB should not be defined only for the positive integers
but rather be extended.

        (r)
  ie.  n    is a symbol read "n to r factors", is defined as follows:
        (r)
       n   =n(n-1)(n-2)...(n-r+1), r>0
        (0)
       n   =1.

                                        (r)
       If n is a non-negative integer, n   is the number of arrangements,
       or permutations, of n different things taken r at a time, for which
       another common symbol is nPr.  In particular, 
        (n)
       n   = nPn is the number of arrangements or permutations of n different
       things taken all at a time, and is given a special symbol n! called
       "n factorial".
                                           (r)
       "n choose r" is then defined as:   n      for r>= 0.
                                         -----
                                          r!
        
       If r and n are non-negative integers, then "n choose r" is the number
       of ways to choose r items from n when the order of choice is unimportant.       This is sometimes referred to as the number of combinations of n things
       taken r at a time, and another frequently used symbol is nCr.

       Excerpts taken from:
       Probability and Statistical Inference Volume 1: Probability
       by non other than J.G. Kalbfleisch. Dean of Faculty of Mathematics
       at U of W. (God I hate this textbook!)  :^).

Now, the whole point of all this is that is possible to take n as being 
negative in "n choose r", and this is really useful when you get into the
binomial theorum for statistics, and combinatorics and optomizations.

       ie.       n   ___  /   \  r
            (1+t)  = \_   | n | t
                     /__  | r |
                     r>=0 \   /

I find it suprizing that HP restricted the domain of COMB(n,r) such that
n is a positive integer rather than a real.

Just my $.02 worth. 

--Dave Hubert
  3A Math Non-Specailist
  Faculty of Mathematics
  University of Waterloo, Canada.
