octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #41890] nchoosek(vector, 0) should return a 1x


From: anonymous
Subject: [Octave-bug-tracker] [bug #41890] nchoosek(vector, 0) should return a 1x0 matrix instead of 0x0
Date: Tue, 18 Mar 2014 03:56:03 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0

URL:
  <http://savannah.gnu.org/bugs/?41890>

                 Summary: nchoosek(vector, 0) should return a 1x0 matrix
instead of 0x0
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Tue 18 Mar 2014 03:56:02 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Pedro Angelo
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.4
        Operating System: GNU/Linux

    _______________________________________________________

Details:

If we have a vector `v' of length `n=length(v)', then the following
inconsistency is observed

    size(nchoosek(v, 0 ),1) != nchoosek(length(v), 0 )
    size(nchoosek(v, 1 ),1) == nchoosek(length(v), 1 )
    size(nchoosek(v, 2 ),1) == nchoosek(length(v), 2 )
    ...
    size(nchoosek(v, N ),1) == nchoosek(length(v), N )

that is, for all values of K, the equality `size(nchoosek(v, K ),1) ==
nchoosek(length(v), K )' is valid, except for K==0.

This is taken from the nchoosek's help:

    The resulting C has size `[nchoosek (length (N), K), K]'.

For the case K==0, the help is wrong; however, what really should be changed
is the result of the function, not the help.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?41890>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]