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.![\frac15(\frac12 + \frac25 + \frac36 + \frac4{10} + \frac5{12}) \frac15(\frac12 + \frac25 + \frac36 + \frac4{10} + \frac5{12})](https://moodlearchive.epfl.ch/2021-2022/filter/tex/pix.php/93f93944e3ec150f3014ecd47c4b3ce4.gif)
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.
![\frac15(\frac12 + \frac25 + \frac36 + \frac4{10} + \frac5{12}) \frac15(\frac12 + \frac25 + \frac36 + \frac4{10} + \frac5{12})](https://moodlearchive.epfl.ch/2021-2022/filter/tex/pix.php/93f93944e3ec150f3014ecd47c4b3ce4.gif)