>>901をSmalltalkに逆翻訳してみた。もちろん厳密にはいろいろと違うけどまあ勘弁して。
>>782や>>799と見比べて、関数型でMultiSet(Bag)が使えてもぜんぜん嬉しくないのはよく分かった。

| M N cards bag replicate randoms |
M := 1000.
N := 10.
cards := 1 to: N.
replicate := [:n :x | Array new: n withAll: x].
randoms := [:g | (g next: N*10) * 2147483647 truncated].
bag := (replicate value: M value: Random new) inject: Bag new into: [:b :g |
   b add: (((randoms value: g) inject: {Bag new} into: [:xs :n |
         xs, {xs last copy add: n \\ N + 1; yourself}])
      detect: [:xs | xs includesAllOf: cards]) size; yourself].
^{bag min. bag max. bag sortedCounts first} "=> {12 . 85 . 56->23} "