views:

196

answers:

1

I have solved #103 and #105, but I have a hard time understanding #106, specifically where does the number 25 come from?

If we are talking about two disjoint subsets with equal number of elements, then

1-elem vs. 1-elem: there are 4 x 3 = 12 comparisons
2 vs. 2: C(4, 2) = 6 comparisons

If we include disjoint subsets with non-equal number of elements, then

1 vs. 2: C(4, 1) x C(3, 2) = 12
1 vs. 3: C(4, 1) = 4

What am I missing here? Thanks in advance.

+3  A: 

For the first two types of comparisons, I get half your numbers -- I think a comparison that is just the reverse of another comparison doesn't count as a new one.

For example, if the four elements are a,b,c,d, then the 2 vs 2 comparison a,b vs. c,d is the same as c,d vs. a,b. So I get:

1 vs 1: 6
2 vs 2: 3
1 vs 2: 12
1 vs 3: 4

which does indeed add up to 25.

JacobM
Thanks. Two weeks ago, I got it, but today I stumbled on it again, shame on me.
grokus