Given a set ** S containing repeating elements, how to determine the total number of all possible subsets of S, where each subset is unique.
For example, say S = {A, B, B} and let K be the set of all subsets, then K = {{}, {A}, {B}, {A, B}, {B, B}, {A, B, B}} and therefore | K | = 6.
Another example: if S = {A, A, B, B}, then K = {{}, {A}, {B}, {A, B}, {A, A}, {B, B }, {A, B, B}, {A, A, B}, {A, A, B, B}} and for this | K | = 9
It is easy to see that if S is a real set having only unique elements, then | K | = 2 ^ | S |.
What is the formula for calculating this value | K | given the “set” of S (with duplicates) without generating all subsets?
** Not technically set.