Number of ways of selecting one or more disjoint two-element subsets from a set with $n$ elements

85 Views Asked by At

I have the equation for $n$ choose $k$ as: $$\binom nk=\frac{n!}{k!(n-k)!}$$

However, this only works for the disjoint pairs which completely fill the original set. Is there a way to modify this to include all unique subsets of possible omitted disjoint pairs, without overlapping?

Edit: To add to this, I believe the combinations for a set of 6 should number 60 (though I did this by hand so I may have missed some,) hopefully the actual set will help clear up any potential failings in my communication of the question:

12 34 56
12 35 46
12 36 45
13 24 56
13 25 46
13 26 45
14 23 56
14 25 36
14 26 35
15 23 67
15 26 37
15 27 36
16 23 45
16 24 35
16 25 34
12 34
12 35
12 36
13 24
13 25
13 26
14 23
14 25
14 26
15 23
15 24
15 26
16 23
16 24
16 25
23 45
23 46
23 56
24 35
24 36
24 56
25 34
25 36
25 46
26 34
26 35
26 45
34 56
35 46
36 45
12
13
14
15
16
23
24
25
26
34
35
36
45
46
56
1

There are 1 best solutions below

3
On BEST ANSWER

According to OEIS the sequence is https://oeis.org/A001189. The nicest formula seems to be $$a_n=\sum_{j = 1}^{n/2} \frac{n!}{(j!(n-2j)!(2^j))}$$

For a recursive formula, $$\begin{cases} a_1=0\\a_2=1 \\ a_{n}= a_{n-1}+ (n-1)(a_{n-2}+1) \qquad n>2\end{cases}$$