Combinations / Sets of objects

In summary, combinations are a selection of objects where the order does not matter, while permutations are a selection of objects where the order does matter. The number of combinations can be calculated using the formula nCr = n! / (r! * (n-r)!), and the number of permutations can be calculated using the formula nPr = n! / (n-r)!. Combinations and permutations can also be repeated, with different formulas to use depending on whether repetition is allowed or not. They are used in various fields such as mathematics, computer science, and statistics to solve problems involving selecting and arranging objects, as well as in probability and statistics. Examples of combinations include choosing a group of students for a project, selecting toppings for a pizza
  • #1
arno100
1
0
Hi,

I am looking for a solution that generates combinations of objects from a series of objects in a set. For example, {Apple, Pear, Orange} should bring back
Apple
Pear
Orange
Apple, Pear
Apple, Pear, Orange,
Apple, Orange
...

Items in the series should not repeat (i.e. Apple, Orange / Orange, Apple should only appear once). Any online generators anybody can suggest? Or, material I can use to figure this out?

Many thanks
 
Mathematics news on Phys.org
  • #2
You forgot "Pear, Orange", the formula is 2^n with n is the number of elements in the set. Beware that 2^n also includes an empty set.
 
Back
Top