# Combinations of two sets

I'd like to confirm, what is the name of this combination, and if its calculated right:

Set (a,b) is spread over set of (1,2,3)

1 2 3
a b

a1 b1 2 3
a1 b2 3
a1 2 b3
b1 a2 3
b1 2 a3
1 a2 b2 3
1 a2 b3
1 b2 a3
1 2 a3 b3


2*3 + 3 = 9

And based on that I'm doing it with a bigger sets without manual trial and error:

1 2 3 4 5 6 7 8 9 10 11 12
a b c d e f g


7*12 + 12 = 96

-
The meaning is unclear. Your worked example suggests you are counting the maps from {a,b} to {1,2,3}, which is 3^2 = 9. However in the second case the answer would be much bigger than 96 if that were the meaning. –  hardmath Mar 25 '12 at 7:28

Actually @Henry might be right after all. I made further construction with a set of 1, 2, 3, 4 and a, b:

a1 b1 2 3 4
a1 b2 3 4
a1 2 b3 4
a1 2 3 b4
b1 a2 3 4
b1 2 a3 4
b1 2 3 a4
1 a2 b2 3 4
1 a2 b3 4
1 a2 3 b4
1 b2 a3 4
1 b2 3 a4
1 2 a3 b3 4
1 2 a3 b4
1 2 b3 a4
1 2 3 a4 b4


To compare my earlier formula that coincidently happened to give right answer, we can see:

2*4 + 4 = 12 != 4^2 = 16

I was confused with the pattern, that you can see from the example result. There are 4 rows popping up from other rows with certain interval. I think that pattern kind of "fractalizes" depending how many items there are on sets. But thats another story.

-

If $a$ can take any of $3$ possible values, and independently $b$ can take any of $3$ possible values, then in total there are $3 \times 3 =9$ possibilities.

So with $m$ letters each taking $n$ possible values there are $n^m$ possibilities.

With $7$ letters and $12$ values this is $12^7 = 35831808$ possibilities, rather more than your $96$.

-
Yes, a and b can take any possible value independently, and they must to take one value plus same combination is count only once. But I'm not really sure, if combinations can be that big tens millions... –  PHPGAE Mar 25 '12 at 18:27
@PHPGAE: Try with one letter and twelve values: the answer is obvious $12$ possibilities. Now with a second letter, that has $12$ possible values too so combined you have $12 \times 12$ possibilities. Now with a third letter, that has $12$ possible values as well so combined you have $12 \times 12 \times 12$ ... –  Henry Mar 25 '12 at 21:00
$$N= \frac{n!}{(n-k)!}+n$$
where $n$ is a number of elements of numbers set , and $k$ is number of elements of letters set .