β = 2

Plot[Exp[-β] β^k/k!, {k, 0, 2}, 
      PlotRange -> All]

ListPlot[Table[{k, Exp[-β] β^k/k!}, {k, 0, 10}], 
      PlotJoined -> True]

<< Statistics`

?ExponentialDistribution

dist1 = ExponentialDistribution[1]

dist = ExponentialDistribution[β]

gr1 = Plot[PDF[dist, z], {z, 0, 5}, PlotRange -> All]

ttns = Table[Random[dist1]/β, {10000}];

<< Graphics`

gr2 = Histogram[ttns, HistogramScale -> 1]

Show[gr2, gr1]

?PoissonDistribution

β = 6

poisdist = PoissonDistribution[β]

PDF[poisdist, z]

gr3 = 
      ListPlot[Table[Evaluate[PDF[poisdist, zz]], {zz, 0, 12}], 
        PlotJoined -> True]

tidtilnaestespring := Random[dist1]/β

AntalSpringIPeriode := (T = 1; t = 0; n = 0; 
        While[t ≤ T, 
          t += tidtilnaestespring; n++]; n--)

as := Table[AntalSpringIPeriode, {10000}]

asgr = Histogram[as, HistogramScale -> 1]

Show[asgr, gr3, PlotRange -> All]