Combinations / Sets of objects

  • Context:
  • Thread starter Thread starter arno100
  • Start date Start date
  • Tags Tags
    Combinations Sets
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
arno100
Messages
1
Reaction score
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
 
Physics news on Phys.org
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.