Here is a linear equation $$a+b+c+d=12$$ where $a,b,c,d$ are restricted to be greater than zero and less than or equal to 6.
How many set of positive integer solutions are possible using partitions and permutations?
Here is a linear equation $$a+b+c+d=12$$ where $a,b,c,d$ are restricted to be greater than zero and less than or equal to 6.
How many set of positive integer solutions are possible using partitions and permutations?
Generating Function Approach $$ \begin{align} &\left[x^{12}\right]\left(x+x^2+x^3+x^4+x^5+x^6\right)^4\\ &=\left[x^{12}\right]\left(\frac{x-x^7}{1-x}\right)^4\\ &=\left[x^8\right]\left(\frac{1-x^6}{1-x}\right)^4\\ &=\left[x^8\right]\left(\sum_{k=0}^4\binom{4}{k}\left(-x^6\right)^k\sum_{j=0}^\infty\binom{-4}{j}(-x)^{j}\right)\\ &=\sum_{k=0}^1(-1)^k\binom{4}{k}\binom{-4}{8-6k}\\ &=\sum_{k=0}^1(-1)^k\binom{4}{k}\binom{11-6k}{3}\\ &=\binom{4}{0}\binom{11}{3}-\binom{4}{1}\binom{5}{3}\\[6pt] &=125 \end{align} $$
Stars and Bars Approach
Without the restriction of the minimum of $1$ and the maximum of $6$, Stars and Bars would give $\binom{15}{3}$ for $12$ stars and $3$ bars.
To get a minimum of $1$, we prefill all the partitions with $1$ leaving $8$ stars and $3$ bars which gives $\binom{11}{3}$.
Now, as mentioned in Kevin Long's answer, we can only account for the maximum of $6$ by subtracting the cases where some partitions have more than $6$. Only one partition can have more than $6$ if all have at least $1$, so there are $4$ choices of where to have more than $6$. For each of those choices, we prefill $7$ in that one and $1$ in each of the others, leaving $2$ stars and $3$ bars; that is, $\binom{5}{3}$. Thus, the number of good arrangements is $$ \binom{11}{3}-4\binom{5}{3}=125 $$
I wrote up a proof using generating functions, but after your comment that you didn't know them, I realized that they were unnecessary. I didn't want to waste the writing, so I left it, but feel free to ignore it. The first two paragraphs use only basic combinatorics.
We know how to find compositions of $n$ into $k$ nonnegative parts- ${n+k-1\choose k-1}$. If we assume each part is positive, we can put $1$ in each part and get back to the same case. In other words, the number of compositions of $n$ into $k$ positive parts is equal to the number of compositions of $n-k$ into $k$ nonnegative parts. Here, compositions of $12$ into $4$ positive parts are the same as compositions of $8$ into $4$ nonnegative parts, since we just put $1$ in each part. This gives us ${11\choose 3}$ ways to get $12$ with $4$ positive parts.
However, a part also cannot be greater than $6$, so we want to remove these parts. The number of "bad" compositions can be found by putting $7$ into one of the parts and $1$ into the rest. In other words, we assume that a part is bad at the start. Then there are $2$ stars left and still $3$ bars, so there are ${5\choose 3}$ ways to add in the last $2$ stars. However, there are $4$ different ways to choose which part is the "bad" part, since it can be any of the $4$. Hence, there are $4{5\choose 3}$ bad compositions. Hence, the difference ${11\choose 3}-4{5\choose 3}$ is the number of good compositions. Note that I can only have one "bad" part, thanks to the nice choice of numbers in this problem. If I had $13$ stars, there could be $2$ bad parts, and I'd be double counting when I take them out.
Consider the function $f(x)=x+x^2+x^3+x^4+x^5+x^6=x(1+x+x^2+...x^5)=x\frac{1-x^6}{1-x}$. The coefficient of $x^n$ of this function is the number of ways each block in this composition can have value $n$. In other words, a part can be anywhere from $1$ to $6$, and in only one way, but nothing else. Then the coefficient of $x^{12}$ in $f^4(x)$ is the number of ways to get a composition of $12$, since this counts compositions into $4$ parts where each part is from $1$ to $6$.