Number of solutions to the equation $x_1 + x_2 + ldots + x_n = k$ when $0 leq x_i leq m$ and $m + 1 leq k leq 2m + 1$Number of integer solutions if $x_1leq x_2leq x_3leq cdotsleq x_rleq k$Number of integer solutions of $x_1+x_2+⋯+x_n=m$ when $x_i$ can be negative, simpler solutionNumber of solutions of $x_1 + x_2 + x_3 + x_4 = 14$ such that $x_i le 6$The Number of Increasing Vectors $(x_1,…,x_k)$ Satisfying $1 leq x_i leq n$ and $x_1 < x_2 <…<x_k$Find the number of integer solutions to $x_1+x_2+x_3+x_4= 30$ where $0leq x_n <10$ for $1leq n leq 4$Product of $x_1,x_2, ldots, x_n$Find the number of integer solutions of $x_1 + x_2 + x_3 = 16$, with $x_i geq 0$, $x_1$ odd, $x_2$ even, $x_3$ prime.How many solutions are there to the equation $x_1 + x_2 + x_3 + x_4 leq 35$ in which all the $x_i$ are non-negative integers?Product of $x_1, x_2, ldots, x_n$ on circleHow to find a number of solutions for $x_1+x_2+ldots+x_n=r$ where $r$ is divisible by 3 and for a given $l$ and $r$ such that $lleq x_i leq r$?
Test whether all array elements are factors of a number
The use of multiple foreign keys on same column in SQL Server
Maximum likelihood parameters deviate from posterior distributions
Why do falling prices hurt debtors?
Test if tikzmark exists on same page
Writing rule stating superpower from different root cause is bad writing
Can divisibility rules for digits be generalized to sum of digits
"to be prejudice towards/against someone" vs "to be prejudiced against/towards someone"
What is the offset in a seaplane's hull?
Why not use SQL instead of GraphQL?
Is it unprofessional to ask if a job posting on GlassDoor is real?
What does "Puller Prush Person" mean?
TGV timetables / schedules?
Why are electrically insulating heatsinks so rare? Is it just cost?
What's the output of a record cartridge playing an out-of-speed record
Can I make popcorn with any corn?
Modeling an IPv4 Address
How to write a macro that is braces sensitive?
Today is the Center
Collect Fourier series terms
Smoothness of finite-dimensional functional calculus
Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)
Why does Kotter return in Welcome Back Kotter?
What do the dots in this tr command do: tr .............A-Z A-ZA-Z <<< "JVPQBOV" (with 13 dots)
Number of solutions to the equation $x_1 + x_2 + ldots + x_n = k$ when $0 leq x_i leq m$ and $m + 1 leq k leq 2m + 1$
Number of integer solutions if $x_1leq x_2leq x_3leq cdotsleq x_rleq k$Number of integer solutions of $x_1+x_2+⋯+x_n=m$ when $x_i$ can be negative, simpler solutionNumber of solutions of $x_1 + x_2 + x_3 + x_4 = 14$ such that $x_i le 6$The Number of Increasing Vectors $(x_1,…,x_k)$ Satisfying $1 leq x_i leq n$ and $x_1 < x_2 <…<x_k$Find the number of integer solutions to $x_1+x_2+x_3+x_4= 30$ where $0leq x_n <10$ for $1leq n leq 4$Product of $x_1,x_2, ldots, x_n$Find the number of integer solutions of $x_1 + x_2 + x_3 = 16$, with $x_i geq 0$, $x_1$ odd, $x_2$ even, $x_3$ prime.How many solutions are there to the equation $x_1 + x_2 + x_3 + x_4 leq 35$ in which all the $x_i$ are non-negative integers?Product of $x_1, x_2, ldots, x_n$ on circleHow to find a number of solutions for $x_1+x_2+ldots+x_n=r$ where $r$ is divisible by 3 and for a given $l$ and $r$ such that $lleq x_i leq r$?
$begingroup$
The problem:
Find the number of solutions to the equation: $x_1+x_2+...+x_n=k$ when $0leq x_ileq m$ and $m+1leq kleq 2m+1$.
The answer in the book is $n+k-1choose k-nchoose 1n+k-(m+1)-1choose k-(m+1)$.
I understand that the idea is taking all solutions, a number equals to $n+k-1choose k$ and then subtracting "bad" solutions, and that $nchoose 1$ is there because we can't have more than a single $i$ so $x_igeq m+1$, what I can't understand is the last part. I think it works only if the "bad" element equals exactly $m+1$, but what if it equals $m+2$? That way it doesn't seem correct anymore.
Thanks in advance.
combinatorics combinations
$endgroup$
add a comment |
$begingroup$
The problem:
Find the number of solutions to the equation: $x_1+x_2+...+x_n=k$ when $0leq x_ileq m$ and $m+1leq kleq 2m+1$.
The answer in the book is $n+k-1choose k-nchoose 1n+k-(m+1)-1choose k-(m+1)$.
I understand that the idea is taking all solutions, a number equals to $n+k-1choose k$ and then subtracting "bad" solutions, and that $nchoose 1$ is there because we can't have more than a single $i$ so $x_igeq m+1$, what I can't understand is the last part. I think it works only if the "bad" element equals exactly $m+1$, but what if it equals $m+2$? That way it doesn't seem correct anymore.
Thanks in advance.
combinatorics combinations
$endgroup$
add a comment |
$begingroup$
The problem:
Find the number of solutions to the equation: $x_1+x_2+...+x_n=k$ when $0leq x_ileq m$ and $m+1leq kleq 2m+1$.
The answer in the book is $n+k-1choose k-nchoose 1n+k-(m+1)-1choose k-(m+1)$.
I understand that the idea is taking all solutions, a number equals to $n+k-1choose k$ and then subtracting "bad" solutions, and that $nchoose 1$ is there because we can't have more than a single $i$ so $x_igeq m+1$, what I can't understand is the last part. I think it works only if the "bad" element equals exactly $m+1$, but what if it equals $m+2$? That way it doesn't seem correct anymore.
Thanks in advance.
combinatorics combinations
$endgroup$
The problem:
Find the number of solutions to the equation: $x_1+x_2+...+x_n=k$ when $0leq x_ileq m$ and $m+1leq kleq 2m+1$.
The answer in the book is $n+k-1choose k-nchoose 1n+k-(m+1)-1choose k-(m+1)$.
I understand that the idea is taking all solutions, a number equals to $n+k-1choose k$ and then subtracting "bad" solutions, and that $nchoose 1$ is there because we can't have more than a single $i$ so $x_igeq m+1$, what I can't understand is the last part. I think it works only if the "bad" element equals exactly $m+1$, but what if it equals $m+2$? That way it doesn't seem correct anymore.
Thanks in advance.
combinatorics combinations
combinatorics combinations
edited Mar 29 at 15:46
N. F. Taussig
45k103358
45k103358
asked Mar 29 at 12:53
איתן לויאיתן לוי
795
795
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
A solution of the equation in the nonnegative integers
$$x_1 + x_2 + ldots + x_n = k tag1$$
corresponds to the placement of $n - 1$ addition signs in a row of $k$ ones. For instance, if $n = 4$ and $k = 10$,
$$1 1 + + 1 1 1 1 1 + 1 1 1$$
corresponds to the solution $x_1 = 2$, $x_2 = 0$, $x_3 = 5$, $x_4 = 3$. The number of such solutions is
$$binomk + n - 1n - 1 = binomk + n - 1k$$
since we must choose which $n - 1$ of the $k + n - 1$ positions required for $k$ ones and $n - 1$ addition signs will be filled with addition signs or, equivalently, which $k$ of the $k + n - 1$ positions will be filled with ones.
We wish to solve equation 1 in the nonnegative integers not larger than $m$ when $m + 1 leq k leq 2m + 1$. Thus, we must subtract those solutions in which a variable exceeds $m$. At most one variable may exceed $m$ since $2(m + 1) = 2m + 2 > 2m + 1$.
We may choose a variable that exceeds $m$ in $n$ ways. Suppose that variable is $x_1$. Then $x_1' = x_1 - (m + 1)$ is a nonnegative integer. Substituting $x_1' + m + 1$ into equation 1 equation yields
beginalign*
x_1' + m + 1 + x_2 + ldots + x_n & = k\
x_1' + x_2 + ldots + x_n & = k - (m + 1) tag2
endalign*
Equation 2 is an equation in the nonnegative integers with
$$binomk - (m + 1) + n - 1n - 1 = binomk - (m + 1) + n - 1k - (m + 1)$$
solutions. Hence, there are
$$binomn1binomk - (m + 1) + n - 1n - 1 = binomn1binomk - (m + 1) + n - 1k - (m + 1)$$
solutions in which one of the variables exceeds $m$.
Thus, there are
$$binomk + n - 1k - binomn1binomk - (m + 1) + n - 1k - (m + 1)$$
admissible solutions.
Notice that in equation 2, $m + 1 leq x_1 leq 2m + 1 implies 0 leq x_1' leq m$. It does not imply that $x_1 = m + 1$.
Let's compare this with what would happen if $x_1 = m + 1$. Then we would have
beginalign*
m + 1 + x_2 + ldots + x_n & = k\
x_2 + ldots + x_n & = k - (m + 1)
endalign*
which is an equation in the nonnegative integers with
$$binomk - (m + 1) + (n - 1) - 1(n - 1) - 1 = binomk - (m + 1) + (n - 1) - 1k - (m + 1)$$
solutions, which is a smaller number as we would expect.
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3167115%2fnumber-of-solutions-to-the-equation-x-1-x-2-ldots-x-n-k-when-0-leq%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
A solution of the equation in the nonnegative integers
$$x_1 + x_2 + ldots + x_n = k tag1$$
corresponds to the placement of $n - 1$ addition signs in a row of $k$ ones. For instance, if $n = 4$ and $k = 10$,
$$1 1 + + 1 1 1 1 1 + 1 1 1$$
corresponds to the solution $x_1 = 2$, $x_2 = 0$, $x_3 = 5$, $x_4 = 3$. The number of such solutions is
$$binomk + n - 1n - 1 = binomk + n - 1k$$
since we must choose which $n - 1$ of the $k + n - 1$ positions required for $k$ ones and $n - 1$ addition signs will be filled with addition signs or, equivalently, which $k$ of the $k + n - 1$ positions will be filled with ones.
We wish to solve equation 1 in the nonnegative integers not larger than $m$ when $m + 1 leq k leq 2m + 1$. Thus, we must subtract those solutions in which a variable exceeds $m$. At most one variable may exceed $m$ since $2(m + 1) = 2m + 2 > 2m + 1$.
We may choose a variable that exceeds $m$ in $n$ ways. Suppose that variable is $x_1$. Then $x_1' = x_1 - (m + 1)$ is a nonnegative integer. Substituting $x_1' + m + 1$ into equation 1 equation yields
beginalign*
x_1' + m + 1 + x_2 + ldots + x_n & = k\
x_1' + x_2 + ldots + x_n & = k - (m + 1) tag2
endalign*
Equation 2 is an equation in the nonnegative integers with
$$binomk - (m + 1) + n - 1n - 1 = binomk - (m + 1) + n - 1k - (m + 1)$$
solutions. Hence, there are
$$binomn1binomk - (m + 1) + n - 1n - 1 = binomn1binomk - (m + 1) + n - 1k - (m + 1)$$
solutions in which one of the variables exceeds $m$.
Thus, there are
$$binomk + n - 1k - binomn1binomk - (m + 1) + n - 1k - (m + 1)$$
admissible solutions.
Notice that in equation 2, $m + 1 leq x_1 leq 2m + 1 implies 0 leq x_1' leq m$. It does not imply that $x_1 = m + 1$.
Let's compare this with what would happen if $x_1 = m + 1$. Then we would have
beginalign*
m + 1 + x_2 + ldots + x_n & = k\
x_2 + ldots + x_n & = k - (m + 1)
endalign*
which is an equation in the nonnegative integers with
$$binomk - (m + 1) + (n - 1) - 1(n - 1) - 1 = binomk - (m + 1) + (n - 1) - 1k - (m + 1)$$
solutions, which is a smaller number as we would expect.
$endgroup$
add a comment |
$begingroup$
A solution of the equation in the nonnegative integers
$$x_1 + x_2 + ldots + x_n = k tag1$$
corresponds to the placement of $n - 1$ addition signs in a row of $k$ ones. For instance, if $n = 4$ and $k = 10$,
$$1 1 + + 1 1 1 1 1 + 1 1 1$$
corresponds to the solution $x_1 = 2$, $x_2 = 0$, $x_3 = 5$, $x_4 = 3$. The number of such solutions is
$$binomk + n - 1n - 1 = binomk + n - 1k$$
since we must choose which $n - 1$ of the $k + n - 1$ positions required for $k$ ones and $n - 1$ addition signs will be filled with addition signs or, equivalently, which $k$ of the $k + n - 1$ positions will be filled with ones.
We wish to solve equation 1 in the nonnegative integers not larger than $m$ when $m + 1 leq k leq 2m + 1$. Thus, we must subtract those solutions in which a variable exceeds $m$. At most one variable may exceed $m$ since $2(m + 1) = 2m + 2 > 2m + 1$.
We may choose a variable that exceeds $m$ in $n$ ways. Suppose that variable is $x_1$. Then $x_1' = x_1 - (m + 1)$ is a nonnegative integer. Substituting $x_1' + m + 1$ into equation 1 equation yields
beginalign*
x_1' + m + 1 + x_2 + ldots + x_n & = k\
x_1' + x_2 + ldots + x_n & = k - (m + 1) tag2
endalign*
Equation 2 is an equation in the nonnegative integers with
$$binomk - (m + 1) + n - 1n - 1 = binomk - (m + 1) + n - 1k - (m + 1)$$
solutions. Hence, there are
$$binomn1binomk - (m + 1) + n - 1n - 1 = binomn1binomk - (m + 1) + n - 1k - (m + 1)$$
solutions in which one of the variables exceeds $m$.
Thus, there are
$$binomk + n - 1k - binomn1binomk - (m + 1) + n - 1k - (m + 1)$$
admissible solutions.
Notice that in equation 2, $m + 1 leq x_1 leq 2m + 1 implies 0 leq x_1' leq m$. It does not imply that $x_1 = m + 1$.
Let's compare this with what would happen if $x_1 = m + 1$. Then we would have
beginalign*
m + 1 + x_2 + ldots + x_n & = k\
x_2 + ldots + x_n & = k - (m + 1)
endalign*
which is an equation in the nonnegative integers with
$$binomk - (m + 1) + (n - 1) - 1(n - 1) - 1 = binomk - (m + 1) + (n - 1) - 1k - (m + 1)$$
solutions, which is a smaller number as we would expect.
$endgroup$
add a comment |
$begingroup$
A solution of the equation in the nonnegative integers
$$x_1 + x_2 + ldots + x_n = k tag1$$
corresponds to the placement of $n - 1$ addition signs in a row of $k$ ones. For instance, if $n = 4$ and $k = 10$,
$$1 1 + + 1 1 1 1 1 + 1 1 1$$
corresponds to the solution $x_1 = 2$, $x_2 = 0$, $x_3 = 5$, $x_4 = 3$. The number of such solutions is
$$binomk + n - 1n - 1 = binomk + n - 1k$$
since we must choose which $n - 1$ of the $k + n - 1$ positions required for $k$ ones and $n - 1$ addition signs will be filled with addition signs or, equivalently, which $k$ of the $k + n - 1$ positions will be filled with ones.
We wish to solve equation 1 in the nonnegative integers not larger than $m$ when $m + 1 leq k leq 2m + 1$. Thus, we must subtract those solutions in which a variable exceeds $m$. At most one variable may exceed $m$ since $2(m + 1) = 2m + 2 > 2m + 1$.
We may choose a variable that exceeds $m$ in $n$ ways. Suppose that variable is $x_1$. Then $x_1' = x_1 - (m + 1)$ is a nonnegative integer. Substituting $x_1' + m + 1$ into equation 1 equation yields
beginalign*
x_1' + m + 1 + x_2 + ldots + x_n & = k\
x_1' + x_2 + ldots + x_n & = k - (m + 1) tag2
endalign*
Equation 2 is an equation in the nonnegative integers with
$$binomk - (m + 1) + n - 1n - 1 = binomk - (m + 1) + n - 1k - (m + 1)$$
solutions. Hence, there are
$$binomn1binomk - (m + 1) + n - 1n - 1 = binomn1binomk - (m + 1) + n - 1k - (m + 1)$$
solutions in which one of the variables exceeds $m$.
Thus, there are
$$binomk + n - 1k - binomn1binomk - (m + 1) + n - 1k - (m + 1)$$
admissible solutions.
Notice that in equation 2, $m + 1 leq x_1 leq 2m + 1 implies 0 leq x_1' leq m$. It does not imply that $x_1 = m + 1$.
Let's compare this with what would happen if $x_1 = m + 1$. Then we would have
beginalign*
m + 1 + x_2 + ldots + x_n & = k\
x_2 + ldots + x_n & = k - (m + 1)
endalign*
which is an equation in the nonnegative integers with
$$binomk - (m + 1) + (n - 1) - 1(n - 1) - 1 = binomk - (m + 1) + (n - 1) - 1k - (m + 1)$$
solutions, which is a smaller number as we would expect.
$endgroup$
A solution of the equation in the nonnegative integers
$$x_1 + x_2 + ldots + x_n = k tag1$$
corresponds to the placement of $n - 1$ addition signs in a row of $k$ ones. For instance, if $n = 4$ and $k = 10$,
$$1 1 + + 1 1 1 1 1 + 1 1 1$$
corresponds to the solution $x_1 = 2$, $x_2 = 0$, $x_3 = 5$, $x_4 = 3$. The number of such solutions is
$$binomk + n - 1n - 1 = binomk + n - 1k$$
since we must choose which $n - 1$ of the $k + n - 1$ positions required for $k$ ones and $n - 1$ addition signs will be filled with addition signs or, equivalently, which $k$ of the $k + n - 1$ positions will be filled with ones.
We wish to solve equation 1 in the nonnegative integers not larger than $m$ when $m + 1 leq k leq 2m + 1$. Thus, we must subtract those solutions in which a variable exceeds $m$. At most one variable may exceed $m$ since $2(m + 1) = 2m + 2 > 2m + 1$.
We may choose a variable that exceeds $m$ in $n$ ways. Suppose that variable is $x_1$. Then $x_1' = x_1 - (m + 1)$ is a nonnegative integer. Substituting $x_1' + m + 1$ into equation 1 equation yields
beginalign*
x_1' + m + 1 + x_2 + ldots + x_n & = k\
x_1' + x_2 + ldots + x_n & = k - (m + 1) tag2
endalign*
Equation 2 is an equation in the nonnegative integers with
$$binomk - (m + 1) + n - 1n - 1 = binomk - (m + 1) + n - 1k - (m + 1)$$
solutions. Hence, there are
$$binomn1binomk - (m + 1) + n - 1n - 1 = binomn1binomk - (m + 1) + n - 1k - (m + 1)$$
solutions in which one of the variables exceeds $m$.
Thus, there are
$$binomk + n - 1k - binomn1binomk - (m + 1) + n - 1k - (m + 1)$$
admissible solutions.
Notice that in equation 2, $m + 1 leq x_1 leq 2m + 1 implies 0 leq x_1' leq m$. It does not imply that $x_1 = m + 1$.
Let's compare this with what would happen if $x_1 = m + 1$. Then we would have
beginalign*
m + 1 + x_2 + ldots + x_n & = k\
x_2 + ldots + x_n & = k - (m + 1)
endalign*
which is an equation in the nonnegative integers with
$$binomk - (m + 1) + (n - 1) - 1(n - 1) - 1 = binomk - (m + 1) + (n - 1) - 1k - (m + 1)$$
solutions, which is a smaller number as we would expect.
edited Mar 30 at 11:06
answered Mar 29 at 15:44
N. F. TaussigN. F. Taussig
45k103358
45k103358
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3167115%2fnumber-of-solutions-to-the-equation-x-1-x-2-ldots-x-n-k-when-0-leq%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown