How to calculate HumanEval pass@k from ten samples
With two passing programs among ten candidates for one problem, estimated pass@1 is 20%, pass@3 is 53.33% and pass@5 is 77.78%.
Count selections that miss every passing program
For a problem with n generated candidates and c passing candidates, the HumanEval estimator is 1 − C(n−c,k)/C(n,k), where C counts combinations. Of the 120 ways to choose three distinct candidates from ten, 56 choose only from the eight failing candidates. The remaining 64 include a pass: 64/120 = 53.33%.
Reproduce all three figures
In Python, import comb from math and evaluate 1 - comb(8,k)/comb(10,k) for k equal to 1, 3 and 5. The results above use this synthetic input. Replacing the combination ratio with 1 − 0.8³ gives 48.8% at k=3; that calculation assumes sampling with replacement and answers a different question.
Read an aggregate benchmark
Compute the estimate per problem, then average across problems. Report attempts per problem and the test harness used. A high pass@5 means that a passing candidate often exists within the five; a user who can ship only one answer still needs tests or a selection method to identify it.