# Math notation for histogram selection process

Suppose you have values and classify them in a histogram. In pseudo code this may look like this:

foreach value
foreach bucket
if(value > bucket.lowerBound && value <= bucket.upperBound)
bucket.count = bucket.count + 1


Is there a mathematical notation for this selection task?

Suppose $i$ is an index denoting the bucket and $j$ an index of the values. Does a nice compact notation exist for writing the count $c_i$ in bucket $i$ as a function of the lower $l_i$ and upper $u_i$ bounds of bucket $i$, akin to

$c_i = ... someNotation (v_j, l_i, u_i)$

Or maybe a matrix notation could better fit? With $C$ the vector of counts, $V$ the vector of values and $U$,$L$ the vectors of bounds.

$C = ...$

Edit: It might be a problem that you check for $\quad left < x \leq right$ and not $left \leq x \leq right$
• Ah okay, you could write it as $1_{(l_i,r_i]}$ but this does not really change the fact that you have no matrix representation. – k1next Mar 5 '13 at 14:01