Combinations (not permutations) of numbers


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Combinations (not permutations) of numbers

  1. #1
    Join Date
    May 2006
    Posts
    2

    Combinations (not permutations) of numbers

    Does anyone have a method that I could use to print (or anything) all combinations (so, 123 and 321 are the same) of given numbers, or even something that would do the same to objects??

  2. #2
    Join Date
    Jul 2004
    Posts
    83
    you want the different ways 123 could be printed? ex:
    123
    132
    213
    231
    312
    321
    ?
    They say if you play a Microsoft Windows CD backwards it will play satanic messages. But thats nothing, if you play it forwards it installs Windows.

  3. #3
    Join Date
    Mar 2004
    Posts
    635
    so you dont want all combinations, just all groups.

    S = set of all numbers
    C = number of elements in a combination, or group

    So all possible groups equals S!/C!

  4. #4
    Join Date
    May 2006
    Posts
    2
    Ummm... I don't think you got me...
    Permutations, variations and combinations are not the same thing... Permutations are when total number of elements and a number of elements in a group are the same, so you just change their places (so, ordering metters)... variations are when you can group less elements than the maximum, but ordering still metters, and combinations are the same as variations except that ordering does not metter ie. 123, 213 and 321 are the same... and combinations are exactly what I need...
    I want my program to take n elements and print out all combinations, meaning from combinations with 1 element to those with all n elements...
    Any ideas??

    Thanks

Similar Threads

  1. Replies: 1
    Last Post: 05-31-2006, 02:14 AM
  2. Random Numbers on button
    By daina in forum Java
    Replies: 3
    Last Post: 10-12-2005, 01:35 AM
  3. Replies: 0
    Last Post: 05-27-2005, 01:23 AM
  4. Rounding numbers
    By Big Swifty in forum Java
    Replies: 3
    Last Post: 11-10-2002, 06:33 AM
  5. Replies: 0
    Last Post: 08-25-2000, 07:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center