Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I apologize if this question sounds weird, but I have come across this function (which I am trying to replicate using C# code), which has left me a bit confused.

enter image description here

The way I am understanding, is that this function states that the total amount of elements in set Sj will be divided by the sum of the two vectors (since pc and coh(s) return vectors, each having 2 points). From what I managed to find, the || denote the absolute value of the addition (I could be wrong though). The function will then return the maximum value for that calculation.

What is confusing me is the fact that I am dividing an integer by the sum of two vectors and to my (limited) knowledge, that cannot be done.

Can anyone offer some explanation for this?

Thanks in advance.

EDIT: After some more digging, I found this:

The length or magnitude or norm of the vector a is denoted by ||a|| or, less commonly, |a|, which is not to be confused with the absolute value (a scalar "norm").

So I take it that now I am deviding an integer by an float. Is my assumption correct or did I get something wrong?

share|cite|improve this question
up vote 3 down vote accepted

Here is how you should read it $$ \max_{s \in S_j} \frac{|S_j|}{|| p_c + \Delta_{coh}(s) ||} = \max \frac {\mbox{the size of the set }S_j}{\mbox{the magnitude of the vector sum } p_c + \Delta_{coh}(s)}$$

Now note that the magnitude of the vector $(v_0, v_1) = p_c + \Delta_{coh}(s) = \sqrt{v_0^2 + v_1^2}$. I'm assuming 2D euclidean space (for example look here).

The max operator requires you to find the maximum value of the fraction for all different values of $s$.

And you are right. You're dividing integer (that is: $|S_j|$) by a real number, or float, (that is: length of $p_c + \Delta_{coh}(s)$).

Edit: programming wise, if i is int and f is float, then you can compute i/f by first casting i into a float, e.g. ((float) i)/f. The result will be a float. Some compilers will do that for you (implicit coercion).

share|cite|improve this answer
Thanks a lot for the information. When you say `the magnitude of vector (V0, V1) =... what exactly are V0 and V1? Are they the points making up the vector? – npinti Mar 6 '12 at 15:47
@J.D.: It's not a matter of "some compilers"; the C# language definition requires that i/f implicitly converts the int to a float. See ECMA-334, sections 13.1.2, 14.2.4, 14.7.2 (and for the non-normative TLDR version). But the OP should almost certainly use double rather than float here. – Henning Makholm Mar 6 '12 at 16:20
@npinti: A vector does not consists of "points", but of "elements" or "coordinates". As a whole, the vector can be thought of as defining one point in 2-dimensional space. – Henning Makholm Mar 6 '12 at 16:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.