Processing math: 100%
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 8 years ago

dan_fulea gravatar image

The question is not well defined. The best way to "do something" is to "guess" the or a related question, and answer this one. (The original question must have been in the same circle of ideas, and should have been touched with similar vehicles.)

Restatement:

Let us fix an integer K>1. We consider

  • K random variables Z1,,ZK which follow the standard normal distribution N(0,12),

  • and K random variables V1,,VK which follow the uniform distribution on the intervals (1,2),,(1,K+1) - respectively.

The family of all these variables should be an independent family of random variables defined on the same probability space. Let E be the expectation, the mean on this space. We build X(K)=|Z1V1++ZKVK| and its expectation f(K)=EX(K)=E[ |Z1V1++ZKVK| ] as a function of K. The exercise asks for

  • heuristical arguments, that may lead to an asymptotic F(K)=O(K?) in big-O-notation, and

  • a computer simulation that supports the heuristic.

This was the complicated part of the answer. From this point things go straightforward: The random variable under the modulus has mean zero since E[ZjVj]=E[Zj]E[Vj]=0E[Vj]=0, and terms have variance Var[ZjVj]=E[(ZjVj)2]E[ZjVj]2=E[Z2j]E[V2j]E[Zj]E[Vj]2=1E[V2j]0=1jj+11x2dv=13j((j+1)313) and so on. (We used independence. Further using the independence, the variance of the sum is the sum of the variances and we compute 1jK13j((j+1)313):

sage: var( 'j,K' );
sage: latex( sum( 1/3/j * ( (j+1)^3-1^3 ), j, 1, K ).factor() )
\frac{1}{9} \, {\left(K^{2} + 6 \, K + 14\right)} K

Then we expect: Z1V1++ZKVK19(K2+6K+14)KN(0,12) . (This is the optimistic law of large numbers, used outside mathematics when we do not have time to check the details.) For a big K we can optimistically and statistically approximate the RHS with a normally distributed YN(0,12). Then E|Y| is twice the integral on [0,) from 12πyexp(y2/2). Putting all together we get: f(K)232πK(K2+6K+14) .

That's the maths.

Now we simulate and we ask also for the values respecting the guessed asymptotic:

  • The simulateion:

    sage: %cpaste Pasting code; enter '--' alone on the line to stop or use Ctrl-D. : :for pow in [ 2,3,4,5 ]: : K = 10 ** pow : SAMPLES = [] # and we append : for experiment in [ 1..99 ]: : SAMPLES . append( abs( sum( [ gauss(0,1) * uniform( 1,k+2 ) for k in range(K) ] ) ) ) : print "%s -> %s" % ( K, mean( SAMPLES ) ) :-- 100 -> 294.711735785 1000 -> 8714.8222098 10000 -> 249403.620665 100000 -> 8734793.09067

Next time we will see other numbers above.

  • And the asymptotic: sage: for pow in [ 2,3,4,5 ]: K = 10 * pow print "%s -> %f" % ( K, 2/3/sqrt(2pi) * sqrt( K * ( K^2 + 6*K + 14 ) ) ) ....:
    100 -> 274.004912 1000 -> 8435.694028 10000 -> 266041.315371 100000 -> 8410694.055422

I did not check the details, but we strongly encourage f(K)O(K3/2), even more, we have f(K)12π23K3/2.

click to hide/show revision 2
No.2 Revision

The question is not well defined. The best way to "do something" is to "guess" the or a related question, and answer this one. (The original question must have been in the same circle of ideas, and should have been touched with similar vehicles.)

Restatement:

Let us fix an integer K>1. We consider

  • K random variables Z1,,ZK which follow the standard normal distribution N(0,12),

  • and K random variables V1,,VK which follow the uniform distribution on the intervals (1,2),,(1,K+1) - respectively.

The family of all these variables should be an independent family of random variables defined on the same probability space. Let E be the expectation, the mean on this space. We build X(K)=|Z1V1++ZKVK| and its expectation f(K)=EX(K)=E[ |Z1V1++ZKVK| ] as a function of K. The exercise asks for

  • heuristical arguments, that may lead to an asymptotic F(K)=O(K?) in big-O-notation, and

  • a computer simulation that supports the heuristic.

This was the complicated part of the answer. From this point things go straightforward: The random variable under the modulus has mean zero since E[ZjVj]=E[Zj]E[Vj]=0E[Vj]=0, and terms have variance Var$[Z_jV_j]

Var$\displaystyle[Z_jV_j] = \mathbb{E} [(Z_jV_j)^2] -\mathbb{E} [Z_jV_j]^2 =\mathbb{E} [Z_j^2] \mathbb{E} [V_j^2] -\mathbb{E} [Z_j]\mathbb{E} [V_j]^2 [V_j]^2$

=1E[V2j]0=1jj+11x2dv=13j((j+1)313)

and so on. (We

We used independence. Further using the independence, the variance of the sum is the sum of the variances and we compute $\sum_{1\le $\displaystyle\sum_{1\le j\le K}\frac 1{3j}((j+1)^3-1^3)$:

sage: var( 'j,K' );
sage: latex( sum( 1/3/j * ( (j+1)^3-1^3 ), j, 1, K ).factor() )
\frac{1}{9} \, {\left(K^{2} + 6 \, K + 14\right)} K

Then we expect: Z1V1++ZKVK19(K2+6K+14)KN(0,12) .

(This is the optimistic law of large numbers, used applied outside mathematics when we do not have time to check the details.)

For a big K we can optimistically and statistically approximate the RHS with a normally distributed YN(0,12).

Then E|Y| is twice the integral on [0,) from $\frac1 {\sqrt{2\pi}}y\exp(-y^2/2)$. {\sqrt{2\pi}}y\exp(-y^2/2)$.

Putting all together we get: f(K)232πK(K2+6K+14) .

That's the maths.

Now we simulate and we ask also for the values respecting the guessed asymptotic:

  • The simulateion:

    sage: %cpaste Pasting code; enter '--' alone on the line to stop or use Ctrl-D. : :for simulation:

    for pow in [ 2,3,4,5 ]: : K = 10 ** pow : SAMPLES = [] # and we append : for experiment in [ 1..99 ]: : SAMPLES . append( abs( sum( [ gauss(0,1) * uniform( 1,k+2 ) for k in range(K) ] ) ) ) : print "%s -> %s" % ( K, mean( SAMPLES ) ) :-- )

    100 -> 294.711735785 1000 -> 8714.8222098 10000 -> 249403.620665 100000 -> 8734793.09067

Next time we will see other numbers above.

  • And the asymptotic: asymptotic:

    sage: for pow in [ 2,3,4,5 ]: K = 10 * pow print "%s -> %f" % ( K, 2/3/sqrt(2pi) * sqrt( K * ( K^2 + 6*K + 14 ) ) ) ....:
    )

    100 -> 274.004912 1000 -> 8435.694028 10000 -> 266041.315371 100000 -> 8410694.055422

I did not check the details, but we strongly encourage f(K)O(K3/2), even more, we have $f(K)\sim\frac

f(K)12π23K3/2.

click to hide/show revision 3
No.3 Revision

The question is not well defined. The best way to "do something" is to "guess" the or a related question, and answer this one. (The original question must have been in the same circle of ideas, and should have been touched with similar vehicles.)

Restatement:

Let us fix an integer K>1. We consider

  • K random variables Z1,,ZK which follow the standard normal distribution N(0,12),

  • and K random variables V1,,VK which follow the uniform distribution on the intervals (1,2),,(1,K+1) - respectively.

The family of all these variables should be an independent family of random variables defined on the same probability space. Let E be the expectation, the mean on this space. We build X(K)=|Z1V1++ZKVK| and its expectation f(K)=EX(K)=E[ |Z1V1++ZKVK| ] as a function of K. The exercise asks for

  • heuristical arguments, that may lead to an asymptotic F(K)=O(K?) in big-O-notation, and

  • a computer simulation that supports the heuristic.

This was the complicated part of the answer. From this point things go straightforward: The random variable under the modulus has mean zero since E[ZjVj]=E[Zj]E[Vj]=0E[Vj]=0, and terms have variance

Var[ZjVj]=E[(ZjVj)2]E[ZjVj]2=E[Z2j]E[V2j]E[Zj]E[Vj]2

=1E[V2j]0=1jj+11x2dv=13j((j+1)313)

and so on.

We used independence. Further using the independence, the variance of the sum is the sum of the variances and we compute 1jK13j((j+1)313):

sage: var( 'j,K' );
sage: latex( sum( 1/3/j * ( (j+1)^3-1^3 ), j, 1, K ).factor() )
\frac{1}{9} \, {\left(K^{2} + 6 \, K + 14\right)} K

Then we expect: Z1V1++ZKVK19(K2+6K+14)KN(0,12) .

(This is the optimistic law of large numbers, applied outside mathematics when we do not have time to check the details.)

For a big K we can optimistically and statistically approximate the RHS with a normally distributed YN(0,12).

Then E|Y| is twice the integral on [0,) from 12πyexp(y2/2).

Putting all together we get: f(K)232πK(K2+6K+14) .

That's the maths.

Now we simulate and we ask also for the values respecting the guessed asymptotic:

  • The simulation:

    simulation...

    for pow in [ 2,3,4,5 ]:
        K = 10 ** pow
        SAMPLES = []    # and we append
        for experiment in [ 1..99 ]:
            SAMPLES . append( abs( sum( [ gauss(0,1) * uniform( 1,k+2 ) for k in range(K) ] ) ) )
        print "%s -> %s" % ( K, mean( SAMPLES ) )

    )

    We get

    100 -> 294.711735785
    1000 -> 8714.8222098
    10000 -> 249403.620665
    100000 -> 8734793.09067

8734793.09067

Next time we will see other numbers above.

  • And the asymptotic:

    sage:

    for pow in [ 2,3,4,5 ]:
        K = 10 * ** pow
        print "%s -> %f" % ( K, 2/3/sqrt(2pi) 2/3/sqrt(2*pi) * sqrt( K * ( K^2 + 6*K + 14 ) ) )

    ) 100 -> 274.004912 1000 -> 8435.694028 10000 -> 266041.315371 100000 -> 8410694.055422

8410694.055422

I did not check the details, but we strongly encourage f(K)O(K3/2), even more, we have

f(K)12π23K3/2.