Number of combinations from a set with certain rules Suppose I would like to select $m$ integers from the set $S=\{1,2,...,n\}$ with the following rules:
1) $j$ out of $m$ are necessarily distinct. Denote this as $S_1$
2) the rest $m-j$ are selected from a subset of $S_2$ of $S$ of size of $i<=n$ that contains also $S_1$ (allowing any integer from $S_2$ to be selected more than once). 
I would like to compute the number of such "subsets" (no strictly speaking a set as we allow repetitions of elements) of size $m$ and compute the probability that a given "set" of size $m$ will have this property if chosen uniformly at random.
Example: Suppose $S=\{1,2,3,4,5,6,7,8\}$, $m=5$, $S_1=\{1,2,3\}$ (i.e. $j=3$) $S_2=\{1,2,3,4,7,8\}$, then possible candidates are: $\{1,2,3,1,2\},\{1,2,3,4,7\},\{1,2,3,1,1\},\{1,2,3,8,8\},\{1,2,3,3,8\}...$
 A: Your selection is uniquely determined by these data:


*

*The set of $j+i$ distinct integers in it.

*The $j$ unique integers in it.

*The multiplicities of the remaining $i$ integers.
For instance, an example of the case $n=8, j=2, i=2, m=7$ is the multiset $12^235^3$ (representing the tuple $(1,2,2,3,5,5,5)$ up to permutation).  There must be exactly $j=2$ elements with no explicit power in this notation and $i=2$ elements with powers of $2$ or greater.  Furthermore, the sum of all the powers is $m$.
If we subtract $2$ from all the powers of the $i$ repeated elements, the powers that are left must sum to $m - j - 2i$.  In the example, the powers of the repeated elements are $2$ and $3$; subtracting $2$ from each and adding gives $0+1 = 7 - 2 - 2(2)$.
Consequently, the number of these sets equals 


*

*The number of $j+i$-subsets of $[n]$, equal to $\binom{n}{j+i}$;

*Times the number of $j$-subsets of $[j+i]$, equal to $\binom{j+i}{j}$;

*Times the number of ordered partitions of $m - j - 2i$ things into $i$ parts of size $0$ or larger.
The last can be counted by writing those $m-j-2i$ things down and inserting $i-1$ breaks between them.  Those are in one-to-one correspondence with all the ways of selecting $i-1$ positions out of $m-j-2i+(i-1) = m-j-i-1$ locations, as explained at https://math.stackexchange.com/questions/31562.
The answer therefore is
$$\binom{n}{j+i}\binom{j+i}{j}\binom{m-j-i-1}{i-1}.$$
A: Not sure if I understood the question correctly.
There are $n \choose j$ subsets of size $j.$ For each of these choices you then choose $m-j$ points freely (allowing duplicates) from subset $S_1\subset S$ of size $i.$ Thus $i\geq j$.
Let's fix $i.$ For the remainder of the points, you are looking at the number of all functions from $\{1,2,\ldots,m-j\}$ to a set of size $i,$ and there are $i^{m-j}$ such choices.
If $i$ is fixed and specified, the answer is ${n \choose j} i^{m-j}.$ If you are interested in the total number of choices for $i$ in the range $j,j+1,\ldots,n$ you may need to use inclusion exclusion. However, since any solution for a given $i>j$ is also a valid solution for $i'\in \{j+1, \ldots,i\}$ I feel that the answer should be 
$$
{n \choose j} n^{m-j}
$$
since we can take $i=n.$
A: Are you simply asking for the number of size-$m$ multisets of $1,\ldots,n$ such that there are anywhere from $j$ up to $i$ distinct elements in the multiset?
That would be $\sum_{k=j}^{k=i}\binom{n}{k}\binom{m-1}{k-1}$, where the binomial coefficients are understood to be zero for "bad" parameters, I think.
