wu :: forums
« wu :: forums - Expected length of repeating random sequences »

Welcome, Guest. Please Login or Register.
Apr 28th, 2024, 9:28pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   easy
(Moderators: william wu, Grimbal, Icarus, SMQ, Eigenray, ThudnBlunder, towr)
   Expected length of repeating random sequences
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Expected length of repeating random sequences  (Read 3828 times)
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Expected length of repeating random sequences  
« on: May 12th, 2013, 12:12pm »
Quote Quote Modify Modify

What's the expected number of coins you'd need to toss to get a sequence that repeats itself? (i.e. first half equal to the second half)
 
And, in general, how about for dice with k sides? (Assuming it isn't already infinite for 2.)
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
pex
Uberpuzzler
*****





   


Gender: male
Posts: 880
Re: Expected length of repeating random sequences  
« Reply #1 on: May 13th, 2013, 3:07am »
Quote Quote Modify Modify

on May 12th, 2013, 12:12pm, towr wrote:
What's the expected number of coins you'd need to toss to get a sequence that repeats itself? (i.e. first half equal to the second half)

Seems like the number of such sequences of length 2n is A216958(n); at least, it matches as far as I bothered to check (up to n=7) and it deals with a similar problem. No closed form, nor even a recurrence, for A216958(n) seems to be known, so looking for sum [ (2n) A216958(n) / 22n ] might be kind of hard.
 
My hunch is that it's actually infinite, based on how easy it is to mess up the property you're looking for.
 
Edit: The number of sequences of length n that do not yet include such a repetition is A122536(n). Not much help though, as the listed recurrence depends on A216958.
« Last Edit: May 13th, 2013, 3:35am by pex » IP Logged
rmsgrey
Uberpuzzler
*****





134688278 134688278   rmsgrey   rmsgrey


Gender: male
Posts: 2873
Re: Expected length of repeating random sequences  
« Reply #2 on: May 13th, 2013, 6:59am »
Quote Quote Modify Modify

There are 2n binary sequences of length 2n where the first and second halves are identical, so, if you don't stop just because you've already met the condition, the probability of meeting the condition at length 2n is 2-n.
 
The expected number of times a random sequence will match the condition is a familiar sum:
1/2 + 1/4 + ... = 1
 
That's an upper bound on the probability a sequence of length 2n meets the condition at least once - some sequences will meet the condition more than once (all heads and all tails each meet it n times) and the probability of meeting the condition at length 6 is not independent of the probability of meeting it at length 4, so I'm out of shortcuts...
The corresponding lower bound on the expected length of sequence is 4 (n=2)
 
With a three-sided die, the expected number of hits in a given sequence is:
1/3+1/9+1/27+... -> 1/2 which I think gives us lower bound on the expected length of sequence of infinity, but it's been too long since I last used the relevant maths, so I could be wrong
IP Logged
dudiobugtron
Uberpuzzler
*****





   


Posts: 735
Re: Expected length of repeating random sequences  
« Reply #3 on: Oct 16th, 2014, 11:44pm »
Quote Quote Modify Modify

I assume 0 and 1 aren't acceptable answers?  Wink
IP Logged
rmsgrey
Uberpuzzler
*****





134688278 134688278   rmsgrey   rmsgrey


Gender: male
Posts: 2873
Re: Expected length of repeating random sequences  
« Reply #4 on: Oct 17th, 2014, 4:55am »
Quote Quote Modify Modify

on Oct 16th, 2014, 11:44pm, dudiobugtron wrote:
I assume 0 and 1 aren't acceptable answers?  Wink

 
0 is probably acceptable, but uninteresting. For 1, it raises the question of what half a head looks like...
IP Logged
dudiobugtron
Uberpuzzler
*****





   


Posts: 735
Re: Expected length of repeating random sequences  
« Reply #5 on: Oct 17th, 2014, 12:36pm »
Quote Quote Modify Modify

on Oct 17th, 2014, 4:55am, rmsgrey wrote:
0 is probably acceptable, but uninteresting.

I think it's pretty interesting! Tongue
 
Quote:
For 1, it raises the question of what half a head looks like...

Indeed, I was considering only the mathematical sequence, and not the actual physical coin.
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board