-1
$\begingroup$

I don't understand how to calculate

The Expected value of ∏ x(i) for N values of x(i) taken from a uniform distribution.

i.e. to generalise

Expectation[ 
   x * y *z, { x ~ UniformDistribution[], 
               y ~ UniformDistribution[], 
               z ~ UniformDistribution[]
              }]

to N terms. (And no, “½^N” is not the answer I'm looking for.)

$\endgroup$
2
  • 6
    $\begingroup$ ½^N is the answer if $X_i$ are independent rvs. $\endgroup$
    – kglr
    Commented Aug 30, 2019 at 17:14
  • 1
    $\begingroup$ btw replace ~ with \[Distributed]. $\endgroup$
    – kglr
    Commented Aug 30, 2019 at 17:16

1 Answer 1

3
$\begingroup$
Clear["Global`*"]

Using Expectation

exp[n_Integer?Positive] := exp[n] = 
   Expectation[
    Product[x[k], {k, n}],
    Evaluate@
     (x[#] \[Distributed] UniformDistribution[] & /@ Range[n])]

seq = exp /@ Range[10]

(* {1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512, 1/1024} *)

FindSequenceFunction[seq, n]

(* 2^-n *)

Using TransformedDistribution

dist[n_Integer?Positive] := dist[n] =
  TransformedDistribution[Product[x[k], {k, n}],
   Evaluate@
    (x[#] \[Distributed] UniformDistribution[] & /@ Range[n])]

seq2 = Mean[dist[#]] & /@ Range[10]

(* {1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512, 1/1024} *)

EDIT: Or, as suggested by @ciao, using the multivariate uniform distribution over the standard n dimensional unit hypercube,

Clear[dist]

dist[n_Integer?Positive] := dist[n] = Module[{var = Array[x, n]},
   TransformedDistribution[
    Times @@ var, var \[Distributed] UniformDistribution[n]]]

seq2 = Mean@*dist /@ Range[10]

(* {1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512, 1/1024} *)

FindSequenceFunction[seq2, n]

(* 2^-n *)
$\endgroup$
3
  • 2
    $\begingroup$ Expectation[Times @@ Array[x, n], Array[x, n] \[Distributed] UniformDistribution[n]] a bit more concise... $\endgroup$
    – ciao
    Commented Aug 30, 2019 at 20:15
  • $\begingroup$ So I guess the approach either way is to create a sequence. $\endgroup$ Commented Aug 31, 2019 at 17:03
  • $\begingroup$ @ciao - added your suggestion. Thanks. $\endgroup$
    – Bob Hanlon
    Commented Sep 1, 2019 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.