Welcome Guest
Log In | Register )
You last visited January 18, 2017, 2:28 am
All times shown are
Eastern Time (GMT-5:00)

source code for generation very fast poss

Topic closed. 6 replies. Last post 12 years ago by freehand.

Page 1 of 1
PrintE-mailLink
Avatar
New Member

Canada
Member #8436
November 5, 2004
17 Posts
Offline
Posted: March 26, 2005, 9:54 pm - IP Logged
    Avatar
    New Member

    East Timor
    Member #12948
    March 26, 2005
    7 Posts
    Offline
    Posted: March 26, 2005, 10:47 pm - IP Logged
    Quote: Originally posted by foxy on March 26, 2005


    This should do it: http://www.codeproject.com/cpp/zigurat.asp



    Hi,

    Thank you for replay.

    But, my big problem is the filter in the code source.

    I go work in your sugestion.

    Thanks.

      RJOh's avatar - chipmunk
      mid-Ohio
      United States
      Member #9
      March 24, 2001
      19895 Posts
      Offline
      Posted: March 26, 2005, 11:41 pm - IP Logged
      Quote: Originally posted by freehand on March 26, 2005



      I want source code c++ for generation very fast possible random combinations for "n,k" but filtering...... such.... no more than 4 elements in common?  

      It sees this example:

      C 10,6 = 210 FULL

      But, filtering C 10,6 with maximum 4 elements in common = 18

      01 02 03 04 05 06
      01 02 03 04 07 08
      01 02 03 04 09 10
      01 02 03 05 07 09
      01 02 03 05 08 10
      01 02 03 06 07 10
      01 02 03 06 08 09
      01 02 04 05 07 10
      01 02 04 05 08 09
      01 02 04 06 07 09
      01 02 04 06 08 10
      01 02 05 06 07 08
      01 02 05 06 09 10
      01 02 07 08 09 10
      03 04 05 06 07 08
      03 04 05 06 09 10
      03 04 07 08 09 10
      05 06 07 08 09 10 






      The example you give is not randomly generated, it's a group of sequential combinations starting with the lowest and preceding to the next higher one.  It's unlikely that a randomly generated list would start with  01 02 03 04 05 06 or even have that combination in the list.  Regardless of how the combinations are generated, you need a routine that compare the newly generated combinations with the saved list and reject the combinations if it matches more than four numbers in any of those combinations in the list else add it to the list.  The advantage of working with a sequential list is that you know when you have covered every possible combinations where with a randomly generated list, you would have to assume when no more combinations were added to the list every possible combination had been covered. 

      RJOh

       * you don't need to buy more tickets, just buy a winning ticket * 
         
                   Evil Looking       

        Avatar
        New Member

        East Timor
        Member #12948
        March 26, 2005
        7 Posts
        Offline
        Posted: March 27, 2005, 12:02 am - IP Logged
        Quote: Originally posted by RJOh on March 26, 2005



        Quote: Originally posted by freehand on March 26, 2005



        I want source code c++ for generation very fast possible random combinations for "n,k" but filtering...... such.... no more than 4 elements in common?  

        It sees this example:

        C 10,6 = 210 FULL

        But, filtering C 10,6 with maximum 4 elements in common = 18

        01 02 03 04 05 06
        01 02 03 04 07 08
        01 02 03 04 09 10
        01 02 03 05 07 09
        01 02 03 05 08 10
        01 02 03 06 07 10
        01 02 03 06 08 09
        01 02 04 05 07 10
        01 02 04 05 08 09
        01 02 04 06 07 09
        01 02 04 06 08 10
        01 02 05 06 07 08
        01 02 05 06 09 10
        01 02 07 08 09 10
        03 04 05 06 07 08
        03 04 05 06 09 10
        03 04 07 08 09 10
        05 06 07 08 09 10 






        The example you give is not randomly generated, it's a group of sequential combinations starting with the lowest and preceding to the next higher one.  It's unlikely that a randomly generated list would start with  01 02 03 04 05 06 or even have that combination in the list.  Regardless of how the combinations are generated, you need a routine that compare the newly generated combinations with the saved list and reject the combinations if it matches more than four numbers in any of those combinations in the list else add it to the list.  The advantage of working with a sequential list is that you know when you have covered every possible combinations where with a randomly generated list, you would have to assume when no more combinations were added to the list every possible combination had been covered. 

        RJOh





        Hi RJOh,

        You are total certain.

        For small amounts of numbers it is really better to filter all the combinations.

        The same ideal is to have an option to use or random or full combinations.

        But my main problem is compares the newly generated combinations with the saved list and reject the combinations if it matches lives than
        four numbers in any of those combinations.

        You can help me in this source code?

        Regards,

          RJOh's avatar - chipmunk
          mid-Ohio
          United States
          Member #9
          March 24, 2001
          19895 Posts
          Offline
          Posted: March 27, 2005, 5:55 am - IP Logged
          Quote: Originally posted by freehand on March 27, 2005


          Hi RJOh,

          You can help me in this source code?

          Regards,





          No, I don't know C++, I know some old GWBasic. I was just trying to understand the routine you wanted coded.  Sounds like you want a custom program coded using C++.  Good luck to you.

          RJOh

           * you don't need to buy more tickets, just buy a winning ticket * 
             
                       Evil Looking       

            RJOh's avatar - chipmunk
            mid-Ohio
            United States
            Member #9
            March 24, 2001
            19895 Posts
            Offline
            Posted: March 27, 2005, 11:48 am - IP Logged

            CoverMaster without the optimzer switch produced this list in 4 sec. It appears the program you want is already written.

             1  2  3  4  5  6
             1  2  3  4  8 10
             1  2  3  4 12 13
             1  2  4  7 11 13
             1  2  5  9 16 17
             1  2  6 12 13 15
             1  2  8 12 14 18
             1  2  9 11 15 17
             1  3  4  7 16 17
             1  3  4  9 15 18
             1  3  5  6 10 11
             1  3  5  9 13 16
             1  3  6  7 13 17
             1  3  7  8 13 18
             1  4  5  6  8 12
             1  4  8 10 14 17
             1  4 11 14 16 18
             1  5  7 12 14 15
             1  6  7  8  9 13
             1  6 10 11 12 18
             1  7  8  9 10 11
             1 12 13 14 15 16
             2  3  5 11 14 18
             2  3  7 10 14 16
             2  3  7 12 17 18
             2  4  6  8  9 10
             2  4  7  9 13 14
             2  4  8 15 16 17
             2  4 11 12 15 17
             2  5  6 10 13 17
             2  5 10 13 15 18
             2  6  8 11 13 16
             2  6 15 16 17 18
             2  7  9 11 12 16
             3  4  6 12 13 14
             3  4  9 11 16 18
             3  5  8 11 14 15
             3  6  8 12 16 17
             3  6  9 13 15 16
             3  7 10 15 17 18
             3  8  9 10 12 13
             3  9 12 13 14 17
             4  5  6  9 10 16
             4  5  7 10 12 16
             4  5  8 13 17 18
             4  6  7 11 13 15
             4  8  9 11 12 17
             5  6  9 12 14 18
             5  7  8  9 12 15
             5  7 11 13 14 17
             5  8 10 12 15 16
             6  7  8  9 14 18
             6  7  8 15 16 18
             6  9 10 14 15 17
            10 11 13 14 15 18
            10 11 13 16 17 18

            Good luck to you.
            RJOh

             * you don't need to buy more tickets, just buy a winning ticket * 
               
                         Evil Looking       

              Avatar
              New Member

              East Timor
              Member #12948
              March 26, 2005
              7 Posts
              Offline
              Posted: March 27, 2005, 1:21 pm - IP Logged
              Quote: Originally posted by RJOh on March 27, 2005



              CoverMaster without the optimzer switch produced this list in 4 sec. It appears the program you want is already written.

               1  2  3  4  5  6
               1  2  3  4  8 10
               1  2  3  4 12 13
               1  2  4  7 11 13
               1  2  5  9 16 17
               1  2  6 12 13 15
               1  2  8 12 14 18
               1  2  9 11 15 17
               1  3  4  7 16 17
               1  3  4  9 15 18
               1  3  5  6 10 11
               1  3  5  9 13 16
               1  3  6  7 13 17
               1  3  7  8 13 18
               1  4  5  6  8 12
               1  4  8 10 14 17
               1  4 11 14 16 18
               1  5  7 12 14 15
               1  6  7  8  9 13
               1  6 10 11 12 18
               1  7  8  9 10 11
               1 12 13 14 15 16
               2  3  5 11 14 18
               2  3  7 10 14 16
               2  3  7 12 17 18
               2  4  6  8  9 10
               2  4  7  9 13 14
               2  4  8 15 16 17
               2  4 11 12 15 17
               2  5  6 10 13 17
               2  5 10 13 15 18
               2  6  8 11 13 16
               2  6 15 16 17 18
               2  7  9 11 12 16
               3  4  6 12 13 14
               3  4  9 11 16 18
               3  5  8 11 14 15
               3  6  8 12 16 17
               3  6  9 13 15 16
               3  7 10 15 17 18
               3  8  9 10 12 13
               3  9 12 13 14 17
               4  5  6  9 10 16
               4  5  7 10 12 16
               4  5  8 13 17 18
               4  6  7 11 13 15
               4  8  9 11 12 17
               5  6  9 12 14 18
               5  7  8  9 12 15
               5  7 11 13 14 17
               5  8 10 12 15 16
               6  7  8  9 14 18
               6  7  8 15 16 18
               6  9 10 14 15 17
              10 11 13 14 15 18
              10 11 13 16 17 18

              Good luck to you.
              RJOh





              Hi RJOh,

              I have Covermaster e anothers softwares.

              But i go to use the code to filter milhoes of combinations and big games.

              Thanks,