home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-SSP.ARJ / PODTF.C < prev    next >
Encoding:
Text File  |  1984-08-12  |  529 b   |  26 lines

  1.    podtf(l,m,y)
  2.  
  3.       /* computes the probability that less than m events occur in */
  4.       /* unit time in a series of events which have a poisson      */
  5.       /* distribution over time.                                   */
  6.  
  7.       int l,m;
  8.       float *y;
  9.  
  10.     {
  11.       int i;
  12.       float xl,z;
  13.       extern double pow();
  14.  
  15.       *y = 0.0;
  16.       if (m <= 0) return;
  17.       xl = l;
  18.       z = pow(.36789,xl);
  19.  
  20.       for(i = 1; i <= m; i++)
  21.       {
  22.        *y = *y + z;
  23.        z = z * xl / i;
  24.       }
  25.     }
  26.