0

So I have been working on this equation which sums up two summations from i = 1 to N.

This is the equation.

enter image description here

This is the latex equation for it for help in editing if its wrong.

AL =  \sum_{i=1}^{N}\left ( \sum_{i=1}^{N}max(0, m + d(r_{a},r_{p}) - d(r_{a}, r_{n})) + (-\frac{1}{N}(\sum_{i=1}^{N}L_{i}\cdot log(s_{i}))) \right  )

This looks right to me but do I need the N and i on every sum or only the first one? Thank you

MNM
  • 111

1 Answers1

1

I doubt that any compiler would let that by without an error message! You are using the same variable name, i, for two different variables. Interpreted rigorously it would mean that the first sum would set each occurance of i 1 to N, then add them. There would be no "i" for the outer sum. if you were to write it as [tex]AL = \sum_{i=1}^{N}\left ( \sum_{j=1}^{N}max(0, m + d(r_{a},r_{p}) - d(r_{a}, r_{n})) + (-\frac{1}{N}(\sum_{j=1}^{N}L_{i}\cdot log(s_{i}))) \right)[/tex] where I have change the "i" for the sums inside the parentheses to "j". Notice that I can use the same "j" for both sums inside the parentheses because those two sums are done independently of each other.

user247327
  • 18,710
  • Thank you I see what you are saying, but for this equation i is a index of the same data like the same image. Would what you said work with that as well? – MNM Nov 03 '20 at 22:38