# Notation in set theory applied to counters

I have written a notation representing a counter for a condition:

$M \leftarrow \displaystyle \sum_{i =1}^{|X|} [B_j = X_i]$

So far this gives me a number for a specific j (the counter), but I want to turn this into a set for all values of j in such a way M is representing a multiset. M would be something like this:

$M = \{1,1,2,4,5\}$

How can I fix my notation to represent what I want?

thanks

-

Assuming your indexing starts at $0$ for the first element, then you want to sum to the order of $X - 1$. For example, the set

I think this might work:

$$M = \left\{M_j \mid M_j \leftarrow \displaystyle \sum_{i =0}^{|X|-1} [B_j = X_i]; 0\le j < |M|\right\}.$$

Of course, determining $|M|$ requires knowing in advance the number of counters = $C$, so the condition $0 \le j < C$ should probably replace the condition $0 \le j < |M|$:

$$M = \left\{M_j \mid M_j \leftarrow \displaystyle \sum_{i =0}^{|X|-1} [B_j = X_i]; 0\le j < C\right\}.$$

-
Hi, thanks for your solution, it looks good. I just would like to know if this is true for a multiset as well, because a set does not allow repetition of the elements and considering I have a counter, I need definitely a multiset. If I get no better answer, I accept yours. –  sfelixjr Dec 23 '12 at 20:21
I will use your solution with double brackets. According to this, that's how we should represent a multiset: fr.m.wikipedia.org/wiki/Multiensemble –  sfelixjr Dec 23 '12 at 20:26
This would be a multiset: it is the set of all $M_j$ each depending on/associated with $B_j$, where $j$ ranges through the number of counters. –  amWhy Dec 23 '12 at 20:27
Good enough!... –  amWhy Dec 23 '12 at 20:27