Source c++ to filter

Freehand

Member
Hi,

Somebody can help me with a code source in c++ to filter a game with in the maximum "n" equal sets of ten between the combinations.

EXAMPLE

maximum of 4 equal sets

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

Thanks,
 

Freehand

Member
Hi,

I want a code to generate combinations with a filter automatically.

The necessary filter that, it must only generate combinations with in the maximum 4 equal sets of ten between itself.
 

PAB

Member
Hi Freehand,

Do you Mean that you want ALL Combinations of 6 Numbers from 10 Numbers. That will give you a Total of 210 Combinations.

All the Best.
PAB
:wavey:
 

Freehand

Member
Re: Hi Freehand,

PAB said:
Do you Mean that you want ALL Combinations of 6 Numbers from 10 Numbers. That will give you a Total of 210 Combinations.

All the Best.
PAB
:wavey:


Yes.

I want source code that each combination has in the maximum 4 equal sets.

It sees this example:

C 10,6 = 210

C 10,6 with in maximum equal 4 = 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

Thanks
 

PAB

Member
Freehand,

Here is the FULL Wheel for C(10,6,6,6) = 210 Combinations.

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


If you Wanted to Guarantee Matching 4 Numbers if you have ALL 6 Numbers Drawn in your Selected 10 Numbers then you can Use the Wheel C(10,6,4,6) = 3 Combinations.

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

If this is NOT what you want, Perhaps you can Explain in a Little More Detail what you Mean by "Maximum 4 Equal Sets".

I Hope this Helps.
All the Best.
PAB
:wavey:
 

Freehand

Member
thornc said:
I would say that an explanation to why it is useful might be in order also!

I look to a simple code source to generate combinations and to
filter, eliminating combinations with more than 4 repeated numbers in the sets.
 

PAB

Member
Hi Freehand,

If you are Saying that you want a Set of 6 Number Combinations from 10 Selected Numbers so that EACH Number does NOT Appear More Than 4 Times in 18 Combinations, it is NOT Possible.
If you Multiply the 10 Numbers that will be in your Selection by 4, Being the Maximum Number of Times you want EACH Number to Appear Overall, that Equals 40 Numbers. Now Because you want 6 Number Combinations you Divide the 40 Numbers by 6 which Equals 6.67 Combinations, the 0.67 Being the Remaining 4 Numbers. Therefore there would be a Maximum of 7 Combinations Needed to be Played to Accomodate your Criteria. BUT, this Means that there MUST be 2 Numbers that will Appear MORE than the 4 Times you Specify.

I Hope this Helps.
All the Best.
PAB
:wavey:
 
Last edited:

Freehand

Member
Re: Hi Freehand,

PAB said:
If you are Saying that you want a Set of 6 Number Combinations from 10 Selected Numbers so that EACH Number does NOT Appear More Than 4 Times in 18 Combinations, it is NOT Possible.
If you Multiply the 10 Numbers that will be in your Selection by 4, Being the Maximum Number of Times you want EACH Number to Appear Overall, that Equals 40 Numbers. Now Because you want 6 Number Combinations you Divide the 40 Numbers by 6 which Equals 6.67 Combinations. Therefore there would be a Maximum of 7 Combinations Needed to be Played to Accomodate your Criteria. BUT, this Means that there MUST be 4 Numbers that will Appear MORE than the 4 Times you Specify.

I Hope this Helps.
All the Best.
PAB
:wavey:

I go to look a form to explain better.

It is a simple idea and much program already makes this, but I want to have my proper code source.
 

Freehand

Member
Re: Hi Freehand,

PAB said:
If you are Saying that you want a Set of 6 Number Combinations from 10 Selected Numbers so that EACH Number does NOT Appear More Than 4 Times in 18 Combinations, it is NOT Possible.
If you Multiply the 10 Numbers that will be in your Selection by 4, Being the Maximum Number of Times you want EACH Number to Appear Overall, that Equals 40 Numbers. Now Because you want 6 Number Combinations you Divide the 40 Numbers by 6 which Equals 6.67 Combinations, the 0.67 Being the Remaining 4 Numbers. Therefore there would be a Maximum of 7 Combinations Needed to be Played to Accomodate your Criteria. BUT, this Means that there MUST be 2 Numbers that will Appear MORE than the 4 Times you Specify.

I Hope this Helps.
All the Best.
PAB
:wavey:

Hi PAB,

You it could indicate me a code source in c++ to generate all the
possible combinations and also random and saves the result in
an file in format text?
 

Freehand

Member
Re: Hi Freehand,

PAB said:
If you are Saying that you want a Set of 6 Number Combinations from 10 Selected Numbers so that EACH Number does NOT Appear More Than 4 Times in 18 Combinations, it is NOT Possible.
If you Multiply the 10 Numbers that will be in your Selection by 4, Being the Maximum Number of Times you want EACH Number to Appear Overall, that Equals 40 Numbers. Now Because you want 6 Number Combinations you Divide the 40 Numbers by 6 which Equals 6.67 Combinations, the 0.67 Being the Remaining 4 Numbers. Therefore there would be a Maximum of 7 Combinations Needed to be Played to Accomodate your Criteria. BUT, this Means that there MUST be 2 Numbers that will Appear MORE than the 4 Times you Specify.

I Hope this Helps.
All the Best.
PAB
:wavey:

Hi PAB,

I have one more simpler explanation:

I want source code for generation very fast possible random combinations for "n,k" but filtering collection of (n,k) combinations such have 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

Thanks
 

PAB

Member
Hi Freehand,

I am NOT Familiar with c++.
Now that we Understand what you are After, maybe Someone here will be Able to come up with some Code for you.

All the Best.
PAB
:wavey:
 

hot4

Member
Re: Re: Hi Freehand,

Freehand said:
Hi PAB,

I have one more simpler explanation:

I want source code for generation very fast possible random combinations for "n,k" but filtering collection of (n,k) combinations such have 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

Thanks

Is that you want a 5if6 cover? Or a 5if5? I presume it's a 5if6, that means if 6 numbers are drawn from your 10, you'll hit 5; that wheel allows repeating 4 numbers.
 

Freehand

Member
Re: Re: Re: Hi Freehand,

hot4 said:
Is that you want a 5if6 cover? Or a 5if5? I presume it's a 5if6, that means if 6 numbers are drawn from your 10, you'll hit 5; that wheel allows repeating 4 numbers.

Hi Hot4,

This is only one example.

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


You can help me in this filter?
 

hot4

Member
As I don't know c++, I can't but before you go to ask in c++ forums/news you need to know how to put your question, and it seems to me that,till now, your question is not understandable to those that have some lotto knowledge :dizzy:
Is really what you want? to get lines without repeating 5 numbers?
 

Freehand

Member
Re: Re: Re: Hi Freehand,

hot4 said:
Is that you want a 5if6 cover? Or a 5if5? I presume it's a 5if6, that means if 6 numbers are drawn from your 10, you'll hit 5; that wheel allows repeating 4 numbers.

Hi Hot4,

It is 5if6.

Of course 5if6 exist for 14 combinations.

But, i need source for filter very milhions combinations.
 

Sidebar

Top