Search Results

Search found 1 results on 1 pages for 'erw'.

Page 1/1 | 1 

  • java random percentages

    - by erw
    I need to generate n percentages (integers between 0 and 100) such that the sum of all n numbers adds up to 100. If I just do nextInt() n times, each time ensuring that the parameter is 100 minus the previously accumulated sum, then my percentages are biased (i.e. the first generated number will usually be largest etc.). How do I do this in an unbiased way?

    Read the article

1