Guest User

Untitled

a guest
Nov 18th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. documentclass{article
  2.  
  3. usepackage{pgfplots}
  4. usepackage{tikz}
  5.  
  6. begin{document}
  7. begin{tikzpicture}[
  8. declare function={p(k,n) = 1-((n!)/((n^(k))*((n-k)!)));}
  9. ]
  10. begin{axis}[axis lines=middle,
  11. xlabel=$k$, ylabel=$y$,
  12. ylabel style={anchor=south},
  13. xlabel style={anchor=west},
  14. ymax=1.2, xmax=12.5,
  15. domain=0:12.5, samples at={0,...,12},
  16. no markers
  17. ]
  18. addplot+ [ycomb, red, very thick] {p(x,2)}; % <----
  19. end{axis}
  20. end{tikzpicture}
  21.  
  22. end{document}}
Add Comment
Please, Sign In to add comment