IFRAME SYNC
IFRAME SYNC
IFRAME SYNC
IFRAME SYNC

How many ways to combine elements from "different bags"?

I could not find this problem anywhere else, but maybe I am just using the wrong keywords (in that case, I'm sorry).

Considering I have two bags, each one with $N$ elements inside, I need to pair each element of the first bag to an element in the second bag (therefore creating $N$ pairs). The question is how many ways there are to pair these elements.

For example, let's consider two bags with $N=5$:

Bag_1 = [A, B, C, D, E]

Bag_2 = [1, 2, 3, 4, 5]

Creating pairs [A1, B2, C3, D4, E5] (one possibility) or [A2, B1, C3, D4, E5] (two possibilities) and so on...

There are $5! = 120$ ways of pairing these elements.

For the case of one bag containing $N$ different elements I could generalize the answer to be:

$\frac{N!}{\prod{K_i!}}$

Where $K_i$ is the amount of each element present in the second bag (e.g. for [1,1,2,2,3] the denominator would be $2!2!1!$).

But when both "bags" have repeated elements, I could not create a rule for describing how many different ways there were to pair the elements.

This is a simplification of the problem, what I actually have to solve involves $N$ bags (creating not pairs, but groups of $N$ elements). But any light on the problem is appreciated.

Thanks for your attention!

Edit: I also need to mention that elements in both bags could be the same (e.g. both could be letters) and order does not matter in any way (e.g 'AB' is the same as 'BA').



from Hot Weekly Questions - Mathematics Stack Exchange

Post a Comment

[blogger]

Contact Form

Name

Email *

Message *

copyrighted to mathematicianadda.com. Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget

Blog Archive