|
-
Oct 11th, 2003, 12:33 PM
#1
Thread Starter
pathfinder
Please Confirm 369,569
Are there 369569 subsets of 6 numbers that add to 150, from
a set of 61 numbers, range = 1 to 61?
ie...
Given:
VB Code:
Dim MySourceArr() As Integer
ReDim MySourceArr(60)
For MyI = 0 To 60
MySourceArr(MyI) = MyI + 1
Next MyI
and:
VB Code:
Dim My4_arr() As Integer
ReDim My4_arr(5)
How many combinations of 61 elements, taken 6 at a time add to 150, if the 61 elements are the numbers 1 thru 61?
I've got an app that calculates 369569 of them over 71 seconds, and I'm wondering if it is correct?
-Lou
Last edited by NotLKH; Oct 13th, 2003 at 05:32 AM.
-
Oct 11th, 2003, 07:02 PM
#2
With that radom sampling method I put in your other post, I got around 350,000,000 of them, although that is with the ability to reuse numbers in each series (ie. 30, 30, 10, 10, 30, 40)
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Oct 12th, 2003, 02:26 AM
#3
Thread Starter
pathfinder
Originally posted by jemidiah
With that radom sampling method I put in your other post, I got around 350,000,000 of them, although that is with the ability to reuse numbers in each series (ie. 30, 30, 10, 10, 30, 40)
Then that is not a combination, but thanks anyways!
-
Oct 12th, 2003, 02:36 PM
#4
Most people use permutation and combination interchangeably, although I should've known you wouldn't after remembering you actually do post in the maths forum
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Oct 12th, 2003, 08:00 PM
#5
Hyperactive Member
Yes, it is correct. I also got 369569 using C++. But I got it under 10 seconds on a AMD Athlon 2000+ (Actual speed: 1667Mhz)
-
Oct 12th, 2003, 10:11 PM
#6
Thread Starter
pathfinder
If you see my thread in General VB Questions, Mine is now down to about 4 seconds. But Thanks for the confirmation! I don't have to worry now that my spaghetti code is missing a few combinations.
-Lou
-
Oct 13th, 2003, 04:54 AM
#7
-
Oct 13th, 2003, 05:33 AM
#8
Thread Starter
pathfinder
Good Catch!
Yep! Meant 61!
Thanks
-Lou
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|