Re: a combinatorics proof needed

From: Fred the Wonder Worm (ftww_at_maths.usyd.edu.au)
Date: 10/08/04


Date: 8 Oct 2004 07:43:47 GMT


In article <ck43u6$1m9$1@license1.unx.sas.com>,
Rob Pratt <Rob.Pratt@sas.com> wrote:
>"Fred the Wonder Worm" <ftww@maths.usyd.edu.au> wrote in message
>news:ck2ls2$da6$1@spacebar.ucc.usyd.edu.au...
>> In article <ba1b8b10.0410042146.22fc53d3@posting.google.com>,
>> Chakravarthi <pschax@gmail.com> wrote:
>>>
>>> If we take a random binary sequence of length 'n' how
>>> to prove that the expected number of runs of zeroes
>>> 0000...0 (or 1s) of length 'i' is (n-i+3)/2^(i+2).
[...]
>> The first point is that your formula does not work for i = n,
>> but I assume you are aware of this. Assuming that we have
>> 1 <= i < n, and that we are interested in zeroes. Let E(n,i)
>> be the expected number of runs of zeroes of exact length i in
>> a random bit sequence.
>
> [rest of solution snipped]
>
> Here's a much shorter solution using a powerful property: the
> linear of expectation.
>
> For k = 1 to n - i + 1, define random variable R_k = 1 if an i-run
> starts at position k, 0 otherwise.
>
> Let E(n,i) be defined as above, and denote the expected value of
> R_k by E{R_k}. (By the way, the expected value of a Bernoulli
> random variable is just the probability that the variable is 1.)
> Now the total number of i-runs is sum [k = 1 to n - i + 1] R_k,
> and so
>
> E(n,i) = E{sum [k = 1 to n - i + 1] R_k}
> = sum [k = 1 to n - i + 1] E{R_k}
> = (n - i) E{R_1} + E{R_n}
> = (n - i) (1/2)^(i+1) + (1/2)^i
> = (n - i + 2) / 2^(i+1),
>
> which differs from the original poster's formula but seems to be
> correct. As a check, note that my formula yields E(n,n) = 1/2^n,
> as expected.

This seems to be the only case where it returns the correct
answer. For example, consider the simple case where n=2,i=1:

        runs
    00 0
    01 1
    10 1
    11 0

For an expected value of 1/2, whereas your formula gives 3/4.
I'm guessing this discrepancy arises because you are considering
the '00' case to have a run of 1 zero starting at the second
position, but (based on the formula) it seems clear this is not
the original poster's intent.

Modifying your argument based on this does yield a much simpler
approach:

E(n,i) = E{sum [k = 1 to n - i + 1] R_k}
       = sum [k = 1 to n - i + 1] E{R_k}
       = E{R_1} + (n-i-1)*E{R_2} + E{R_(n-i+1)}
       = 1/2^(i+1) + (n-i-1)/2^(i+2) + 1/2^(i+1)
       = (n - i + 3) / 2^(i+2)

[ i.e., the expected value E{R_1} is the probability that the
sequence starts with an i-run, which is the probability that it
starts with i 0s followed by a 1, which is 1/2^(i+1). Similarly
for E{R_(n-i+1)}. The other E{R_j} are all equal to E{R_2},
which is the probability of a 1, i 0s and another 1 appearing
in the appropriate positions, which is 1/2^(i+2). ]

This formula breaks down when i = n, but we already knew that.

Thanks for pointing this approach out.

Cheers,
Geoff.

-----------------------------------------------------------------------------
Geoff Bailey (Fred the Wonder Worm) | Programmer by trade --
ftww@maths.usyd.edu.au | Gameplayer by vocation.
-----------------------------------------------------------------------------



Relevant Pages

  • Re: Howard theory - "cannot be computed"
    ... in fact require some sort of probability calculation. ... the expectation of chance alone. ... but some of the differences may arise rapidly by selection for changes ... that the current sequence retains or changed. ...
    (talk.origins)
  • Re: Vary Large Linear equation
    ... That's the only constraint, ... Give the probability p_i that the ith even will happen ... even at the cost of some expectation. ... scheme is as follows (where A>= B means that gamble A is as good as, ...
    (sci.math)
  • To appear in: Q. Smith, ed., Epistemology: New Philosophical Essays
    ... Operational epistemology is, to a first approximation, the attempt to ... The injunction to proportion your confidence in a hypothesis to its probability, ... relevant than pure subjective probability to any normative epistemology or philosophy of ... the expectation of a real-valued random variable, its mean value weighted by probability. ...
    (sci.math)
  • Re: poker
    ... "find the function p such that A's expectation is maximised **when B ... this strategy and B uses probability gto bet when he is dealt t. ... No. (I haven't checked the detail of the calculations, ... A makes at least 1/10 point per game. ...
    (sci.math)
  • Re: True odds bets? Probability says........
    ... The probability is .079589. ... after one trial....expected distance is 1 ... This is only good for even-money, ... on the mathematical expectation, however, which, for one trial, is .5. ...
    (rec.gambling.craps)