\documentclass[a4paper, 12pt]{article}
\usepackage{amsmath}

\title{Monkey Doing A Multiple Choice Exam}
\date{22 December 2023}

\begin{document}

	\maketitle

	\section*{Problem statement}

		\begin{flushleft}
			Suppose, you were given a multiple choice exam, but you didn't feel like doing it, so you
			just selected random answers. What grade will you get? 25\%? 0\%? 100\%?
		\end{flushleft}

		\begin{flushleft}
			We must realise that you cannot predict exactly what score you will get, however, you
			can find the probability of getting a certain number of questions correct. A complete
			statement of the problem is as follows:
		\end{flushleft}

		\begin{flushleft}
			If you were to randomly select the options on a multiple choice exam consisting of $n$ questions
			and $m$ otpions per question with only one correct option, what is the probability of you
			getting $k$ out of $n$ questions correct?
		\end{flushleft}

	\section*{The extreme cases}

		\begin{flushleft}
			It is easiest to find the probability of getting all questions correct or the probability of
			getting no questions correct.
		\end{flushleft}

		\begin{flushleft}
			Say, you randomly choose one option out of $4$ possible options
			on a single question. Assume there is only one correct option. The probability of you guessing
			correctly is $\frac{1}{4}$. Now, you move on to the next question. The probability of you guessing the
			first question correctly \textbf{and} the second one as well is $\frac{1}{4} \cdot \frac{1}{4} = \frac{1}{16}$.
			The probability of
			guessing three questions correctly is $\frac{1}{4} \cdot \frac{1}{4} \cdot \frac{1}{4}$. If you were to answer
			a test with 20 questions in total, then the probability of getting a perfect score would be
			$\left( \frac{1}{4} \right)^{20}$.
		\end{flushleft}

		\begin{flushleft}
			In general, the probability ($P_{perfect}$) of getting a perfect score by selecting options
			randomly on a multiple choice
			exam with $n$ questions and $m$ options per question with only one correct option is given by
		\end{flushleft}

		\[
			P_{perfect} = \left( \frac{1}{m} \right)^n.
		\]

		\begin{flushleft}
			Similar reasoning will allow us to find the probability of getting a score of $0$. The probability
			of getting a single question wrong with $m$ options per
			question and only once correct option is $\frac{m - 1}{m}$.
			Therefore:
		\end{flushleft}

		\begin{flushleft}
			In general, the probability $(P_{none})$ of getting no questions correct by selecting options randomly
			on a multiple
			choice exam with $n$ questions and $m$ options per question with only one correct option is given by
		\end{flushleft}

		\[
		\begin{aligned}
			P_{none}	&= \left( \frac{m - 1}{m} \right)^n \\
	       				&= \left( 1 - \frac{1}{m} \right)^n \\
	       				&= \left( 1 - P_c \right)^n
		\end{aligned}
		\]

		\begin{flushleft}
			where $P_{c}$ is the probability of answering a single question correctly.
		\end{flushleft}

	\section*{The complete solution}

		\begin{flushleft}
			Lets now consider cases such as getting 5 out of 20 questions correct.
		\end{flushleft}

		\begin{flushleft}
			Assume there are still 4 options per question. You could guess the first
			5 questions correctly while getting the other 15 wrong.
			The probability of doing so is
			$\left( \frac{1}{4} \right)^5 \left( \frac{3}{4} \right)^{15}$. However,
			this isn't the only way to get a score of 5 out of 20. You could also guess
			the first 3 correct, the next 15 wrong and the last 2 correct. The same score could
			be achieved with many different arrangements of wrong and correct guesses. The probability
			for each one of these arrangements is the same though. To figure out a complete solution to
			our problem, we need to find the number of possible arrangements of wrong and correct guesses.
		\end{flushleft}

		\begin{flushleft}
			Let $C$ represent a correct guess and $W$
			represent a wrong guess. A possible arrangement of wrong and correct guesses may be
			represented as a list:
		\end{flushleft}

		\[
			(C,\ C,\ \dots,\ C,\ W,\ W,\ \dots,\ W)
		\]

		\begin{flushleft}
			where a $C$ in position 1 indicates that question 1 was guessed correctly.
		\end{flushleft}

		\begin{flushleft}
			To find the number of arrangments is to find the number of permutations. In our
			case, not every object is unique. The number of permutations of $n$ objects where
			$p$ are of one kind, $q$ are of another kind, $r$ are of yet another kind, and so on,
			is given by
		\end{flushleft}

		\[
			\frac{n!}{p! \cdot q! \cdot r! \cdot \dots}.
		\]

		\begin{flushleft}
			With our situation of 5 correct guesses out of 20, the number of arrangements of such guesses is
			$\frac{20!}{5! \cdot 15!}.$
		\end{flushleft}

		\begin{flushleft}
			The probability of each of the arrangements was found earlier. The probability of getting a score of 5
			out of 20 can be found by adding the probabilities for all the different arrangements.
		\end{flushleft}

		\[
		\begin{aligned}
			P(guessing\ 5\ out\ of\ 20\ correct)	&= P(arrangement_1\ \textbf{or}\ arrangement_2\ \textbf{or}\ \dots) \\
								&= P(arrangement_1)\ +\ P(arrangement_2)\ +\ \dots \\
								&= \left( \frac{1}{4} \right)^5 \left( \frac{3}{4} \right)^{15} \left( \frac{20!}{5! \cdot 15!} \right).
		\end{aligned}
		\]

		\begin{flushleft}
			All of our reasoning above can be generalised.
		\end{flushleft}

		\begin{flushleft}
			With $m$ options per question and only one correct option, the probability of guessing
			$k$ out of $n$ questions correctly in a specific way is
		\end{flushleft}

		\[
			\left( \frac{1}{m} \right)^k \left( \frac{m-1}{m} \right)^{n-k}.
		\]

		\begin{flushleft}
			The number of ways to do so is
		\end{flushleft}

		\[
			\frac{n!}{k!(n-k)!}.
		\]

		\begin{flushleft}
			Therefore, \vspace{1cm}
		\end{flushleft}

		\begin{flushleft}
			The probability, $f(k,\ n,\ m)$, of getting $k$ out of $n$ questions correct by selecting
			options randomly on a multiple choice exam where there are $m$ options per question
			and only one correct option is
		\end{flushleft}

		\[
			f(k,\ n,\ m) = \left( \frac{1}{m} \right)^k \left( \frac{m-1}{m} \right)^{n-k} \left( \frac{n!}{k!(n-k)!} \right)
			\quad \diamond
		\]

		\begin{flushleft}
			This is the answer to the problem stated at the beggining of this article.
		\end{flushleft}

		\begin{flushleft}
			Notice that setting $k = n$ in the above expression yields the expression for $P_{perfect}$ and
			setting $k = 0$ yields the expression for $P_{none}$.
		\end{flushleft}
\end{document}
