Average Distance of an element and a set of elements

220 Views Asked by At

Let $a$ be an element and $B$ be a set of elements $\{b_1,\dots,b_n\}$ which would be the best notation to represent the average distance between $a$ and all the elements of $B$?

One way to describe that would be: $\frac{\sum_{b \in B} dist(a,b)}{length(B)}$. Is there any good but more compact and readable way to describe that?

Maybe a "short version" of $avg\{dist(a,b) : b \in B\}$ ?

Thanks!

1

There are 1 best solutions below

0
On

$$\dfrac{\displaystyle \sum_{b\in B} \operatorname {dist}(a, b)}{|B|}$$

If $|B| = n,\,$ then we can index each element $\,b_i \in B, \;1\leq i \leq n$ and sum the distances between $a$ and each $b_i$ as $i$ ranges from $1$ to $n$. Then, it's just a matter of dividing that sum by $|B|= n$:

$$\frac 1n \cdot \sum_{i = 1}^n \operatorname{dist}(a, b_i)$$