First, we have to find the number of moles of each element. The molar mass of phosphorus is 31 g/mol and the molar mass of bromine is 80 g/mol (You can find this in the periodic table):
[tex]5.11\text{ g P}\cdot\frac{\text{1 mol P}}{31\text{ g P}}=0.165\text{ moles P.}[/tex][tex]39.55\text{ g Br}\cdot\frac{1\text{ mol Br}}{80\text{ g Br}}=0.494\text{ moles Br.}[/tex]And then, we have to divide each value by the least value obtained. In this case, we have to divide everything by 0.165:
[tex]\begin{gathered} 0.165\text{ moles P/0.165=1 mol P.} \\ 0.494\text{ moles Br/0.165=2.99 moles Br}\approx3\text{ moles Br.} \end{gathered}[/tex]We're going to have 1 mol of phosphorus and 3 moles of bromine obtaining the empirical formula PBr3.