I have a multiset, say $\{8,5,7,8,8,9,5,5,3,0,1\}$, and I wish to compute a weight with the following formula: number of times an element appears in the multiset divided by the total number of elements in the multiset. For example, if the element is $8$ then the weight becomes $3$ (eight appearing three times) divided by $11$ (the total number of elements in the multiset).
How can I express this formula in mathematical notation using symbols like the sigma (sum) symbol for the number of times an element appears and what should be the symbol for expressing the size of the multiset?
First, it is not a set: it is a multiset (a set does not include multiplicities: $\{1,1,1,1,1,2\} = \{1,2\}$. A multiset does).
A possibility, using the indicator $\mathbf{1}$: for a multiset $S$,the number of times $x$ appears in $S$ (the multiplicity of $x$ in $S$) can be written $$ \sum_{s\in S} \mathbf{1}_{\{x\}}(s) $$ or $$ \sum_{s\in S} \mathbf{1}_{\{s=x\}} $$ (What it means is, literally: sum, over all elements of $S$, of a value which is $1$ if $s=x$ (that is, equivalently, if $s\in\{x\}$) and 0 otherwise).
This is quite standard; at least, I have seen it in numerous occasions (papers and lecture notes). From there, the frequency of $x$ in $S$ can be written simply as $$ \frac{1}{\lvert S\rvert}\sum_{s\in S} \mathbf{1}_{\{x\}}(s) $$ using again the standard notation $\lvert S\rvert$ for the cardinality of $S$.