benchmarks.wiki / Public workspace

MMLU-Pro / 10615 / Write a FORTRAN program segment to compute values of the POISSON distribution…

Problem

Answer published by the source. Consult the official source to check your work against its answer.

question

Write a FORTRAN program segment to compute values of the POISSON distribution given by P(X) = e^-mm^x/x! Assume (1) that X and m are integer variables; (2) that X and m are small enough that no term will exceed the size permitted for a real variable in your computer; and (3) that the function FACT (n) for computing n! is available.

category

computer science

options

  1. FUNCTION P(X,M) INTEGER X Y = FLOAT(M) P = EXP(M) * M ** X / FACT(X) RETURN END
  2. FUNCTION P(X,M) INTEGER X, M P = EXP(-M) * M ** X / FACT(X) RETURN END
  3. FUNCTION P(X,M) INTEGER X, M P = EXP(-M) / (M ** X * FACT(X)) RETURN END
  4. FUNCTION P(X,M) INTEGER X Y = FLOAT (M) P = EXP(-Y) * M ** X / FACT (X) RETURN END
  5. FUNCTION P(X,M) INTEGER X Y = FLOAT (M) P = EXP(Y) * M ** X / FACT (X) RETURN END
  6. FUNCTION P(X,M) REAL X Y = FLOAT(M) P = EXP(Y) / (M ** X / FACT(X)) RETURN END
  7. FUNCTION P(X,M) REAL X Y = FLOAT(M) P = EXP(-Y) * Y ** X RETURN END
  8. FUNCTION P(X,M) INTEGER X Y = FLOAT (M) P = EXP(-Y) * M ** X * FACT (X) RETURN END
  9. FUNCTION P(X,M) INTEGER X Y = FLOAT(M) P = EXP(-Y) / (M ** X * FACT(X)) RETURN END
  10. FUNCTION P(X,M) INTEGER X Y = FLOAT (M) P = EXP(-Y) * M / X / FACT (X) RETURN END

src

stemez-ComputerScience

Discussion

Discussion

No discussion posts on this page yet. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

Source and history

Official source

initial import