Maths Question

Page may contain affiliate links. Please see terms for details.

Levo-Lon

Guru
Thought this was why we had computers :whistle:
Alexa doesnt know though...neither does the wife:banghead:
 

nickyboy

Norven Mankey
[QUOTE 5416694, member: 9609"]Is there a way, through a formula/equation to determine if a combination of numbers from a list adds up to a specific value. For instance, from the following list is there a combination that adds up to 250 and if not what is the closest I can get to 250 (can only use any number once)

2
19
27
49
79
46
21
5
49
71
6
4
82
6
31
39

other than cracking this by going through every combination is there a simple way, I will be working with lists with 500+ numbers[/QUOTE]
No
It's an iterative process of going through each combination of numbers. It's the kind of thing computers were invented to do
 
  • Like
Reactions: C R

DaveReading

Don't suffer fools gladly (must try harder!)
Location
Reading, obvs
[QUOTE 5416694, member: 9609"]Is there a way, through a formula/equation to determine if a combination of numbers from a list adds up to a specific value. For instance, from the following list is there a combination that adds up to 250 and if not what is the closest I can get to 250 (can only use any number once)

2
19
27
49
79
46
21
5
49
71
6
4
82
6
31
39

other than cracking this by going through every combination is there a simple way, I will be working with lists with 500+ numbers[/QUOTE]

Can the same number appear in the list more than once? If not, the solution will be a lot easier.
 
[QUOTE 5416694, member: 9609"]Is there a way, through a formula/equation to determine if a combination of numbers from a list adds up to a specific value. For instance, from the following list is there a combination that adds up to 250 and if not what is the closest I can get to 250 (can only use any number once)

2
19
27
49
79
46
21
5
49
71
6
4
82
6
31
39

other than cracking this by going through every combination is there a simple way, I will be working with lists with 500+ numbers[/QUOTE]


Get excel and use this

https://www.extendoffice.com/docume...nd-all-combinations-that-equal-given-sum.html
 

Ming the Merciless

There is no mercy
Location
Inside my skull
[QUOTE 5416694, member: 9609"]Is there a way, through a formula/equation to determine if a combination of numbers from a list adds up to a specific value. For instance, from the following list is there a combination that adds up to 250 and if not what is the closest I can get to 250 (can only use any number once)

2
19
27
49
79
46
21
5
49
71
6
4
82
6
31
39

other than cracking this by going through every combination is there a simple way, I will be working with lists with 500+ numbers[/QUOTE]

71 + 79 + 82 + 6 + 4 + 6 + 2

Might I ask what this is connected to? I am intrigued.
 
Last edited:

Katherine

Guru
Moderator
Location
Manchester
Does it have to add up to exactly 250? Just add the units to see if they come to a whole tens number? Or whatever your unit number is.

Or round up the numbers for a quick calculation for a rough estimate to see if it is close. If not, rule it out and move onto the next list of numbers.
 
Top Bottom