Calculate probability of passing in an exam I need to calculate the probability of passing on an exam. Each exam chooses 30 random questions out of 5500 questions. If you miss more than three questions, you fail.
How can I calulate the probability of passing the exam? 
I am able to get the number of aproved exams, the number of failed exams, how many times a question was correctly answered, and the number of unanswered questions.
If the user has awnsered most of the questions (a question can be awnsered more the once) correctly, the probability should be high and vice versa.
 A: I would like to elaborate on AlgorithmsX' answer. Letting $N $ be the total number of questions to choose from (I.e. 5500) and $K $ the number of questions the user knows the answer to, then AlgorithmsX' answer explains how to calculate the probability that the exam is passed.
However, we do not know what $K$ is. Just assuming that the fraction of known questions $\frac{K}{N}$ is equal to the fraction of correctly answered questions, is not justified. Indeed, suppose that a student answers 45 out of 50 questions correctly. You can't just assume that he knows exactly 90 percent of the answers to the 5500 questions, he might just have gotten the questions he knew the answer to.
Assuming you do want to give feedback to a user who hasn't answered all 5500 questions, you need statistics. If you never had statistics, the following might feel backward. Let $m$ be the number of questions answered on the app during a 'test exam', $Y$ the number of correctly answered questions on the test exam. Then $Y$ too has a hypergeometric distribution.
$$
P(Y = k) = \frac{\binom{K}{k}\binom{N-K}{m-k}}{\binom{N}{m}} \\
P(Y \geq k) = \sum_{i=k}^{m} \frac{\binom{K}{i}\binom{N-K}{m-i}}{\binom{N}{m}}
$$
We want a conservative estimate for $K$. One way to find this is to pick the smallest value of $K$ for which the received value of $Y$ is not too improbable. "not too improbable" is subjective: statisticians often interpret this as "with probability at least 5%". I too will use this definition in what follows. Let $y$ be the received value of $Y$, then let $\hat{K}$ be the solution of
$$
P(Y \geq y) = \sum_{i=y}^{m} \frac{\binom{K}{i}\binom{N-K}{m-i}}{\binom{N}{m}} = 0.05
$$
rounded to the nearest integer. Solving the above equation requires numerical methods: Google 'Secant method' or ask a new question if you do not know how to do this.
You can now state with 95% confidence that the student knows the answer to at least $\hat{K}$ questions. You can then proceed to calculate the minimal probability of success using the method described before and with this $\hat{K}$ as $K$. Google 'confidence intervals' if you want to know more about the method used. This is a lot more complicated than the first answer, so take your time to look some things up and let me know if anything is unclear.
For the sake of completeness I want to point out that two implicit assertions were made:


*

*Students can only get a question correct if they really know the answer. This assertion is false if the exam is multiple choice and a question can be marked correct because of a lucky guess. Extra calculations are needed to take this effect into account. For your app, I would suggest to encourage users to skip a question when they do not know the answer to avoid overestimating their knowledge because of lucky guesses.

*The value of $K$ is fixed, I.e. students do not learn or forget. In practice, a good app should explain the user why an answer was wrong, thereby hopefully increasing $K$ during the test exam. On the other hand, knowledge can be forgotten. AlgorithmsX mentioned the Forgetting Curve in a comment before.


There is a lot of extra tweaks which can be done, but I think this answer covers the basics: use statistics to estimate the student's knowledge, then use probability to calculate their odds of succeeding.
A: This ain't no high school math here. What we need is a Hypergeometric Distribution. The probability that someone gets exactly $k$ out of $n$ questions on an exam with $N$ questions to choose from and the user got $K$ out of those $N$ questions is correct is
$$P(X=k)=\frac{{K \choose k} {N-K \choose n-k}}{ {N \choose n}}$$
The probability that the user got at least $k$ out of $n$ questions correct is
$$\sum_{i=k}^n\frac{{K \choose i} {N-K \choose n-i}}{ {N \choose n}}$$
In our case, $k=30-3=27$, $n=30$, and $N=5500$.
If the student had been through all the questions, this equation would be exact. This could be a problem if the student answered one question and got it right, but if the student answered a large enough question set, you could set $K=p*N$, where $p$ is the fraction of questions the user got right.
Here is a related link from a similar question.
Edit
Someone pointed out that you need to make a confidence interval and do a whole bunch of sampling stuff. All you need to do to deal with that is pick a confidence level, use the total number of questions a person has been asked, and then calculate a confidence interval. What you then do is calculate the maximum and minimum values of $K$ and put that into the equation. The final probability will be within the two numbers you get with the confidence level you chose.
