<<Histograms`

Teilchensimulation

n=50000;

ClearAll[part];
part[0, n_]:=2 RandomReal[{0,1},n]-1;
part[k_Integer, n_]:=part[k,n]=part[k-1,n]+2RandomReal[{0,1},n]-1;

ClearAll[part];
part[0, n_]:=Table[0,{n}];
part[k_Integer, n_]:=part[k,n]=part[k-1,n]+2RandomReal[{0,1},n]-1;

Print/@Table[Histogram[part[k, n], HistogramScale->1, HistogramRange->{-k-1, k+1}], {k, 0, 7}]

Table[Histogram[part[k, n], HistogramScale->1, HistogramRange->{-k-1, k+1}], {k, 0, 4}]