I made a random distribution using 2 dice rolls, the output usually collects most data around mean:
Then I try to do sampling of N sample size. While using sample size of N = 2 it looks more or less real when sampling size is 3 and above it generates really strange results:
It does look real a little bit but not those sudden drops. I don't understand where they are coming from.
Algorithm. Well, it's sampling. I just brute force it. It finds every possible combination of values with a recursive function and after that calculates the mean of those. So it will be:
- [1,1,1] = mean of values is (1+1+1)/3=1 and mean of probabilities will be something like (0.2+0.2+0.2)/3
- [1,1,2] = (1+1+2)/3 | (0.2+0.2+0.3)/3
- ...
- [3,3,3]
Then if there are multiple results where mean values are the same it will find also mean of those. So [1,1,2] and [2,1,1] will have the same mean so their probability means will be calculated (p1+...+pn)/n. After that, the array is sorted and the output is on the second figure.
I think my issue is somewhere at the end. Combining values of the same mean seem odd to me, but I don't understand why. Any idea of what I am possibly doing wrong?

