Combinatorics Question — Counting Subsets

Правка en1, от dimiTree, 2021-09-17 01:30:54

We are given n disjoint, finite sets.

We would like to count the amount of all possible subsets, while having the following restriction: we are only allowed to include a max of one element each out of every of our n disjoint sets.

My initial thought was to count all possible subsets of size {0, 1, ..., n} and sum them up.

Code

There is probably a much more elegant and efficient solution out there.

Feel free to share your ideas!

Теги #combinatorics

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский dimiTree 2021-09-17 01:30:54 1068 Initial revision (published)