Article View: comp.soft-sys.matlab
Article #26Enumerating Combinations
From: Kevin Wayne
Date: Sat, 23 Jan 1993 21:44
Date: Sat, 23 Jan 1993 21:44
11 lines
866 bytes
866 bytes
I want to enumerate all combinations of n items taken p at a time for arbitrary n, p<=n. (i.e., for (n,p)=(5,3) generate a sequence of vectors: [1 2 3], [1 2 4], [1 2 5], [1 3 4], [1 3 5], [1 4 5], [2 3 4], [2 3 5], [2 4 5], [3 4 5] ) Obviously, the computational effort will increase exponentially, but I only need to use it for relatively small n. If anyone has written such code, please send e-mail. Thanks in advance.
Technical Details
Message-ID:
<1993Jan23.214452.26779@news.yale.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!think.com!yale.edu!news.yale.edu!wayneShow Full Headers
Complete Article Headers
Newsgroups: comp.soft-sys.matlab Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!yale.edu!news.yale.edu!wayne From: wayne@econ.yale.edu (Kevin Wayne) Subject: Enumerating Combinations Message-ID: <1993Jan23.214452.26779@news.yale.edu> Sender: news@news.yale.edu (USENET News System) Nntp-Posting-Host: aida.econ.yale.edu Organization: Economics Department, Yale University, New Haven, Ct. Date: Sat, 23 Jan 1993 21:44:52 GMT Lines: 11