Guest User

Untitled

a guest
Sep 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. documentclass[]{article}
  2.  
  3. usepackage{pgfplotstable}
  4. usepackage{pgfplots}
  5.  
  6. begin{document}
  7. The C.D.F is as follows:
  8.  
  9. [F(x)=
  10. begin{dcases}
  11. 0&text{$x<1$}\
  12. frac{11}{36}&text{$1leq x<2$}\
  13. frac{20}{36}&text{$2leq x<3$}\
  14. frac{27}{36}&text{$3leq x<4$}\
  15. frac{32}{36}&text{$4leq x<5$}\
  16. frac{35}{36}&text{$5leq x<6$}\
  17. 1&text{$xgeq 6$}\
  18. end{dcases}
  19. ]
  20.  
  21. The C.D.F can be graphed as follows:
  22.  
  23. {centering
  24. begin{tikzpicture}
  25. begin{axis}[
  26. clip=false,
  27. jump mark left,
  28. ymin=0,ymax=1,
  29. xmin=0, xmax=5,
  30. every axis plot/.style={very thick},
  31. discontinuous,
  32. table/create on use/cumulative distribution/.style={
  33. create col/expr={pgfmathaccuma + thisrow{f(x)}}
  34. }
  35. ]
  36. addplot [red] table [y=cumulative distribution]{
  37. x f(x)
  38. 0 0
  39. 1 11/36
  40. 2 20/36
  41. 3 27/36
  42. 4 32/36
  43. 5 35/36
  44. 6 1
  45. };
  46. end{axis}
  47. end{tikzpicture}
  48. par}
  49. end{document}
  50.  
  51. documentclass[]{article}
  52. usepackage{amsmath,mathtools}
  53. usepackage{pgfplotstable}
  54. usepackage{pgfplots}
  55.  
  56. begin{document}
  57. The C.D.F is as follows:
  58. [F(x)=
  59. begin{dcases}
  60. 0&text{$x<1$}\
  61. frac{11}{36}&text{$1leq x<2$}\
  62. frac{20}{36}&text{$2leq x<3$}\
  63. frac{27}{36}&text{$3leq x<4$}\
  64. frac{32}{36}&text{$4leq x<5$}\
  65. frac{35}{36}&text{$5leq x<6$}\
  66. 1&text{$xgeq 6$}\
  67. end{dcases}
  68. ]
  69.  
  70. The C.D.F can be graphed as follows:
  71. begin{center}
  72. begin{tikzpicture}
  73. begin{axis}[
  74. clip=false,
  75. jump mark left,
  76. %ymin=0,ymax=1,
  77. %xmin=0, xmax=5,
  78. every axis plot/.style={very thick},
  79. %discontinuous,
  80. table/create on use/cumulative distribution/.style={
  81. create col/expr={pgfmathaccuma + thisrow{f(x)}}
  82. }
  83. ]
  84. addplot [red] table [y=cumulative distribution]{
  85. x f(x)
  86. 0 0
  87. 1 11/36
  88. 2 20/36
  89. 3 27/36
  90. 4 32/36
  91. 5 35/36
  92. 6 1
  93. };
  94. end{axis}
  95. end{tikzpicture}
  96. end{center}
  97. end{document}
Add Comment
Please, Sign In to add comment