Discrete variables with constraint on sum - How many possible cases?

47 Views Asked by At

Given n variables $$X_1,..., X_n \in [1, 2, ..., k-1, k] $$ (Each variable has takes an integer value between 1 and k)

and the constraint $\sum_{i=1}^n X_i = k$

What is the total number of distinct possibilities for $(X_1, ..., X_n)$?

Without the constraint, the solution is $k^N$.

With the constraint and n=2, the solution is $k$

I am stuck at solving the general case.

1

There are 1 best solutions below

3
On BEST ANSWER

There needs to be a condition that $ n<k$ and other conditions like whether we need to assign some value to each variable or it can be left empty, need to be specifically mentioned.

Assuming that each variable needs to be assigned a value and $n<k$ the no. of solution will be same as coefficient of $x^{k-n}$ in expression $(1-x)^{-n}$ which is $^{k-1}C_{n-1}$

I will explain, if you require.