You say you "have" two matrices. Does that mean you have the exact matrix representation of these two matrices? If so, why not just compute AC and CA, and see if they're different? Some matrices in your group will commute, and others will not. The identity, for example, commutes with all members of the group!