Welcome Guest
You last visited March 22, 2019, 2:56 am
All times shown are
Eastern Time (GMT-5:00)

# Wheeling

Topic closed. 4 replies. Last post 10 years ago by Stew12.

 Page 1 of 1

United States
Member #5599
July 13, 2004
1204 Posts
Offline
 Posted: October 23, 2008, 2:21 pm - IP Logged

Hi,

Below is my first crude attemp at writing a wheeling program. It is written in Liberty Basic. Is there another approach?

REM WHEELING DEVELOPEMENT PROGRAM
RESTORE
CLS

REM SPECIFY HOW MANY NUMBERS TO BE WHEELED
WAMT=20

REM VARY G2,G3, AND G4 TO CONFIGURE WHEEL OUTPUT

REM DIM STATEMENTS

DIM CNTA(60)
DIM CNTB(60)
DIM CNTC(60)
DIM CNTD(60)
DIM CNTE(60)
DIM CNTS(60)
DIM CNTP(60,60)

REM PRINT OUT SHIFTS
DL1=5:DL2=10:DL3=15:DL4=20:DL5=25
DL6=30:DL7=35:DL8=40:DL9=45:DL10=50
DL11=55:DL12=60:DL13=65:DL14=70:DL15=75
DL16=80:DL17=85:DL18=90:DL19=95:DL20=100
DL21=105:DL22=110:DL23=115:DL24=120:DL25=125
DL26=130:DL27=135:DL28=140:DL29=145:DL30=150
DL31=155:DL32=160:DL33=165:DL34=170:DL35=175
DL36=180:DL37=185:DL38=190:DL39=195:DL40=200
DL41=205:DL42=210:DL43=215:DL44=220:DL45=225
DL46=230:DL47=235:DL48=240:DL49=245:DL50=250

REM BEGIN LOOPS

FOR A=1 TO (WAMT-4)
FOR B=(A+1) TO (WAMT-3)
FOR C=(B+1) TO (WAMT-2)
FOR D=(C+1) TO (WAMT-1)
FOR E=(D+1) TO (WAMT)

REM SINGLES FILTER POSITIONAL
G4=1
IF CNTA(A)>G4 THEN GOTO [SKIP]
IF CNTB(B)>G4 THEN GOTO [SKIP]
IF CNTC(C)>G4 THEN GOTO [SKIP]
IF CNTD(D)>G4 THEN GOTO [SKIP]
IF CNTE(E)>G4 THEN GOTO [SKIP]

REM SINGLES FILTER (VERTICAL)
G2=5
IF CNTS(A)>G2 THEN GOTO [SKIP]
IF CNTS(B)>G2 THEN GOTO [SKIP]
IF CNTS(C)>G2 THEN GOTO [SKIP]
IF CNTS(D)>G2 THEN GOTO [SKIP]
IF CNTS(E)>G2 THEN GOTO [SKIP]

REM PAIRS FILTER (HORIZONTAL)
G3=1
IF CNTP(A,B)>G3 THEN GOTO [SKIP]
IF CNTP(A,C)>G3 THEN GOTO [SKIP]
IF CNTP(A,D)>G3 THEN GOTO [SKIP]
IF CNTP(A,E)>G3 THEN GOTO [SKIP]
IF CNTP(B,C)>G3 THEN GOTO [SKIP]
IF CNTP(B,D)>G3 THEN GOTO [SKIP]
IF CNTP(B,E)>G3 THEN GOTO [SKIP]
IF CNTP(C,D)>G3 THEN GOTO [SKIP]
IF CNTP(C,E)>G3 THEN GOTO [SKIP]
IF CNTP(D,E)>G3 THEN GOTO [SKIP]

REM POSITIONAL FILTER

REM AVERAGING
AVGWAMT=0
AVGWAMT=INT(WAMT/2)
AVGA=(AVGWAMT-2)+(AVGWAMT-1)+(AVGWAMT)+(AVGWAMT+1)+(AVGWAMT+2)
IF (A+B+C+D+E)>(AVGA*1.2) THEN GOTO [SKIP]
IF (A+B+C+D+E)<(AVGA*.8) THEN GOTO [SKIP]

REM COUNT SINGLES
CNTS(A)=CNTS(A)+1
CNTS(B)=CNTS(B)+1
CNTS(C)=CNTS(C)+1
CNTS(D)=CNTS(D)+1
CNTS(E)=CNTS(E)+1

REM COUNT SINGLES BY POSTION
CNTA(A)=CNTA(A)+1
CNTB(B)=CNTB(B)+1
CNTC(C)=CNTC(C)+1
CNTD(D)=CNTD(D)+1
CNTE(E)=CNTE(E)+1

REM COUNT PAIRS
CNTP(A,B)=CNTP(A,B)+1
CNTP(B,C)=CNTP(B,C)+1
CNTP(C,D)=CNTP(C,D)+1
CNTP(D,E)=CNTP(D,E)+1

LOCATE DL1,AA+6:PRINT A
LOCATE DL2,AA+6:PRINT B
LOCATE DL3,AA+6:PRINT C
LOCATE DL4,AA+6:PRINT D
LOCATE DL5,AA+6:PRINT E

AA=AA+1

[SKIP]

NEXT E
NEXT D
NEXT C
NEXT B
NEXT A

PRINT
PRINT AA
PRINT

You are a slave to the choices you have made.  jk

Even a blind squirrel will occasionally find an acorn.

There is no elevator to success, you will have to take the stairs.

United States
Member #5599
July 13, 2004
1204 Posts
Offline
 Posted: October 23, 2008, 3:03 pm - IP Logged

Here is a sample output for 20 numbers.

G2=30:G3=0:G4=5

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

20

INPUT 1 TO SEE SUMMARY PAGE AND 2 TO END ?

You are a slave to the choices you have made.  jk

Even a blind squirrel will occasionally find an acorn.

There is no elevator to success, you will have to take the stairs.

United States
Member #4877
May 30, 2004
5289 Posts
Offline
 Posted: October 27, 2008, 8:38 pm - IP Logged

WHEEL'g is the KEY>>>>>>>>>!!!

2 cut'n the Odd's 2 winn'g lottery

butt U must BOIL-D-STRING<<<<!

THIS is not a SMALL TASK!!!!!!!!!!

butt U must know it's nece\$\$ary!

lol

psykomo

50
mid-Ohio
United States
Member #9
March 24, 2001
20273 Posts
Offline
 Posted: October 27, 2008, 8:53 pm - IP Logged

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

T if M        Tested     Covered         %   Uncovered         %
-----------------------------------------------------------------
2 On 2 :         190         143  75.26316          47  24.73684
2 On 3 :       1,140       1,115  97.80702          25   2.19298
2 On 4 :       4,845       4,843  99.95872           2   0.04128
2 On 5 :      15,504      15,504 100.00000           0   0.00000
2 On 6 :      38,760      38,760 100.00000           0   0.00000
2 On 7 :      77,520      77,520 100.00000           0   0.00000
3 On 3 :       1,140         192  16.84211         948  83.15789
3 On 4 :       4,845       2,535  52.32198       2,310  47.67802
3 On 5 :      15,504      12,969  83.64938       2,535  16.35062
3 On 6 :      38,760      37,592  96.98658       1,168   3.01342
3 On 7 :      77,520      77,323  99.74587         197   0.25413
4 On 4 :       4,845         100   2.06398       4,745  97.93602
4 On 5 :      15,504       1,488   9.59752      14,016  90.40248
4 On 6 :      38,760       9,958  25.69143      28,802  74.30857

I stuck the wheel in a copy of CoverMaster and the above coverage report was generated.

* you don't need to buy every combination, just the winning ones *

CT
United States
Member #61396
May 21, 2008
781 Posts
Offline
 Posted: October 28, 2008, 11:53 am - IP Logged

Below is my first crude attemp at writing a wheeling program. It is written in Liberty Basic. Is there another approach?

It looks like you have a good start, but it depends on which wheel guarantee you are trying to create. Each guarantee will have a different distribution.  I have been trying to figure out a good algorithm for creating 2if2 wheels (since I like the distribution best) and it is not as easy as it seems.  The problem (create certain guarantees for dynamic number inputs) seems to not have an [easily] progamable solution and seems to be almost a NP-Hard problem much like the Traveling Salesman.  I coded my software in a C# Windows Application.

So far my best approach is one where I input the amount of tickets I want and the amount of numbers to wheel.  Then the algorithm creates an array with the correct numbers and loops through the tickets evaluating how each number will do in each position (one position at a time).  It ranks each number in each position based on; match satisfactions minus match duplicates = rank, and picks the best one for the job.  The algorithm isn't perfect, and for right now is only designed to satisfy 2if2 wheels.

Looking at some medium sized wheels, we have a 2if2 of 30 here on the site that requires 49 tickets.  The method I built requires 60 tickets for a 2if2 of 30 wheel.  I havent been able to get that down algorithmically as of yet. The program also creates a 2if2 of 22 in 36 tickets, but here on Lottery Post we have a 2if2 of 22 in 27 tickets.  Still needs some tweaks for optimality here and there.

This is the output for a 2if2 attempt on 30 numbers:

30 numbers used 10 times each

Matched 0 times: 0
Matched 1 time: 273
Matched 2 times: 159
Matched 3 times: 3

13-2-10-18-3
17-16-12-9-14
22-4-20-7-0
19-27-15-6-21
11-1-26-8-29
5-24-23-25-28
13-17-22-19-11
2-16-4-27-1
10-12-20-15-26
18-9-7-6-8
3-14-0-21-29
5-13-16-20-6
24-2-17-7-15
23-10-9-22-27
25-18-12-4-19
28-3-11-16-7
14-1-5-10-19
0-26-24-13-9
21-8-23-2-12
29-25-17-20-27
28-18-14-22-15
3-4-6-26-23
0-11-5-2-25
21-1-24-18-20
8-28-13-4-29
10-17-0-6-28
3-12-22-1-5
16-19-26-7-21
9-15-11-4-21
14-27-8-24-3
29-23-18-16-0
25-13-14-7-1
2-9-20-19-28
10-11-24-12-6
17-26-5-18-27
22-8-25-16-15
29-2-22-6-14
23-13-15-1-17
10-4-7-29-5
3-9-25-20-19
12-0-27-28-13
21-10-25-26-22
11-23-14-20-8
24-16-4-17-3
2-26-28-1-9
18-11-27-7-12
0-19-8-15-5
6-1-0-25-21
29-24-19-23-12
13-21-5-9-29
2-10-16-8-17
18-3-15-29-20
14-4-26-27-6
22-24-7-23-28
11-13-2-18-14
10-3-9-7-0
17-21-28-12-4
16-22-20-27-11
19-6-1-8-24
15-26-5-23-25

The numbers are 0-29 instead of 1-30, works better with the rest of my software that way ;)

RJ, if you can stick that into CoverMaster I'd be curious to see how it does.  Maybe I'll have to write a method for checking coverings, might be handy to have.

 Page 1 of 1