## Sunday, 16 September 2012

### Distribution of Solution Times

We can use the results from my previous article A Simpler Server Rating Method to calculate the probability distribution for a user's solution times on the assumption that he always checks his solutions perfectly.  With the notation of the previous article, the user's expected score is given by:

sU = 1 / (1 + 10^[(RP - RU - K*log2(t/T))/400])

Let xP = 10^(RP/400) and xU = 10^(RU/400).

sU = 1 / (1 + (xP / xU) / 10^[K*log2(t/T))/400])

As before:

10^[K*log2(t/T))/400] = [10^log2]^(K/400) = [10^[log(t/T)/log(2)]/400]^(K/400) = (t/T)k

where k = K/(400*log(2)).

sU = 1 / (1 + (xP / xU) * (t/T)-k) = xU / [xU + xP * (t/T)-k]

The expression for sU is the cumulative probability distribution of the user's correct solution times.  The probability distribution itself is the derivative of sU with respect to t:

dsU/dt = -xU * xP * -k * (t/T)-k-1) * (1/T) / [xU + xP * (t/T)-k)]2

= xU * xP * (k/t) * (t/T)-k / [xU + xP * (t/T)-k)]2

= (k/t) * {xU / [xU + xP * (t/T)-k)]} * {xP (t/T)-k / [xU + xP * (t/T)-k)]}

= sU * (1 - sU) * k / t

Equally Rated User and Problem

The graph below shows the distribution of solution times with perfect checking for a user and problem that are equally rated at a target time of 100 seconds:

For this graph, K = 150.  The most likely solution time for this example is 17 seconds, i.e. just over a sixth of the target time.  I worked out values for the average time using the trapezium rule, with intervals of 1 second.  The average solution time exceeds the target time after about 343 seconds, and is about 227 seconds after an hour.  It is still rising steadily on a log scale, but most users would have given up before that!  This is a very curious result.

User 400 Points Stronger

The graph below shows what happens when the user's rating is increased to 400 points more than the problem rating:

The user is nearly three times faster here, so the graph is squashed to the left.