I have access to a black box function $f$ that returns 4 random integers $n_1$, $n_2$, $n_3$, $n_4$ with $4 \le n_i \le 13$ and $\sum_i n_i = 25$.
Experimentally, I can see that $n_1$, $n_2$, $n_3$ and $n_4$ all follow the same distribution, but I am trying to study the distribution of a fixed $n_i$, let's say $n_1$. Running the function a few thousand times gives me the following outcomes for $n_1$:
My first thought was that this function may simply try to generate 4 random numbers uniformly in the required range, and reject any combination where the sum is not 25. However, simulating this (enumerating all 219 tuples and counting the possible values for $n_1$) gives me a distribution that is completely different:
I believe there may be an error in my reasoning, since intuitively, I would expect that in order to match the sum constraint, $n_1$ should on average be close to $25/4=6.25$, which matches the experimentally measured distribution, and not $4$.
Is there an error in my approach of listing all the different tuples, or is this blue distribution actually the intended one with my assumptions? Furthermore, how can I figure out the actual distribution of $n_1$, assuming $f$ uses a relatively common algorithm? I have found several similar questions on Stack Overflow or Cross Validated but they didn't seem to give the actual probability distribution of any single variable.
Here are the raw frequencies after running the function 6024 times:
n 4 5 6 7 8 9 10 11 12 13
freq 446 1314 1820 1393 737 237 68 8 1 0
Edit: after some research I found the following algorithm, which seem like it would give a distribution close to the one I measured.
n1 = n2 = n3 = n4 = 4
do 9 times:
do:
i = random(1, 4)
while n_i = 13
n_i = n_i + 1
return n1, n2, n3, n4
I believe this would make it into a simple binomial distribution?

