Given two subgroups H, K of a compact group G, the probability that a random element of H commutes with a random element of K is denoted by \(\textrm{Pr} (H,K)\) . We show that if G is a profinite group containing a Sylow 2-subgroup P, a Sylow 3-subgroup \(Q_3\) and a Sylow 5-subgroup \(Q_5\) such that \(\textrm{Pr} (P,Q_3)\) and \(\textrm{Pr} (P,Q_5)\) are both positive, then G is virtually prosoluble (Theorem 1). Furthermore, if G is a prosoluble group in which for every subset \(\pi \subseteq \pi (G)\) there is a Hall \(\pi \) -subgroup \(H_\pi \) and a Hall \(\pi '\) -subgroup \(H_{\pi '}\) such that \(\textrm{Pr} (H_\pi ,H_{\pi '})>0\) , then G is virtually pronilpotent (Theorem 2).