[Math] Sum of Permutations of n objects taken r at a time ( r=1 to n ) where objects may be groups of same entities

combinatoricspermutations

Given n objects where n1 objects are the same ,along with another group of n2 objects of same element etc.. such that Σni = n (i=1 to k). Assuming there are k groups of similar objects

eg: in {1,1,2,2,2,3,4}

Thus n1=2, n2=3, n3=1, n4=1 and n=7
for two 1's, three 2's, one 3 and one 4 thus k=4 groups

Here Permutations of taking r elements at a time from n when r=n is
$\frac{n!}{n1!.n2!.n3!…nk!}$

What about the permutations where r < n (i.e. r=1 to r=n-1) ? Is there a direct formula?

Is it possible to find the sum of all numbers that can be formed with these elements when the objects are numbers (using the above concept)?

(Similar to the formula when r=n

Total sum of all numbers that can be formed = (n-1)!.(sum of all n digits).(1111…n times) )

Best Answer

Let us assume that there are $k$ groups.

For a fixed $r\in\{1,\dots,n\}$ let: $$\langle r_1,\dots,r_k\rangle\in R(r)\iff r_1\in\{0,\dots,n_1\}\wedge\cdots\wedge r_k\in\{0,\dots,n_k\}\wedge r_1+\dots+r_k=r$$

Then the number of permutations by taking $r$ elements is: $$\sum_{\langle r_1,\dots,r_k\rangle\in R(r)}\frac{r!}{r_1!\times\cdots\times r_k!}$$

Note that $R(n)$ only has one element, and $R(1)$ has $k$ elements.