Given a linear diophantine equation $$x\_1+\dots+x\_n=m\leq nn'$$ how many solutions does it have with each $x\_i\in[0,n']\cap\mathbb Z$? Looking for asymptotics that parametrizes well with both $n$ and $n'$ over different ranges for both situations


1. $x\_1\leq\dots\leq x\_n$ and
2. unordered.



Integer partitions into restricted parts
Since $m$ is a dummy variable (*i.e.* a bound variable) and $n,n'$ are "real" variables (*i.e.* they are free) perhaps we should rewrite the problem accordingly as
$``$compute the following
$$ f(y,z) = \#\left\lbrace (x\_1,... , x\_y )\mid x\_1 + ... + x\_y = m,\ x\_i \in \mathbb{N},\ m \leq yz ,\ i < j \implies x\_i \leq x\_j \right\rbrace."$$
We can let $f'$ be the number if we omit the condition $i < j \implies x\_i \leq x\_j$ (*i.e.* $f$ corresponds to partitions and $f'$ corresponds to compositions). Intuition tells us that $f$ will likely have a closed form solution and $f'$ will probably only have solution expressible by generating functions (which are perfect for asymptotics). Let us confirm our intuitions:



> 
> **Compositions (*i.e.* $f'$)**
> 
> 
> 


It is straightforward to see that if we let
$$g(y,m) = \#\left\lbrace (x\_1,..., x\_y ) \mid x\_1 + ... + x\_y = m, \ x\_i \in \mathbb{N}\right\rbrace,$$
then we have the identity
$$f'(y,z) = \sum\_{m=0}^{yz}g(y,m).$$
It is well known, [see the famous stars and bars method in feller's introduction to probability theory](https://g.co/kgs/jbxxTD), that
$$g(y,m)= \binom{y+m-1}{m},$$



> 
> so that $$f'(y,z) = \sum\_{m=0}^{yz}\binom{y+m-1}{m}= 
> \binom{yz+y}{yz},$$
> (or, using your notation, $f'(n,n')=\binom{nn'+n}{nn'}$)
> 
> 
> 


where the last identity can be derived as a consequence of [Chu Shih-Chieh](https://en.wikipedia.org/wiki/Zhu_Shijie)'s identity, see example 2.5.1 of [Chuan-Chong & Khee-Meng's text on combinatorics](https://g.co/kgs/PZxPtA). I also strongly recommend taking a peek at [Flajolet & Sedgewick's text on analytic combinatorics](https://g.co/kgs/mtSh6P) for asymptotics and the more abstract [symbolic method](https://en.wikipedia.org/wiki/Symbolic_method_(combinatorics))/[species](https://en.wikipedia.org/wiki/Combinatorial_species) style which is necessary for the more difficult analysis of $f$.



> 
> **Partitions (*i.e.* $f$)**
> 
> 
> 


It is straightforward to see that if we let
$$g(y,m) = \#\left\lbrace (x\_1,... , x\_y ) \mid x\_1 + ... + x\_y = m, \ x\_i \in \mathbb{N}, \ i < j \implies x\_i \leq x\_j\right\rbrace,$$
then we have the identity
$$f(y,z) = \sum\_{m=0}^{yz}g(y,m).$$


It is well known that if we define the generating function $\mathcal{G}\_y$ as
$$\mathcal{G}\_y(x) = \sum\_{m \in \mathbb{N}} g(y,m) x^m,$$
then we have that
$$\mathcal{G}\_y(x) = \prod\_{k=1}^{y}\frac{1}{1-x^k},$$
see [Flajolet & Sedgewick's text on analytic combinatorics](https://g.co/kgs/mtSh6P) or [Andrews elementary text on partitions](https://g.co/kgs/dWf28q). One way to see this is to notice the following famous theorem attributed to Euler



> 
> The number of partitions of a number $n$ into at most $l$ parts is equal to the number of partitions of a number $n$ into parts all bounded by $l$
> 
> 
> 


and the result follows by elementary generating function magic. Finally, theorem 5.1.1 of [Chuan-Chong & Khee-Meng's text on combinatorics](https://g.co/kgs/PZxPtA) states that
$$\mathcal{A}(x) = \sum\_{n \in \mathbb{N}} a\_n x^n \implies \frac{1}{1-x}\mathcal{A}(x) = \sum\_{n \in \mathbb{N}} \left(\sum\_{k \leq n} a\_k \right) x^n;
$$
therefore, if we define the generating function $\mathcal{F}\_y$ as
$$\mathcal{F}\_{y}(x) = \sum\_{n \in \mathbb{N}} f(y,n) x^n,$$



> 
> then we have that $$\mathcal{F}\_{y}(x) = \frac{1}{1-x}\mathcal{G}\_y(x)
>  = \frac{1}{1-x}\prod\_{k=1}^{y}\frac{1}{1-x^k}. $$
> 
> 
> 


More explicitly we have that
$$f(y,z) = [x^{yz}] \mathcal{F}\_{y}(x) =[x^{yz}] \left(\frac{1}{1-x}\prod\_{k=1}^{y}\frac{1}{1-x^k}\right)$$
where the operator $[x^{k}] $ is defined as follows:
$$\mathcal{A}(x) = a\_0+a\_1x+ ... +a\_nx^n+ ... \implies [x^{k}]\mathcal{A}(x) = a\_k.$$ For the asymptotics please consult [Flajolet & Sedgewick's text on analytic combinatorics](https://g.co/kgs/mtSh6P) where you will find a wealth of information and techniques for extracting the asymptoics of the coefficients of $\mathcal{F}\_{y}(x) $.


