Find all possible combinations of dividers to match the sum condition












0














I will give you an example what I'm looking for.



Let's assume that I have the following numbers defined at the beginning of an algortihm:



7, 10, 30, 60



I want to find all possible combinations of this numbers that will be greater or equal to 350. Order of numbers doesn't matter (I'm not looking for permutations).



Sample results:



50 * 7 = 350 >= 350 (OK)



49 * 7 + 10 = 343 + 10 = 353 > 353 (OK)



48 * 7 + 10 = 336 + 10 = 346 < 353 (NOT OK)



...and so on (to use also dividers 30 and 60)



I want to point out, that the correct result should be equal or grater to 350, but also should be as close to 350 as it is possible (each divider has its own price -> The total price should be to lowest).



How should I caluculate such combinations?










share|cite|improve this question
























  • Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
    – José Carlos Santos
    Nov 24 at 12:10










  • This is not clear. is $10^{100}times 7$ a valid combination? Why not? What about $30^{60}$?
    – lulu
    Nov 24 at 12:11










  • So you also want ot include $99999cdot 7+99999cdot 10+99999999cdot 30+9999cdot 60$?
    – Hagen von Eitzen
    Nov 24 at 12:12










  • Can you clarify your question? As you can see from the comments, nobody can sort out what sort of combinations you want to count.
    – lulu
    Nov 24 at 12:17










  • Yes! I can clarify the question. Correct combination is when the result is greater to 350 or it is as close as possible to 350.
    – Lis.es
    Nov 24 at 12:20
















0














I will give you an example what I'm looking for.



Let's assume that I have the following numbers defined at the beginning of an algortihm:



7, 10, 30, 60



I want to find all possible combinations of this numbers that will be greater or equal to 350. Order of numbers doesn't matter (I'm not looking for permutations).



Sample results:



50 * 7 = 350 >= 350 (OK)



49 * 7 + 10 = 343 + 10 = 353 > 353 (OK)



48 * 7 + 10 = 336 + 10 = 346 < 353 (NOT OK)



...and so on (to use also dividers 30 and 60)



I want to point out, that the correct result should be equal or grater to 350, but also should be as close to 350 as it is possible (each divider has its own price -> The total price should be to lowest).



How should I caluculate such combinations?










share|cite|improve this question
























  • Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
    – José Carlos Santos
    Nov 24 at 12:10










  • This is not clear. is $10^{100}times 7$ a valid combination? Why not? What about $30^{60}$?
    – lulu
    Nov 24 at 12:11










  • So you also want ot include $99999cdot 7+99999cdot 10+99999999cdot 30+9999cdot 60$?
    – Hagen von Eitzen
    Nov 24 at 12:12










  • Can you clarify your question? As you can see from the comments, nobody can sort out what sort of combinations you want to count.
    – lulu
    Nov 24 at 12:17










  • Yes! I can clarify the question. Correct combination is when the result is greater to 350 or it is as close as possible to 350.
    – Lis.es
    Nov 24 at 12:20














0












0








0







I will give you an example what I'm looking for.



Let's assume that I have the following numbers defined at the beginning of an algortihm:



7, 10, 30, 60



I want to find all possible combinations of this numbers that will be greater or equal to 350. Order of numbers doesn't matter (I'm not looking for permutations).



Sample results:



50 * 7 = 350 >= 350 (OK)



49 * 7 + 10 = 343 + 10 = 353 > 353 (OK)



48 * 7 + 10 = 336 + 10 = 346 < 353 (NOT OK)



...and so on (to use also dividers 30 and 60)



I want to point out, that the correct result should be equal or grater to 350, but also should be as close to 350 as it is possible (each divider has its own price -> The total price should be to lowest).



How should I caluculate such combinations?










share|cite|improve this question















I will give you an example what I'm looking for.



Let's assume that I have the following numbers defined at the beginning of an algortihm:



7, 10, 30, 60



I want to find all possible combinations of this numbers that will be greater or equal to 350. Order of numbers doesn't matter (I'm not looking for permutations).



Sample results:



50 * 7 = 350 >= 350 (OK)



49 * 7 + 10 = 343 + 10 = 353 > 353 (OK)



48 * 7 + 10 = 336 + 10 = 346 < 353 (NOT OK)



...and so on (to use also dividers 30 and 60)



I want to point out, that the correct result should be equal or grater to 350, but also should be as close to 350 as it is possible (each divider has its own price -> The total price should be to lowest).



How should I caluculate such combinations?







algorithms combinations






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Nov 24 at 12:22

























asked Nov 24 at 12:01









Lis.es

11




11












  • Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
    – José Carlos Santos
    Nov 24 at 12:10










  • This is not clear. is $10^{100}times 7$ a valid combination? Why not? What about $30^{60}$?
    – lulu
    Nov 24 at 12:11










  • So you also want ot include $99999cdot 7+99999cdot 10+99999999cdot 30+9999cdot 60$?
    – Hagen von Eitzen
    Nov 24 at 12:12










  • Can you clarify your question? As you can see from the comments, nobody can sort out what sort of combinations you want to count.
    – lulu
    Nov 24 at 12:17










  • Yes! I can clarify the question. Correct combination is when the result is greater to 350 or it is as close as possible to 350.
    – Lis.es
    Nov 24 at 12:20


















  • Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
    – José Carlos Santos
    Nov 24 at 12:10










  • This is not clear. is $10^{100}times 7$ a valid combination? Why not? What about $30^{60}$?
    – lulu
    Nov 24 at 12:11










  • So you also want ot include $99999cdot 7+99999cdot 10+99999999cdot 30+9999cdot 60$?
    – Hagen von Eitzen
    Nov 24 at 12:12










  • Can you clarify your question? As you can see from the comments, nobody can sort out what sort of combinations you want to count.
    – lulu
    Nov 24 at 12:17










  • Yes! I can clarify the question. Correct combination is when the result is greater to 350 or it is as close as possible to 350.
    – Lis.es
    Nov 24 at 12:20
















Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
– José Carlos Santos
Nov 24 at 12:10




Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
– José Carlos Santos
Nov 24 at 12:10












This is not clear. is $10^{100}times 7$ a valid combination? Why not? What about $30^{60}$?
– lulu
Nov 24 at 12:11




This is not clear. is $10^{100}times 7$ a valid combination? Why not? What about $30^{60}$?
– lulu
Nov 24 at 12:11












So you also want ot include $99999cdot 7+99999cdot 10+99999999cdot 30+9999cdot 60$?
– Hagen von Eitzen
Nov 24 at 12:12




So you also want ot include $99999cdot 7+99999cdot 10+99999999cdot 30+9999cdot 60$?
– Hagen von Eitzen
Nov 24 at 12:12












Can you clarify your question? As you can see from the comments, nobody can sort out what sort of combinations you want to count.
– lulu
Nov 24 at 12:17




Can you clarify your question? As you can see from the comments, nobody can sort out what sort of combinations you want to count.
– lulu
Nov 24 at 12:17












Yes! I can clarify the question. Correct combination is when the result is greater to 350 or it is as close as possible to 350.
– Lis.es
Nov 24 at 12:20




Yes! I can clarify the question. Correct combination is when the result is greater to 350 or it is as close as possible to 350.
– Lis.es
Nov 24 at 12:20















active

oldest

votes











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3011474%2ffind-all-possible-combinations-of-dividers-to-match-the-sum-condition%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3011474%2ffind-all-possible-combinations-of-dividers-to-match-the-sum-condition%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Quarter-circle Tiles

build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

Mont Emei