Definition of the Domain of a Function when the sets are the elements

39 Views Asked by At

In case I have a function that calculate the normalized distance of elements in two sets $A$ and $B$ I can define the function as $\mathrm{elementDistance} : A \times B \rightarrow [0,1]$.

But if I want to define another function to calculated the normalized distance of the sets (summing all the distances obtained by the other function), could I defined it in the same way as $\mathrm{setDistance} : A \times B \rightarrow [0,1]$ ?

Or would it create an ambiguity since $\mathrm{setDistance}$ is the distance of $A$ to $B$ and not their elements distance $(a_i,b_j)$?

Thanks!

1

There are 1 best solutions below

4
On

When we have a function $f: X\rightarrow Y$, it means that $f(x)$ is defined for every $x\in X$. Hence you are using correct notation only in the first situation where the distance function is defined for every $x\in A\times B$, while in the second case is the distance function is not defined for any $x\in A\times B$.

If we let $S$ be the set of sets you are interested in, then the second function would properly be defined as $g: S^2\rightarrow [0,1]$. Note that if the only sets you are interested in are $A$ and $B$, then $S=\{A,B\}$.