Lotry version 2.0 
Copyright 1996 Shaun Trevor
---------------------------

	A Lottery Predictor for the Psion Series 3a computer. The program uses a sophisticated statistical technique to analyse the results of previous draws in an attempt to predict the following weeks draw. The software uses a combination of many different systems and ideas on number selection, it also includes a random element in every draw in an attempt to ensure that if you win the big one! you wont have to share with too many others. This program requires about 70K of free memory to run properly.

	This computer program is protected by copyright law & international treaties. Any reproduction, distribution or use of this program or any portion of it, must comply with the terms of this license agreement.


Installation.
-------------

	The program is installed in the same manner as other series 3/3a applications.

	- copy the two files Lotryv2.OPA and Forecast. OPA into an \APP directory on any drive. (NB. both files need to be on the same drive)

	- copy the file UK.LOT to your \OPD directory on your machines INTERNAL drive. This is the results of the UK national lottery to 23rd March, 1996.

	- if the on-line help is required (the program works fine without it and you can save 16K if space is tight, but it can be handy in the early days) copy the Lotry.hlp file to an \OPD directory on any drive. You may also need to copy the file sys$help.opo to an \OPO directory on any drive, if you don't already have a copy there. Thankyou to Tom Dolbilin for his excellent help manager program.

	- Install the program by using PSION-I and navigating your way to the Lotryv2 application file and pressing <enter>. If installed correctly the 'Uk' file should be listed under your icon.

	Users of Lotry v1.0 or v1.1 should read History.


Quick Instructions.
-------------------

	When the program is run the program will display a message requesting the result of the draw on a certain date. If a forecast is made the computer will forecast the result of that weeks draw. If that draw has already been made use the 'Update' option to enter the result of that draw. Continue entering data until the computer indicates that it requires the result of the next draw.

	You can then use the 'Guess' option to get the computer to calculate its selections.  NB. Unregistered copies will only ever generate pure random lines whatever settings it is given. Registered users can have complete control over the statistical forecast the computer makes.

	Use the 'Add a line' option to enter your own prediction or get the computer to generate one or more lines. To view or edit the lines in your lines file use the 'view/edit lines' option (Psion-D). When the draw is made use the 'Update results' option, the computer will then check any lines you have stored. The result of your lines is displayed showing if you have any winning lines. Your lines are then listed with matched numbers in brackets.


Registration & License Agreement.
---------------------------------

	This software is shareware and is such is freely distributable as long as this document file is included with the program. By using this program you agree that if after a period not exceeding 28 days you still wish to use this program you will register its use with me, the copyright owner (see Registration for how to register). In return for registering I will send you a code which when entered into the Registration screen of the program will unlock some extra features only available to registered users. A period of 28 days should give you long enough to evaluate the program and to decide whether you wish to continue to use it.

	- To register send a letter to me quoting "Ref: Lotry v2.0" and stating from where you received your copy of this program, enclosing your payment

	- Send 10 pounds (10 UKP), Registered users of Lotry v1.0 or v1.1 need only send 5 pounds (5 UKP) (half-price) with their registration number, cheques should be made payable to Mr S Trevor. Please ensure that your address is clearly legible so that I can send you the access code. Please send to Mr S Trevor, 138 Greenlee Garth, Newton Aycliffe, County Durham, DL5 7EX, England.


	By their very nature computer programs are very complex things and are rarely completely bug free. You use this program at your own risk and I am not to be held responsible for any damage to other software or information held on your computer which may be corrupted through use of this program.


Extra features gained by Registration.
--------------------------------------

	- the most important feature gained by registering your copy of Lotry v2.0 is the Guess next draw. This only ever gives a purely random set of numbers unless you register. Registered users can alter all the features and the amount of random to add. They can adjust the bias applied for example towards hot-numbers. Although these figures can be altered by non-registered users when enter is pressed if they watch the bottom left corner of the screen when the computer is guessing numbers it will confirm that a random selection is being made.

	- registered users gain the ability to print a list of predicted lines to the screen, a file, or to a printer enabling the filling out of tickets to be done much more easily. When you have a lot of lines eg. in a syndicate (the program can handle and keep track, checking for wins etc up to 99 lines), it becomes difficult keeping the file up to date. If you get the computer to pick 10 different random lines each week, last weeks will remain on file in-case you wanted them again. If you do not need them you can delete them, unfortunately you can only delete on at a time. Registered users can at a stroke delete all out of date lines, there are also other options for example enabling the deletion of all psion lines or even all lines on file.

	- Many pubs, clubs and even work syndicates are now holding a bonus ball draw. This is where people buy a number and if this number is the bonus ball that week they win whatever is in the pot. While you enter your results on your psion each week wouldn't it be handy if it could check the bonus draw to see who had won that as well. Registered users have this facility, they can log all numbers to an individual and when the lottery is drawn and the results entered, this program will inform you of the bonus ball draw winner.

	- Registered users also gain some extra graphs, not more graphs! I here you cry. These however are very useful. You can get a graph of the lines cover gained with all lines on file. This for example shows if your syndicate is not covering certain numbers or has certain numbers in a lot of lines. It can also be used to confirm that the software is targetting the numbers that you want it to. For example you could set your required bias and get the computer to generate, say 20 lines. Graph the lines cover and you will see how the computers selections are distributed. For users of Lotry v1.1 they will understand the column principal this program uses (see The Forecasting System Explained), as in v1.1 graphs of each of the columns can be drawn, as this is not of much use tounregistered users (the prediction system is pure random) these graphs are for registered users only. If you are in a bonus ball draw, wouldn't it be nice to see a graph of just the bonus ball frequency so that you can select a good ball - Registered users can even graph the bonus ball frequency.

	- It is useful to have statistical information on the draw when predicting the next weeks draw, this is available for registered users giving the number of low/high and odd/even numbers drawn. The program will even indicate the best settings for the Guess option.

	- Registered users can also request information on a particular ball, for example to date 14/3/96 ball 28 has been drawn 11 times and has been drawn as the bonus ball four times. It was first drawn on 13/5/95 and was last drawn on 10/2/96. The program holds all of this data & it is readily available to registered users.


Menu Options
------------ 

	Menu options only available to registered users are marked with a [R], this is displayed as an R in a circle on the menu display within the program.


PROGRAM MENU
------------

	about lotry (Psion-V) - This displays a brief description of the program. 

	register program (Psion-K) - Displays a requester in which you can enter your registration details. Upon registration you will be sent a sequence of five numbers, these are entered on this screen. If entered correctly a message will be displayed confirming your registration. A file Lotry.ini will be created in your internal \app directory containing your registration details. NB. On registering this program your owner name is noted. Be sure this is correct using Psion-P from the system screen. If you ever change the owner information, Lotry checks the current owner against that registered, if different the software becomes unregistered. If you need to change the owner name (I can't see any reason!), delete the Lotry.ini file from \app and re-register using your access code from within the program. The new owner information will then be recorded on file. This is to prevent the registration file being copied to another persons machine.

	[R] sort results file (Psion-K) - This will sort all the entries in your results file into the correct order (see 'Edit Results' and 'ball info'), it can be a little slow so be patient.

	eXit (Psion-X) - quite simply exits the program. This can also be accomplished from the system screen as with other applications using the delete key on the highlighted file.


RESULTS MENU
------------

	New results file (Psion-N) - This requests a file name for the new file. The file should have the extension '.LOT', if you just enter a filename with no extension, the correct extension is added for you (see also 'Files created). You are then asked for a start date for results, as a default 19/11/1994 is offered (the date of the first UK draw), any date since then can be entered. NB. draws are only on Saturdays so be sure to enter a Saturdays date. [If as is often mentioned there is a mid-week draw, you could create a new file for this draw with an appropriate start-date]. Unlike version 1.1 you can now have many different files of results, eg. useful for other 49-ball draws such as the North American National Lottery.

	Open results (Psion-O) - Opens a different results file. A normal file requester is displayed so that you can either type the file or use 'TAB' and navigate your way to the file.

	Update results (Psion-U) - Displays a requester into which you enter the results of the draw for the week indicated on the main screen. Any stored lines are checked to see if you have any winning lines. The current lines are then listed for you to scroll (use Up and Down, Psion-Up or Down jumps in steps of 5 and Psion-Home or End takes you to the first/last result, use Psion-X to exit) showing any matched numbers in brackets. Any winning line is displayed with a * at the right-side, it will then indicate the balls matched eg. *3p - 3 balls matched on a personal line, or *5bp - 5 balls & the bonus ball matched on a personal line. This information is automatically stored in a \wrd\l-drwres.wrd file for you to peruse in detail later if you so wish. Registered users can also get the program to check any 'bonus ball draw' winner information.

	view/Edit results (Psion-E) - Displays a scrolling edit window listing all previous draw results. Use Up and Down to navigate (Psion-Up or Down jumps in steps of 5 and Psion-Home or End takes you to the first/last result), pressing 'Enter' will allow you to edit the highlighted result. The edited line will the be appended to the end of the file and you will re-enter the scroll routine at the first record. Use Psion-X to exit when you have finished viewing or editing the results file. NB. This routine is memory hungry with large files and also can be cumbersome, therefore if there are more than 99 weeks results on file, you do not enter the scroll/edit routine but are requested for the date of the draw to edit (use 'Tab' to display a calendar if required), this weeks results are then displayed as before for editing.  ** IMPORTANT NOTE **, the bias settings applied when selecting numbers (Registered users) will be adversely affected by editing results other than the last weeks entered. These look for sequences and patterns which require the order to be correct. If results are edited (really this should be rarely needed) use the 'Sort Results file' option Psion-K (Registered users only). This will sort all the entries into the correct order but can be a little slow - be patient. The ball information option also requires the results to be in the correct order or strange results may be displayed. If you are not sure whether the file is in the correct order use the view/print results option and check the order yourself.

	view wks results (Psion-J) - Requests a draw date ('Tab' displays a useful calendar to navigate), will then display the draw result for that date. Although the numbers can be changed this is a view only option and the recorded results on file will remain unchanged.

	view/Print results (Psion-P) - Will list all previous draw results to either the screen, a connected printer for a permanent record, or to a file (\wrd\L-result.wrd)


LINES MENU
----------

	Add a line (Psion-A) - Allows you to enter a line onto the lines file. This is your guess, it could be birthdays etc, whatever method you use or it could be the lines your syndicate uses each week. You first enter a name (up to 10 letters), enter your choices. The number of weeks can be 1-8, you can also enter 0 (which tells the computer to store the line but not to check it for a win), you can also make it permanent by entering 9, this is for lines you have every week. You can also tell the computer whether the line is your own personal line or part of a syndicate. After 'Update' is used with the weeks results your lines file is checked excepting 0 entries, all number of weeks are then reduced by one, nb. if you only have the line on for 1 week after one week it will read 0 and not be checked again. (Use the Edit lines option to delete unwanted/expired entries, Registered users can also use the Erase/Tidy lines option).

	view/eDit lines (Psion-D) - A scrolling edit window is displayed showing all lines on file (up to the maximum 99 entries). Use the Up and Down keys to navigate to an entry (Psion-Up or Down jumps in steps of 5 and Psion-Home or End takes you to the first/last result). You can then use 'Enter' to edit the information or the 'Delete' key to delete an unwanted/expired line. When finished use Psion-X to exit.

	[R] view/print Lines (Psion-L) - Will list all stored lines to either the screen, a connected printer for a permanent record, or to a file (\wrd\L-synd.wrd). The number in brackets at the end of each line shows the number of weeks (+ indicates a syndicate line, - for a personal line).

	[R] eRase/tidy lines (Psion-R) - This option is designed to save a lot of tedious editing work. As you will probably have noticed all lines gnerated by the program are prefiixed with 'psion' followed by the selection date. This option can delete all expired or only the psion expired lines at a stroke. It can also delete all psion lines barring permanent (9 wk) entries, all psion lines. It can even clear the file completely deleting all stored lines. Using the scrolling edit routine these would all have to be deleted one by one.

	[R] bonuS ball draw (Psion-S) - Many Pubs/Clubs and syndicates are now offering a 'Bonus ball draw', this is where each member buys a number (1-49), and if that ball is drawn as the bonus ball that person collects whatever money is in the kitty. This option will create a bonus draw file, or if one exists allow editing of the ball owner information. A scrolling edit window is used, use Up and Down until the required ball is highlighted, press 'Enter' and enter the name of the person who has that number. The available balls are listed first for convenience. When finished exit as usual with Psion-X. This file is then checked and the Bonus draw winner displayed each week when the results are entered using the 'Update' option.

	[R] delete bonus draw (Psion-M) - If the bonus ball draw is stopped, or you have created the file in error use this option to Delete the Bonus Ball file.


GRAPH MENU
----------

	[R] lines cover analYsis (Psion-Y) - Draws a graph showing what numbers are covered by your lines file. This can be used to show you are targeting the numbers you wanted etc., Personal, Syndicate or all lines can be included in the graph.

	Frequency distribution (Psion-F) - Draws a graph of all previous draw results, showing  the frequency distribution of all the lottery balls. The bonus ball can be included in the figures if required.

	Bell shaped curve (Psion-B) - This is similar to the frequency distribution graph, but the most popular numbers are shown in the centre of the graph with the least popular numbers on the outside edges of the graph. Again the bonus ball can be included in the figures if required.

	sTepper graph (Psion-T) - Another way of displaying frequency distribution, this time the least popular numbers are displayed at the left-hand edge progressing to the most popular at the right-hand edge. Yet again the bonus ball can be included in the figures if required.

	[R] Column frequency graphs (Psion-C) - Users of v1.0 or v1.1 will recognise these graphs from this program. This option will graph the frequency of each of the six columns in the draw (See Tailoring the forecast for further information). Also available is a graph of bonus ball frequency, this could be useful when selecting your number(s) for the Bonus Ball draw.


FORCAST MENU
------------

	[R] draw statistics (Psion-Z) - Displays the  ratio of odd/even and low/high numbers (high being greater than 24) drawn to date. Also offers a recommended bias setting for odd/even and high/low for use by registered users when attempting to forecast the next weeks draw.

	ball Information (Psion-I) - This option will display to the screen/printer or to a file (\wrd\l-binfo) statistical information on any ball in the draw. The following information is displayed - Frequency in the draw and in each of the six columns (see Tailoring the forecast). It also displays the number of times that ball has appeared as the bonus ball. The date that ball was first and last drawn is also displayed.

	Guess (Psion-G) - Using all previous draw results stored, and all the bias settings you have requested be applied, the software makes a prediction of the result of the next lottery draw. To make a completely random selection use R100 #(100% Random). Please note this is a complex procedure and may take a few seconds to complete all of the calculations (usually about 20 seconds per line). Several selections can be made at once and recorded automatically in your lines file. A total of 99 lines can be recorded. If only one line is to be selected the computers selection is displayed, you can alter any of the numbers displayed as required, pressing 'enter' adds it to your lines file. If you do not wish this selection to be stored just press the escape key. NB. Unregistered users will only ever get a random selection, regardless of what bias etc is applied, they are all ignored and a random choice made (Watch the bottom-left corner as it makes the selections!). 

# If all bias settings are at no bias and R90 is selected the computer will make a pseudo random choice. It is random but within the columns system (see tailoring the forecast). This will not produce lines like 1,2,3,4,5,6 but is this really likely to occur!

	Wheel (Psion-W) - Given 7 or 8 numbers this routine will calculate a full cover perm either 7 or 28 lines respectively. The numbers initially given are a random set but you can alter these to whatever you like. 

	Wheeling has become very popular especially with syndicates. You may spend a bit of money putting them on but if you get a good few numbers correct you will have many winning lines. The lines are calculated from your 7 or 8 numbers and stored in your lines file automatically.


Files created
-------------

	For each results file you have any or all of the following files could be created by the program:

\OPD\*.LOT - This holds the draw results. (Eg. UK.LOT)
\OPD\*.SYN - This stores your lines for the next draw.
\OPD\*.INI - An initialisation file for your Guess settings.
\OPD\*.BON - The bonus ball draw information

In addition registered users will have a file \APP\LOTRY.INI which holds registration details. 


History
-------


Version 1.0 initial shareware release for Psion 3 and 3a.


Changes in version v1.1

	- Error in draw data file LOT.DAT now contains corrected data for draw Wk2 31 drawn not 32. This file should replace your previous copy of the file. Now contains results of all draws to 18/3/95 inclusive.

	- Alter Wts menu now stores any alterations to weighting figures for future use without having you enter them each time you run the program.

	- Plot menu added giving the ability to view in graph form the frequency distribution of all numbers previously drawn. Graphs can also be plotted for each of the six columns of results aiding in the narrowing down of selections in the forecasting process. (NB. Columns 2-6 are only available to registered users, Column 1 being available as a taster of this facility, see also Tailoring the Forecast)

	- The ability to narrow the forecasting ranges for each of the columns. For a typical narrowing, 90% of hits can still be attained narrowing the selection field by 1/3rd. (NB. This feature is available to registered users only, See also Tailoring the Forecast)


Changes in version v2.0

	- This version is a completely re-written version of the program with a great many improved and added features. Apologies to series 3 users, this program has many features which would have been very difficult to convert to work on your model, it is therefore 3a only (isn't it time you upgraded anyway?).I have had a great response to previous versions. Thankyou to all those who took the trouble to make suggestions for improvement, I have tried to include as many requested features as I could. This program has taken several months to write and has been thoroughly tested (I hope all the bugs are gone!!!).

	- You can now have several files of results each with their own associated lines file. These are listed under the icon. You can now also exit from the system screen.

	- The ability to edit results has been included you no longer have to ditch the file and start again.

	- You can print all results (not just the last 4), to screen, printer or to a file.

	- Unregistered users can store their lines (aren't I generous?) and have them checked. There is no longer a 5 line limit, you can store up to 99 lines and edit, delete, update them at will.

	- You can now log lines as being either Personal or Syndicate (no more need for a separate syndicate checker!). You can also see exactly what lines have won or matched some of the balls in a nice scrolling window.

	- Bonus ball draws are becoming very popular and rather than having them scribbled on bit of paper you can have the computer keep track of who has what number and the winner is displayed automatically each week.

	- Many new graphs have been added with a scale bar so that the frequency can be easily calculated. Some people like the bonus ball included in their graphs (I can't see why myself!), this is now available as an option.

	- Information on each balls frequency, when first/last drawn etc. is now freely available.

	- As wheeling grows in popularity amongst syndicates I have included a full cover 7 or 8 number perm with the lines automatically added to your lines file.

	- The forecast engine has been greatly improved with many new options. The amount of random added can be adjusted to suit from a very small random element to 100% random numbers. Odd/Even and Low/High can now have different bias. Frequent/Rare, Sawtooth and Repeat bias have been added. The forecast engine automatically adjusts the range to home in on the column range most used avoiding freak results (No more studying the graphs to calculate the optimum target range). Also no more funny numbers such as 1.8 as bias settings, they are now all integers in the range 1-9 (See also Tailoring the forecast).


Tailoring the Forecast
----------------------

	NB To tailor the software effectively you need to register your copy of this program (all of the features detailed below are only available to registered users, unregistered users can only generate purely random numbers).

If we examine a weeks draw with these results:

16  20  6  31  30  47  Bonus 14


The first thing we do is to sort them into numerical order ignoring the bonus number. The result is:

6  16  20  30  31  47  Bonus 14


If we examine the following 5 wks sorted results:

9  17  32  36  42  44
2  5   21  22  25  32
7  17  23  32  38  42
6  16  20  30  31  47
4  16  25  26  31  43

1  2   3   4   5   6  Column number

	These columns after sorting are very useful in restricting the selection range. For example to pick numbers we need six numbers each in the range 1-49. To pick our first number from 1-49 is very wasteful, using the column information we can shorten this. Using just five weeks is not really useful (in fact the program will not even try predicting - it will just generate random numbers until it has at least 10 weeks results), but we can get the idea. In Column 1 we can see it ranges from 2 to 9 now if we pick a number in this range we stand a pretty good chance of getting a winner. This is a much shorter range than 1-49. You will if you examine the column graphs get stray results which unnecessarily extend the range This program automatically targets the popular range avoiding the stray results.

	Examining the 5 wks results we can see that there are 13 odd and 17 even numbers, the law of averages says that these will to even out. If the results spread one way we can add a bias say to odd numbers (the program will then add a bias towards selecting odd numbers). All bias is in the range 1-9 with odd/even, low/high, frequent/rare having a central point of 5 with no bias either way. A bias of 4 will give a slight bias to odd, 6 gives a slight bias to even. Increasing bias is applied with 1 being the a large bias to odd and 9 a large bias to even. Psion-Z displays draw statistics and gives recommended settings for odd/even, low/high bias.

	The frequent/rare bias also works the same with 5 being no-bias etc. This is a matter of personal taste with frequent bias (1-4) picking hot-numbers more frequently. A rare bias (6-9) will bias towards numbers that have not been picked many times before (cold-numbers).

	The sawtooth and repeat bias are also in the range 1-9 but 1 is no bias with 2-9 adding an increasing amount of bias. Sawtooth examines the last line, starting with column 1 we have the number 4 drawn, the week previously we had 6. the number drawn decreased from 6 to 4, adding sawtooth bias will assume that as we had a fall we will next week have a climb (examine the results - it works most weeks), the program will therefore bias towards numbers bigger than 4. A larger figure gives a greater bias.

	The repeat bias examines the last weeks results and looks through the file to see if any hot the numbers are prone to repeating the next week (as 16 and 31 did in the 5 results above). If they are prone to repeating an appropriate bias is applied based on your bias (1-9) and how often it has repeated before.

	The following settings would have no bias, they would however produce random numbers within the column ranges.

Random			R90
odd/even			5
low/high			5
frequent/rare		5
sawtooth			1
repeat			1
