title: R: combinatorics, number of permutations for one combination
body: <p>I have three different events (1,2,3) with different probabilities (0.15, 0.76, 0.09) and I would like to draw 5 times with replacement.
  I can now determine the number of possible combinations using</p>
  
  <pre><code>nsimplex(3,5)  ### =21
  </code></pre>
  
  <p>from the combinat-package.
  And I can determine the probabilities of each combination using </p>
  
  <pre><code>mySimplex &lt;- xsimplex(3,5)
  myProbs&lt;-c(0.15, 0.76, 0.09)
  results&lt;- apply(mySimplex,2,dmultinom,prob=myProbs)
  </code></pre>
  
  <p>Further, I can of course determine the number of permutations by calculating 3^5= 243.</p>
  
  <p>But how do I know how often each permutation of the same combination is drawn without counting them manually? That is, how many permutations are in each of my combinations? </p>
  
  <p>If I undestand that correctly, there are 243 permutations building 21 different combinations. Now my question is, how many permutations build each combination. E.g. the combination {1,1,1,1,1} will be built up only once, whereas others are created by several permutations.</p>
  
  <p>I guess you can come to this by using the probabilities for each combination but I do not know how to do it? Or is there any other way to easiliy determine that in R?
  Thank you in advance.</p>