counting ways for sum with maximums on variables
If $a < 3$ and $b < 4$ and $a, b, c, d geq 0$, how may different combinations are there for $a + b + c + d = 10$?
I've tried star and bar method but had no luck. How can I approach this?
combinatorics combinations
add a comment |
If $a < 3$ and $b < 4$ and $a, b, c, d geq 0$, how may different combinations are there for $a + b + c + d = 10$?
I've tried star and bar method but had no luck. How can I approach this?
combinatorics combinations
Welcome to MathSE. When you pose a question here, you should show what you have attempted and explain where you are stuck. In this case, you could show your calculation for the number of nonnegative integer solutions of the equation $a + b + c + d = 10$ so that we can check that calculation. I suspect that you are stuck on how to handle the restrictions, but you should explicitly state that so that you receive responses that address the specific difficulties you are encountering.
– N. F. Taussig
Nov 25 at 11:27
This tutorial explains how to typeset mathematics on this site.
– N. F. Taussig
Nov 25 at 11:28
add a comment |
If $a < 3$ and $b < 4$ and $a, b, c, d geq 0$, how may different combinations are there for $a + b + c + d = 10$?
I've tried star and bar method but had no luck. How can I approach this?
combinatorics combinations
If $a < 3$ and $b < 4$ and $a, b, c, d geq 0$, how may different combinations are there for $a + b + c + d = 10$?
I've tried star and bar method but had no luck. How can I approach this?
combinatorics combinations
combinatorics combinations
edited Nov 25 at 11:29
N. F. Taussig
43.5k93355
43.5k93355
asked Nov 24 at 19:29
WEPIOD
31
31
Welcome to MathSE. When you pose a question here, you should show what you have attempted and explain where you are stuck. In this case, you could show your calculation for the number of nonnegative integer solutions of the equation $a + b + c + d = 10$ so that we can check that calculation. I suspect that you are stuck on how to handle the restrictions, but you should explicitly state that so that you receive responses that address the specific difficulties you are encountering.
– N. F. Taussig
Nov 25 at 11:27
This tutorial explains how to typeset mathematics on this site.
– N. F. Taussig
Nov 25 at 11:28
add a comment |
Welcome to MathSE. When you pose a question here, you should show what you have attempted and explain where you are stuck. In this case, you could show your calculation for the number of nonnegative integer solutions of the equation $a + b + c + d = 10$ so that we can check that calculation. I suspect that you are stuck on how to handle the restrictions, but you should explicitly state that so that you receive responses that address the specific difficulties you are encountering.
– N. F. Taussig
Nov 25 at 11:27
This tutorial explains how to typeset mathematics on this site.
– N. F. Taussig
Nov 25 at 11:28
Welcome to MathSE. When you pose a question here, you should show what you have attempted and explain where you are stuck. In this case, you could show your calculation for the number of nonnegative integer solutions of the equation $a + b + c + d = 10$ so that we can check that calculation. I suspect that you are stuck on how to handle the restrictions, but you should explicitly state that so that you receive responses that address the specific difficulties you are encountering.
– N. F. Taussig
Nov 25 at 11:27
Welcome to MathSE. When you pose a question here, you should show what you have attempted and explain where you are stuck. In this case, you could show your calculation for the number of nonnegative integer solutions of the equation $a + b + c + d = 10$ so that we can check that calculation. I suspect that you are stuck on how to handle the restrictions, but you should explicitly state that so that you receive responses that address the specific difficulties you are encountering.
– N. F. Taussig
Nov 25 at 11:27
This tutorial explains how to typeset mathematics on this site.
– N. F. Taussig
Nov 25 at 11:28
This tutorial explains how to typeset mathematics on this site.
– N. F. Taussig
Nov 25 at 11:28
add a comment |
2 Answers
2
active
oldest
votes
I am assuming $a,b,c,d in mathbb{Z}$ and non-negative. And even though you mentioned combination, I assume $a=b=c=0,d=10$ is different from $a=b=d=0, c=10$. It very easy to tune it if you intended otherwise.
This problem can be most elegantly solved with additive number theory method. As I don't know it (yet :), I will approach it with a computer algorithm method called dynamic programming.
Define $p(n,m)$ the number of ways of partitioning an integer $n$ into sum of $m$ non-negative integers. $p(n,m)$ can be arranged into a $ntimes m$ matrix/grid to minimize counting work.
So our problem becomes evaluation of $p(10,4)$ with the restriction $a<3, b<4$.
$p(10,4)=p(10,3)+p(9,3)+p(8,3)$ RHS, assign $0,1,2$ to $a$ respectively and pass to next level
$p(10,3)=p(10,2)+p(9,2)+p(8,2)+p(7,2)$ RHS, assign $0,1,2,3$ to $b$ respectively and pass to next level;
$p(9,3)=p(9,2)+p(8,2)+p(7,2)+p(6,2)$ RHS, assign $0,1,2,3$ to $b$ respectively and pass to next level;
(Note: $p(9,2),p(8,2)$ etc appears on RHS multiple times, the intention of a dynamic programming is to process these repetition only once.)
$cdots$
$p(10,2)=p(10,1)+p(9,1)+cdots+p(0,1)=11$, assign $0,1,2,cdots,10$ to $c$ respectively. And each represent a final scheme, so we have $11$ ways...
Make a table and do it manually. It's a good educational experience to understand dynamic programming.
add a comment |
There are three possible values $(0,1,2)$ for $a$ and four $(0,1,2,3)$ for $b$. Thus there are twelve settings for $a$ and $b$. For each setting, there are $10 - (a+b) + 1$ possible values for $c$. Then $d$ is constrained and fixed.
So go through the $12$ settings for $a$ and $b$, and for each, add up the number of settings for $c$. And you're done!
For instance: $a=0, b=0$ leads to $11$ possible values for $c$ $(0, 1, ldots, 10)$ and then $d$ is constrained.
I get $102$.
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%2f3011978%2fcounting-ways-for-sum-with-maximums-on-variables%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I am assuming $a,b,c,d in mathbb{Z}$ and non-negative. And even though you mentioned combination, I assume $a=b=c=0,d=10$ is different from $a=b=d=0, c=10$. It very easy to tune it if you intended otherwise.
This problem can be most elegantly solved with additive number theory method. As I don't know it (yet :), I will approach it with a computer algorithm method called dynamic programming.
Define $p(n,m)$ the number of ways of partitioning an integer $n$ into sum of $m$ non-negative integers. $p(n,m)$ can be arranged into a $ntimes m$ matrix/grid to minimize counting work.
So our problem becomes evaluation of $p(10,4)$ with the restriction $a<3, b<4$.
$p(10,4)=p(10,3)+p(9,3)+p(8,3)$ RHS, assign $0,1,2$ to $a$ respectively and pass to next level
$p(10,3)=p(10,2)+p(9,2)+p(8,2)+p(7,2)$ RHS, assign $0,1,2,3$ to $b$ respectively and pass to next level;
$p(9,3)=p(9,2)+p(8,2)+p(7,2)+p(6,2)$ RHS, assign $0,1,2,3$ to $b$ respectively and pass to next level;
(Note: $p(9,2),p(8,2)$ etc appears on RHS multiple times, the intention of a dynamic programming is to process these repetition only once.)
$cdots$
$p(10,2)=p(10,1)+p(9,1)+cdots+p(0,1)=11$, assign $0,1,2,cdots,10$ to $c$ respectively. And each represent a final scheme, so we have $11$ ways...
Make a table and do it manually. It's a good educational experience to understand dynamic programming.
add a comment |
I am assuming $a,b,c,d in mathbb{Z}$ and non-negative. And even though you mentioned combination, I assume $a=b=c=0,d=10$ is different from $a=b=d=0, c=10$. It very easy to tune it if you intended otherwise.
This problem can be most elegantly solved with additive number theory method. As I don't know it (yet :), I will approach it with a computer algorithm method called dynamic programming.
Define $p(n,m)$ the number of ways of partitioning an integer $n$ into sum of $m$ non-negative integers. $p(n,m)$ can be arranged into a $ntimes m$ matrix/grid to minimize counting work.
So our problem becomes evaluation of $p(10,4)$ with the restriction $a<3, b<4$.
$p(10,4)=p(10,3)+p(9,3)+p(8,3)$ RHS, assign $0,1,2$ to $a$ respectively and pass to next level
$p(10,3)=p(10,2)+p(9,2)+p(8,2)+p(7,2)$ RHS, assign $0,1,2,3$ to $b$ respectively and pass to next level;
$p(9,3)=p(9,2)+p(8,2)+p(7,2)+p(6,2)$ RHS, assign $0,1,2,3$ to $b$ respectively and pass to next level;
(Note: $p(9,2),p(8,2)$ etc appears on RHS multiple times, the intention of a dynamic programming is to process these repetition only once.)
$cdots$
$p(10,2)=p(10,1)+p(9,1)+cdots+p(0,1)=11$, assign $0,1,2,cdots,10$ to $c$ respectively. And each represent a final scheme, so we have $11$ ways...
Make a table and do it manually. It's a good educational experience to understand dynamic programming.
add a comment |
I am assuming $a,b,c,d in mathbb{Z}$ and non-negative. And even though you mentioned combination, I assume $a=b=c=0,d=10$ is different from $a=b=d=0, c=10$. It very easy to tune it if you intended otherwise.
This problem can be most elegantly solved with additive number theory method. As I don't know it (yet :), I will approach it with a computer algorithm method called dynamic programming.
Define $p(n,m)$ the number of ways of partitioning an integer $n$ into sum of $m$ non-negative integers. $p(n,m)$ can be arranged into a $ntimes m$ matrix/grid to minimize counting work.
So our problem becomes evaluation of $p(10,4)$ with the restriction $a<3, b<4$.
$p(10,4)=p(10,3)+p(9,3)+p(8,3)$ RHS, assign $0,1,2$ to $a$ respectively and pass to next level
$p(10,3)=p(10,2)+p(9,2)+p(8,2)+p(7,2)$ RHS, assign $0,1,2,3$ to $b$ respectively and pass to next level;
$p(9,3)=p(9,2)+p(8,2)+p(7,2)+p(6,2)$ RHS, assign $0,1,2,3$ to $b$ respectively and pass to next level;
(Note: $p(9,2),p(8,2)$ etc appears on RHS multiple times, the intention of a dynamic programming is to process these repetition only once.)
$cdots$
$p(10,2)=p(10,1)+p(9,1)+cdots+p(0,1)=11$, assign $0,1,2,cdots,10$ to $c$ respectively. And each represent a final scheme, so we have $11$ ways...
Make a table and do it manually. It's a good educational experience to understand dynamic programming.
I am assuming $a,b,c,d in mathbb{Z}$ and non-negative. And even though you mentioned combination, I assume $a=b=c=0,d=10$ is different from $a=b=d=0, c=10$. It very easy to tune it if you intended otherwise.
This problem can be most elegantly solved with additive number theory method. As I don't know it (yet :), I will approach it with a computer algorithm method called dynamic programming.
Define $p(n,m)$ the number of ways of partitioning an integer $n$ into sum of $m$ non-negative integers. $p(n,m)$ can be arranged into a $ntimes m$ matrix/grid to minimize counting work.
So our problem becomes evaluation of $p(10,4)$ with the restriction $a<3, b<4$.
$p(10,4)=p(10,3)+p(9,3)+p(8,3)$ RHS, assign $0,1,2$ to $a$ respectively and pass to next level
$p(10,3)=p(10,2)+p(9,2)+p(8,2)+p(7,2)$ RHS, assign $0,1,2,3$ to $b$ respectively and pass to next level;
$p(9,3)=p(9,2)+p(8,2)+p(7,2)+p(6,2)$ RHS, assign $0,1,2,3$ to $b$ respectively and pass to next level;
(Note: $p(9,2),p(8,2)$ etc appears on RHS multiple times, the intention of a dynamic programming is to process these repetition only once.)
$cdots$
$p(10,2)=p(10,1)+p(9,1)+cdots+p(0,1)=11$, assign $0,1,2,cdots,10$ to $c$ respectively. And each represent a final scheme, so we have $11$ ways...
Make a table and do it manually. It's a good educational experience to understand dynamic programming.
edited Nov 24 at 20:04
answered Nov 24 at 19:55
Lance
54229
54229
add a comment |
add a comment |
There are three possible values $(0,1,2)$ for $a$ and four $(0,1,2,3)$ for $b$. Thus there are twelve settings for $a$ and $b$. For each setting, there are $10 - (a+b) + 1$ possible values for $c$. Then $d$ is constrained and fixed.
So go through the $12$ settings for $a$ and $b$, and for each, add up the number of settings for $c$. And you're done!
For instance: $a=0, b=0$ leads to $11$ possible values for $c$ $(0, 1, ldots, 10)$ and then $d$ is constrained.
I get $102$.
add a comment |
There are three possible values $(0,1,2)$ for $a$ and four $(0,1,2,3)$ for $b$. Thus there are twelve settings for $a$ and $b$. For each setting, there are $10 - (a+b) + 1$ possible values for $c$. Then $d$ is constrained and fixed.
So go through the $12$ settings for $a$ and $b$, and for each, add up the number of settings for $c$. And you're done!
For instance: $a=0, b=0$ leads to $11$ possible values for $c$ $(0, 1, ldots, 10)$ and then $d$ is constrained.
I get $102$.
add a comment |
There are three possible values $(0,1,2)$ for $a$ and four $(0,1,2,3)$ for $b$. Thus there are twelve settings for $a$ and $b$. For each setting, there are $10 - (a+b) + 1$ possible values for $c$. Then $d$ is constrained and fixed.
So go through the $12$ settings for $a$ and $b$, and for each, add up the number of settings for $c$. And you're done!
For instance: $a=0, b=0$ leads to $11$ possible values for $c$ $(0, 1, ldots, 10)$ and then $d$ is constrained.
I get $102$.
There are three possible values $(0,1,2)$ for $a$ and four $(0,1,2,3)$ for $b$. Thus there are twelve settings for $a$ and $b$. For each setting, there are $10 - (a+b) + 1$ possible values for $c$. Then $d$ is constrained and fixed.
So go through the $12$ settings for $a$ and $b$, and for each, add up the number of settings for $c$. And you're done!
For instance: $a=0, b=0$ leads to $11$ possible values for $c$ $(0, 1, ldots, 10)$ and then $d$ is constrained.
I get $102$.
edited Nov 24 at 20:30
answered Nov 24 at 19:43
David G. Stork
9,54721232
9,54721232
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
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%2f3011978%2fcounting-ways-for-sum-with-maximums-on-variables%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
Welcome to MathSE. When you pose a question here, you should show what you have attempted and explain where you are stuck. In this case, you could show your calculation for the number of nonnegative integer solutions of the equation $a + b + c + d = 10$ so that we can check that calculation. I suspect that you are stuck on how to handle the restrictions, but you should explicitly state that so that you receive responses that address the specific difficulties you are encountering.
– N. F. Taussig
Nov 25 at 11:27
This tutorial explains how to typeset mathematics on this site.
– N. F. Taussig
Nov 25 at 11:28