Computing a composition of factors
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Assume the following situation:
- there are n factors (0 < n < 200),
- there are m attributes of each factor (0 < m < 5) - each factor has a fixed numeric value of each attribute.
I need to solve the following problem:
I need to create sets of factors (e.g. from 1 to 5 factors) that create together a desired sum of values of each attribute.
Real world example:
I have:
- a banana (protein 2, carbohydrates 15, fat 1)
- a cottage cheese (protein 10, carbohydrates 4, fat 5).
Number of factors n=2, number of attributes m=3.
I want to calculate a set of bananas and cottage cheeses that together have:
protein 22, carbohydrates 23 and fat 11.
Solution: 2 cottage cheese + 1 banana
Question
Which scientific method can be used to solve this kind of problem? What should I look for? The above example is easy but I want to be able to compute e.g. 5 possible sets from 100 factors. Of course I don't want to do it on paper but rather apply some computational power to it.
Results containing values close to the expected ones are also allowed. So it doesn't have to be an exact match because sometimes it may not be possible to create such a set.
statistics multivariable-calculus
add a comment |Â
up vote
1
down vote
favorite
Assume the following situation:
- there are n factors (0 < n < 200),
- there are m attributes of each factor (0 < m < 5) - each factor has a fixed numeric value of each attribute.
I need to solve the following problem:
I need to create sets of factors (e.g. from 1 to 5 factors) that create together a desired sum of values of each attribute.
Real world example:
I have:
- a banana (protein 2, carbohydrates 15, fat 1)
- a cottage cheese (protein 10, carbohydrates 4, fat 5).
Number of factors n=2, number of attributes m=3.
I want to calculate a set of bananas and cottage cheeses that together have:
protein 22, carbohydrates 23 and fat 11.
Solution: 2 cottage cheese + 1 banana
Question
Which scientific method can be used to solve this kind of problem? What should I look for? The above example is easy but I want to be able to compute e.g. 5 possible sets from 100 factors. Of course I don't want to do it on paper but rather apply some computational power to it.
Results containing values close to the expected ones are also allowed. So it doesn't have to be an exact match because sometimes it may not be possible to create such a set.
statistics multivariable-calculus
The solution to your toy example is $1$ banana and $2$ cottage cheese. In general, presumably you need a non-negative number of each item. Does it have to be an integer? If there are multiple possible combinations of items, is there a way of choosing between them (such as cost)?
â Henry
Sep 9 at 11:32
The number needs to be non-negative, but it doesn't have to be an integer. Each combination is as good as another one, the goal is to produce e.g. any 5 combinations that fit the criteria (not ALL possible combinations).
â Jacek
Sep 9 at 14:42
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Assume the following situation:
- there are n factors (0 < n < 200),
- there are m attributes of each factor (0 < m < 5) - each factor has a fixed numeric value of each attribute.
I need to solve the following problem:
I need to create sets of factors (e.g. from 1 to 5 factors) that create together a desired sum of values of each attribute.
Real world example:
I have:
- a banana (protein 2, carbohydrates 15, fat 1)
- a cottage cheese (protein 10, carbohydrates 4, fat 5).
Number of factors n=2, number of attributes m=3.
I want to calculate a set of bananas and cottage cheeses that together have:
protein 22, carbohydrates 23 and fat 11.
Solution: 2 cottage cheese + 1 banana
Question
Which scientific method can be used to solve this kind of problem? What should I look for? The above example is easy but I want to be able to compute e.g. 5 possible sets from 100 factors. Of course I don't want to do it on paper but rather apply some computational power to it.
Results containing values close to the expected ones are also allowed. So it doesn't have to be an exact match because sometimes it may not be possible to create such a set.
statistics multivariable-calculus
Assume the following situation:
- there are n factors (0 < n < 200),
- there are m attributes of each factor (0 < m < 5) - each factor has a fixed numeric value of each attribute.
I need to solve the following problem:
I need to create sets of factors (e.g. from 1 to 5 factors) that create together a desired sum of values of each attribute.
Real world example:
I have:
- a banana (protein 2, carbohydrates 15, fat 1)
- a cottage cheese (protein 10, carbohydrates 4, fat 5).
Number of factors n=2, number of attributes m=3.
I want to calculate a set of bananas and cottage cheeses that together have:
protein 22, carbohydrates 23 and fat 11.
Solution: 2 cottage cheese + 1 banana
Question
Which scientific method can be used to solve this kind of problem? What should I look for? The above example is easy but I want to be able to compute e.g. 5 possible sets from 100 factors. Of course I don't want to do it on paper but rather apply some computational power to it.
Results containing values close to the expected ones are also allowed. So it doesn't have to be an exact match because sometimes it may not be possible to create such a set.
statistics multivariable-calculus
statistics multivariable-calculus
edited Sep 9 at 14:40
asked Sep 9 at 8:14
Jacek
1062
1062
The solution to your toy example is $1$ banana and $2$ cottage cheese. In general, presumably you need a non-negative number of each item. Does it have to be an integer? If there are multiple possible combinations of items, is there a way of choosing between them (such as cost)?
â Henry
Sep 9 at 11:32
The number needs to be non-negative, but it doesn't have to be an integer. Each combination is as good as another one, the goal is to produce e.g. any 5 combinations that fit the criteria (not ALL possible combinations).
â Jacek
Sep 9 at 14:42
add a comment |Â
The solution to your toy example is $1$ banana and $2$ cottage cheese. In general, presumably you need a non-negative number of each item. Does it have to be an integer? If there are multiple possible combinations of items, is there a way of choosing between them (such as cost)?
â Henry
Sep 9 at 11:32
The number needs to be non-negative, but it doesn't have to be an integer. Each combination is as good as another one, the goal is to produce e.g. any 5 combinations that fit the criteria (not ALL possible combinations).
â Jacek
Sep 9 at 14:42
The solution to your toy example is $1$ banana and $2$ cottage cheese. In general, presumably you need a non-negative number of each item. Does it have to be an integer? If there are multiple possible combinations of items, is there a way of choosing between them (such as cost)?
â Henry
Sep 9 at 11:32
The solution to your toy example is $1$ banana and $2$ cottage cheese. In general, presumably you need a non-negative number of each item. Does it have to be an integer? If there are multiple possible combinations of items, is there a way of choosing between them (such as cost)?
â Henry
Sep 9 at 11:32
The number needs to be non-negative, but it doesn't have to be an integer. Each combination is as good as another one, the goal is to produce e.g. any 5 combinations that fit the criteria (not ALL possible combinations).
â Jacek
Sep 9 at 14:42
The number needs to be non-negative, but it doesn't have to be an integer. Each combination is as good as another one, the goal is to produce e.g. any 5 combinations that fit the criteria (not ALL possible combinations).
â Jacek
Sep 9 at 14:42
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2910539%2fcomputing-a-composition-of-factors%23new-answer', 'question_page');
);
Post as a guest
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
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
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
The solution to your toy example is $1$ banana and $2$ cottage cheese. In general, presumably you need a non-negative number of each item. Does it have to be an integer? If there are multiple possible combinations of items, is there a way of choosing between them (such as cost)?
â Henry
Sep 9 at 11:32
The number needs to be non-negative, but it doesn't have to be an integer. Each combination is as good as another one, the goal is to produce e.g. any 5 combinations that fit the criteria (not ALL possible combinations).
â Jacek
Sep 9 at 14:42