Say I have a $K$-component alloy system, where the $K$ components are chosen from $N$ possible metal elements ($N>K$), and the concentration of each component always ranges from $a$% to $b$% (only consider integer percentages). Two alloys are considered to be different if any metal content differs by 1%. If we don't distinguish the arrangement of the components (i.e. the order doesn't matter), what is the total number of unique alloy compositions?
For now I only know if we assume the concentrations of all compoenents are always equal, the total number of unique alloy compositions is $\displaystyle{N \choose K} = \frac{N!}{(N-K)!K!}$. But how should we take into account the percentage constraint?
Edit: To make a component considered as "exists" in the alloy, obviously it has to be at least having a percentage of 1%, thus we always have $K−1 \le a \le b \le 100−K+1$.
To give you some idea: let's say $K=3,a=2,b=98$, the first component can take a percentage equal to $2,3,\ldots,98$, but when the first component takes a percentage of 98% for example, the other two components have to both take a percentage of 1%.
You want to find the number of ways to distribute $100$ percentage points into $N$ boxes, of which $N-K$ are empty and the remaining $K$ have between $a$ and $b$ percentage points.
First, fix $K$. We can use a generating function $G(z)$ to count the number of possibilities.
$$\tag{1} G(z)=(z^{a}+z^{a+1}+\cdots+z^{b})^K=z^{aK}(1-z^{1-a+b})^K(1-z)^{-K} $$
By appealing to the binomial theorem, we may write
$$\tag{2} G(z)=z^{aK}\left[\sum\limits_{m=0}^K\left(\begin{matrix}K \\ m \end{matrix}\right) (-z^{1-a+b})^{m}\right]\left[\sum\limits_{n=0}^\infty \left(\begin{matrix}-K \\ n\end{matrix}\right) (-z)^n\right] $$
The coefficient of $z^{100}$ in the Maclaurin expansion of $G$ corresponds to the number of possibilities $\Omega_K$. By setting $aK+m(1-a+b)+n=100$ we can collapse one sum to find
$$\tag{3} \Omega_K=\sum\limits_{m=0}^M(-1)^{aK+m(b-a)} \left(\begin{matrix}K \\ m \end{matrix}\right) \left(\begin{matrix}-K \\ 100-aK-m(1-a+b)\end{matrix}\right) $$
Where $M=\operatorname{floor}(\frac{100-aK}{1-a+b})$. The total number of combinations $\Omega(N,K)$ is then $\Omega_K$ weighted by the number of ways to choose $K$ boxes out of $N$, which is again a binomial coefficient.
$$\tag{4} \Omega(N,K)=\left(\begin{matrix}N \\ K\end{matrix}\right)\Omega_K $$