3
$\begingroup$

How many solutions to $x_1+x_2+x_3+x_4 = n$ with restriction $0\leq x_1 \leq x_2 \leq x_3 \leq x_4$.

I have seen this kind of questions with $x_i$ odd/even. Or each having a range like $l\leq x_i \leq r$ also $x_1+\cdots x_k < n$ and in many other formats. But I dont know how to cope with this. How to proceed?

  • 0
    if $x$ can be negative, there can be infinite solutiins2017-02-08
  • 0
    @Kiran I forgot to put that2017-02-08
  • 0
    again, i guess $x$ can be only positive integers2017-02-08
  • 0
    @Kiran It needs no telling that they should be integers.... But as you said .. I am adding that also ^_^2017-02-08
  • 0
    This is a compositions problem as a starting point https://en.wikipedia.org/wiki/Composition_(combinatorics)2017-02-08
  • 0
    http://oeis.org/A0014002017-02-08
  • 0
    @MarcusStuhr This is not what I asked .. -_- This is finding the total solutions to $x_1 = n$, $x_1+x_2 = n$, $x_1 + x_2 + x_3 = n$ and $x_1+x_2+x_3+x_4 = n$. And also without any restrictions -_- My question is totally different -_-2017-02-08
  • 0
    @RezwanArefin The outputs are equivalent.2017-02-08
  • 0
    @MarcusStuhr I think not -_- It will count the solutions with 1,2,3 or 4 variables... also this doesn't satisfy my question ... Example... $x_1+x_2+x_3+x_4 = 5$. In my question .. there is only one way to have such solution that is $1+1+1+2$ But see your sequence .. it is saying $5$ ...2017-02-08
  • 0
    Do these solutions not count? $(0, 0, 0, 5), (0, 0, 1, 4), (0, 0, 2, 3), (0, 1, 1, 3), (0, 1, 2, 2), (1, 1, 1, 2)$2017-02-08
  • 0
    It looks like you may need to update your question to exclude $0$ if that is not what you meant. If $0$ is not allowed, then the sequence follows http://oeis.org/A0268102017-02-08
  • 0
    No... I included $0$.... But how this problem simplifies to "Number of partitions of n into at most 4 parts" ? Btw... I didn't see any technique there how to find the number of solutions :|2017-02-08
  • 0
    So if you are including $0$, do you agree that there are $6$ solutions for $n=5$?2017-02-08
  • 0
    @MarcusStuhr Yes now got it ... there are $6$ solutions :) ... But how do I find this?2017-02-08
  • 0
    You can try one of the approaches listed under "formula" on the OEIS page, or check out some partition number computation methods here https://en.wikipedia.org/wiki/Partition_%28number_theory%29#Partition_function_formulas2017-02-08
  • 0
    I guess you are looking for a general equation, I see a recursion formula here: https://math.stackexchange.com/questions/76684/number-of-integer-solutions-if-x-1-leq-x-2-leq-x-3-leq-cdots-leq-x-r-leq-k?noredirect=1&lq=1 and I have asked a similar question and a guy suggested to use the generating function https://math.stackexchange.com/questions/2641729/number-of-integral-solutions-of-x-1x-2-cdotsx-k-n-with-conditions-1-leq-x/2642105#26421052018-02-09

0 Answers 0