Combination problem

This topic has expert replies
Newbie | Next Rank: 10 Posts
Posts: 3
Joined: Mon Jan 26, 2009 9:20 am

Combination problem

by agriff98 » Mon Jan 26, 2009 9:24 am
I have a computation problem!

So, here it is….

I have a beginning matrix that consists of 35,000 rows and 120 columns (sample of smaller version below).


A B C D E F Sum Helped
1 10 14 3 5 3 1 sum # of columns w/ # < 6
2 6 7 14 11 11 15
3 6 12 1 1 0 0
4 1 2 3 4 14 15
5 12 0 1 0 10 14
6 3 10 15 13 0 13
7 5 6 8 8 11 0
8 6 15 10 0 10 2
9 7 1 8 6 13 12
10 9 5 12 14 6 4

Definitions:
Sum – Sum of cells for a combination of 30 columns
Helped – The number of columns with a value that is less than 6 within the combination of 30 columns
Cell Values – Random values between 0 and 15
Successful or Best Combination – The combination that has the greatest value in the “Helped” Column.


First, I already know that the number of combinations for 120 is REALLY big!


So, in my sample problem above lets use the combination of 4. Is there a way that one could eliminate combinations without actually running the combination? Or is there a “simple” way that one could determine the best combination?


Solutions??????
Source: — Problem Solving |

User avatar
Master | Next Rank: 500 Posts
Posts: 138
Joined: Thu Jan 15, 2009 7:52 am
Location: Steamboat Springs, CO
Thanked: 15 times

by gaggleofgirls » Mon Jan 26, 2009 9:46 am
I'm sorry, I don't see the actual question in what you posted.

You have a matrix of 35,000 rows and 120 columns.

Each of the 120 positions in each row can contain the numbers 0-15 inclusive (so 16 choices for each position) and I assume that there are no restrictions on repeating numbers.

The Sum = sum of all numbers in 120 columns
The Helped = number of columns (of the 120) that have the number 0-5 in it.
and you are looking for the Best Combination that yeilds the highest value for Helped?

Why wouldn't that just be 120 (where every row has 0-5 in it)? Are there other restrictions I am not getting or are you looking for something else here?

Can you clarify the question?

Thanks,
-Carrie

Newbie | Next Rank: 10 Posts
Posts: 3
Joined: Mon Jan 26, 2009 9:20 am

by agriff98 » Mon Jan 26, 2009 9:53 am
In this case...

sum - sum of values for a combination of 4 columns
helped - sum of columns with value < 6 included in the combination


Result that I am looking for:

For each row, the combination of 4 columns that gives me the highest value in the helped column

User avatar
Master | Next Rank: 500 Posts
Posts: 138
Joined: Thu Jan 15, 2009 7:52 am
Location: Steamboat Springs, CO
Thanked: 15 times

by gaggleofgirls » Mon Jan 26, 2009 10:00 am
Sorry, still confused what you are looking for. The sum of the 4 columns that will get you the highest 'helped' value is 20 (4 columns with 5 each in them, the highest value that is counted as helped).

Sorry, maybe someone else will 'see' the question better than I can.

-Carrie

Newbie | Next Rank: 10 Posts
Posts: 3
Joined: Mon Jan 26, 2009 9:20 am

by agriff98 » Mon Jan 26, 2009 10:04 am
No, using the values that are in the columns, not the highest possible value in the column.

i.e. the Answer for Row 4 is CDEF