Consider each section of the exam as containing the result of several draws (without replacement) from an urn. The urn contains the K
subjects the student studied, and the N - K
subjects he/she skipped. Let J = N - K
, for convenience.
Part A contains between 0 and 4 subjects that the student studied, while part B contains between 0 and 2 such subjects.
Now, for each of these 15 possible combinations, consider the value of k
that that combination gives rise to:
k = 0: 0 correct on part A, 0 correct on part B
k = 1: 0 correct on part A, 1 or 2 correct on part B, OR
1 correct on part A, 0 correct on part B
k = 2: 1 correct on part A, 1 or 2 correct on part B, OR
2 correct on part A, 0 correct on part B
k = 3: 2 correct on part A, 1 or 2 correct on part B, OR
3 correct on part A, 0 correct on part B, OR
4 correct on part A, 0 correct on part B
k = 4: 3 correct on part A, 1 or 2 correct on part B, OR
4 correct on part A, 1 or 2 correct on part B
At this point, it's just a matter of summing up the probabilities of the configurations, for each value of k
. Let f(k, K, J, n)
be the pmf of the hypergeometric distribution, with k
white balls drawn, K
white balls and J
black balls in the urn, and n
balls drawn overall. Then the probabilities are:
k = 0: f(0, K, J, 4) * f(0, K, J - 4, 2)
k = 1: f(0, K, J, 4) * (f(1, K, J - 4, 2) + f(2, K, J - 4, 2)) +
f(1, K, J, 4) * f(0, K - 1, J - 3, 2)
k = 2: f(1, K, J, 4) * (f(1, K - 1, J - 3, 2) + f(2, K - 1, J - 3, 2)) +
f(2, K, J, 4) * f(0, K - 2, J - 2, 2)
k = 3: f(2, K, J, 4) * (f(1, K - 2, J - 2, 2) + f(2, K - 2, J - 2, 2)) +
f(3, K, J, 4) * f(0, K - 3, J - 1, 2) +
f(4, K, J, 4) * f(0, K - 4, J, 2)
k = 4: f(3, K, J, 4) * (f(1, K - 3, J - 1, 2) + f(2, K - 3, J - 1, 2)) +
f(4, K, J, 4) * (f(1, K - 4, J, 2) + f(2, K - 4, J, 2))
I'm assuming the probability is just 0 wherever the distribution isn't supported (e.g., where k > K
).
As Joel W. says in the comments, probability is tricky, and it's always worth checking your work with a simulation. Here's my R code to do just that (with N
set to 25 and K
to 17; you could of course set these to whatever you wanted):
N <- 25
K <- 17
answered <- sapply(1:300000, function(i) {
subjects <- seq(from = 1, to = N)
studied <- sample(subjects, K)
asked <- sample(subjects, 6)
asked.1 <- asked[1:4]
asked.2 <- asked[5:6]
answerable.1 <- sum(is.element(asked.1, studied))
answerable.2 <- sum(is.element(asked.2, studied))
answered.1 <- min(answerable.1, 3)
answered.2 <- min(answerable.2, 1)
answered.1 + answered.2
})
table(answered) / length(answered)
Running the above, I got these observed proportions:
k = 0: 0.00016
k = 1: 0.00910
k = 2: 0.09298
k = 3: 0.34898
k = 4: 0.54879
Meanwhile, using R to evaulate the probabilities described above (with 25 and 17 substituted for N and K), I got:
k = 0: 0.00016
k = 1: 0.00896
k = 2: 0.09318
k = 3: 0.34762
k = 4: 0.55009
Good enough agreement, I think, to lend credence to my solution. (Happily, the probabilities sum to 1, ignoring a bit of rounding error.)
I realize that a single overall formula would have been more satisfying than the tabulation-based approach I took above. Unfortunately, I wasn't able to come up with a clean, readable formula that encapsulated all the various sums. I think the distinction between answerable and answered questions really complicates the problem, but it could very well be that someone more skilled in probability/combinatorics could find a way to express the various sums as a single crisp formula.