Possible marks in a MCQ test Just out of curiosity(we have a similar test) not homework :
A multiple choice questions test has $100$ questions. The marking scheme is $+4$ for correct answer, $-1$ for wrong answer and $0$ marks for question not attempted. There are $4$ options for each question. A student can attempt any number of questions he wants. How many different marks are possible?
Obviously minimum marks are $-100$. Working from $400$, the possible marks can be guessed till we see intuitively that all marks less than it are possible. But this approach is long. I want a more general and short approach which would be short even if the marking pattern was $+5,-2,0$.
 A: It depends on what you call "short".  Counting exceptions seems work fairly quickly for your two examples, though errors in doing so are possible 
With your $100$ questions and possible marks of $\{+4,-1,0\}$: possible total marks range from $-100$ to $+400$ which suggests $501$ possibilities.  But $\{+399,+398,+397, +394,+393,+389\}$ are not possible, leaving $495$ possibilities
With your $100$ questions and possible marks of $\{+5,-2,0\}$: possible total marks range from $-200$ to $+500$ which suggests $701$ possibilities.  But $\{+499,+498,+497,+496, +494,+492,+491,+489,+487,+484,+482,+477,$ $-195,-197,-199\}$ are not possible, leaving $686$ possibilities
As a more general expression, suppose that there are $n$ questions with marks $a \lt b \lt c$ and that $c-b$ and $b-a$ are coprime (in which case $c-a$ is too) and that $n \gt 2(c-a)$.  Then I think the answer is $$(c-a)\left(n-\frac{c-a-3}{2}\right)$$ which in these two examples give $5 \times (100-1)=495$ and $7 \times (100-2)=686$
Curiously, $b$ does not appear in my expression, but is necessary for the coprime requirement
A: Here is a way to figure out if a score is achievable in general. Sorry that it's not so pretty.
Let $c>0$ be the number of marks awarded to a correct answer, $w\geq 0$ the number of marks deducted for a negative answer. Assume $c,w$ are both positive. Suppose the test has $n$ questions and that $0$ marks are awarded for unattempted questions.
The total score on a test is $M=cx-wy$ where $x$ is the number of correct answers and $y$ the number of incorrect answers. Of course we need $0\leq x+y\leq n$.
Fix a score $M$. I think what you are asking is whether or not we can always find a $k$ between $0$ and $n$ so that the following system of linear equations has nonnegative integer solutions $x$ and $y$: \begin{align*} cx-wy&=M\\x+y&=k.\end{align*} 
In matrix form we have $$\begin{bmatrix} c & -w\\1 & 1\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix} = \begin{bmatrix}M\\k\end{bmatrix}.$$
Since $c+w>0$, the $2\times 2$ matrix on the left is invertible so we see that the solution to this system over the rational numbers is $$\begin{bmatrix}x\\y\end{bmatrix}  =\frac{1}{c+w}\begin{bmatrix} 1 & w\\-1 & c\end{bmatrix}\begin{bmatrix}M\\k\end{bmatrix} = \frac{1}{c+w}\begin{bmatrix} M+wk\\-M+ck \end{bmatrix}.$$
Now the question is, can we choose $k$ so that the right-side are both nonnegative integers? 
The first entry is always nonnegative, the second is if and only if $k\geq \frac{M}{c}$. 
For the entries to be integers, we need both to be divisible by $c+w$. But in fact one is if and only if the other is, since $M+wk$ is divisible by $c+w$ if and only if $M+wk-k(c+w) = M-ck$ is, if and only if $-M+ck$ is. 
In summary, to find out if a score of $M$ is achievable by a marking scheme for a test with $n$ questions where $c>0$ points are awarded to each correct answer, $w\geq 0$ points are awarded to each incorrect answer, and no points are awarded to unattempted questions,  we need to find a $k$ with the properties $$\frac{M}{c}\leq k\leq n$$ and $$M-ck\textrm{ is divisible by }c+w.$$
The second condition is equivalent to saying $M$ and $ck$ have the same remainder when divided by $c+w$.
In your example, $n=100,c=4,w=1$, so the above amounts to showing that a given score $M$ is achievable if we can find a $k$ such that $\frac{M}{4}\leq k \leq 100$ and $M$ and $4k$ have the same remainder when divided by $5$. 
Now $5$ is prime. This is fortunate for the following reason. First, if an integer is divided by $5$ the possible remainders are $0,1,2,3,4$. But consider the five numbers $4z,4(z+1),4(z+2),4(z+3),4(z+4)$ for any integer $z$. I claim that the set of remainders of these numbers when divided by $5$ is exactly $\{0,1,2,3,4\}$. Well, if not, then there are $i,j$ with $0\leq i < j\leq 4$ such that $4z+4i$ and $4z+4j$ have the same remainder when divided by $5$. In other words their difference is divisible by $5$. But their difference is $4(j-i)$. Since $5$ is prime, this means that $5$ divides either $4$ or $j-i\leq 4$. Either case is impossible.
What the previous paragraph is saying is that whatever the remainder of $M$ is when divided by $5$, you can definitely find a number of the form $4k$ with the same remainder. You just then need to check that $k$ is within the necessary range.
For example, suppose you want to find a way of a student getting a score of $246$. Now $246$ has a remainder of $1$ when divided by $5$, and the first integer $k$ larger than $61.5$ in which $4k$ also has a remainder of $1$ is $k=64<100$. Plugging into the above we see that a student could get a score of $246$ when $$\begin{bmatrix}x\\y\end{bmatrix}=\frac{1}{5}\begin{bmatrix}246+1(64)\\-246+4(64)\end{bmatrix}=\begin{bmatrix} 62 \\ 2\end{bmatrix},$$ i.e., when the student attempts $64$ questions, getting $62$ correct and $2$ incorrect. 
