Calculates the expected value of an array.
The array
Optional
The probabilities of the corresponding elements of the array (optional, defaults to equiprobable)
Calculates the expected value of an array.