|
||
|
|
|||||||
| Welcome to the Exploding Garrmondo Weiner Interactive Swiss Army Penis. |
|
GFF is a community of gaming and music enthusiasts. We have a team of dedicated moderators, constant member-organized activities, and plenty of custom features, including our unique journal system. If this is your first visit, be sure to check out the FAQ or our GFWiki. You will have to register before you can post. Membership is completely free (and gets rid of the pesky advertisement unit underneath this message).
|
![]() |
|
|
Thread Tools |
Matrixes and Randomization in Excel
Well, I'm not entirely sure what to call the topic, but it's simpler to explain what I am trying to do.
I have an array of numbers, the list of which is:
I am trying to group them in such a way that the first group is close to 94,204,280 and the second group is close to 70,043,499. These do not add up exactly, but are 4 figures off (164,247,789). It's going to take me a lot of manual combinations to do this properly, even if it's at all possible. So, is there a way to get Excel to do this automagically? I have already tried Solver and Goal Seek, but am unable to come up with a viable solution. Jam it back in, in the dark. |
I don't know how powerful Excel scripting is. I know you can run Visual Basic scripts on it, but I don't know how to program. So admittedly when you talk about algorithm methods like "genetic" or "quasi-Newton gradual descent", I'm afraid I'm totally clueless.
![]()
![]()
There's nowhere I can't reach. |
Wow, you nailed it exactly!
I think I get the gist of your logic, incrementing a binary matrix that is as long as my set, performing a sumtotal, and getting the difference. How do you come up with the limit variable? Seems to be 2 ^ [size of matrix] - 1?
![]() This thing is sticky, and I don't like it. I don't appreciate it. |
So... no? Or yes?
I am a dolphin, do you want me on your body? |
My first attempt was actually to set up an Excel worksheet in this manner:
Column A is the "Bits" column. Column B has the matrix Column C outputs Column B if the row in Column A is 1, and zero if it's not. Column D outputs Column B if the row in Column A is 0, and zero if it's not. I summed up column C and column D, and deduct the totals by the desired figures. I then added the absolute values of both, and placed it in E1 Then I entered Solver, and said: Set E1 to Minimum by Changing Column A cells Subject to the following constraints: - Column A cells are integers - Column A cells are greater than or equal to zero - Column A cells are lesser than or equal to one I then set 9999 iterations. Seeing as how brute-forcing this took packrat 8 million iterations, I guess I shouldn't be so surprised that Excel refused to do this ![]() I was speaking idiomatically. |
Araes' method is impossible to do in Excel 2007, period. For the simple reason that Excel only supports 1.4+ million rows
![]() Most amazing jew boots |
I'm bumping this to say that I've found a nice little Excel add-in called "Find Combinations"
It purports to be especially useful for auditors dealing with clients who are especially... sloppy when it comes to recording invoice numbers. As it is with my problem, you have a total expense figure that you're trying to look for. You also have a set of numbers you're trying to combine in various ways to reach that total. The difference is that it looks for exact summation, while my figures are not precise. While this is still unsuitable for the purposes of this thread, but may be of use to someone else. While installing, you will need to add this site to your "Trusted Sites" in Internet Explorer: http://s3downloads.lyquidity.com P.S.: My exercise was basically an attempt to brute-force how Michael Porter classifies data from the UN ComTrade database to his nice little "Porter Cluster Model." He was quite reluctant to share it with us, hence the brute force. Haven't been able to get satisfactory results across years, so I eventually abandoned the effort. FELIPE NO |