Its two. But you could have 9 balls. Divide the balls in 3 groups of 3 balls. You compare the weight 2 of the groups. Now you known the group where the heavy ball is. You pick two balls from this group and compare them, you now know wich ball is heavier.

Harder. You have 9 balls and one has a different weight, with three weighings you can get which ball is the different ball.

Its two. But you could have 9 balls. Divide the balls in 3 groups of 3 balls. You compare the weight 2 of the groups. Now you known the group where the heavy ball is. You pick two balls from this group and compare them, you now know wich ball is heavier.

Harder. You have 9 balls and one has a different weight, with three weighings you can get which ball is the different ball.