Randomly took two three-ball groups, G1 and G2 and weigh them.
(1) If G1 = G2 then the heavy ball is in the remaining 2 balls, with one more weighing you can find the heavy ball.
(2) If G1 is not equal to G3 then take the heavier three-ball group and take randomly two balls B1 and B2 from this group and weigh them. If B1=B2 then the remaining ball in this group is the heavy ball. Otherwise, the heavier ball is the ball we look for.
In both cases ((1) and (2)) we can find the heavy ball in only two weighings .

Randomly took two three-ball groups, G1 and G2 and weigh them.

(1) If G1 = G2 then the heavy ball is in the remaining 2 balls, with one more weighing you can find the heavy ball.

(2) If G1 is not equal to G3 then take the heavier three-ball group and take randomly two balls B1 and B2 from this group and weigh them. If B1=B2 then the remaining ball in this group is the heavy ball. Otherwise, the heavier ball is the ball we look for.

In both cases ((1) and (2)) we can find the heavy ball in only

two weighings.