# Number of possible combinations of a certain type

**URL:** <https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100>\
**Category:** Factual Questions\
**Created:** [February 7, 2012, 6:33pm UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100 "2012-02-07T18:33:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [February 7, 2012, 6:33pm UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/1 "2012-02-07T18:33:34Z")

</div>

Suppose I have 150 New Englanders tell me which state they live in, so I have a list:  
Fred Vermont  
Barney Mass.  
Wilma Mass.  
Betty Conn.  
etc etc

It’s sad that Barney ran off with Fred’s wife, but I digress…

How can I calculate the number of possible two-person pairs such that the people are from different states?

Thanks!

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [February 7, 2012, 6:44pm UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/2 "2012-02-07T18:44:53Z")

</div>

> [@](#):
>
> How can I calculate the number of possible two-person pairs such that the people are from different states?

That’ll depend on how many you get from each state. In the extreme example where everyone tells you the same state, for instance, you have zero pairs that meet your criteria.

In general, though, I would make a list of the number of possible pairs of states (with 6 states, there will be 21 pairs), and for each pair, multiply the number of people in the first state times the number in the second state, to get the number of possible pairs of people from that pair of states. Then I’d add all those up.

---

<div class="post-metadata">

**Author:** ![mcgato](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@mcgato](https://boards.straightdope.com/u/mcgato)\
**Post date:** [February 7, 2012, 7:38pm UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/3 "2012-02-07T19:38:46Z")

</div>

Without thinking too much, suppose that the numbers come out to:  
a live in state A  
b live in state B  
c live in state C  
d live in state D  
e live in state E

Possible pairs is equal to:  
a(150-a) + b(150-a-b) + c(150-a-b-c) + d(150-a-b-c-d), or I guess:  
a(b+c+d+e) + b(c+d+e) + c(d+e) + d(e)

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [February 7, 2012, 7:43pm UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/4 "2012-02-07T19:43:18Z")

</div>

Yeah, **mcgato** ’s method scales better than mine. He only has five states, but it should be easy enough to see the pattern.

---

<div class="post-metadata">

**Author:** ![Saint\_Cad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saint_cad/32/18907_2.png) [@Saint\_Cad](https://boards.straightdope.com/u/Saint_Cad)\
**Post date:** [February 8, 2012, 1:27am UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/5 "2012-02-08T01:27:17Z")

</div>

that’s permutations and not combinations that you got there.

There are (150x149)/2 total combinations with the same 5 variables mcgato uses. Of the total combinations [ax(a-1)]/2 both live in state A, [bx(b-1)]/2 live in state B, etc.  
So your number is [(150x149) - (a^2 - a) - (b^2 - b) - (c^2 - c) - (d^2 - d) - (e^2 - e)] / 2

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [February 8, 2012, 1:45am UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/6 "2012-02-08T01:45:31Z")

</div>

Surely “combination” was being used in the ordinary language sense, which is a perfectly fine way to speak.

But I agree with **Saint Cad** ’s methodology. And if the goal was to only count opposite-sex couples, the problem is even easier: total males \* total females - the sum of (males \* females for each particular state).

Basically, the easiest thing is to count couples without regard to statehood first, then subtract out the undesired same-state couples.

---

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [February 8, 2012, 3:46am UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/7 "2012-02-08T03:46:49Z")

</div>

> [@Saint\_Cad](#):
>
> that’s permutations and not combinations that you got there.
> 
> There are (150x149)/2 total combinations with the same 5 variables mcgato uses. Of the total combinations [ax(a-1)]/2 both live in state A, [bx(b-1)]/2 live in state B, etc.  
> So your number is [(150x149) - (a^2 - a) - (b^2 - b) - (c^2 - c) - (d^2 - d) - (e^2 - e)] / 2

Mmm, I think I like this. Thanks!

---

<div class="post-metadata">

**Author:** ![mcgato](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@mcgato](https://boards.straightdope.com/u/mcgato)\
**Post date:** [February 8, 2012, 3:00pm UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/8 "2012-02-08T15:00:13Z")

</div>

> [@Saint\_Cad](#):
>
> So your number is [(150x149) - (a^2 - a) - (b^2 - b) - (c^2 - c) - (d^2 - d) - (e^2 - e)] / 2

If you use the fact that a+b+c+d+e = 150 and do some algebra, you end up with exactly what I wrote.

---

<div class="post-metadata">

**Author:** ![Chessic\_Sense](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@Chessic\_Sense](https://boards.straightdope.com/u/Chessic_Sense)\
**Post date:** [February 8, 2012, 4:22pm UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/9 "2012-02-08T16:22:11Z")

</div>

> [@mcgato](#):
>
> a(b+c+d+e) + b(c+d+e) + c(d+e) + d(e)

> [@Saint\_Cad](#):
>
> that’s permutations and not combinations that you got there.

> [@mcgato](#):
>
> If you use the fact that a+b+c+d+e = 150 and do some algebra, you end up with exactly what I wrote.

Yeah, **mcgato** already accounted for the combination-permutation difference by excluding a from “b(c+d+e)” and a+b from “c(d+e)”, etc. He thusly never double-counted “ab” and “ba”.

---

<div class="post-metadata">

**Author:** ![Saint\_Cad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saint_cad/32/18907_2.png) [@Saint\_Cad](https://boards.straightdope.com/u/Saint_Cad)\
**Post date:** [February 8, 2012, 6:00pm UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/10 "2012-02-08T18:00:48Z")

</div>

> [@Chessic\_Sense](#):
>
> Yeah, **mcgato** already accounted for the combination-permutation difference by excluding a from “b(c+d+e)” and a+b from “c(d+e)”, etc. He thusly never double-counted “ab” and “ba”.

You’re right. I missed it the first time I read it. Sorry mcgato.

---

<div class="post-metadata">

**Author:** ![Saint\_Cad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saint_cad/32/18907_2.png) [@Saint\_Cad](https://boards.straightdope.com/u/Saint_Cad)\
**Post date:** [February 8, 2012, 6:11pm UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/11 "2012-02-08T18:11:19Z")

</div>

> [@mcgato](#):
>
> If you use the fact that a+b+c+d+e = 150 and do some algebra, you end up with exactly what I wrote.

True and if P=a+b+c+d+e then mine generalizes to

{(P^2 - P) - [(a^2 - a) + (b^2 - b) + (c^2 - c) + (d^2 - d) + (e^2 - e)]} / 2

I think I could definately make a math activity that has the students show that the two expressions are equivalent.  
FWIW given 5 states and a total population of 150 with at least one resident in each state the minimum number of combinations is 590 and the max is 9000. I love Excel

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [February 8, 2012, 11:23pm UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/12 "2012-02-08T23:23:56Z")

</div>

Ahem.  
1: Connecticut  
2: Rhode Island  
3: Massachusetts  
4: Vermont  
5: New Hampshire  
6: Maine

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [February 9, 2012, 8:45am UTC](https://boards.straightdope.com/t/number-of-possible-combinations-of-a-certain-type/612100/13 "2012-02-09T08:45:17Z")

</div>

> [@Indistinguishable](#):
>
> Surely “combination” was being used in the ordinary language sense, which is a perfectly fine way to speak.

For what it’s worth, in case anyone was wondering, I realize I had misinterpreted the statement I was replying to with this… So it basically makes no sense in proper context.
