I have a data set which looks like this:! http://i.imgur.com/vrDpuQ5.png
There are about 10000 entries in total the Outcomes(EventId#) can be either $1,2,3,\ldots,18,19$ so from 1-19.
Although it is highly debatable if the events are independent, let's assume for simplicity's sake that they are for now. The reality is that for the smaller EventId's (1,2,3) are more likely to occur after each other and especially after EventId 19. Then again, let's ignore this for now.
I am looking specifically for what methodology/formula/principles would allow me to calculate the probability of EventID/Number $n$ to occur between two numbers $x_1$ and $x_2$. Or as can be seen in the first picture of the data set, the probability of the EventId/Number "17" occuring betwen two number/EventId "18". The amount of numbers between $x_1$ and $x_2$ and whether they are located before or after the number $n$, is irrelevant to us, as long as they do not exceed the numbers $n$ and $x_1$ and $x_2$.
So throughout the entire data set we are looking for the probability of events / subseries(?) like these:
So how would I approach solving this problem. What is the solution I am looking for?
I have tried looking at almost everything the internet would offer me as a solution, cumulative distribution functions, empirical distribution functions, multivariate distribution, exponential distribution, etc., but from my understanding is that most of these things really just deal with a number/EventID occurring that is between number $x_1$ and Number $x_2$. Which is fine but it doesn't necessarily deal with for example: EventId 18 happening, and then waiting until EventId 17 happens and then waiting again until we have EventId 18. The same obviously could apply to EventId 5 happening then waiting for EventId 10 and then waiting for EventId 15 all the while not allowing any numbers/EventId in between to be higher than 10 and 15.
Now assuming I can have / expand this data set into a much much larger data set and I have much more data available, sooner or later the obvious logical conclusion is in fact that EventId 1 2 and 3 tend to follow EventId 19 and 18 more often than for the other EventId's.
But I would have to do more analysis on this using Markov chains or some other tool I assume which is why I said for the moment being, let's just assume that the EventId's are independent and random.
So yeah, I'm pretty much stuck, if anyone has an idea how to approach this problem then I'd appreciate it, quite a lot.