title: Generating N numbers that sum to 1
body: <p>Given an array of size <code>n</code> I want to generate random probabilities for each index such that <code>Sigma(a[0]..a[n-1])=1</code></p>
  
  <p>One possible result might be:</p>
  
  <pre><code>0     1     2     3     4
  0.15  0.2   0.18  0.22  0.25
  </code></pre>
  
  <p>Another perfectly legal result can be:</p>
  
  <pre><code>0     1     2     3     4
  0.01  0.01  0.96  0.01  0.01
  </code></pre>
  
  <p>How can I generate these easily and quickly? Answers in any language are fine, Java preferred.</p>