A gun shoots a bullet of mass into a wooden sphere of mass . The sphere hangs from a fixed point; the bullet makes the sphere swing up to a height , here taken as 0.1 meters. The bullet has an initial kinetic energy ; when it hits the sphere their kinetic energies are combined. As they swing up together, the kinetic energy is converted into potential energy. In order to make the sphere go up to 0.1 m, the velocity of the bullet must vary. Its velocity can be deduced using the conservation of energy. Vary the mass of the sphere and see how the velocity of the bullet must change in order to maintain the same velocity of the pendulum.
The velocity of the sphere and the bullet is and the initial velocity of the bullet is , where is the acceleration due to gravity, is the maximum height of the sphere and and are the masses of the bullet and the wood sphere, respectively. You can derive these expressions as an exercise.