Q:

Probability of getting same grade on two tests?

A lazy professor gave two tests $A$ and $B$ to a class of $n$ students and assigned marks $A_i$ and $B_i$, respectively, to student $i$ for $i=1,2,...,n$ uniformly and independently at random with values from the set of possible grades $1,2,...,k$. What is the probability that some student receives the same grade on both tests?

My answer:
If the students were rolling two dice, for instance, only the dice had $k$ sides, the
  probability a student gets some grade is $\frac{1}{k}$ for one dice and
  $\frac{1}{k} \times \frac{1}{k} = \frac{1}{k^2}$ for two dice.
Applying this analogy here, if the students are assigned marks uniformly and
  randomly from a set of possible grades, the probability that a student gets
  one unique grade froim this set is $\frac{1}{k}$, and then the probability
  that the student gets the same grade again is $\frac{1}{k}\times\frac{1}{k}=\frac{1}{k^2}$
Apparently, though, the answer is supposed to be $\frac{1}{k}$ and that doesn't make much sense to me. Any ideas on why that is?

A:

It's quite simple. The probability of a student getting (for example) 1 on both tests is indeed $\frac{1}{k^2}$. But getting 2 on both tests also has the same probability. In general, a student can be getting the same grade on both tests in k different ways, each having probability of $\frac{1}{k^2}$. So the total probability of that event is $\frac{k}{k^2}$, or $\frac{1}{k}$.

