Welcome Guest
You last visited May 24, 2017, 1:50 pm
All times shown are
Eastern Time (GMT-5:00)

# In need of a bayesian

Topic closed. 25 replies. Last post 7 years ago by RL-RANDOMLOGIC.

 Page 1 of 2

United States
Member #59354
March 13, 2008
4301 Posts
Offline
 Posted: June 9, 2010, 3:26 pm - IP Logged

Help!

My software uses a spin off of Bayes' theorem to predict the next

best choice within a lottery draw.  The system that I now use worked

fine until the last couple months when it became much less able to

predict with any certainly. "Averages less than 50% when given only

two choices." I was digging out some old code and came across a much

earlier attempt that I was never able to complete. Any help would be

appreciated.

Example.

lets say that I have three filters labeled A,B,C. The sum of the

values taken from A+B+C can never go above or below five.

In 635 drawings observed, this is the outcome for each.

A Contains 20 numbers
A never appeared in 16 of the draws
A appeared 1 time in 73 of the draws
A appeared 2 times in 201 of the draws
A appeared 3 times in 205 of the draws
A appeared 4 times in 124 of the draws
A appeared 5 times in 16 of the draws

B Contains 9 numbers
B never appeared in 162 of the draws
B appeared 1 time in 278 of the draws
B appeared 2 times in 159 of the draws
B appeared 3 times in 30 of the draws
B appeared 4 times in 6 of the draws
B appeared 5 times in 0 of the draws

C Contains 10 numbers
C never appeared in 133 of the draws
C appeared 1 time in 267 of the draws
C appeared 2 times in 178 of the draws
C appeared 3 times in 52 of the draws
C appeared 4 times in 5 of the draws
C appeared 5 times in 0 of the draws

P(A)
P(B)
P(C)

P(A|B)
P(A|C)

P(B|A)
P(B|C)

P(C|A)
P(C|B)

P(A|(B+C))
P(B|(A+C))
P(C|(A+B))

and so on ......

remember the total values taken from A, B, and C must =5

lets say that I have already drawn x number of unfiltered
sets to play.

First I select the top 3 or 4 highest hitting values from each
of A, B, and C and set them as hi / low ranges. This has
little effect in reducing the sets as most drawings fall within
this range. Narrowing the hi/low reduces sets but also reduces
winners.

The Bayes filter process.

I pull the first set of numbers from my list of unfiltered sets.
from this I select the first number and find that it comes from
(C) which contains only 10 numbers. Next the (P's) are recalculated
removing the number from (C). I repeat the process for the second
number. I then begin a simple second process to determine if the
numbers within the set are following my data. In the 3rd and 4th
number processed the decision is made if the set should be rejected,
Then the 5th number is processed and the set is given a second chance

To put simply, this process updates with each number and relies on
past observations for the most probable A,B or C selection, if it
fails to follow this path past the 3rd and 4th number it is rejected.

The above P(A|B) is quite simple but with all the recalculating in the
many steps it becomes very complicated as each new data is used with
the old.

Is this worth the effort to try again or is it a pipedream. Someone
must have tried this or something similar before.

Thanks
RL

....

United States
Member #59354
March 13, 2008
4301 Posts
Offline
 Posted: June 9, 2010, 4:14 pm - IP Logged

I have another one just for fun.

Three Gunfighters are standing in the street ready for a three way shootout

gunfighter #1, age 50. is a dead shot and the fastest of the three. he has 10 kills

gunfighter #2, age 40. is the slowest of the three but the best shot . he has 15 kills

gunfighter #3,  age 18, is fast but not as good of shot as 1 or 2, he has 6 kills

You are gunfighter #1,  who would aim at. both 2 and 3 are aiming at you. scroll way down for my answer

I would point my gun at myself and hope they were Dumb and gullible enough to think that I was no longer

a treat, then draw on each other. I would only have to make one well placed shot.

HAAA!

Think about it and use bayes and find a solution.

....

United States
Member #59354
March 13, 2008
4301 Posts
Offline
 Posted: June 9, 2010, 4:37 pm - IP Logged

Once one has considered all the possibilites one must still consider the possibility that one or more

of the possibilites has been overlooked.

RL

....

NASHVILLE, TENN
United States
Member #33372
February 20, 2006
1044 Posts
Offline
 Posted: June 9, 2010, 8:54 pm - IP Logged

I don't understand where you are getting your values "that can never go above or below five".  Please elaborate.

United States
Member #59354
March 13, 2008
4301 Posts
Offline
 Posted: June 9, 2010, 9:26 pm - IP Logged

I don't understand where you are getting your values "that can never go above or below five".  Please elaborate.

GASMETERGUY

In the example A, B and C are strings of numbers,  one has 20 numbers 1 has 10 and the other has 9

only 5 total numbers are drawn as it is a 5-39 lottery.  So lets say 3 came from A and 1 came from B

and 1 came from C.  3+1+1 = 5 since only 5 numbers are drawn no matter which string they are from

the total will always be 5.

RL

....

New Jersey
United States
Member #17843
June 28, 2005
58123 Posts
Offline
 Posted: June 10, 2010, 11:28 am - IP Logged

Gunfighters 1, 2, 3 are Dead: Quigley Left Standing!

A mind once stretched by a new idea never returns to its original dimensions!

Way back up in them dadgum hills, son!
United States
Member #73904
April 28, 2009
14903 Posts
Offline
 Posted: June 10, 2010, 12:10 pm - IP Logged

Gunfighters 1, 2, 3 are Dead: Quigley Left Standing!

Sharps 1874, love to have one of them. You can get the identical gun he used for about 2K. Great movie too.

"The only thing necessary for evil to triumph is for good men to do nothing"

--Edmund Burke

United States
Member #59354
March 13, 2008
4301 Posts
Offline
 Posted: June 10, 2010, 2:46 pm - IP Logged

Help!

My software uses a spin off of Bayes' theorem to predict the next

best choice within a lottery draw.  The system that I now use worked

fine until the last couple months when it became much less able to

predict with any certainly. "Averages less than 50% when given only

two choices." I was digging out some old code and came across a much

earlier attempt that I was never able to complete. Any help would be

appreciated.

Example.

lets say that I have three filters labeled A,B,C. The sum of the

values taken from A+B+C can never go above or below five.

In 635 drawings observed, this is the outcome for each.

A Contains 20 numbers
A never appeared in 16 of the draws
A appeared 1 time in 73 of the draws
A appeared 2 times in 201 of the draws
A appeared 3 times in 205 of the draws
A appeared 4 times in 124 of the draws
A appeared 5 times in 16 of the draws

B Contains 9 numbers
B never appeared in 162 of the draws
B appeared 1 time in 278 of the draws
B appeared 2 times in 159 of the draws
B appeared 3 times in 30 of the draws
B appeared 4 times in 6 of the draws
B appeared 5 times in 0 of the draws

C Contains 10 numbers
C never appeared in 133 of the draws
C appeared 1 time in 267 of the draws
C appeared 2 times in 178 of the draws
C appeared 3 times in 52 of the draws
C appeared 4 times in 5 of the draws
C appeared 5 times in 0 of the draws

P(A)
P(B)
P(C)

P(A|B)
P(A|C)

P(B|A)
P(B|C)

P(C|A)
P(C|B)

P(A|(B+C))
P(B|(A+C))
P(C|(A+B))

and so on ......

remember the total values taken from A, B, and C must =5

lets say that I have already drawn x number of unfiltered
sets to play.

First I select the top 3 or 4 highest hitting values from each
of A, B, and C and set them as hi / low ranges. This has
little effect in reducing the sets as most drawings fall within
this range. Narrowing the hi/low reduces sets but also reduces
winners.

The Bayes filter process.

I pull the first set of numbers from my list of unfiltered sets.
from this I select the first number and find that it comes from
(C) which contains only 10 numbers. Next the (P's) are recalculated
removing the number from (C). I repeat the process for the second
number. I then begin a simple second process to determine if the
numbers within the set are following my data. In the 3rd and 4th
number processed the decision is made if the set should be rejected,
Then the 5th number is processed and the set is given a second chance

To put simply, this process updates with each number and relies on
past observations for the most probable A,B or C selection, if it
fails to follow this path past the 3rd and 4th number it is rejected.

The above P(A|B) is quite simple but with all the recalculating in the
many steps it becomes very complicated as each new data is used with
the old.

Is this worth the effort to try again or is it a pipedream. Someone
must have tried this or something similar before.

Thanks
RL

Another attemp to explain

5-39 lottery

5 balls are drawn of 39 possible

first the probability for each of the 5 draw numbers is calculated "no history"

5 in 39    1st number drawn

4 in 38

3 in 37

2 in 36

1 in 35   5th number drawn

next using past draw history the probability for each of the 39 balls to hit in the next draw is calculated

next the balls are sorted into 3 strings of numbers

string A=20  "all mixed digit numbers like "09-18-23....." numbers formed of one odd and one even digit

string C=9  "all double even digit numbers "02-04-22....." numbers formed of two even digits

string C=10   "all double odd digit numbers 11-19-35....." numbers formed of two odd digits

A never appeared in 16 of the draws
A appeared 1 time in 73 of the draws
A appeared 2 times in 201 of the draws
A appeared 3 times in 205 of the draws
A appeared 4 times in 124 of the draws
A appeared 5 times in 16 of the draws

B Contains 9 numbers
B never appeared in 133 of the draws
B appeared 1 time in 267 of the draws
B appeared 2 times in 178 of the draws
B appeared 3 times in 52 of the draws
B appeared 4 times in 5 of the draws
B appeared 5 times in 0 of the draws

C Contains 10 numbers
C never appeared in 162 of the draws
C appeared 1 time in 278 of the draws
C appeared 2 times in 159 of the draws
C appeared 3 times in 30 of the draws
C appeared 4 times in 6 of the draws
C appeared 5 times in 0 of the draws

next the probabilities that the 1st number would come from A or B or C

next the probabilities that the 2nd number would come from A or B or C  given 1st

next the probabilities that the 3rd number would come from A or B or C   given 1st and 2nd

next the probabilities that the 4th number would come from A or B or C   given 1st, 2nd and  3rd

next the probabilities that the 5th number would come from A or B or C   given 1st, 2nd, 3rd and  4th

The Filter

I select the first set of 5 numbers from my playlist

I take the 1st number from the set and using the information from above, predict which string

the 2nd number will most probable come from,

I take the 2nd number from the set and using the information from above, predict which string

the 3rd number will most probable come from.

I take the 3nd number from the set and using the information from above, predict which string

the 4th number will most probable come from.

I take the 4th number from the set and using the information from above, predict which string

the 5th number will most probable come from.

I take the 5th number from the set and using all information, accept or reject the set

If you think about this you will find it "spider-webs" and begins to look a little like a nerual network

as many of the (P)'s change with every step. I did not include any of the feedback steps as this would

really make it hard to understand.  I avoided using bayesian terminology in this post.  reply

as needed.

RL

....

United States
Member #59354
March 13, 2008
4301 Posts
Offline
 Posted: June 10, 2010, 8:11 pm - IP Logged

Gunfighters 1, 2, 3 are Dead: Quigley Left Standing!

Raven62

I like the way you think out side the box.

RL

....

United States
Member #59354
March 13, 2008
4301 Posts
Offline
 Posted: June 10, 2010, 8:19 pm - IP Logged

Sharps 1874, love to have one of them. You can get the identical gun he used for about 2K. Great movie too.

Ridge runner

My family roots are in Tennessee.  My other half is ont of them trere McCoys, he he.  My grandad was

a real moon shiner in SW MO. So I got a little ridge runner in me too.

RL

....

Pennsylvania
United States
Member #2218
September 1, 2003
5475 Posts
Offline
 Posted: June 11, 2010, 8:37 am - IP Logged

GASMETERGUY

In the example A, B and C are strings of numbers,  one has 20 numbers 1 has 10 and the other has 9

only 5 total numbers are drawn as it is a 5-39 lottery.  So lets say 3 came from A and 1 came from B

and 1 came from C.  3+1+1 = 5 since only 5 numbers are drawn no matter which string they are from

the total will always be 5.

RL

RL,

Question?

A = String of 20 Numbers.  Would this equate to over 68 billion string combinations for a 39/5 game?  =combin(39,20)

B = String of 9 Numbers.   Would this equate to over 211 million string combinations for a 39/5 game? =combin(39,9)

C = String of 10 Numbers.   Would this equate to over 635 million string combinations for a 39/5 game? =combin(39,10)

New Jersey
United States
Member #17843
June 28, 2005
58123 Posts
Offline
 Posted: June 11, 2010, 10:01 am - IP Logged

RL,

What sample size do you use in your software?

A mind once stretched by a new idea never returns to its original dimensions!

United States
Member #59354
March 13, 2008
4301 Posts
Offline
 Posted: June 11, 2010, 10:20 am - IP Logged

RL,

Question?

A = String of 20 Numbers.  Would this equate to over 68 billion string combinations for a 39/5 game?  =combin(39,20)

B = String of 9 Numbers.   Would this equate to over 211 million string combinations for a 39/5 game? =combin(39,9)

C = String of 10 Numbers.   Would this equate to over 635 million string combinations for a 39/5 game? =combin(39,10)

winsomeloosesum

If using nPr then maybe as I don't know just how you are calculating.  Let me Try again as I may be running in tiggs mode again.

Lets say that you have three buckets and in one you place 20 of the numbered balls. in the second you

place 10 balls and the third you place 9 balls.  I then calculate the (P) for each bucket as to how many

numbers should come from each in any given drawing.

Next I take the first number from my set. Lets say it is the numberl 23.  I then look in each bucket and note

which bucket contains this number. lets say again that it is bucket #1 as bucket #1 contains only balls with

numbers that are made up of 1-odd digit and 1-even digit.  Number 23 has one even digit (2) and one odd

digit (3). All numbers in bucket #1 have this in common.

Say again that I have tracked for each drawing how many numbers come from each bucket for any given

drawing.

I find that  many drawings will have three numbers from bucket #1 and one each from #2 and #3.

Since number 23 cannot be drawn twice within one draw, I remove it and then recalculate the (P's) as

a 4 of 38 game with bucket #1 now having only 19 balls.

I then take the second number from my list and repeat the process.

Next using bayes I calculate which bucket should contain the next number in my set given the first two

findings.  Here is where I begin having trouble as I now have three sets of (P"s) one for a 5 of 39

"without history" one with 5 of 39 with history and one 4 of 38 based on this process. This is repeated

for all five numbers in the set that I am trying to filter.  As you can see by the 5th number I have many

sets of (P) that have to be used for the final "accept or reject".  I could use a simple hi/ low range type

filter, like 2 or 3 from the first bucket, 0 to 1 for the second bucket and say 0 to 2 for the third based on

what has most often using the draw history.

Bayes however allows me to see how closely the set matches or mimics the draw from history and then

accept or reject the set based on another formula.

I may not need this any more because I got another idea as to what is wrong with my current system.

I modify / add new code on a weekly basis and might have two seperate variables sharing the same name.

This would account for the sudden drop.

I would like to complete this work just to know how well it could predict not just for this example but

for any filter, digit or number selection.  My current use of bayes is very similar but does not contain this

type of feedback process.

RL

....

United States
Member #59354
March 13, 2008
4301 Posts
Offline
 Posted: June 11, 2010, 10:30 am - IP Logged

RL,

What sample size do you use in your software?

Raven62

Most of the time all of them from the current matrix around 650 +/-  but this can be adjusted as needed

RL

....

New Jersey
United States
Member #17843
June 28, 2005
58123 Posts
Offline
 Posted: June 11, 2010, 11:06 am - IP Logged

RL,

Over the life of the Game things change: Ball Sets, Machines, etc.

A smaller draw sample may be necessary to make the output of your Software closer to actual drawing results.

A mind once stretched by a new idea never returns to its original dimensions!

 Page 1 of 2