blockdamofo

### Author Topic: The same number twice in a row  (Read 14937 times)

0 Members and 1 Guest are viewing this topic.

#### Jay

• Guest ##### The same number twice in a row
« on: December 05, 2015, 10:01:43 PM »
For a European roulette wheel (with numbers 0 thru 36), how many times should I see numbers come up twice in a row, for say 1,000 spins? I'm trying to come up with the probabilities, but am having a hard time.

#### Reyth

• Global Moderator
• Hero Member
•     • • Posts: 4373
• Thanked: 1666 times ##### Re: The same number twice in a row
« Reply #1 on: December 05, 2015, 10:05:32 PM »
Well, although I don't yet have an answer for you, I am wondering about what kind of answer you want because when you say, "how many times should I see", there will be expected minimum occurrences & expected maximum occurrences and everything in between will be variance.

I can work up a quick simulation that will track both these extremes.  Would that help?

#### Jay

• Guest ##### Re: The same number twice in a row
« Reply #2 on: December 05, 2015, 10:08:31 PM »
Yes, that would help greatly, thanks!!

#### Jay

• Guest ##### Re: The same number twice in a row
« Reply #3 on: December 05, 2015, 10:21:57 PM »
The simulation would definitely help!! I would be interested in seeing the variance.

I was originally trying to figure out what the probability would be for seeing a number come up twice in a row, and then applying that to a specific number of spins to try to come up with a number that "on average" I would expect to see so many "doubles" for a given number of spins.

#### Reyth

• Global Moderator
• Hero Member
•     • • Posts: 4373
• Thanked: 1666 times ##### Re: The same number twice in a row
« Reply #4 on: December 05, 2015, 10:22:40 PM » Code: [Select]
`10 RANDOMIZE TIMER: md = 100120 r = INT(RND * 37): s = s + 1: pn1 = pn2: pn2 = r30 IF pn1 = pn2 THEN dn = dn + 140 IF s = 1000 THEN 60 ' process batch50 GOTO 2060 '1000 batch complete70 IF mad < dn THEN mad = dn80 IF md > dn THEN md = dn90 s = 0: dn = 0: pn1 = -1: pn2 = -1: se = se + 1100 'output110 LOCATE 1, 1: PRINT "Maximum duplicates:"; mad120 PRINT "Minimum duplicates:"; md130 IF se = 16000000 THEN END140 GOTO 20`

#### Reyth

• Global Moderator
• Hero Member
•     • • Posts: 4373
• Thanked: 1666 times ##### Re: The same number twice in a row
« Reply #5 on: December 05, 2015, 10:24:20 PM »
Ok so do you want me to calculate an average number of occurrences?

I can do an average high and an average low.
« Last Edit: December 05, 2015, 10:28:04 PM by Reyth »

#### Reyth

• Global Moderator
• Hero Member
•     • • Posts: 4373
• Thanked: 1666 times ##### Re: The same number twice in a row
« Reply #6 on: December 05, 2015, 10:37:11 PM » Code: [Select]
`5 DIM sh(1000)10 RANDOMIZE TIMER: md = 1001: la = 100120 r = INT(RND * 37): s = s + 1: pn1 = pn2: pn2 = r: sh(s) = r30 IF pn1 = pn2 THEN dn = dn + 140 IF s = 1000 THEN 60 ' process batch50 GOTO 2060 '1000 batch complete70 IF mad < dn THEN mad = dn80 IF md > dn THEN md = dn90 s = 0: dn = 0: pn1 = -1: pn2 = -1: se = se + 1100 FOR i = 1 TO 1000110 tt = tt + sh(i): NEXT i120 av = tt / 1000130 IF ma < av THEN ma = av140 IF la > av THEN la = av150 FOR i = 1 TO 1000: sh(i) = -1: NEXT i160 av = 0: tt = 0500 'output510 LOCATE 1, 1: PRINT "Maximum duplicates:"; mad520 PRINT "Minimum duplicates:"; md522 PRINT "Low average:"; la524 PRINT "High average:"; ma530 IF se = 16000000 THEN END540 GOTO 20`

#### Reyth

• Global Moderator
• Hero Member
•     • • Posts: 4373
• Thanked: 1666 times ##### Re: The same number twice in a row
« Reply #7 on: December 05, 2015, 10:40:14 PM »
So we can see here that the force of equal distribution favors numbers not to repeat consecutively as the average occurrences of repeats are weighted closer to the minimum number of expected occurrences.

I can also do a repeat distribution with number of occurrences for each repeat from 7 to 55 so you can see how those extremes are distributed and their odds.
« Last Edit: December 05, 2015, 10:48:07 PM by Reyth »

#### Reyth

• Global Moderator
• Hero Member
•     • • Posts: 4373
• Thanked: 1666 times ##### Re: The same number twice in a row
« Reply #8 on: December 05, 2015, 10:57:23 PM » The slots shown are for 5 to 60 occurrences.  If you study this distribution you can get a good mathematical idea of how often deviations from the averages occur.

Code: [Select]
`5 DIM sh(1000), ad(60)10 RANDOMIZE TIMER: md = 1001: la = 100120 r = INT(RND * 37): s = s + 1: pn1 = pn2: pn2 = r: sh(s) = r30 IF pn1 = pn2 THEN dn = dn + 140 IF s = 1000 THEN 60 ' process batch50 GOTO 2060 '1000 batch complete65 ad(dn) = ad(dn) + 170 IF mad < dn THEN mad = dn80 IF md > dn THEN md = dn90 s = 0: dn = 0: pn1 = -1: pn2 = -1: se = se + 1100 FOR i = 1 TO 1000110 tt = tt + sh(i): NEXT i120 av = tt / 1000130 IF ma < av THEN ma = av140 IF la > av THEN la = av150 FOR i = 1 TO 1000: sh(i) = -1: NEXT i160 av = 0: tt = 0500 'output510 LOCATE 1, 1: PRINT "Maximum duplicates:"; mad520 PRINT "Minimum duplicates:"; md522 PRINT "Low average:"; la524 PRINT "High average:"; ma530 IF se = 16000000 THEN END540 FOR i = 5 TO 60: PRINT ad(i);: NEXT i550 GOTO 20`
« Last Edit: December 05, 2015, 11:23:39 PM by Reyth »

#### Jay

• Guest ##### Re: The same number twice in a row
« Reply #9 on: December 05, 2015, 11:00:33 PM »
Great, thanks so much!!

#### Reyth

• Global Moderator
• Hero Member
•     • • Posts: 4373
• Thanked: 1666 times ##### Re: The same number twice in a row
« Reply #10 on: December 05, 2015, 11:04:20 PM »
Sure!  Notice there is some number trash to the extreme right on some lines, you have to ignore it.

#### december ##### Re: The same number twice in a row
« Reply #11 on: December 06, 2015, 05:15:12 AM »
I read somewhere that we can expect to see number back to back repeating once in 37 spins...

#### Reyth

• Global Moderator
• Hero Member
•     • • Posts: 4373
• Thanked: 1666 times ##### Re: The same number twice in a row
« Reply #12 on: December 06, 2015, 06:12:26 AM »
I will run 37 spins to see... Something is wrong with the average calculation but we can see that 0 occurrences are almost the same as 1 and there can rarely be as many as 8.

We can also see that 3,4 or 5 are also relatively common.
« Last Edit: December 06, 2015, 06:25:55 AM by Reyth »

#### Trilobite ##### Re: The same number twice in a row
« Reply #13 on: December 06, 2015, 09:31:55 AM »
For a European roulette wheel (with numbers 0 thru 36), how many times should I see numbers come up twice in a row, for say 1,000 spins? I'm trying to come up with the probabilities, but am having a hard time.

In practical terms, for a number to show twice in a row it must first show once.

After the first appearance of a number, the chance of the same number showing immediately a second time is 1/37 as december mentioned.

After a number shows, the chance of it showing a second successive time is twice as good as any other number showing twice in a row. The problem is that the practical chance of the next number being the same is 1/37, which is identical to every other number. Therefore, the foreseen advantage of the previous number showing twice in a row is an illusion.

In fact, I‘ve heard it said that if anything there is a minutely diminished chance of any number showing twice in a row.
« Last Edit: December 06, 2015, 09:35:41 AM by Trilobite »

#### dobbelsteen

• Hero Member
•      • Posts: 1856
• Thanked: 783 times ##### Re: The same number twice in a row
« Reply #14 on: December 06, 2015, 01:07:56 PM »
I can offer you an excel analyse program for the ECs. I mean that excel is much easier to undestand then VB