Given an integer n > 1 and a compact group G, we find some restrictions for the probability that two randomly picked elements x^n and y of G commute. In the case n = 1 this notion was investigated by W. H. Gustafson in 1973 and its influence on the structure of the group has been studied in the researches of several authors in last years.