Calculates the expected value of an array.
The array
Optional
The probabilities of the corresponding elements of the array (optional, defaults to equiprobable)
const result = Chalkboard.stat.expected([0, 1, 2], [0.25, 0.5, 0.25]); // Returns 1 Copy
const result = Chalkboard.stat.expected([0, 1, 2], [0.25, 0.5, 0.25]); // Returns 1
Calculates the expected value of an array.