You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Dominique Merle 845ed67a21
test: add a test-case with 70 millions of participants
3 years ago
..
README.md test: add a test-case with 70 millions of participants 3 years ago
assertions.json test: add a test-case with 70 millions of participants 3 years ago

README.md

Do add your test cases in the JSON file.

Some of the sample tallies were made using python.

import numpy as np
def randofsum_unbalanced(s, n):
    # Where s = sum (e.g. 40 in your case) and n is the output array length (e.g. 4 in your case)
    r = np.random.rand(n)
    a = np.array(np.round((r/np.sum(r))*s,0),dtype=int)
    while np.sum(a) > s:
        a[np.random.choice(n)] -= 1
    while np.sum(a) < s:
        a[np.random.choice(n)] += 1
    return a