Markov Chains

doug_w

Member
Thanks Frank Appreciate All Your Time And Effort

Frank said:
Well the problem here Doug, is that there are markov chains and there are lotteries. As you probably discovered, the Markov process is a mathematical matrix method of calculating probabilites where there is some cause and effect between a starting condition and the next thing to happen. Any course on Markov will talk you through tree diagrams of probabilites and then put the figures into Matrices. If you have not done Matrix calculations before it can get a bit heavy.

However I'm not calculating the probability that if a number six is drawn today what is the probability that number 14 will be drawn next time ?. Lotteries are random so there is no actual relationship between a ball drawn today and a ball drawn tomorrow. That complicated mathematics would be pointless.

If you want to learn it, be my guest :- http://techeffigytutorials.blogspot.co.uk/2015/01/markov-chains-explained.html

And there are lots of Youtube videos which would talk you through it, but they will not be talking about lotteries, so what's the point ?

All you need to read are the first six lines on the page I just linked to, in fact I will quote them here:-

Markov Chains is a probabilistic process, that relies on the current state to predict the next state. For Markov chains to be effective the current state has to be dependent on the previous state in some way; For instance, from experience we know that if it looks cloudy outside, the next state we expect is rain. We can also say that when the rain starts to subside into cloudiness, the next state will most likely be sunny. Not every process has the Markov Property, such as the Lottery, this weeks winning numbers have no dependence to the previous weeks winning numbers.

Bearing in mind the above, one can still ask the question " which ball(s) were drawn the most in the past which followed named ball (n) ?

That's all my programme does. It answers that question. I does not work out probabilities, but there just might be a physical reason why balls 12,17,27,44 follow ball number 15 the most over the past 600 daws. You dont need maths to count them, you need a computer. If you think there is a reason for this result you can use that information to your advantage. That's all I'm doing Doug. Its not actual Markov, its it's cousin. :)


I just wanted to get an insight into how you decided to go down this route. I really like what you have done, hope you don't mind if I translate what you have done into my Visual Basic program. Which when finished and working to acceptable criteria, will gladly send you a copy.
 

Frank

Member
You go ahead Doug, the concept is quite simple, the macros are already in the public domain. Good luck!
 

bloubul

Member
Hi All

I'm glad I could spark some renewed interest in Markov Chain.
It may be worthwhile to explore in depth.


BlouBul :cool:
 

jmcl

Member
Hi Frank and everybody

I have been reading a lot on the forum since joining up and a big thanks to all of you guys for the information that is available.

Frank, I am giving the spreadsheet a go, going for 74 years of age, this will be a big achievement for me personally. Thanking you.

John from Durban
 

doug_w

Member
jmcl said:
Hi Frank and everybody

I have been reading a lot on the forum since joining up and a big thanks to all of you guys for the information that is available.

Frank, I am giving the spreadsheet a go, going for 74 years of age, this will be a big achievement for me personally. Thanking you.

John from Durban


Never told old John to learn new tricks. Good on you for giving it a go.
 

jmcl

Member
Up and running

My (Frank's) system is up and running and a big thanks for a well explained

set of rules which were supplied by Frank. In post 34 for there is a change for

cell A2. Is this necessary or can I stay with the original info?

Thanks :lphant: :lphant:

John
 

Frank

Member
Yes, although the original formula is OK, it assumes a full set of results with none missing, so it asumes that the highest draw number is the number of draws in the table. This is incorrect if there are some draws missing from the table, so we need to actually count how many there are. Thats why I changed the formula in

cell A2 to =COUNTIF(A5:A10000,">0")

The 10000 assumes that no lottery will have more than that many draws in it. From experience looking back over more than 1000 draws will give too many results anyway to be of use. So please change the formula.

Well done for making it work ! :clap:
 

jmcl

Member
Hi Frank and almost done but I have struck a problem, please help.

I get a run time error 1004: Method 'Range' of object'_Global failed

Then this happens:
Sub CreateVariableMaxList()
Dim i, j, count As Integer
Dim maxima(49, 49) As Integer 'the balls which are equal to the max in the column
Dim flag, Top3, top2, errorflag As Boolean
flag = False
Top3 = False
top2 = False
errorflag = False

If Range("choice1").Value = 1 Then Top3 = True
If Range("choice1").Value = 2 Then top2 = True

When debugging the line in red appears and I don't know how to fix or look for the problem?

Is it possible please and thanks

John
 

jmcl

Member
Sorry but ignore my previous post but all of a sudden I spell choice with a dubbel 'o' and my spreadsheet is up and running with a very big thanks to Frank for his patience with us

John :smash:
 

Frank

Member
I'm glad you spotted it, John I was going to suggest it was about the named range, but you beat me to it. :thumb:
 

Icewynd

Member
First, I would like to express my thanks to Frank for sharing his wonderful spreadsheet and for incorporating quite a bit of learning about Excel macros in the process. My spreadsheet is up and running fine, thanks to your excellent explanations.

Second, way back at the beginning of this thread, there was some talk about "show me yours and I'll show you mine". Well, Frank has shown us his work, so I guess it is up to me to post my effort at the Markov Chain as applied to the lottery.

I have taken a different approach to the problem, looking for followers by position. So, if a 5 hits in the first position, what is the next most likely number or range of numbers?

The spreadsheet will calculate the percentage of times that each number followed the current number in that position, and also provides a summary of which ranges of 5 numbers are most likely to follow a given number. Finally, it calculates the percentage of followers that are higher, lower or the same as the current number.

Thanks to larbec for some help with the formulas in this sheet.

https://www.mediafire.com/?mauv8wjwcb8iw29


Hope this helps someone with their analysis.

Good Luck!
:thumb:
 

Icewynd

Member
"Markov Chains is a probabilistic process, that relies on the current state to predict the next state. For Markov chains to be effective the current state has to be dependent on the previous state in some way; For instance, from experience we know that if it looks cloudy outside, the next state we expect is rain. We can also say that when the rain starts to subside into cloudiness, the next state will most likely be sunny. Not every process has the Markov Property, such as the Lottery, this weeks winning numbers have no dependence to the previous weeks winning numbers."


I don't entirely agree with the statement that you quoted, Frank. While it is true that we cannot predict with a high degree of accuracy a number that will follow the current set of numbers, I think we can be much more accurate in terms of tendencies.

For example, instead of 3 cloudy days, imagine that we have just had 3 successive lottery draws in which the lowest number drawn was 15. I think we can certainly expect that the next condition is one which includes some of the numbers from 1-14.

Indeed, this is where my spreadsheet is most successful. By reporting on the percentages of followers that are higher/same/lower than the current result by position, it gives some clues as to which direction to start your search for the next numbers.

Good Luck!
:thumb:
 

Sidebar

Top