home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 41 / IOPROG_41.ISO / soft / c++ / NUMCPP11.ZIP / discdist.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-04-10  |  4.4 KB  |  103 lines

  1. //===================================================================
  2. // discdist.h
  3. //
  4. // Version 1.1
  5. //
  6. // Written by:
  7. //   Brent Worden
  8. //   WordenWare
  9. //   email:  Brent@Worden.org
  10. //
  11. // Copyright (c) 1998-1999 WordenWare
  12. //
  13. // Created:  August 28, 1998
  14. // Revised:  April 10, 1999
  15. //===================================================================
  16.  
  17. #ifndef _DISCDIST_H_
  18. #define _DISCDIST_H_
  19.  
  20. #include "numerics.h"
  21.  
  22. NUM_BEGIN
  23.  
  24. NUMERICS_EXPORT double binomialp(int x, int n, double p);
  25. //-------------------------------------------------------------------
  26. // Returns the value of the Binomial random variable distribution
  27. // function with n trials and p chance of success at the value x.
  28. //-------------------------------------------------------------------
  29.  
  30. NUMERICS_EXPORT void binomialv(double pp, int n, double p, int *b0, int *b1);
  31. //-------------------------------------------------------------------
  32. // Returns two critical points of the Binomial random variable
  33. // distribution function with n trials and p chance of success such
  34. // that P(B <= b0) <= pp <= P(B <= b1).
  35. //-------------------------------------------------------------------
  36.  
  37. NUMERICS_EXPORT double geomp(int x, double p);
  38. //-------------------------------------------------------------------
  39. // Returns the value of the Geometric random variable distribution
  40. // function with probability of success p at the value x.
  41. //-------------------------------------------------------------------
  42.  
  43. NUMERICS_EXPORT void geomv(double pp, double p, int *x0, int *x1);
  44. //-------------------------------------------------------------------
  45. // Returns two critical points of the Geometric random variable
  46. // distribution function with probability of success p such that
  47. // P(X <= x0) <= pp <= P(X <= x1).
  48. //-------------------------------------------------------------------
  49.  
  50. NUMERICS_EXPORT double hyperp(int x, int n, int N, int M);
  51. //-------------------------------------------------------------------
  52. // Returns the probability from the Hypergeometric random variable
  53. // distribution function with a population size M, containing N
  54. // successes, with a sample of size n, and observing x or less
  55. // successes.
  56. //-------------------------------------------------------------------
  57.  
  58. NUMERICS_EXPORT void hyperv(double p, int n, int N, int M, int *x0, int *x1);
  59. //-------------------------------------------------------------------
  60. // Returns two critical points of the Hypergeometric random variable
  61. // distribution function with a population size M, containing N
  62. // successes, with a sample of size n, such that P(X <= x0) <= p
  63. // <= P(X <= x1).
  64. //-------------------------------------------------------------------
  65.  
  66. NUMERICS_EXPORT double negbnlp(int x, int r, double p);
  67. //-------------------------------------------------------------------
  68. // Returns the value of the negative binomial random variable
  69. // distribution function with r successes each with probability of p
  70. // at the value of x failures.
  71. //-------------------------------------------------------------------
  72.  
  73. NUMERICS_EXPORT void negbnlv(double p, int r, double pp, int *x0, int *x1);
  74. //-------------------------------------------------------------------
  75. // Returns two critical points of the negative binomial random
  76. // variable distribution function with r successes each with
  77. // probability of pp, such that P(X <= x0) <= p <= P(X <= x1).
  78. //-------------------------------------------------------------------
  79.  
  80. NUMERICS_EXPORT double poissonp(int x, double l);
  81. //-------------------------------------------------------------------
  82. // Returns the value of the Poisson random variable distribution
  83. // function with mean l at the value x.
  84. //-------------------------------------------------------------------
  85.  
  86. NUMERICS_EXPORT void poissonv(double p, double l, int *x0, int *x1);
  87. //-------------------------------------------------------------------
  88. // Returns two critical points of the Poisson random variable
  89. // distribution function with mean l such that P(X <= x0) <= p <=
  90. // P(X <= x1).
  91. //-------------------------------------------------------------------
  92.  
  93. NUM_END
  94.  
  95. #endif
  96.  
  97. //===================================================================
  98. // Revision History
  99. //
  100. // Version 1.0 - 08/28/1998 - New.
  101. // Version 1.1 - 04/10/1999 - Added Numerics namespace.
  102. //===================================================================
  103.