Welcome Guest
( Log In | Register )
The time is now 1:54 am
You last visited December 9, 2016, 12:40 am
All times shown are
Eastern Time (GMT-5:00)

jayemmar's Blog

  • jayemmar's Blog has 4 entries (0 private) and has been viewed 5,407 times.
  • Lottery Post members have made 12 comments in jayemmar's Blog.
  • jayemmar is a Standard member

August 31, 2009, 4:03 pmModeling The P3 Via Pair Frequency Part 3

In Part 2 of this series, we discussed how to get a set of straight selections using the frequencyModel.txt file and looking for missing mailbox numbers preferably having digits below 3. In Part 3 of this series, we will discuss how to use the cache80.txt file to determine a range of mailboxes to play. Very often this will lead to boxed wins, and, on  occasion, a straight win.

To get started, we'll use 200 past draws taken from the Missouri P3 starting from March 18, 2009 and back. Createing a drawsP3.txt file and running mailBox100, with inputs of 000 and 000 for both the lower and upper bonds of the mailboxes, leads to a chache80.txt file, which presents itself as follows:

000    97
001    59
002    30
003    10
004    1
010    90
011    55
012    17
013    8
014    1
020    17
021    13
022    8
023    1
030    9
031    3
050    1
100    100
101    52
102    27
103    4
104    3
110    83
111    57
112    20
113    16
114    2
120    13
121    9
122    6
123    2
130    10
131    12
132    9
150    2
151    2
152    1
200    12
201    11
202    6
203    3
204    1
210    19
211    10
212    11
213    1
214    1
220    2
221    2
222    4
230    1
231    3
232    1
233    1
252    1
300    10
301    8
302    2
303    1
310    4
311    9
312    3
320    1
321    1
322    1
330    3
331    2
332    1
333    1
334    1
351    1
353    1
400    3
410    2
413    1
430    1
432    2
451    1

Notice that all mailbox numbers with digits 0 and 1 have the most contents. It's not until the mailbox numbers start containing digits exceeding 1 that we see a drop in the contents. Look at the range of mailbox numbers 200-201. Both mailboxes containg double digit contents. The mailbox number range 202-204, however shows a drop to single digit contents(so to say the tail of the comet). Let's examine the contents of mailboxes 202-204. To do this, click on the icon mailbox100, and when you are prompted for the lower bound of the mailbox, enter 202(the smaller number). When you are prompted for the upper bound of the mailbox, enter 204. After succussfully entering the mailbox range, you should see the following message:

There were 10 selections.

Enter any key to exit.

After exiting, look for a file allSelections.txt. Open allselections.txt with notepad(or any other text editor) to examine the 10 selections. They are:

024,026,124,129,170,255,755,800,806,850

The next 20 numbers drawn in the Missouri P3 were:

507,771,400,817,261,092,482,417,785,709,345,258,240,678,556,224,557,817,211,624

We were able to snag two boxed hits with these selections.

Let's try another similar play. Look at the mailbox number range 210-212. This range contains double digits contents , and the range that follows, 213-252 has single digit contents. Let's examine the contents of mailboxes 213 to 252 following the same procedure as above. 213 is the lower bound and 252 becomes the upperbound to input to mailBox100. The 17 selections are:

025,029,127,177,250,251,256,259,655,751,754,801,805,851,855,891,895

We snagged two boxed hits with these selections.

One more try. Mailbox 300 contains 10 selections, all the mailboxes that follow contain single digit contents. This is a "long comet" , and with the number of selections involved, we would only profit from a win. Let's see what happens. The range of mailbox numbers are from 301 to 451. The 50 selections are:

220,221,223,224,225,226,227,229,230,231,232,233,234,235,236,237,238,239,270,271,273
274,275,276,277,279,370,371,372,373,374,375,376,377,379,500,503,504,505,506,507,509
780,781,782,783,784,785,787,788

Not too bad. We were able to snag 2 straight hits with these 50 selections.

I know there are many out there who are asking: Just how consistent is this methodology? Let's update the draw file with the last 20 draws and try again. Here's the new cache80.txt file:

000    110
001    60
002    42
003    7
004    4
010    102
011    52
012    18
013    8
014    2
020    22
021    14
022    2
023    5
030    5
031    3
032    2
040    1
051    1
100    89
101    26
102    16
103    6
104    4
110    72
111    45
112    26
113    11
114    5
120    10
121    5
122    6
123    2
130    6
131    2
132    5
140    1
143    1
150    1
151    1
200    20
201    18
202    9
203    2
210    34
211    21
212    8
213    4
214    2
220    2
221    6
222    1
224    1
230    7
231    3
232    2
240    2
241    1
242    2
250    1
251    1
252    3
300    9
301    2
302    2
303    1
304    1
310    8
311    5
312    2
313    1
321    2
322    1
323    1
331    1
332    1
334    1
340    1
350    1
400    2
410    3
413    1
430    1
432    1
441    1
452    1

 

Mailboxes 020-021 are showing the same characteristics as in the previous cycle, and ditto for the mailboxes, 022-051(the tail of the comet), that follow. Let's look at the 19 selections in these mailboxes and see how they did over the next 20 draws. Here are the 19 selections:

280,281,286,289,316,356,396,517,524,537,587,711,721,731,761,791,837,845,917

 

Here are the results of the next 20 draws:

063,361,357,949,823,694,142,998,892,135,353,087,239,517,434,105,657,782,197,138

On this round we were able to catch 3 boxed hits with these selections.

And now for the big question. What about that nice long comet formed by the mailboxes from 212-452? If you run mailBox100(and you should for the practice), you'll get the following 96 selections:

025,029,171,210,211,216,217,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233
234,235,236,237,238,239,240,241,243,246,249,250,251,256,258,259,260,261,266,269,270,271
276,279,370,376,412,417,482,485,487,500,501,502,503,504,505,506,507,508,509,554,557,624
629,751,758,780,781,782,783,784,785,786,787,788,789,804,805,807,809,810,811,812,813,814
815,816,817,818,819,855,857,858

Not too terribly bad. Two straight and 6 boxed hits

In the next and final part of this series, we will examine a methodology for predicting which pairs to play over the next cycle. Practice the methodology described here, and let's discuss your results.

jayemmar

Entry #4
View and Add Comments  (0 Comments)

August 27, 2009, 12:57 pmModeling The P3 Via Pair Frequency Part 2

Before we get started with Part 2 of this series, I have to point out an error in the description of the draw file, drawsP3.txt. This draw file should contain 200 past draws and not 120. Also, in the frequencyModel.txt file, which is output by mailBox100, the day that the winning draw occurred is calculated in error, and I plan to fix this in a future version. Otherwise, everything else is correct to the best of my knowledge.

MAKING SELECTIONS WITH MAILBOX100 USING THE FREQUENCY MODEL FILE

For our example, we'll take the last 200 draws of the CA Daily 3 starting from Aug. 21st and back. After running mailBox using 0 for the upper and lower bounds, we find that mailbox 000 contains 128 numbers between 000 and 999, such that the front, back side, and back pairs have no occurrences over the past 80 draws. As a side remark, mailbox 000 is probably the worst mailbox to play over a 20 day cycle, because it contains to many entries(usually the highest amout of all mailboxes), and, as is the usually case with other mailbox entries, only one winning draw occurs over the 20 day cycle. So how do we determine which mailbox to choose for play over the 20 day cycle. The answer by looking at the past 100 mailbox numbers that provided the winners over the last 5 cycles(100 days).

If you are following with the same set of test data, get the frequecyModel.txt data into a text editor, and select and all of the data, except the header data, to the clipboard. Paste the data into an Excel worksheet starting in column A. The mailbox digits should now start in column B and extend to column D. Select all of the frequency model data by clicking the mouse from cloumn A to column G, and then perform a sort on the mailbox digits (columnns B, C, D) in ascending order. Columns B, C and D should look like the following:

0    0    0
0    0    0
0    0    0
0    0    0
0    0    0
0    0    0
0    0    0
0    0    0
0    0    0
0    0    0
0    0    0
0    0    0
0    0    0
0    0    0
0    0    0
0    0    1
0    0    1
0    0    1
0    0    1
0    0    1
0    0    1
0    0    1
0    0    2
0    0    2
0    0    2
0    0    3
0    1    0
0    1    0
0    1    0
0    1    0
0    1    0
0    1    0
0    1    0
0    1    0
0    1    0
0    1    0
0    1    0
0    1    1
0    1    1
0    1    1
0    1    1
0    1    1
0    1    2
0    1    2
0    1    3
0    2    0
0    2    0
0    2    0
0    2    0
0    2    1
0    3    0
1    0    0
1    0    0
1    0    0
1    0    0
1    0    0
1    0    1
1    0    1
1    0    1
1    1    0
1    1    0
1    1    0
1    1    0
1    1    0
1    1    0
1    1    0
1    1    1
1    1    1
1    1    1
1    1    1
1    1    1
1    1    1
1    1    2
1    1    2
1    2    0
1    2    0
1    2    1
1    3    2
2    0    0
2    0    0
2    0    0
2    0    1
2    0    1
2    0    1
2    0    1
2    0    2
2    0    2
2    1    0
2    1    0
2    1    1
2    1    1
2    1    1
2    1    2
2    1    2
2    1    2
2    1    2
2    2    0
2    2    2
3    0    1
3    1    2

You should immediately notice that, just as in the case of the mailboxes listed in the cache80.txt file, there is also a continuum in the sequence of mailbox numbers. If we were to append the mailbox numbers for the next 5 cycles of play, to this list and do a resort, we would find that the sequencing would become finer, in the sense that less "holes" would be present. Let's have a look at what is missing not going higher that a 3  for any digit. These are the best mailboxes to play, because they contain fewer entries. Our list of missing mailbox numbers looks something like: 022,031, 102, 103, 113, 122, 123, etc.  We would expect to see some of these mailbox numbers appearing over the next 5 cycles of play.

Let's update the draw file with 3 cycles worth of draws and see what happens. After updating drawsP3.txt and saving, run mailBox100 with 0 for the upper and lower bounds, just to get the output files. Our 3 new cycles will correspond to cyles 5, 4, and 3(cycle 5 is always the latest cycle). Here are the mailboxes that had winning entries for these three cycles of play(sorted):

379    0    0    0    115    5    1
574    0    0    0    115    5    2
887    0    0    0    115    5    12
152    0    0    0    115    5    19
030    0    0    0    116    4    17
124    0    0    0    116    4    19
240    0    0    0    128    3    4
920    0    0    0    128    3    7
241    0    0    0    128    3    18
022    0    0    1    62    3    14
143    0    0    1    62    3    17
959    0    0    2    21    4    2  
749    0    1    0    84    5    11
246    0    1    0    70    3    11
693    0    1    0    70    3    13
854    0    1    1    89    5    5  
619    0    1    1    89    5    13
253    0    1    1    89    5    14
869    0    1    1    47    4    12
298    0    1    1    53    3    1  
069    0    1    2    19    5    3  
859    0    1    2    19    5    8  
286    0    1    4    4    3    15
934    0    2    0    34    3    5  
445    0    2    1    10    3    16
322    0    3    1    17    3    19
025    1    0    0    60    5    17
847    1    0    0    60    5    18
948    1    0    0    81    4    6  
323    1    0    0    81    4    9  
844    1    0    0    81    4    14
870    1    0    0    81    4    20
946    1    0    1    37    5    15
620    1    0    1    60    4    3  
204    1    1    1    65    5    9  
920    1    1    1    46    4    5  
692    1    1    1    46    4    11
166    1    1    1    46    4    13
802    1    1    1    50    3    10
869    1    1    2    15    5    4  
967    1    1    2    21    3    6  
308    1    1    3    9    3    2  
190    1    2    0    28    4    7  
299    1    2    0    28    4    18
209    1    2    1    28    5    10
862    1    2    1    28    5    16
833    1    2    1    21    3    8  
345    1    2    1    21    3    20
300    2    0    0    26    5    20
004    2    0    0    31    4    1  
234    2    0    1    15    4    16
454    2    0    1    26    3    9  
766    2    1    1    12    4    4  
111    2    1    2    9    3    12
806    2    1    4    3    5    6  
784    2    2    1    12    3    3  
263    3    0    0    13    4    15
241    3    1    1    10    5    7  
406    3    1    3    1    4    8  
111    3    2    3    1    4    10

Notice that mailbox numbers 031 and 131 now appear, because they contained winning entries. Draw 322 was in mailbox 031 and came out on day 4 of the first cycle of play. In addition there were 17 entries in mailbox 031. Had we played these entries, we would spent 68 dollars to get a 900 dollar win. Draw 308 was in mailbox 113, which contained only 9 entries. It came out on day 18 of the first cycle of play. Had we played these entries, we would have won 900 dollars for a 162 dollar investment.

 

Follow this example very carefully, and create your own examples in the very same way, so you get the feel for making selections using this methodolgy. There are other strategies to consider, and we'll talk about these in the next series.

Just one more tip: Never look for a second winner. Once  the mailbox entries you are playing has shown a hit, take your profit and stop play. It's not to often that you'll find more than one winner in a mailbox, especially mailbox numbers that have higher digits. Also consider using seperate pools when you are playing entries from more than one mailbox.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 











































































 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

























































































































 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 



 

 












 

 

 

 















































































































































































































































































Last Edited: August 27, 2009, 1:58 pm

Entry #3
View and Add Comments  (0 Comments)

August 26, 2009, 1:28 pmModeling The P3 Via Pair Frequency

Hi Everyone:

In this blog I will show you how to model the P3 by way of looking at the frequecies of the right, side and back pairs using a set of 120 past draws. This is a real deep think methodology.

 

First download the program mailBox100.exe into a working directory from the following link:

http://cid-53e66599b04974a6.skydrive.live.com/browse.aspx/MailBox

Next create a text draw file called drawsP3.txt, which should contain the past 120 draws from the P3 lottery you are playing. The past draws file should have the latest draw on top and the oldest draw on bottom. No spaces, or other characters, and only one entry per line.

Play is always over a 20 day cycle, after which the draw file is updated. Before running the program, it's important to discuss what exactly mailBox100 does and the files it creates.

For each of five 20 day cycles, mailBox100 goes back 80 draws and looks at the pair frequencies of those eighty draws. Once the frequecies are created, it assigns a "frequency number" or "mail box number" to the 20 draws above the 80. For example: if 838 was drawn within a cycle of 20 draws and was assigned the mail box number 202, it would mean that based on the pair frequecies of  the 80 draws below the 20 draws, the front pair 83 occured twice , the side pair 88 occurred zero times, and the back pair, 38 occurred twice. It might be well to read this paragraph again if you did not fully understand.

Here's a diagram:

Break down a set of 100 past draws

          20 draws -> assign mailbox numbers to these draws based pair frequecies of bottom 80 draws

          80 draws -> calculate pair frequecies

 

mailBox100 outputs 4 files:

1. frequencyModel.txt

2.  cache80.txt

3. maxFrequecies.txt

4. allMaps.txt

Within the drawsP3.txt, there are five past cycles of play(100 days), which can be analyzed. Below is a sample outputof the first three lines of a sample file:

*********Compsite Frequency Model*********
Draw    Mail Box Number        Cnts    Cycle#    Day
804       2    1    2                     16       5            1
649       0    0    1                     82       5            2
168       1    0    1                     37       5            3

..........................................................................

..........................................................................

 

 

The first entry is 804, which occured on the first day of cycle five(day 20 of the last 20 draws). Its mailbox number is 212, which means that within the 80 draws below this cycle, 80 occured twice, 84 occurred once and 04 occurred twice. The next entry, 16, tells how many other numbers were assigned the mailbox number of 212. From the data line, we can infer that if we had played all 16 such numbers during cycle 5, we would have been rewarded with a win on day one.

The second data line gives a different set of information about the draw 649. It came from mailbox 001, which contained 82 numbers, and the win came on day 2 of the 5th 20 day cycle.

The next file, cache80.txt, gives us information, which will be useful for play over the next 20  day cycle. For the very most recent 80 draws in drawsP3.txt, mailBox calculates the mailBox numbers for all of the numbers from 000-999. Here's a sample of cache80.txt

000    118
001    84
002    41
003     7
010    60
011    52
012    25
013    1
020    32
021    22
022    14
030    1
031    3
100    76
101     39
102   30
110    38
111    29
112    19
120    25
121    26
122    10
130    10
131    11
132    7
200     36
201    27
202     6
203   4
210    24
211    15
212    17
213    3
220    10
221    16
222    16
223    1
230    4
231    4
232    7
300    4
301    3
302    3
311    3
312    1
321    3
322    1
323    2
400    1
403    1
411    2
413    1
420    1
421    1
432    3

Mailbox 301, for example, contains all of the numbers from 000-999 such that, the front pairs occurred three times, the side pairs, occurred zero times, and the back pairs occurred once. There 3 such numbers.

It's important to become familiar with cache80.txt. It has serveral important features. First notice that the mailbox numbers form a continuum. That is, there are very few, if any, "holes" in the sequence numbers. Look at the numbers in bold, for example. It isn't until we start hitting frequencies of 3 and above that the sequencing becomes erratic. For example mailboxes 401 and 402 are missing, and this merely means there were no past draws that could be assigned to these numbers. If we were to see, for example, that the mailbox 102 were missing, it would be very significant, and we'll talk about these situations later on. Also notice that there is always a complete partitioning of the numbers between 000-999 using this methodology. If you add up the all the contents you will get 1000.

Note the file cache80.txt changes with every twenty day cycle!

The next file, allMaps.txt, shows you the mailBox number assigned to each number between 000-999, based on the last 80 draws.

Finally, maxFrequencies.tx is a file that shows you the max and min contents for all of the mailboxes, which were analyzed in the 100 day model.

By now you are probably asking: So how do I find out what numbers are exactly in each mailbox? We could use allMaps.txt, but that's a little too tedious. Running mailBox100 is the answer. So lets get started.

Click on the icon mailBox100.exe. You'll see a prompt asking: Enter a lower bound for the mailbox. What does this exactly mean? The program will not only get the contents from a single mailbox for you, but it will also get the contents from a range of mailbox numbers. For example if you wanted to see all the numbers in mailboxes 101, 102, and 103, for the lower bound you would enter 101. Once you enter the lower bound, you will be prompted for the upper bound. For this prompt you would enter 103. So for now, lets just enter 000 for the lower bound and 000 for the upper bound. If effect were are asking for the contents of mailbox 000.

Once you have entered the upper bound  and lower bound numbers, you should see the total number of entries for the mailbox 000. Enter any key to exit. The entries are written to a file called, allSelections.txt

Once you exit the program all four files should appear in the directory, out of which you are working.

Get a good feel for running the program and look at the frequencyModel.txt file. We'll be discussing this next time. It is the main file we will be working with.

jayemmar

Last Edited: August 26, 2009, 4:47 pm

Entry #2
View and Add Comments  (5 Comments)

March 19, 2009, 3:06 pmC code For Generating Key Numbers For The P3

Hello:

 

A few members have asked me for the code I used to create keyNumberFinderP3.

Todd suggested pasting it into a blog, and I'm going to do this here.

First a few requirements:

1. This code is ANSI C and should be compiled into a console executable.

2. Copy the code, which starts below the asterisks, into your compiler's editor and save as keyNumberFinderP3.c

3. Once the code has been compiled into an executable move it to a working directory, where you'll have to also create a text draw file consisting of 20 past draws. One draw on a line, no spaces or delimiters. Latest draw first and oldest draw last. This file should be called drawsP3.txt

4. To run the program click on the keyNumberFinderP3.exe icon. You'll see the results come up in a  DOS window.

5. keyNumberFinderP3.exe may generate more than one set of key numbers. In such a case, pick one set of 4 and stay with that set.

6. Key numbers are only good for 5 days. After 5 days, update drawsP3.txt. Don't worry about having more than 20 draws in the past draw file, the program only looks at the latest 20. 

Good luck and please share your results and methods.

jayemmar

*****************************************************************************

#include <math.h>
#include <stdlib.h>
#include <stdio.h>

int main()
{
int i, j,  temp1, temp2, temp3, temp4, a1, a2, a3, a4, a;
int drawCount, hit, results;
FILE *in;
int drawArray[20];

int arrayOfFours[210] =
{123,124,125,126,127,128,129,134,135,136,137,138,139,
145,146,147,148,149,156,157,158,159,167,168,169,178,
179,189,234,235,236,237,238,239,245,246,247,248,249,
256,257,258,259,267,268,269,278,279,289,345,346,347,
348,349,356,357,358,359,367,368,369,378,379,389,456,
457,458,459,467,468,469,478,479,489,567,568,569,578,
579,589,678,679,689,789,1234,1235,1236,1237,1238,1239,1245,
1246,1247,1248,1249,1256,1257,1258,1259,1267,1268,1269,1278,1279,
1289,1345,1346,1347,1348,1349,1356,1357,1358,1359,1367,1368,1369,
1378,1379,1389,1456,1457,1458,1459,1467,1468,1469,1478,1479,1489,
1567,1568,1569,1578,1579,1589,1678,1679,1689,1789,2345,2346,2347,
2348,2349,2356,2357,2358,2359,2367,2368,2369,2378,2379,2389,2456,
2457,2458,2459,2467,2468,2469,2478,2479,2489,2567,2568,2569,2578,
2579,2589,2678,2679,2689,2789,3456,3457,3458,3459,3467,3468,3469,
3478,3479,3489,3567,3568,3569,3578,3579,3589,3678,3679,3689,3789,
4567,4568,4569,4578,4579,4589,4678,4679,4689,4789,5678,5679,5689,
5789,6789};


      /*
      **Open files
      */
       in = fopen("drawsP3.txt", "r");
       if(in == NULL)
       {
          printf("error in opening drawsP3.txt\n");
          getch();
          exit(0); 
       }



       /*
       ** Get the past 20 draws into memory and then
       ** loop through the first 20 draws and see if
       ** there's a key number set for these draws
       */
       i = 0;
       while(!feof(in) && i < 20)
       {
           fscanf(in, "%d", &a);
           drawArray[i] = a;
           i++;
           drawCount++;           
       }
       drawCount = i;

       results = 0; 
start:     
       for(i = 0; i < 210; i++)
       {     hit = 0;
             /*
             ** Peel off the digits from the key number set
             */
             temp1 = arrayOfFours[i]/1000;
             temp2 = (arrayOfFours[i] - 1000*temp1)/100;
             temp3=  (arrayOfFours[i] - 1000*temp1 - 100*temp2)/10;
             temp4 = (arrayOfFours[i] - 1000*temp1 - 100*temp2 - 10*temp3);

             for(j = 0; j < drawCount; j++)
             {
                /*
                ** Peel off the digits from this draw
                */ 
                a = drawArray[j];           
                a1 = a/100;
                a2 = (a - 100*a1)/10;
                a3=  (a - 100*a1 - 10*a2);
               
                /*
                ** Check to see if at least one digit matches one
                ** in the key set
                */
               
                if((a1 == temp1 || a1 == temp2 || a1 == temp3 || a1 == temp4)
                  ||(a2 == temp1 || a2 == temp2 || a2 == temp3 || a2 == temp4)
                  ||(a3 == temp1 || a3 == temp2 || a3 == temp3 || a3 == temp4))
               {
                  /*
                  ** Bump the match count when a match occurs
                  */
                  hit++;
               }   
                           
             }
           
             
             /*
             ** If the at least one number
             ** in the key number set matched
             ** for all draws, print out the key number set
             */
             if(hit == drawCount)
             {
                printf("Key Number Set -> %i-%i-%i-%i\n",
                        temp1,  temp2, temp3, temp4);
                       
                /*
                ** Signal that a key number set was found
                */ 
                results = 1;
             }
               
                 

       } 


       /*
       ** If no key number set was found, drop the last draw
       ** and search again
       */
       if(results == 0)
       {
            drawCount = drawCount - 1;
            goto start;
       }

       /*
       ** Tell the user how many reductions it took
       ** to find a key number set.
       */
       printf("Final draw count used to find key number set was %i\n", drawCount);
       printf("Enter any key to exit\n");
       getch();
     
       close(in);


}

Last Edited: March 19, 2009, 3:33 pm

Entry #1
View and Add Comments  (7 Comments)