Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{article
- usepackage{pgfplots}
- usepackage{tikz}
- begin{document}
- begin{tikzpicture}[
- declare function={p(k,n) = 1-((n!)/((n^(k))*((n-k)!)));}
- ]
- begin{axis}[axis lines=middle,
- xlabel=$k$, ylabel=$y$,
- ylabel style={anchor=south},
- xlabel style={anchor=west},
- ymax=1.2, xmax=12.5,
- domain=0:12.5, samples at={0,...,12},
- no markers
- ]
- addplot+ [ycomb, red, very thick] {p(x,2)}; % <----
- end{axis}
- end{tikzpicture}
- end{document}}
Add Comment
Please, Sign In to add comment