0

I have two sets with different elements For example

let A = {1,2,3,...n}

let B = {a,b,c, ... m}

How can I calculate how many different unordered pairs I can create?

e.g. {1,a} and {a,1} is the same in my case

Any help is appreciated. I'm not sure how to search for it as I confuse the terminology of what I'm looking for and bumping into the wrong questions which all deal with a single set and it's combinations with a sample of two but in my case there are two distinct sets.

gabtzi
  • 101
  • 1
    Assuming the sets are disjoint, this can be seen as simply the Cartesian Product of the sets, $X\times Y = {(x,y)~:~x\in X ,~y\in Y}$ taken a step further to replace all ordered pairs with unordered pairs. In the event that $X$ and $Y$ were not disjoint, then you may have possibly had some overlap in which case you need to count how much that was. As for counting this, $|X\times Y| = |X|\times |Y|$ is the rule of product, one of the fundamental counting principles. – JMoravitz Nov 16 '20 at 12:50
  • 1
    In the event that there was overlap between $X$ and $Y$, then an element $(x,y)$ with $x\neq y$ will have been doublecounted as we change to unordered sets once as $(x,y)$ and again as $(y,x)$ iff $x$ and $y$ are in both $X$ and $Y$ and will not have been doublecounted in the case that $x=y$. So, we look at $|X\cap Y|$. If the size of the intersection is written as $z$, then we have $z\times (z-1)$ ordered pairings of distinct elements, only half of which should have counted and the other half needed to be discarded, taking the final count to $m\times n - \frac{z(z-1)}{2}$ – JMoravitz Nov 16 '20 at 12:56
  • I see so in simple terms in my case where the sets are disjoint it's just a multiplication of the count of each set. But if it wasn't disjoint I'd have to take into account the intersection. Thank you very much – gabtzi Nov 16 '20 at 13:15

0 Answers0