WLJS LogoWLJS Notebook

Expectation

Expectation[expr, x \[Distributed] dist] gives the expectation of expr under the assumption that x follows the probability distribution dist.

Examples

Expected value of x:

Expectation[x, x \[Distributed] NormalDistribution[0, 1]]
(* 0 *)

Expectation of x^2:

Expectation[x^2, x \[Distributed] UniformDistribution[{0, 1}]]
(* 1/3 *)

Please visit the official Wolfram Language Reference for more details.

On this page