To solve this problem it is necessary to apply the concepts concerning conservation of the linear momentum as well as the equations of energy acquisition for springs.
From the definition of conservation of linear momentum we have to,
Where,
Final velocity
Mass of the bullet
Mass of the block
Initial velocity of the bullet
initial velocity of the block
The block does not have initial speed because it is at rest, then replacing we have to,
Re-arrange to find
Now applying the energy conservation equations we have that the potential and kinetic energy of the spring must be maintained in the way
If the spring is compressed, then the velocity becomes zero. Here the kinetic energy is zero and the spring potential energy as follow,
Re-arrange to find x,
Therefore the spring is compressed around to 0.1913m