Konrad Den Ende wrote:
>We've created a vector with random numbers and took a look at the number of
>raising sequences in it. Normally, one would expect to get about 1/2 of all
>the sequences occured to be of length 1, about 1/4 of length 2, about 1/8 of
>length 3 and so on.
>Everything works as expected except for the sequences of length 2. No matter
>how much we grunt at the machine, it always gets to few of those. All the
>others are about the right size, though.
>Anybody who'd like to contribute and shed some light at this phenomenon?
>
As Herman has pointed out, you haven't adequately described what you are
simulating. What is a "raising sequence"? First you write of the
number of such sequences in a vector of random numbers (with an
unspecified distribution), but then you immediately switch to a
discussion of their lengths. You need to describe the problem more
precisely.
Here is my guess as to what you meant: Let {X_i: i in N} be a
sequence of i.i.d. Uniform(0,1) random variables. Define N = min { n >
0: X_(n-1) > X_n}. You want the distribution of N.
P{N = 1} = P{X0 < X1} = 1/2
P{N = 2} = P{X0 < X1, X1 > X2} = P{X2 < X0 < X1 or X0 < X2 < X1} =
1/3, not 1/4.
(The above uses the fact that the marginal distribution is continuous.)
So, if this is what you mean, your simulation should be generating even
more sequences of length 2.
Are you doing your simulation by starting each succeessive sequence with
the final number of the previous sequence (which is necessarily smaller
than the previous number)? If so, there's a flaw: your initial number
will tend to be smaller than all others.
BTW, the above analysis will work for any continuous marginal
distribution, not just uniform.
--
Stephen J. Herschkorn [EMAIL PROTECTED]
.
.
=================================================================
Instructions for joining and leaving this list, remarks about the
problem of INAPPROPRIATE MESSAGES, and archives are available at:
. http://jse.stat.ncsu.edu/ .
=================================================================