# Thread: Program about probability/statictics for gammblers

1. ## Program about probability/statictics for gammblers

Hi to all thinkers out there

I don't speak english very well, so please be patient while I explain this. This is more like an exercise for me to clear my mind, but if someone suggest something, he/she is welcome.

I'm trying to make a program in C, for gammblers.
It is some kind of lottery, this is how it works:

You pick a number from 0000 to 9999, and fill your ticket with that number. Now there are a few ways to play:

1. You win if exactly the number you picked, appears as the winning number.

2. You win if any permutacion of the digits you picked appears in the winning number (e.g. I chose 1234 and I win if the winning number is 4321 or 2143, etc..). Of course you will eran less money.

3. You can chose a number that could have 1 digit repeated (e.g. 1134, 2234, etc..) and you will win if any permutacion of the digits appears in the winning number.

4. You can play to guess the final digit, the final pair of digits, the first digit, or the first two digits of the number.

So, please tell me if I'm right.
I have all the numbers that have been appearing since 1996.
So, I can calculate wich numbers are likely to show up in the next event by looking at the statistics. I say that a digit is likely to show up if the statictics says that this digit has shown up less than other.

if the digit '1' has appeared 80 times and the digit '2' has appeared 100 times, is more likely that the digit '1' shows up in the next event.

I'm building the whole program with this principle.

If someone is interested in helping me and exchange code via the Net, I will be very pleased, but not just that, I could send some of the money I earn with this program, to you, honestly.

Please, reply to this thread or write me at guglezi@hotmail.com, One more time, I'm serious about this, and you couldn't find someone else more honest than me.

Have a good day.

2. I worked at a casino for 3years.

One thing I learnt is 'follow the runs, don't bet against them'. They will end soon enough.

>>I say that a digit is likely to show up if the statictics says that this digit has shown up less than other.

In my opinion this is flawed. I would consider the opposite to be true. The more offen a digit is drawn the more likely it will be drawn again.

We have a similar game here. I always wondered if some of the balls had a better chance of being drawn (due to construction ect).

Do it both ways, and test the results.

I write UI (user interfaces) in Windows (WIN32 API), so post here or the Windows Programming board if you need help.
Good Luck. (if it works and you make a million send me a copy)

3. if the digit '1' has appeared 80 times and the digit '2' has appeared 100 times, is more likely that the digit '1' shows up in the next event.
In a system where you have only two possible results, for instance flipping a coin - for every time you flip the coin there is always a 50% chance of guessing the side the coin will fall on. (Excluding any external influences such as oddly shaped coins or a bad flip).

Even if one particular side continually lands face up, it does not increase the chances of it landing the same way on the following throw, it will still have a 50% chance of landing either way.

This logic (i believe) also applies to the system that you have proposed here. For every one of the four positions in the number (0000 - 9999) you have a one in 10 chance of selecting the correct number (in each of the four slots), and a one in 10000 chance to correctly guess an entirely unique four digit number in this range. These odds don't change the next time you come to select the next four individual numbers.

I would say that even if a particular combination of numbers appeared more regularly - the actual statistical chances of picking the right number don't change and any apparent patterns won't continue to be born out over a significantly large enough series of tests.

...unless the random function used to generate the number isn't as random as first thought which is possible I suppose.

If any statisticians are reading this could you correct me - because I am very interested in this myself from the point of view of programming an RPG - for fighting/random drop/magic systems etc.

4. We don't know where the numbers come from.

Say you have a machine that drops a number from 0 to 9.
If you see in your statistics that the numbers have appeared as follows:

number times

0 90
1 100
2 75
3 120
4 80
5 72
6 115
7 92
8 82
9 105

...then, isn't it correct to think that number 5 (which has shown up less) is more likely to show up to keep a certain equilibrium?

(sorry if the word equilibrium is not english, but I know you will understand me.)

5. No actually. The reason that statistics tend to 'hit equilibrium' after enough tries is more about the fact that as you sample more, then previously significant seeming statistics lose their weight. For example, in the following numbers...

0 90
1 100
2 75
3 120
4 80
5 72
6 115
7 92
8 82
9 105

5 occours 7.7% of the time, while we expect it to occour 10%.
Now, if we run it 1000 more times, expecting an even distribution, then we will have had 172 5s, which amounts to it occouring 8.9% of the time. So, byhaving more runs, we have statistics that more accurately predict the system's behavior, without the new numbers actually favoring the previous losers.

In such a situation, what you really need to be doing is trying to decide whether or not the statistics indicate that the game is loaded.

For example, if I flip a coin 200 times, and it turns up heads 114 times and tails 86 times, then I can confidently say that the coin is clearly biased towards heads (or to be more specific, if the coin is fair, then the odds of something like this turning up are less than 5%), so I would proceed to place my bets on heads.

Basically, you use the history to determine what the true probabilities for each value are. And you use this guess of what the true probability is to decide what values to choose. You want to pick values that have won in the past.

6. >>For example, if I flip a coin 200 times, and it turns up heads 114 times and tails 86 times,

Isn't that what chi square is for? Determining if the probability is within normal ranges. eg within three standard deviations.

In a perfect system previous results have no bearing on future results. We live in an imperfect world however where manufacturing and even a coat of paint may affect the results.

In my practical experience no coin, die or roulette wheel is perfect. They all have some bias. This is carefully controlled at a casino so no one can find the deviation (since the guy broke the bank at Monte Carlo proving it). To minimise this coins, die and wheels are changed / balanced very regularly, if not daily.

In your program why not 'suggest' both. The numbers that come up more often and those that are 'due'. Both require the same type of processing, just at opposite ends of the scale.

PS these type of programs are comercially available here for both 'lotto' and horse racing.

7. Oh well, we'll never now why things happen.

I think, that in a perfect system, running it infinite times, I would have the same 'heads' and 'tails' at the end.
As someone says above, we don't live in a perfect world, and we don't know what 'mistakes' this machines may have, so is useless a program like this.

But, have you ever think about the mathematical reason of why things happen in a certain way? Have you read Stephen Hawking? He says 'If we know the behaivor of the Universe, I mean if we know how it works, we can predict anything'

Thanks for your help, have a nice day.

Popular pages Recent additions