# Need help with math formula translation

I am given the following formula

$$\sum_{i = 1}^{m}\sum_{j = 1}^{k} r_{ij}||x_i - \mu_j||_2$$

I want to rewrite the norm in basic algebraic terms. If I understand it correctly, is this the correct formula

$$\sum_{i = 1}^{m}\sum_{j = 1}^{k} r_{ij}((x_i^2 - 2x_i\mu_j + \mu_j^2))^\frac{1}{2}$$

Or is this one correct?

$$\sum_{i = 1}^{m}\sum_{j = 1}^{k} r_{ij}(x_i^2 - 2x_i\mu_j + \mu_j^2)$$

• Neither, but the second is almost right. Where did the $2$ in $2\mu_j^2$ come from? Aug 25, 2020 at 22:54
• It goes away @Integrand Aug 25, 2020 at 23:01
• The two as a superscript usually means "square". If you want this two to denote $L_2$ norm, probably better as a subscript $|| \cdot ||_2$.
– mjw
Aug 26, 2020 at 2:52
• Are $x_i$ and $\mu_j$ vectors or scalars?
– mjw
Aug 26, 2020 at 4:25
• $||x_i - \mu_j||_2^2 = (x_i - \mu_j) \cdot (x_i - \mu_j) = ||x_i||_2^2 - 2x_i \cdot \mu_j + ||\mu_j||_2^2$
– mjw
Aug 26, 2020 at 4:27

\begin{aligned} \sum_{i=1}^m \sum_{j=1}^k r_{ij} ||x_i - \mu_j||_2 &= \sum_{i=1}^m \sum_{j=1}^k r_{ij} \left[(x_i - \mu_j) \cdot (x_i - \mu_j)\right]^{1/2} \\ &=\sum_{i=1}^m \sum_{j=1}^k r_{ij} \left( ||x_i||_2^2 - 2x_i \cdot \mu_j + ||\mu_j||_2^2 \right)^{1/2} \end{aligned}