Untitled


SUBMITTED BY: Guest

DATE: Aug. 27, 2012, 5:36 p.m.

FORMAT: Text only

SIZE: 300 Bytes

HITS: 1689

  1. #include <math.h>
  2. double AttackerSuccessProbability (double q, int z)
  3. {
  4. double p = 1.0 - q;
  5. double lambda = z * (q / p);
  6. double sum = 1.0;
  7. int i,k;
  8. for (k = 0; k <= z; k++) {
  9. double poisson = exp(-lambda);
  10. for (i = 0; i <= k; i++) {
  11. poisson = lambda / i;

comments powered by Disqus