Number of ways to arrange $i$ distinct objects into tuples, with each listed at least once

18 Views Asked by At

Let $i<m$. Suppose you have $i$ distinct objects. You need to arrange them into tuples $(x_1,\dotsc, x_m)$, where repetition is allowed, order matters, and each of the $i$ objects is listed at least once.

Question: What is the numbre of ways $a_{i,m}$ to arrange $i$ distinct objects such that, order matters, repetitions are allowed, and each of the $i$ objects are listed at least once?

My thoughts: I believe this should be $a_{i,m} = i^m-c_{i,m}$ for some number $c_{i,m}$. For example, for $m=4$ and $i=2$, we have $1112, 1121, 1211, 2111, 1122, 1221, 2211, 1212, 2121, 2112, 2221, 2122, 2212, 1222$ i.e. $14$, which is $2^4-2$, so $c_{2,2}=2$, provided I have not miscounted any possibilities.

An argument for this case, without explicitly listing all possibilities and counting them by hand, might look like the following. First, we recall number of $m=4$ tuples with $2$ objects without any other restrictions is $$2\cdot 2 \cdot 2 \cdot 2=2^4=16.$$ In our specialized case, three slots may have $2$ choices and one slot is forced to be fixed by one choice, so that both $i=2$ elements are accounted for. Unfortunately, here is where my combinatorics is too rusty to formulate this into a simple product formula. Any help would be greatly appreciated.

I believe $a_{3, 4}=3^4-45=81-45=36$, and $a_{4, 4}=4^4-232=256-232=24=4!$. I obtained these by backing out $c_{i,m}$ from related formulas.

I apologies in advance if this is well known, I could not find it in my google searches without digging through a lot of combinatorics (which I will do now while waiting for any responses, in hopes to answer this myself).