Track Your Lottery With Lotto-Works_V1.3 Lotto_Works Version 1.3 is Copyright © November 1989 by Robert Schader This version is being released as Shareware. If you like the program, please send whatever you feel the program is worth to beocme registered. Hopefully this will be around $5-$15. If it isn't, then you must not like it so get rid of it. If there is enough interest,I will continue working on upgrades. Otherwise, this will be the final version. To Be a registered user, send money to: Robert Schader 3631 Colby S.W. Wyoming, MI 49509 Checks or Money Orders only. Thank you. INTRODUCTION Lotto-Works is a program designed to work with any type of state lottery drawing that uses a format such as six winning numbers out of a possible 44. It is not limited to this configuration and may be fully configured to handle any combination of winning numbers up to a maximum of ten numbers out of 99 possible. This makes it possible for Lotto-Works to handle the Pennsylvannia lottery (8 out of 88) as easily as any other state lottery. The program does not handle daily lotteries of the pick three or four type. Lotto-Works allows a maximum of 520 winning entries per datafile to be stored and analyzed. The program supports an unlimited number of such files to be created. At the standard rate of two lottery drawings per week, this allows for approximately five years worth of data storage per datafile. Program capabilities Lotto-Works helps you maintain a type of database consisting of winning lottery numbers that you enter and additional information generated by the program. The datafiles that are created with Lotto-Works are stored in standard text format in order to facilitate the easy development of additional program modules to be released. You may also develop modules of your own to manipulate the data. Lotto-Works also includes a number of other capabilities. Lotto-Works is capable of displaying a graph which shows the Mean and Standard Deviation for each winning entry. It can also display a histogram or frequency chart which tracks the number of all occurrences for each possible number. The most outstanding feature of Lotto-Works is a built-in random number generator that will select sets of numbers to play which are based on Mean and Standard Deviation values which you supply. Any major success to be made by using this feature depends mainly on your ability to forecast the Mean and standard deviation for the next drawing. As your datafile grows in the number of winning samples, patterns may develop which may help you forecast these numbers. Lists of previous winning numbers are usually available locally at some stores which sell lottery tickets in case you do not wish to wait a year or two for a sizable datafile. Up to 520 sets of such random numbers can be generated for each run of the number generator. A report file is generated which lists all of the number sets and reports any datafile entries which match a certain percentage of the numbers generated. This percentage is called the Match Threshold and is definable within the number generator. The report file also includes a frequency list showing how many times each number was generated and how many times each number occurred in the database. There are a number of ways which you may choose in order to utilize this data. You may choose to play whole sets which either have the least number of matches or the most. Or you may decide to use the listing of occurences in order to pick numbers that either came up the most or least. This decision is left to you. Lotto-Works also has the ability to compare your favorite number combinations with the entries of the datafile for matching combinations. It is also possible to use this optionto compare the entire datafile to itself in order to reveal re-occurring combinations within the datafile. Explanation of the mean and standard deviation For those that are not familiar with statistical terms, the following section explains what they are and how they are used by Lotto-Works. In statistics, there are several types of Means used. Of these, Lotto-Works uses what is termed the arithmetic mean which is simply the average of a set of numbers. The standard deviation is a value used in order to measure the actual dispersion of the number set around the mean. It may more precisely be called the 'root mean square of the deviations'. This value is calculated as follows: a. Square all of the differences from the arithmetic mean. b. Calculate the arithmetic mean of the squared values. c. The square root of this mean is the standard deviation. A more precise determination of the standard deviation is obtained using the following modification: when calculating the arithmetic mean of the squared differences in step b above, divide the sum by the amount of numbers minus one. So if you are calculating the deviation of six numbers, you would divide the sum by five before doing the square root. As a statistical value, this method of determining the deviation is least affected by chance fluctuations than any other method of measuring dispersion. These values may be further used for determining such things as normal distribution curves and values of probabilities. This will hopefully be the subject of future modules to be written for Lotto-Works. Presently, I have not come up with any meaningful way of exploiting such functions based on a lottery system. Lotto-Works incorporates another value similar to the standard deviation which I have dubbed the non-standard deviation for lack of memory of the more appropriate term. This deviation is calculated by using the arithmetic mean of the entire range of numbers present within a lottery system. This mean value remains constant thoughout a datafile and is simply the value of the highest possible number divided by two. The non-standard deviation is then calculated using this number as a central mean. Program Requirements Lotto-Works will run on any Amiga with at least 512k of memory. However, you may need more memory if you wish to run the program in interlace mode and have multiple windows opened at the same time. A printer will definitely come in handy for printing reports but is not absolutely neccessary. Lotto-Works does use the latest release of the ARP.library which is freely distributable and is included on the disk. This library needs to be transferred to the libs directory of your system disk for proper operation. It's main use is for the standard file requester which is available from the library. Starting Lotto-Works Lotto-Works may either be started from the Workbench or CLI environments. To start Lotto-Works from the Workbench, you may either double click on the program icon or a project icon which corresponds to a Lotto-Works created datafile that you wish to work with. Lotto-Works does not support the standard multiple or extended file selection capabilities of the Workbench and will only load the last file selected in this manner. The program automatically creates icons for the datafiles and the default tool name for the icon is automatically set to the current volume, path and program name used. This feature allows your project to find the program properly no matter where it is located. You may even change the filename of the program and the default tool will be set appropriately. Lotto-Works will not re-write icons if they already exist so if you change the location of the program after creating datafiles, you will either have to edit the default tool field of the icon or delete only the info file for the icon and open the file from within the program and then re-saving the file to create a new icon. The program may be started from the CLI by typing the program name and an optional datafile name to load upon startup. You should include the entire pathname of the datafile if you use this option. Because Lotto-Works does not overwrite icons that already exist, you may feel free to use your own icons in place of the default icon supplied by the program. Features of the user interface Lotto-Works uses it's own custom screen for menu and window operations. Once this screen opens after the program is started, you are ready to begin. If you started the program from a project icon or with a datafile argument from the CLI, the file will be loaded and the title bar will display the name of the file. At this point all menu operations will be available for selection. If the program is started without an intial datafile to load, there will only be four menu items available. These consist of the items NEW, OPEN, ABOUT and QUIT. You must either choose NEW or OPEN in order to make the other selections available. Lotto-Works supports extended menu selections which are made by moving through the menus with the right mouse button down and selecting multiple items by clicking the left mouse button on them. In this way, you may select multiple options with only one access to the menu. The program is also capable of having all of the display windows open simultaneously and processing events for any window regardless of how many windows are currently open. However, there are two windows which will suspend any outside events until they are closed. One is the window used for starting a NEW datafile and the other is a status window which appears when either random numbers are being generated or favorite numbers are being compared with the datafile. This is neccessary in the last case in order to prevent changing any data within the file during these operations. Note that any events which have been made will only be suspended until the windows close and will then be executed immediately. Bringing up the ARP file requester will also suspend any processing of events while it is present. If you wish to make a menu selection while any active windows are displayed on the screen, you must first click the left mouse button outside of any windows in order for the menu to appear when the right mouse button is held down. All of the windows may be dragged to new locations on the screen. Most of the windows also have gadgets for depth arrangement and sizing gadgets. Lotto-Works is capable of operating with either a 640 x 200 resolution screen or in 640 x 400 interlace modes. The program reads information within with GfxBase structure of the graphics library to determine the exact size and should work properly on NTSC or PAL video standards. The selection of interlace mode is determined by the current Preferences setting of the Workbench environment or by adding a tool type of the form INTERLACE=1 to the program and project icons. Specific operating procedures This section presents in depth details of using Lotto-Works broken down into specifics for each menu item. The Project Menu New First brings up the arp file requester so that you may choose a path and filename to use for the NEW datafile. No file is actually created on disk until the SAVE item is selected. After selecting a name, the file requester will close and another window will come up for you to input configuration information. This input consists of two values. The top gadget within the window is for entering how many numbers there are for each winning entry. This will typically be between five to eight for most lotteries. The gadget below that is for input of the highest number which can be drawn and will typically be between 40 and 88. Once valid information has been entered in these gadgets, the program will calculate the total number of different combinations which would be possible within this lottery. This value usually corresponds to the odds of winning a lottery type for the data input. At this point, click on the Close gadget for the window in order to continue. The Close gadget will not respond unless all of the requested information is entered. If this option is selected while another datafile is active and that file has entries which have not been saved yet, a requester will come up asking if you wish to save the file first. Otherwise this requester will not appear. Open After selecting the file from the file requester,it will be read into memory. There is no need to enter any of the information used for creating a new datafile. If a previously opened file has entries that are not saved yet, a requester again comes up which allows you to save before continuing. Save Writes the current data to disk under the path/filename used when creating or opening the file. Save As Lets you choose a new path and filename from the ARP file requester before the file is saved. Useful for keeping incremental backups of the file. About Opens a requester showing copyright info and authors name and address. Quit Ends the program. If you have made changes to the datafile without saving them, you will first be presented with a requester asking you if you want to save the new data first. Otherwise, the program will exit immediately. The Edit Menu Add Entries This is the menu option you will probably be using most frequently. In order to avoid confusion and keep a timebased order to your datafile, you should run this program every time the winning numbers are published in order to add them to your file. When this option is selected from the menu, a requester will come up with a number of gadgets and info areas. In the upper one third of the requester are ten string gadgets for entering the actual numbers. However, only the neccessary number of gadgets for the datafile will be activated and the rest will be disabled. So, if your data calls for six winning numbers, only the first six gadgets will be active. Upon opening the requester, the first entry gadget will be automatically selected so you do not have to click the mouse inside of it's box. After entering the number and pressing the RETURN key, the next gadget will be selected and so on and so on. The only time you will need to use the mouse with these gadgets is if you have to back up to correct a mistake. You will notice that there are three gadgets near the bottom of the requester that are labeled 'NEXT', 'CALC' and 'DONE'. After entering the winning numbers, you will want to use these in one of three ways: 1.) If you want to see the calculated results of the entry then click on the 'CALC' gadget. You will then want to use on of the other two gadgets depending on if you want to make more entries or not. 2.) If you do not want to see the results of the calculation but want to continue to add entries then click on the 'NEXT' gadget. The calculations will still be made but will not be displayed long enough for you to read them. At this point you can proceed to make the next entry. 3.) If you do not want to see the results and you are done adding entries then click on the 'DONE' gadget. As with the 'NEXT' gadget, the calculations will be made but the requester will close before you can read the calculations. If there are any invalid entries within the gadgets, CALC or NEXT will have no effect until the proper entries are made. The DONE gadget will still work in this case but the invalid entry will not be added to the current data. Any windows that are opened while this window is being used will automatically be updated whenever the NEXT and DONE gadgets are selected. Display Entries This menu item opens a re-sizable and dragable window with a scroll gadget for examining winning number entries and the associated statistics. Displayed in this window are the entry number within the datafile, the actual winning numbers, and the mean, standard deviation and non-standard deviation for each entry. This display has the added feature of showing all of the even numbers in reverse video. This allows you to gain some insight of even-odd pattern development. If this window is open while you are adding entries, the display will be updated but you will have to click on the scroll gadget and move it down in order to see the entries that have been added. Options Menu Items Graph Mean & Std. Deviation Invoking this menu item will cause a window to open that graphically displays the statistical results for each winning entry as a scrollable chart. As a full database could cause a packed display resembling an accordian if it was packed into one display element, there is a scroll gadget at the bottom of the window in order to spread the graph out more. The colors of the Text headings positioned just above the scroll gadget correspond to the colors of the lines graphed and indicate which line is which. This allows you to set your Preferences colors to whatever you would like as long as each color is distinct from the others. The window that contains the graph is re-sizable and will automatically be scaled and redrawn whenever you adjust the window size. The graph is also scaled vertically to the minumum and maximum statistic values within the current database. You will probably notice that the graph lacks the traditional index markers vertically (for the statistical value) and horizontally ( to denote the entry number). However, as you move the mouse pointer within the graph area, the current values pointed to by the mouse will be displayed in the window's title bar. This method of representing the data is not quite as precise as the actual statistical values within the database but it is far more precise than printing index values along the sides of the chart. You should note that the relative precision of these values is also determined by the size of the window. The best precision is obtained by having the window adjusted to it's maximum size. At this time, there is no built-in way to print this graph. You could use the Graphic Dump Utility supplied on your Workbench disk or use a screen capture utility on each section of the graph, but you would have to fill in the actual values manually from the database. Remember that the database file is in standard ASCII format. Favorite Number Analysis This menu item allows you to analyze your favorite number combinations in relation to the winning numbers within the database in order to determine when and how many of the numbers turned up within a winning number set. The results are generated in the form of a report file in standard ASCII format which may be printed by either copying the file to your printer or using your favorite text editor. Before using this option, you must prepare a special database file to use as input for your favorite numbers as follows: Select NEW from the project menu and set up the new file as you would when starting a regular winning number datafile. Be sure to use the same parameters when asked for how many numbers and the highest number or the results will be incomprehensible. Now use the ADD-ENTRIES option under the EDIT menu to add your favorite number combinations and SAVE the file when you are done. When the file is saved, reload the database of winning numbers that you want to compare your favorite numbers to and then select the analysis menu item. You will now be presented with the first of two File requesters asking for an input file. Choose your prepared favorite number file and click on the OK gadget. The second File requester lets you choose a filename for the output report file. If you choose the name of an existing file, it will be replaced by the new file so make sure your filename is unique unless you do want to replace a previous file. After selecting a name for the output file, the program will immediately begin the analysis and a small "Working..." message should appear on the screen if the resources are available to do so. The Report file generation is complete when either the "Working.." message disappears or the screen flashes (along with a beep sound if you have your sound on) or both. You may now examine the report file however you choose. This option may also be used to generate an in-depth comparision of the winning number datafile by opening the file and using the same file as the input source of favorite numbers. Generate M & S Random Numbers This option allows you to generate up to 520 sets each time that you invoke it from the menu. The random number generator works on certain data that you supply by typing the values into string gadgets. Certain defaults are built into the program and displayed within the requester that pops up in order to save you some time with this option. However, none of the gadgets in this requester feature automatic selection of the next gadget. Following is a description of the information that you supply within the appropriate gadgets: Mean: from your own analysis of the winning entries, you should derive a number that you think looks good and enter it in this gadget. Tol: (Tolerance in percent) - the number generator will keep working on each set of numbers until it calculates that the numbers fall within a certain tolerance of the mean that you supply. In order to minimize calculation time, you should not set this tolerance value too low. (I recommend 5% as the absolute lowest tolerance. Std. Deviation - see Mean. Tol: You are allowed a separate tolerance value for checking the standard deviation of the number set. Follow the guidelines for the Mean tolerance. # of Sets: Enter how many sets of numbers you want the program to generate. Report Filename: this is the path and filename for the report file that will be generated. The default is 'RAM:number.report'. It should be possible to also specify the PRT: device for direct output to your printer. Matching Threshold: this specifies how many numbers of a winning entry must match the random number set in order for that entry to be reported. The default is three matches. Action When you have all your numbers entered and are ready to start the ball rolling, click on the 'PROCESS' gadget. When the report is finished, the screen will flash and you will hear a beep if you have the sound hooked up. At this time click on the 'CANCEL' gadget to close the requester. The report file may be viewed from the CLI with the type command or any text editor or may be copied to your printer. See the main description of the program for details of the random number report format. Histogram This item opens a window to graphically display the number of times each number has come up within the database. The actual numbers are printed on the left side of the screen and a bar is displayed to the right of the number representing how many times the number has come up. This window has a scroll gadget along the right side of it in order to scroll through all the numbers represented and the actual value for the number of times can be obtained by moving the mouse pointer to the end of a bar and looking in the title bar for the value. This window is capable of displaying a total count of up to 1,100 occurences for each number. While the maximum count value for any number is less than 580, each pixel horizontally represents one occurence of that number. Between 580 and 1160 maximum occurences, each horizontal pixel represents 2 occurences for that number. All of the numbers are scaled to the same value and this is automatically accounted for in the value displayed in the title bar. It is highly probable that you will never get a maximum occurence over 500 unless you keep track of the lottery for more than 10 years time, but if you do, this will allow it. The same information that is displayed here graphically is also made available in text form each time you generate a random number report file or a favorite number report file. This ends the description of using the Lotto program. It is really quite simple to use and straight-forward in operation. Datafile Format The datafiles that are created with Lotto-Works are stored in standard ASCII format and follow a certain layout. This description will help you if you wish to develop your own programs to further process the data. Items within a datafile are separated by whitespace. This includes spaces or newlines. The first item is the string 'LOTTO' which is used as a file identifier. Lotto-Works will not load a file that is missing this string. Following this identifier are two numbers which represent how many numbers constitute a winning entry and the upper limit of the range associated with this particular lottery. The fourth entry is a number which shows the total number of possible combinations or what is usually considered the odds of winning the lottery. These three numbers correspond to the entries made when starting a new datafile. The rest of the datafile is just a raw listing of the winning entries without an entry number and including the Mean, Standard Deviation and Non Standard Deviation. A reminder, if you really use and like Lotto-Works, please sent $5-$15 to help support continued developement. Thank you. End of File