Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

$x_1,x_2,...,x_n$ are integer numbers in the range [0,B-1]. Count the number of solution for $x_1+x_2+...+x_n=k$.

I know this problem is similar to the one here Number of ways of partitioning a sum into ordered non-negative summands

But now there is constraint on the range of $x_i$. In the problem text it gives a hint to use principle of inclusion and exclusion. Does anyone have a clue?

share|improve this question

marked as duplicate by Brian M. Scott, Martin, Amzoti, vonbrand, tomasz May 17 '13 at 20:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
@BrianM.Scott I don't see how the first question you linked is related, but the second is essentially the same, so I'll vote to close. –  tomasz May 17 '13 at 20:49
    
@tomasz: They’re all three essentially the same question: how many solutions in non-negative integers are there to $\sum_{k=1}^mx_k=n$ subject to the constraint that each $x_k\le b$? –  Brian M. Scott May 17 '13 at 20:53
    
@BrianM.Scott: I see now. You're right. :) –  tomasz May 17 '13 at 21:45

Browse other questions tagged or ask your own question.