How to express summation over elements of two sets I have two sets A and B;
$A = \{a_1, a_2, \ldots, a_n\}$
$B = \{b_1, b_2, \ldots, b_k\}$
$n$ and $k$ are different.
My function $f(a, b)$ takes one element of from A and one element from B. And the metric I want to calculate is following:
$Metric_{AB} = f(a_1, b_1) + f(a_1, b_2) + \ldots + f(a_1, b_k) + \ldots + f(a_2 + b_k) + \ldots + f(a_n, b_k)$
Sorry if this is a stupid question, but I can't figure out how to express it as a sum. If $n$ and $k$ were the same, I could have done this:
$$\sum_{n=1}^n f(a_n, b_n)$$ but since these sets are of different size, I'm not sure.

You can write $$\sum_{x\in A\times B}f(x)$$
The elements of $A\times B$ are the pairs $(a,b)$ with $a\in A$ and $b\in B$.
