Results 1 to 2 of 2

Generalised permutation algoroithm required

Threaded View

RincewindWIZZ Generalised permutation... 05-06-2014, 06:14 PM
shg Re: Generalised permutation... 05-06-2014, 06:21 PM
  1. #1
    Registered User
    Join Date
    03-03-2005
    Posts
    41

    Generalised permutation algoroithm required

    Hi Experts

    I need some code to generate all possible unique sets of p groups containing q items taken from an array of r elements. Order not important and P*Q<=R. This seems seems marginally more complicated than most of the links I have found so far.

    My current need is specifically for all possible sets of 6 pairs of elements from an array of 12 elements. (i.e. p=6,q=2,r=12)
    In simpler terms suppose there were 4 elements and I wanted all possible sets of 2 pairs I would expect (p=2,q-2,r=4)
    1,2 3,4
    1,3 2,4
    1,4 2,3

    If there were 5 elements and I wanted all possible sets of 2 pairs, I would expect (p=2,q=2,r=5)
    1,2 3,4
    1,2 3,5
    1,2 4,5
    1,3 2,4
    1,3 2,5
    1,3 4,5
    1,4 2,3
    1,4 2,5
    1,4 3,5
    1,5 2,3
    1.5 2,4
    1,5 3,4

    if there were 6 items and I wanted all possible pairs of triplets, I would expect (p=2,q=3,r=6)
    1,2,3 4,5,6
    1,2,4 3,5,6
    1,2,5 3,4,6
    1,2,6 3,4,5
    1,3,4 2,5,6
    1,3,5 2,4,6
    1,3,6 2,4,5
    1,4,5 2,3,6
    etc

    Any help gratefully received.

    Thanks
    PS This was initially posted in http://www.mrexcel.com/forum/excel-q...numbers-3.html
    as a reply to an old (Apr 2006) post but has, unsurprisingly, received no replies
    Last edited by RincewindWIZZ; 05-08-2014 at 07:32 AM. Reason: smacked botty!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Generalised version of LINEST using QR Decomposition
    By Harlan Grove in forum Excel Formulas & Functions
    Replies: 28
    Last Post: 09-07-2005, 12:05 AM
  2. Generalised version of LINEST using QR Decomposition
    By Will in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  3. Generalised version of LINEST using QR Decomposition
    By Will in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  4. Generalised version of LINEST using QR Decomposition
    By Harlan Grove in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 04:05 AM
  5. [SOLVED] Generalised version of LINEST using QR Decomposition
    By Will in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1