Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

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 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?


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

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\}.$$

share|cite|improve this answer
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: – 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

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.