I am trying to formalise a small algorithm and I have difficulties writing it in mathematical terms properly.
I have a vector $d$ with $d = 1, \dots, N$ and a vector $c$ with $c = 1, \dots, C$.
What my algorithm is doing is to compute a distance matrix one $d$ at a time, recursively.
I would like to express the idea of
$dist(d_{i},c_{j})$
one $d_{i}$ at a time.
In the end I end up with a matrix ($M = N \times C$).
For instance, would the following notation be correct to express this idea
\begin{equation} M = \sum_{i=1}^{N}\sum_{j=1}^{C} dist(i,j) \end{equation}
From a programming point of view, it is simply
for (i in 1:N) {
for (j in 1:C){
mat[i,j] = dist( t[i], c[j] )
}
}
Does the sign $\sum$ denotes directly for i in ...? And does the order of the sign $\sum$ matter formally, like it matter in the programming example?
Thank you.
$\sum$ means "sum". What you seem to miss here is a proper way to handle indices.
Let's make a parallel with informatic :
Likewise for matrices, in your case the matrix will be written $$M := (dist(t_i,c_j))_{{1 \leqslant i \leqslant N},\,{1\leqslant j \leqslant C}}$$