Not exactly: you take the precision at when each of these document are retrived (so: "at **the rank** of these documents).
For you example, assume you name those documents d_1 to d_5 and the system returns (wiht "x_something" some other document) :
x_1 d_3 x_2 x_3 d_2 d_5 x_4 x_5 x_6 d_1 x_7 d_4 x_8 x_9 ...
Thus you have to average: P@2 (rank of d_3), P@5, P@6, P@10, P@12 ,
i.e.
For you example, assume you name those documents d_1 to d_5 and the system returns (wiht "x_something" some other document) :
x_1 d_3 x_2 x_3 d_2 d_5 x_4 x_5 x_6 d_1 x_7 d_4 x_8 x_9 ...
Thus you have to average: P@2 (rank of d_3), P@5, P@6, P@10, P@12 ,
i.e.