The second chart, giving the PDF of the pool debt after n rounds, looks completely wrong, I have no idea how you got that. The pool debt, assuming constant difficulty, is (X/D - n)*B, where X is the number of shares it took to get n blocks, which is distributed negative binomial. So it's really a shifted negative binomial, which doesn't have the cusp we see.
Meni, I couldn't find my notes so I've reproduced what I could from memory. I might have left out a step or two, but the results hold, and you can test them out if you like.
Let x1, x2, x3, …, xn be independent geometrically distributed random variables with the same probability, p.
Let Sj be the sum of x1 + x2 + x3 + ….+xj so that:
S1 = x1
S2 = S1 + x2
S3 = S2 + x3
…
Sj = Sj-1 + xj
…..
Sn = Sn-1 + xn
Since x1, x2, x3, … ,xj …,xn are geometrically distributed, Sj is a random variable from a shifted negative binomial distribution with target number of successful trials = j, with density:
Pr(X=Sj) = Γ(x+j)/(Γ(j) * Γ(x+1)) * p^j * (1-p)^x, so it follows:
Pr(X∈(S1, S2, S3, …, Sj, … ,Sn))
= sum from 1 to n [Γ(x+j)/(Γ(j) * Γ(x+1)) * p^j * (1-p)^x]/n (1)
So the probability density of a cumulative sum of independent geometrically distributed random variables is given by (1) and tends toward a uniform distribution on [1,j/p].
Similarly, if x1, x2, x3, … ,xj …,xn are geometrically distributed with mean = 0, then Sj is a random variable from a shifted negative binomial distribution with target number of successful trials = j and mean = 0. Since the mean is 0, the component probability densities can be visualised as below.
The probability densities Pr(X=Sj) and Pr(X∈(S1, S2, S3, …, Sj, … ,Sn)):
Pr(X=Sj) = Γ(x+(1-p)*j/p+j)/(Γ(j) * Γ(x+(1-p)*j/p+1)) * p^j * (1-p)^((x+(1-p)*j/p))
Pr(X∈(S1, S2, S3, …, Sj, … ,Sn))
= sum from 1 to n [Γ(x+(1-p)*j/p+j)/(Γ(j) * Γ(x+(1-p)*j/p+1)) * p^j * (1-p)^((x+(1-p)*j/p))]/n (2)
Although (2) does not exist in a closed form, it can be calculated and charts of the distribution for n=100, n=1000 and n=10000 for p=1e-06 are shown below. This distribution does not seem to tend toward a known distribution for large n or very small p.