where is the magnitude of the velocity of Q after the collision with the wall. (Obviously this velocity is now opposite to the velocity of P.)
Now we have the second collision with P. Set this up the same way as before: with a conservation of momentum equation and the coefficient of restitution is again 1/3. Combining these two equations I get
which you can solve for e.