Let, the matrix B=[adgbehcfi]
∵AB=BA
[010100001][adgbehcfi]=[adgbehcfi][010100001]
⇒[dagebhfci]=[behadgcfi]
On equating the matrices, we get
⇒d=b,e=a,f=c,g=h
∴ Matrix B=[abgbagcci]
No. of ways of selecting each of a,b,c,g,i from the set 1,2,3,4,5 are 5.
Thus, the total number of ways are =5×5×5×5×5
=55=3125
∴ No. of Matrices B=3125.