If I had N characters and I wanted to figure out the number of all possible pairs in that set, how would I do that? What’s the math word?

## 2 thoughts on “If I had N characters and I wa…”

Comments are closed.

Skip to content
# If I had N characters and I wa…

##
2 thoughts on “If I had N characters and I wa…”

If I had N characters and I wanted to figure out the number of all possible pairs in that set, how would I do that? What’s the math word?

Comments are closed.

Usually combination or n choose k.

For the really simple case, if you have N characters (a b c d e f ..) and want to make them into pairs, you have N choices for the first half of the pair, and then N-1 choices for the second (assuming you can’t choose the first choice twice; if you can, then you have N choices the second time too). If the pair “a b” is the same as the pair “b a”, then you have to divide the number of possible pairs in half to account for this double-counting. So probably the answer you want is N*(N-1) / 2, but depending the specific details you may get a different answer. (One other case I’m glossing over is what if you have duplicates in your set, like a a a b b b – you’ll have to decide whether that matters or not.)

Excellent explanation, thank you very much.