Expected value: Product of integers in a range

86 Views Asked by At

What is the expected value of $f(x)^k = f(x) f(x) \cdots f(x)$ if $f(x)$ is a function, that returns a random integer between $0$ and $x - 1$ inclusive?

2

There are 2 best solutions below

0
On

$$Ef(x) = \int P(\xi)\cdot\xi\ d\xi = \int_0^{x-1}\frac{1}{x-1} \cdot \xi\ d\xi = \frac{1}{x-1}(\frac 1 2 \xi^2)\Big|_0^{x-1}$$

$$Ef(x)^k = \underbrace{\int_0^{x-1}...\int_0^{x-1}}_{k\text{ integrals}} (\frac{1}{x-1})^k x_1...x_k\ dx_1 ... dx_k$$

0
On

It's just $${1\over x}\sum_{i=0}^{x-1}i^k.$$ Are you looking for anything more specific than that? There is a closed form, but it involves Bernoulli numbers.