A student takes an examination consisting of $20$ true-false questions. The student knows the answer to $N$ of the questions, which are answered correctly, and guesses the answers to the rest. The conditional probability that the student knows the answer to a question, given that the student answered it correctly, is $0.824$. Calculate $N$.
I first set up the conditional probability as $$P(K \vert C) = 0.824 = \frac{P(C \vert K) \cdot P(K)}{P(C)} = \frac{P(K)}{P(C)} $$ Where, obviously $P(C \vert K) = 1$
I need to know $P(K) $ and $P(C)$. I believe $P(K)$ to just be $\frac{N}{20}$ since $N$ is the number of questions the student knows and there are $20$ questions total. Now I want to know $P(C)$ or the probability that the student gets a question correct.
Initially I formulated this as $P(C) = \frac{(20-N)}{20} \cdot \frac{1}{2}$. Where the first term gives us the probability that a question is a guess and then the probability of getting that question correct ($50$% for a T-F exam). However, this was incorrect.
I tried amending my formula for $P(C)$ by taking more of a "Law of Total Probability" approach to it and tried out $P(C) = [20-N] \cdot \frac{1}{2} + N \cdot 1$ where the first term is the number of problems guessed times the probability of getting a guess correct and the second term is the number of questions known times the probability of getting a known question correct. This too was incorrect.
So my question is how do I approach figuring out what P(C) is?
Your law of total probability approach is the way to go. We know that $\Pr[C \mid K] = 1$, and $\Pr[K] = N/20$. So
$$\Pr[C] = \Pr[C \mid K]\Pr[K] + \Pr[C \mid \bar K]\Pr[\bar K],$$
where $\bar K$ is the complementary event of not knowing the answer to a randomly selected question; hence $\Pr[\bar K] = 1 - N/20$. The only quantity remaining is $\Pr[C \mid \bar K]$, the probability of answering a randomly selected question given that the student doesn't know the answer. As this is a true-false question with only two options, this probability is $1/2$. So
$$\Pr[C] = \frac{N}{20} + \frac{1}{2}\left(1 - \frac{N}{20}\right).$$ It follows that $$0.824 = \Pr[K \mid C] = \frac{\frac{N}{20}}{\frac{N}{20} + \frac{1}{2}\left(1 - \frac{N}{20}\right)} = \frac{2N}{N + 20},$$ from which we obtain $N = 14.0136$, and the most reasonable integer value is $N = 14$. Substituting this into the formula yields $\Pr[K \mid C] = \frac{14}{17} \approx 0.823529,$ which is $0.824$ when rounded to three digits.