Question 616887
<pre>
I will assume you are implying that the student will not leave 
any questions blank, and will therefore either gain or lose
some points for each of the N questions.

let:

N = the number of questions.
a = the number of points added for each correct answer.
b = the number of points subtracted for each incorrect answer.
p = the probability of answering any one question correctly.
C = the number of answers a student guesses correctly.
(Therefore the student guesses N-C answers incorrectly, since
I am assuming he or she leaves no answers blank.]
X = the student's score

Then the student's highest possible score is aN and the lowest
is -bN

The formula for the score X is

X = aC - b(N - C)

Solve that for C

X = aC - bN + bC

X + bN = aC + bC

X + bN = C(a + b)

{{{(X+bN)/(a+b)}}} = C

C = {{{(X+bN)/(a+b)}}}

If that does not come out to a whole number, then the student
cannot possibly score exactly X, so you will then have to 
choose whether to round C up to the next higher integer so that
he or she makes slightly higher than C or to round C down to the
next lower integer and makes slightly lower than X.

The probability of scoring X (or as close to X as possible) 
is the probability of guessing C correct answers correctly,
which is:

{{{(matrix(2,1,N,C))p^C*(1-p)^(N-C)}}}

where {{{(matrix(2,1,N,C))}}} is the number of combinations
of N things taken C at a time.

Edwin</pre>