Matrix which commutes with permutation matrix I'm trying to show that if $A$ commutes with all $3\times 3$ permutation matrices, then $A$ has to be of the following form: 
$ A =
\begin{pmatrix}
a & b & b \\
b & a & b  \\
b & b & a  \\
\end{pmatrix}
$  What i've tried so far: Let $A$ be a general $3 \times 3$-Matrix. We are trying to find $A$ such that $AP = PA$. This equation basically means the following:
$AP$ is A with permuted columns. $PA$ is A with permuted rows. This means that $A$ has to be such that permuting columns and rows in the same way leaves the marix looking the same.
For example for the permutations which flip $1$ and $2$:
$
\begin{pmatrix}
d & e & f \\
a & b & c  \\
g & h & i  \\
\end{pmatrix}$ =
$
\begin{pmatrix}
b & a & c \\
e & d & f  \\
h & g & i  \\
\end{pmatrix}$. If we do the same for flipping $2$ and $3$ and flipping $1$ and $3$ we get three matrix equations for the 9 entries  $a$ to $i$ 
Resulting in the following equations: $a = i, b = h, g = c, f = d , b = d, a = e, c = f, h = g, b = c, f = h, i = e, g = d$ which means : $ a= e = i$ and $b=c=d=g=h$ which is exactly what I was looking for.
The thing now is. If I look at permutations which not only swap two rows/columns (for example $(123) \implies (312)$ ) I get equations which contradict my above equations.
What am I doing wrong? Is the proposition even true i.e. provable? 
Thanks in advance!
 A: I would suggest you check your calculation that gives you contradictory equations. In particular, if $P$ is the permutation matrix:
$$P=\begin{pmatrix}0&1&0\\0&0&1\\1&0&0\end{pmatrix}$$
then it acts on the right by applying $[3,1,2]$ to the columns, and on the left by applying $[2,3,1]$ to the rows, so you don't apply the same permutation to the rows and colums and compare the answers.
It is enough to consider only the permutation matrices that swap two rows/columns, as general permutation matrices are just products of these (this is the result "the symmetric group is generated by transpositions"). So for example, the permutation $1\mapsto 3$, $2\mapsto1$, $3\mapsto 2$ is just that given by swapping the first and second row/column and then swapping the second and third. As your $A$ commutes with both of these "swap matrices", it must commute with their product.
A: Here's the problem:
$$P[3,1,2]=P[2,1,3]P[3,2,1]$$
$$P[3,1,2]A=AP[3,1,2]$$
$$P[2,1,3]P[3,2,1]A=AP[2,1,3]P[3,2,1]$$
When you premultiply you're doing $[3,2,1]$ and then $[2,1,3]$. When you post multiply you're doing $[2,1,3]$ and then $[3,2,1]$, so your calculations only hold for a permutation matrix that can not be written as the product of two other permutation matrices.
A: The identity matrix commutes with all permutation matrices and the same is true for a matrix whose entries are all the same. Since your condition is linear in $A$ (if $A$ and $B$ permute with all $P$ then $A+B$ also commutes), any linear combination of those matrices will commute with permutation matrices.
This shows that your matrices commute with permutation matrices and the computation using transposition shows the converse.
