Solution:
Answer: 2013201220132013−20122013
For each n∈{1,2,…,2013}, let Xn=1 if n appears in {a1,a2,…,a2013} and 0 otherwise. Defined this way, E[Xn] is the probability that n appears in {a1,a2,…,a2013}.
Since each ai (1≤i≤2013) is not n with probability 20132012, the probability that n is none of the ai's is (20132012)2013, so E[Xn], the probability that n is one of the ai's, is 1−(20132012)2013.
The expected number of distinct values in {a1,…,a2013} is the expected number of n∈{1,2,…,2013} such that Xn=1, that is, the expected value of X1+X2+⋯+X2013.
By linearity of expectation,
E[X1+X2+⋯+X2013]=E[X1]+E[X2]+⋯+E[X2013]=2013(1−(20132012)2013)=2013201220132013−20122013.