Results 1 to 8 of 8

Thread: Please Confirm 369,569

  1. #1

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    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:
    1. Dim MySourceArr() As Integer
    2. ReDim MySourceArr(60)
    3. For MyI = 0 To 60
    4.     MySourceArr(MyI) = MyI + 1
    5. Next MyI

    and:

    VB Code:
    1. Dim My4_arr() As Integer
    2. 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

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    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.

  3. #3

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    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!

  4. #4
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    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.

  5. #5
    Hyperactive Member
    Join Date
    Sep 2001
    Posts
    396
    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)

  6. #6

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    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

  7. #7
    Fanatic Member sql_lall's Avatar
    Join Date
    Jul 2002
    Location
    Up Above (i.e. AUS)
    Posts
    571

    Talking I can't count

    Hey, just wondering,
    isn't 1 to 62 = 62 numbers, not 61

    1 to 1 = 1 number
    1 to 2 = 2 numbers
    ...
    1 to 62 = 62 numbers?

    From ur source i'm guessing u mean 1 to 61...
    sql_lall

  8. #8

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width