Exploring Stirling’s Approximation

str[n_] := (n^n) Exp[-n] Sqrt[2 π n]

N[50!, 10]

N[str[50], 10]

Plot[100*(1 - str[n]/n!), {n, 1, 50}, PlotRange -> All, AxesLabel->{"n", "%Error"}, LabelStyle->Larger, PlotLabel -> "Stirling Approximation Error", ImageSize->Scaled[0.8]]

Logarithmic approximation

lnstr[n_] := n Log[n] - n

N[Log[50!], 10]

N[lnstr[50], 10]

Plot[100 * (1 - lnstr[n]/Log[n!]), {n, 2, 50}, PlotRange -> All, AxesLabel->{"n", "% Error"}, PlotLabel -> "Error in Logarithmic Approximation", LabelStyle->Larger, ImageSize->Scaled[0.8]]