The inertia of the dust particles residing on the carpet resists the change in the motion of the carpet. Therefore, the forward motion of the carpet exerts a backward force on the dust particles, setting them in motion in the opposite direction. This is why the dust comes out of the carpet when beaten.