From: Larry Serflaten on

"Larry Serflaten" <serflaten(a)gmail.com> wrote

> Perhaps it may be easier to see the pattern if you reverse the 1's and 0's
>
> 0000 0011
> 0000 0101
> 0000 0110
> 0000 1001
> 0000 1010
> 0000 1100
> 0001 0001
> 0001 0010
> 0001 0100
> 0001 1000
> 0010 0001
> ... etc
>
<... snipped for brievity ...>

> If I am not mistaken, there are 28 patterns in the complete list. And
> you can turn a (3,4) wheel into a (6, 8) wheel by shifting the pattern
> left 1 instead of by 2 as was shown. Add 2 different (6, 8) sets to
> get one (12, 16) set, or, add a set of (3,4) plus a set of (6, 8) to get
> one set of (9, 12), et. al.


Of those 28, some are replicas of earlier patterns, so the final list
could be shorter than 28. For example, of those showing above,
the 1st, 3rd, 6th, and 10th items in the list are essentialy the same
pattern if you shift by 1 to make (6, 8) combinations. If you shift
by 2, then the 1st and 6th are similar, and the 3rd and 10th are
similar.

I thought I would point that out in case it wasn't readily apparent.
(I just noticed it as I re-read the post from the newsgroup)

That is going to effect how you select your starting patterns to
generate your sequences....

HTH
LFS


From: NeatBoxx via VBMonster.com on
Larry Serflaten wrote:
>> The module calculates all possible variations that maintain balance...equal
>> play for each number. This saves the lotto player money...Like in my example
>[quoted text clipped - 4 lines]
>> this explains to you what I am trying to do...it's not about decieving people
>> to think it's magical win system for lotteries...it's merely a tool...
>
>I'd be somewhat of the reverse, better at programming than math, but I thought
>I would draw your attention to the pattern you've set up and suggest you might
>advance that pattern idea to get the numbers you need.
>
>Consider this string of digits that represent the numbers 1 - 8: 1111 1111
>There's a 1 in the first column, representing the number 1 in your combination.
>In fact there are 1's in all the columns, which would represent all the numbers
>1-8. Now lets look at the (3, 4) wheel you previously posted:
>
>1-2-3-5-6-7 1110 1110
>1-2-4-5-6-8 1101 1101
>1-3-4-5-7-8 1011 1011
>2-3-4-6-7-8 0111 0111
>
>Taking the top line (1-2-3-5-6-7) for illustration, produces the string 1110 1110.
>Meaning there is a 1 in the first, second and third column, and the fifth, sixth,
>and seventh column. When you line it up like that, you can see a pattern develop.
>
>You've got two 0's separated by three 1's and you've just left shifted the pattern
>to create the next line.
>
>There are a number of other patterns that might be worth noting. The entire list
>starts out something like this:
>
>1111 1100
>1111 1010
>1111 1001
>1111 0110
>1111 0101
>1111 0011
>1110 1110
>1110 1101
>... etc ...
>
>Perhaps it may be easier to see the pattern if you reverse the 1's and 0's
>
>0000 0011
>0000 0101
>0000 0110
>0000 1001
>0000 1010
>0000 1100
>0001 0001
>0001 0010
>0001 0100
>0001 1000
>0010 0001
>... etc
>
>What you get are starting patterns you might use to generate a new number
>sequence. You'd start with a pattern from the list, and left shift 1 or 2
>(depending on other criteria) until you get back to the original pattern.
>
>For example, taking the top line of the list (0000 0011) equates to the
>number sequence 1-2-3-4-5-6. Left shifing that pattern 2 every time
>produces a different set of the (3, 4) combination:
>
>0000 0011 1-2-3-4-5-6
>0000 1100 1-2-3-4-7-8
>0011 0000 1-2-5-6-7-8
>1100 0000 3-4-5-6-7-8
>
>And that was just the top line, the same shifting could be done for all
>the patterns in the list to create new (3, 4) combinations. (1's that
>shift off the left end are added back to the right side).
>
>If I am not mistaken, there are 28 patterns in the complete list. And
>you can turn a (3,4) wheel into a (6, 8) wheel by shifting the pattern
>left 1 instead of by 2 as was shown. Add 2 different (6, 8) sets to
>get one (12, 16) set, or, add a set of (3,4) plus a set of (6, 8) to get
>one set of (9, 12), et. al.
>
>What I am suggesting is that you stop trying to randomly guess
>possible wheel entries, in favor of enumerating the entire pattern list,
>and selecting one pattern from the enumerated list to begin shifting it
>around to generate your numbers. (They would still be in the 1's and 0's
>form, which you would have to transpose into the numbers 1-8, and then
>into your final 1 through 42, or whatever).
>
>In short, I am suggesting that you avoid random guessing of number
>sequences, testing them against your criteria (which takes an undetermined
>amount of time because the numbers are random) in favor of deterministically
>generating number sequences that meet your criteria, in a finite number of
>steps. When your number sequences get large, the random possibilites
>grow exponentially, which is why you see such a delay. While it will take
>slightly longer to generate a (6, 8) combination compared to a (3, 4) set, still,
>due to the deterministic amount of steps and relative simplicity of the operation,
>I would venture 3 (6, 8) sets (equivilent to an (18, 24) set) should take well
>under a minute to generate.
>
>Once you've grasp that concept, recall that the computer stores all of its
>values in the form of 1's and 0's (in memory). So, instead of a string of
>digits that have to be rotated, make the patterns easier to manage by
>treating them as binary values. The binary notation of 0001 0001 equates
>to the decimal value of 17, The first pattern in the list is 000 0011 which
>equates to a value of 3, the second is 0000 0101 which equates to 5,
>and so on. It is simply Base 2, converted to Base 10.
>
>Once you have the original pattern it is an easy task to shift that
>pattern around to generate the different number sequences. The routine
>below may get you started. Paste the code into a new form and run it.
>You'll see your previously posted wheel show up in VB's Immediate
>window (AKA: Debug window). Use a different call to Sequence()
>to generate a different set [ ex, Sequence(2, 3) ]. Put the two sets
>together and you have a larger set of (6, 8). Because the original patterns
>of the two (3, 4) sets were different, shifting them produced different
>(3, 4) sets with no overlap. (no identical number combinations)
>
>Enough said, here's the code, see if that may be of use....
>
>LFS
>
>Option Explicit
>
>Private Sub Form_Load()
>Dim n
>' For Each n In Sequence(2, 3) ' 0000 0011 = 3
> For Each n In Sequence(1, 17) ' 0001 0001 = 17
> Debug.Print n
> Next
>End Sub
>
>Function Sequence(ByVal ShiftSize As Long, ByVal Pattern As Long) As Collection
>Dim bit As Long, ptn As Long, vlu As Long
>Dim seq As String
>
> ' limited pattern shifting to 1 or 2
> If ShiftSize < 1 Then ShiftSize = 1
> If ShiftSize > 2 Then ShiftSize = 2
>
> Set Sequence = New Collection
> ' copy original pattern
> ptn = Pattern
> Do
> ' copy current bit pattern
> vlu = ptn
> ' erase old seq
> seq = ""
> ' generate sequence; convert bit placement to numbers
> For bit = 8 To 1 Step -1
> If (vlu And 1) = 0 Then ' 0's = present
> seq = "-" & CStr(bit) & seq
> End If
> vlu = vlu \ 2 ' Shift bits 1 place to the right
> Next
> ' Save
> Sequence.Add Mid$(seq, 2)
> ' Shift pattern left
> ptn = ptn * (ShiftSize * 2)
> ' Only testing for 1 or 2 shifts (limited)
> If ptn And &H100 Then ptn = ptn Or 1 ' off left edge
> If ptn And &H200 Then ptn = ptn Or 2
> ' Chop off left bits if any
> ptn = ptn And (&HFF)
> Loop Until ptn = Pattern
>End Function
********************************************************************************
Hey, Larry

I copied the code into a new project, ran it but nothing prints...All I get
is an empty form!!
Doesn't appear to have any compile errors...It's just nothing prints on the
form.
I have never seen Debug.Print before... How is it different from the Print
statement. If I can get it to printing on the form or in a listbox; I would
like to study this code...It's completely new to me in some areas

I have to tell that your work is brilliant, but I think way beyond my
level. You have obliviously been well trained in computer programming...and
it shows!!. I had no idea that it could be this complicated to do what I
want to do. What I am doing currently works fine, but like you said some of
the higher sets take a while to finish and I can only imagine what it's going
to be like when I use higher number bases such as 9,10,11,12 . Twelve will
be the limit because much after 12 the intervals between the numbers become
to great to make small wheels

--
Message posted via VBMonster.com
http://www.vbmonster.com/Uwe/Forums.aspx/vb/201007/1

From: Henning on
Top posting:
Nitpicking...
I would call that left roll, the left bit shifted around into the right bit.
Left shift is entering a zero in the rightmost position.

/Henning

"Larry Serflaten" <serflaten(a)gmail.com> skrev i meddelandet
news:i1vh3s$v2p$1(a)news.eternal-september.org...
>
> "NeatBoxx via VBMonster.com" <u61568(a)uwe> wrote
>
>> The module calculates all possible variations that maintain
>> balance...equal
>> play for each number. This saves the lotto player money...Like in my
>> example
>> of P = (3,4) .... 4 combinations with each number appearing exactly 3
>> times.
>> will produce one 5 out of 6 win if the 6 numbers fall in the example.
>>
>> My math is pretty good it's my computer programming that sucks. I
>> hope
>> this explains to you what I am trying to do...it's not about decieving
>> people
>> to think it's magical win system for lotteries...it's merely a tool...
>
>
> I'd be somewhat of the reverse, better at programming than math, but I
> thought
> I would draw your attention to the pattern you've set up and suggest you
> might
> advance that pattern idea to get the numbers you need.
>
> Consider this string of digits that represent the numbers 1 - 8: 1111
> 1111
> There's a 1 in the first column, representing the number 1 in your
> combination.
> In fact there are 1's in all the columns, which would represent all the
> numbers
> 1-8. Now lets look at the (3, 4) wheel you previously posted:
>
> 1-2-3-5-6-7 1110 1110
> 1-2-4-5-6-8 1101 1101
> 1-3-4-5-7-8 1011 1011
> 2-3-4-6-7-8 0111 0111
>
> Taking the top line (1-2-3-5-6-7) for illustration, produces the string
> 1110 1110.
> Meaning there is a 1 in the first, second and third column, and the fifth,
> sixth,
> and seventh column. When you line it up like that, you can see a pattern
> develop.
>
> You've got two 0's separated by three 1's and you've just left shifted the
> pattern
> to create the next line.
>
> There are a number of other patterns that might be worth noting. The
> entire list
> starts out something like this:
>
> 1111 1100
> 1111 1010
> 1111 1001
> 1111 0110
> 1111 0101
> 1111 0011
> 1110 1110
> 1110 1101
> ... etc ...
>
> Perhaps it may be easier to see the pattern if you reverse the 1's and 0's
>
> 0000 0011
> 0000 0101
> 0000 0110
> 0000 1001
> 0000 1010
> 0000 1100
> 0001 0001
> 0001 0010
> 0001 0100
> 0001 1000
> 0010 0001
> ... etc
>
> What you get are starting patterns you might use to generate a new number
> sequence. You'd start with a pattern from the list, and left shift 1 or 2
> (depending on other criteria) until you get back to the original pattern.
>
> For example, taking the top line of the list (0000 0011) equates to the
> number sequence 1-2-3-4-5-6. Left shifing that pattern 2 every time
> produces a different set of the (3, 4) combination:
>
> 0000 0011 1-2-3-4-5-6
> 0000 1100 1-2-3-4-7-8
> 0011 0000 1-2-5-6-7-8
> 1100 0000 3-4-5-6-7-8
>
> And that was just the top line, the same shifting could be done for all
> the patterns in the list to create new (3, 4) combinations. (1's that
> shift off the left end are added back to the right side).
>
> If I am not mistaken, there are 28 patterns in the complete list. And
> you can turn a (3,4) wheel into a (6, 8) wheel by shifting the pattern
> left 1 instead of by 2 as was shown. Add 2 different (6, 8) sets to
> get one (12, 16) set, or, add a set of (3,4) plus a set of (6, 8) to get
> one set of (9, 12), et. al.
>
> What I am suggesting is that you stop trying to randomly guess
> possible wheel entries, in favor of enumerating the entire pattern list,
> and selecting one pattern from the enumerated list to begin shifting it
> around to generate your numbers. (They would still be in the 1's and 0's
> form, which you would have to transpose into the numbers 1-8, and then
> into your final 1 through 42, or whatever).
>
> In short, I am suggesting that you avoid random guessing of number
> sequences, testing them against your criteria (which takes an undetermined
> amount of time because the numbers are random) in favor of
> deterministically
> generating number sequences that meet your criteria, in a finite number of
> steps. When your number sequences get large, the random possibilites
> grow exponentially, which is why you see such a delay. While it will take
> slightly longer to generate a (6, 8) combination compared to a (3, 4) set,
> still,
> due to the deterministic amount of steps and relative simplicity of the
> operation,
> I would venture 3 (6, 8) sets (equivilent to an (18, 24) set) should take
> well
> under a minute to generate.
>
> Once you've grasp that concept, recall that the computer stores all of its
> values in the form of 1's and 0's (in memory). So, instead of a string of
> digits that have to be rotated, make the patterns easier to manage by
> treating them as binary values. The binary notation of 0001 0001 equates
> to the decimal value of 17, The first pattern in the list is 000 0011
> which
> equates to a value of 3, the second is 0000 0101 which equates to 5,
> and so on. It is simply Base 2, converted to Base 10.
>
> Once you have the original pattern it is an easy task to shift that
> pattern around to generate the different number sequences. The routine
> below may get you started. Paste the code into a new form and run it.
> You'll see your previously posted wheel show up in VB's Immediate
> window (AKA: Debug window). Use a different call to Sequence()
> to generate a different set [ ex, Sequence(2, 3) ]. Put the two sets
> together and you have a larger set of (6, 8). Because the original
> patterns
> of the two (3, 4) sets were different, shifting them produced different
> (3, 4) sets with no overlap. (no identical number combinations)
>
> Enough said, here's the code, see if that may be of use....
>
> LFS
>
>
> Option Explicit
>
> Private Sub Form_Load()
> Dim n
> ' For Each n In Sequence(2, 3) ' 0000 0011 = 3
> For Each n In Sequence(1, 17) ' 0001 0001 = 17
> Debug.Print n
> Next
> End Sub
>
>
> Function Sequence(ByVal ShiftSize As Long, ByVal Pattern As Long) As
> Collection
> Dim bit As Long, ptn As Long, vlu As Long
> Dim seq As String
>
> ' limited pattern shifting to 1 or 2
> If ShiftSize < 1 Then ShiftSize = 1
> If ShiftSize > 2 Then ShiftSize = 2
>
> Set Sequence = New Collection
> ' copy original pattern
> ptn = Pattern
> Do
> ' copy current bit pattern
> vlu = ptn
> ' erase old seq
> seq = ""
> ' generate sequence; convert bit placement to numbers
> For bit = 8 To 1 Step -1
> If (vlu And 1) = 0 Then ' 0's = present
> seq = "-" & CStr(bit) & seq
> End If
> vlu = vlu \ 2 ' Shift bits 1 place to the right
> Next
> ' Save
> Sequence.Add Mid$(seq, 2)
> ' Shift pattern left
> ptn = ptn * (ShiftSize * 2)
> ' Only testing for 1 or 2 shifts (limited)
> If ptn And &H100 Then ptn = ptn Or 1 ' off left edge
> If ptn And &H200 Then ptn = ptn Or 2
> ' Chop off left bits if any
> ptn = ptn And (&HFF)
> Loop Until ptn = Pattern
> End Function
>
>
>
>
>


From: Norm on
NeatBoxx via VBMonster.com submitted this idea :
> Larry Serflaten wrote:
>>> The module calculates all possible variations that maintain balance...equal
>>> play for each number. This saves the lotto player money...Like in my
>>> example [quoted text clipped - 4 lines] this explains to you what I am
>>> trying to do...it's not about decieving people to think it's magical win
>>> system for lotteries...it's merely a tool...
>>
>> I'd be somewhat of the reverse, better at programming than math, but I
>> thought I would draw your attention to the pattern you've set up and suggest
>> you might advance that pattern idea to get the numbers you need.
>>
>> Consider this string of digits that represent the numbers 1 - 8: 1111 1111
>> There's a 1 in the first column, representing the number 1 in your
>> combination. In fact there are 1's in all the columns, which would represent
>> all the numbers 1-8. Now lets look at the (3, 4) wheel you previously
>> posted:
>>
>> 1-2-3-5-6-7 1110 1110
>> 1-2-4-5-6-8 1101 1101
>> 1-3-4-5-7-8 1011 1011
>> 2-3-4-6-7-8 0111 0111
>>
>> Taking the top line (1-2-3-5-6-7) for illustration, produces the string 1110
>> 1110. Meaning there is a 1 in the first, second and third column, and the
>> fifth, sixth, and seventh column. When you line it up like that, you can
>> see a pattern develop.
>>
>> You've got two 0's separated by three 1's and you've just left shifted the
>> pattern to create the next line.
>>
>> There are a number of other patterns that might be worth noting. The entire
>> list starts out something like this:
>>
>> 1111 1100
>> 1111 1010
>> 1111 1001
>> 1111 0110
>> 1111 0101
>> 1111 0011
>> 1110 1110
>> 1110 1101
>> ... etc ...
>>
>> Perhaps it may be easier to see the pattern if you reverse the 1's and 0's
>>
>> 0000 0011
>> 0000 0101
>> 0000 0110
>> 0000 1001
>> 0000 1010
>> 0000 1100
>> 0001 0001
>> 0001 0010
>> 0001 0100
>> 0001 1000
>> 0010 0001
>> ... etc
>>
>> What you get are starting patterns you might use to generate a new number
>> sequence. You'd start with a pattern from the list, and left shift 1 or 2
>> (depending on other criteria) until you get back to the original pattern.
>>
>> For example, taking the top line of the list (0000 0011) equates to the
>> number sequence 1-2-3-4-5-6. Left shifing that pattern 2 every time
>> produces a different set of the (3, 4) combination:
>>
>> 0000 0011 1-2-3-4-5-6
>> 0000 1100 1-2-3-4-7-8
>> 0011 0000 1-2-5-6-7-8
>> 1100 0000 3-4-5-6-7-8
>>
>> And that was just the top line, the same shifting could be done for all
>> the patterns in the list to create new (3, 4) combinations. (1's that
>> shift off the left end are added back to the right side).
>>
>> If I am not mistaken, there are 28 patterns in the complete list. And
>> you can turn a (3,4) wheel into a (6, 8) wheel by shifting the pattern
>> left 1 instead of by 2 as was shown. Add 2 different (6, 8) sets to
>> get one (12, 16) set, or, add a set of (3,4) plus a set of (6, 8) to get
>> one set of (9, 12), et. al.
>>
>> What I am suggesting is that you stop trying to randomly guess
>> possible wheel entries, in favor of enumerating the entire pattern list,
>> and selecting one pattern from the enumerated list to begin shifting it
>> around to generate your numbers. (They would still be in the 1's and 0's
>> form, which you would have to transpose into the numbers 1-8, and then
>> into your final 1 through 42, or whatever).
>>
>> In short, I am suggesting that you avoid random guessing of number
>> sequences, testing them against your criteria (which takes an undetermined
>> amount of time because the numbers are random) in favor of deterministically
>> generating number sequences that meet your criteria, in a finite number of
>> steps. When your number sequences get large, the random possibilites
>> grow exponentially, which is why you see such a delay. While it will take
>> slightly longer to generate a (6, 8) combination compared to a (3, 4) set,
>> still, due to the deterministic amount of steps and relative simplicity of
>> the operation, I would venture 3 (6, 8) sets (equivilent to an (18, 24) set)
>> should take well under a minute to generate.
>>
>> Once you've grasp that concept, recall that the computer stores all of its
>> values in the form of 1's and 0's (in memory). So, instead of a string of
>> digits that have to be rotated, make the patterns easier to manage by
>> treating them as binary values. The binary notation of 0001 0001 equates
>> to the decimal value of 17, The first pattern in the list is 000 0011 which
>> equates to a value of 3, the second is 0000 0101 which equates to 5,
>> and so on. It is simply Base 2, converted to Base 10.
>>
>> Once you have the original pattern it is an easy task to shift that
>> pattern around to generate the different number sequences. The routine
>> below may get you started. Paste the code into a new form and run it.
>> You'll see your previously posted wheel show up in VB's Immediate
>> window (AKA: Debug window). Use a different call to Sequence()
>> to generate a different set [ ex, Sequence(2, 3) ]. Put the two sets
>> together and you have a larger set of (6, 8). Because the original patterns
>> of the two (3, 4) sets were different, shifting them produced different
>> (3, 4) sets with no overlap. (no identical number combinations)
>>
>> Enough said, here's the code, see if that may be of use....
>>
>> LFS
>>
>> Option Explicit
>>
>> Private Sub Form_Load()
>> Dim n
>> ' For Each n In Sequence(2, 3) ' 0000 0011 = 3
>> For Each n In Sequence(1, 17) ' 0001 0001 = 17
>> Debug.Print n
>> Next
>> End Sub
>>
>> Function Sequence(ByVal ShiftSize As Long, ByVal Pattern As Long) As
>> Collection Dim bit As Long, ptn As Long, vlu As Long
>> Dim seq As String
>>
>> ' limited pattern shifting to 1 or 2
>> If ShiftSize < 1 Then ShiftSize = 1
>> If ShiftSize > 2 Then ShiftSize = 2
>>
>> Set Sequence = New Collection
>> ' copy original pattern
>> ptn = Pattern
>> Do
>> ' copy current bit pattern
>> vlu = ptn
>> ' erase old seq
>> seq = ""
>> ' generate sequence; convert bit placement to numbers
>> For bit = 8 To 1 Step -1
>> If (vlu And 1) = 0 Then ' 0's = present
>> seq = "-" & CStr(bit) & seq
>> End If
>> vlu = vlu \ 2 ' Shift bits 1 place to the right
>> Next
>> ' Save
>> Sequence.Add Mid$(seq, 2)
>> ' Shift pattern left
>> ptn = ptn * (ShiftSize * 2)
>> ' Only testing for 1 or 2 shifts (limited)
>> If ptn And &H100 Then ptn = ptn Or 1 ' off left edge
>> If ptn And &H200 Then ptn = ptn Or 2
>> ' Chop off left bits if any
>> ptn = ptn And (&HFF)
>> Loop Until ptn = Pattern
>> End Function
> ********************************************************************************
> Hey, Larry
>
> I copied the code into a new project, ran it but nothing prints...All I get
> is an empty form!!
> Doesn't appear to have any compile errors...It's just nothing prints on the
> form.
> I have never seen Debug.Print before... How is it different from the Print
> statement. If I can get it to printing on the form or in a listbox; I would
> like to study this code...It's completely new to me in some areas
>
> I have to tell that your work is brilliant, but I think way beyond my
> level. You have obliviously been well trained in computer programming...and
> it shows!!. I had no idea that it could be this complicated to do what I
> want to do. What I am doing currently works fine, but like you said some of
> the higher sets take a while to finish and I can only imagine what it's going
> to be like when I use higher number bases such as 9,10,11,12 . Twelve will
> be the limit because much after 12 the intervals between the numbers become
> to great to make small wheels

Go to the vb toolbar, click on view and then click on immediate window.
A window will open at the bottom of the vb IDE. Run the code Larry gave
you and the debug.print will show in the immediate window.

Norm


From: David Kerber on
In article <Xns9DB96BAC05641thisnthatroadrunnern(a)216.196.97.131>,
t.h.i.s.n.t.h.a.t(a)r.o.a.d.r.u.n.n.e.r.c.o.m says...

....

> But there is a difference. While the mathematical odds of any one
single number
> combination is exactly as the same as the next, probability says that 1,2,3,4,5,6 most
> likely will never be chosen, just as 2,3,4,5,6,7 or 3,4,5,6,7,8, etc.....or 2,4,6,8,10,12...or
> 3,6,9,12,15,18.....or 1,2,3,52,53,54....or 1,2,3,10,20,30.....or any of thousands of number
> patterns are much less likely to be picked.
>
> With a standard 54 number lottery, I think there's like 27 million'ish number combinations.
> I believe that through pattern elimination, that can be whittled down to somewhere
> between 50,000 and 100,000 that have the highest probability to come in.......

Nope. If the draw is fair, ALL combinations have exactly the same
probability of being drawn. 1,2,3,4,5,6 is exactly as probable as (for
example) 5,8,11,12,16,22.

D