Description of the Multiset Monad Can someone explain the multieset monad?  Please give concrete examples of the product and unit natural transformations.
 A: Given a semiring $S$ and a set $X$, write $S\langle X \rangle$ for the set of all $S$-linear combinations of expressions of the form $\langle x\rangle$. The multiset monad is obtained in the case $S = (\mathbb{N},+,\times) = (\{0,1,2,\ldots\},+,\times).$
So for example, a multiset of elements of $\{x,y,z\}$ looks something like this: $$3\langle x \rangle + 2\langle y\rangle.$$
The unit is the function $\langle-\rangle  : X \rightarrow S\langle X \rangle$ that puts angled brackets around things. We can write $\langle -\rangle(x) = \langle x \rangle$, for example.
Now elements of $S\langle S\langle X \rangle\rangle$ are $S$-linear combinations of $S$-linear combinations of elements of $X$. For example, in the case $S=\mathbb{N}$ and $X = \{x,y,z\}$, an example element of $S\langle S\langle X \rangle\rangle$ would be: $$2\langle 3\langle x \rangle + 2\langle y\rangle\rangle + 5 \langle \langle x\rangle\rangle.$$ Recall also that the multiplication $\mu$ of a monad is supposed to be a map $\mu_X : S\langle S\langle X\rangle\rangle \rightarrow S\langle X\rangle.$ So basically, we're trying to 'flatten' an $S$-linear combination of $S$-linear combinations to obtain an $S$-linear combination. Something like this:
$$2\langle3\langle x \rangle + 2\langle y\rangle\rangle + 5 \langle \langle x\rangle\rangle \overset{\mu}\mapsto 2(3\langle x \rangle + 2\langle y\rangle) + 5 (\langle x\rangle) = 11\langle x\rangle +4\langle y\rangle.$$
So the multiplication $\mu$ basically just gets rid of the 'outer' layer of angled brackets. It can be defined as the unique $S$-linear transform $\mu:S\langle S\langle X \rangle\rangle \rightarrow S\langle X\rangle$ such that for all $L \in S\langle X\rangle$ we have $\mu(\langle L\rangle) = L.$
