How to calculate unique combinations

13.3k Views Asked by At

Let's suppose that we have three variables: $xyz (n=3)$. We need to calculate how many unique combinations we can make. So in this case, you can simply get the answer without using any formulas: $xy, xz, yz, xyz$. So there are $4$ unique combinations. But how do you calculate it with some kind of formula when it gets more complicated? So for example, $4$ variables $wxyz$. Now you have $wx, wy, wz, xy, xz, yz, wxy, wxz, wyz, xyz, wxyz$ ($11$ combinations). And how do you do this when you have even $10$ variables? How do you do this?

2

There are 2 best solutions below

5
On BEST ANSWER

A set with $n$ elements has exactly $2^n$ subsets. Here we do not want the empty set, nor do we want any set with exactly one element. Thus the answer is $$2^n-n-1$$

1
On

Just to add visualization to my answer (and support Lulu's reply). I tend to think on subgroups in terms of binary numbers. Think about it this way: in how many ways you can have 'sub groups' of the followings ABCD?

    A|B|C|D
    -------
0   0 0 0 0
1   0 0 0 1
2   0 0 1 0 
3   0 0 1 1
4   0 1 0 0 
5   0 1 0 1
6   0 1 1 0 
7   0 1 1 1        changed from 1111 to 0111.
8   1 0 0 0 
9   1 0 0 1
10  1 0 1 0
11  1 0 1 1
12  1 1 0 0
13  1 1 0 1
14  1 1 1 0
15  1 1 1 1

You will note that you can have 2^4=16 possibilities from sub grouping of ABCD and if you wish to eliminate 0000 and exclude only 1 letter (there are 4 possibilities) so you're left with 16-4-1=11.