Hello,

First of all - I know generating random numbers is a big topic. I need to find a solution for a specific problem.

I have a tree with 10 branches. Each branch contains of 10 EQUAL numbers in range 1-10.

For example {5} (3;3;3…3) {6} (7;7;7…7).

I want to generate 10 (each branch length) random numbers have the same range (1-10) for each branch.

I used a loop for seed of random number and want to find a set of numbers that AVERAGES to a value for each branch. F.ex branch {5} average is 3. So for example combination of 1,5,2,4,3,3,4,2,5,1 would result in average 3 and be passed over, than loop jumps into next branch.

My problem is generating random numbers for low and high values - for example getting average of 1 would only happen if one would get (1,1,1,1,1,1,1,1,1,1) - so I added a factor that values that average as 1,5 would also be passed.

As far as I am concerned rolling 10 1s in a row has the same possibility as rolling any other combination, and yet - I can never get that result (despite thousands of iterations).

I tried using both grasshoppers native “random” and “dice” component that can be fount in heteroptera plug-in.

Do you guys have any advice for me on how to approach that one?

Thanks