title: Choosing n numbers with fixed sum
body: <p>In some code I want to choose <code>n</code> random numbers in <code>[0,1)</code> which sum to <code>1</code>.</p>
  
  <p>I do so by choosing the numbers independently in <code>[0,1)</code> and normalizing them by dividing each one by the total sum:</p>
  
  <pre><code>numbers = [random() for i in range(n)]
  numbers = [n/sum(numbers) for n in numbers]
  </code></pre>
  
  <p>My "problem" is, that the distribution I get out is quite skew. Choosing a million numbers not a single one gets over <code>1/2</code>. By some effort I've calculated the pdf, and it's not nice.</p>
  
  <p>Here is the weird looking pdf I get for 5 variables:</p>
  
  <p><img src="https://i.stack.imgur.com/DZkY3.png" alt="enter image description here"></p>
  
  <p>Do you have an idea for a nice algorithm to choose the numbers, that result in a more uniform or simple distribution?</p>