Calculates the expected value of an array.

  • Parameters

    • arr: number[]

      The array

    • Optionalprobabilities: number[]

      The probabilities of the corresponding elements of the array (optional, defaults to equiprobable)

    Returns number