Okay so consider a matrix $$ A = \left( \begin{array}{ccc} 0 & 1 & 1 \\ 1 & -2 & -1 \\ 1 & -1 & 1 \end{array} \right)$$ so obviously to get the upper and lower traiangular matrix for LU factorization I first pivot and then eliminate so I get $$ A = \left( \begin{array}{ccc} 1 & -2 & -1 \\ 0 & 1 & 1 \\ 1 & -1 & 1 \end{array} \right)$$ then making everything 0 under the diagonal I get the following
$$ U = \left( \begin{array}{ccc} 1 & -2 & -1 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{array} \right)$$ and $$ L = \left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0\\ 1 & 1 & 1 \end{array} \right)$$
Then since we pivoted we also get a permutation matrix $P$ $$ P = \left( \begin{array}{ccc} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{array} \right)$$
But if I try to go back using $A = P^TLU = (P^{-1}L)U$ I do not get my original matrix back. Note: the question is only asking to find the permutation matrix. I got the right permutation matrix and it matches the answer at the back of the book but I have a feeling I am just getting lucky.