A model answered the same coding question tries times, and correct of those answers pass the tests. You pick k different answers at random and run them. Write pass_at_k(tries, correct, k): the chance at least one of your k is right.
A model wrote 10 answers to a coding question, and 3 of them pass the tests (filled in, marked ✓). You pick 2 different ones at random and run them. Some draws find a right answer, some don’t. Your function gives the chance a draw finds one.
pass_at_k(tries, correct, k)| tries | how many answers the model wrote | e.g. 10 |
| correct | how many of them are right | e.g. 3 |
| k | how many different answers you pick at random | e.g. 1 |
| returns | the chance at least one of your k is right | |