Answer
(a) $v = \sqrt{\frac{2gh~(m-M~\mu_k)}{M+m}}$
(b) $v = \sqrt{\frac{2mgh}{M+m}}$
Work Step by Step
(a) The kinetic energy of the system just before the block of mass $m$ hits the floor will be equal to the sum of the initial potential energy of block $m$ plus the work done by friction.
We can find an expression for the speed of the block just before it hits the floor.
$KE = PE+W_f$
$\frac{1}{2}(M+m)v^2 = mgh-Mg~\mu_k~h$
$v^2 = \frac{2mgh-2Mg~\mu_k~h}{M+m}$
$v = \sqrt{\frac{2gh~(m-M~\mu_k)}{M+m}}$
(b) The kinetic energy of the system just before the block of mass $m$ hits the floor will be equal to the initial potential energy of block $m$.
We can find an expression for the speed of the block just before it hits the floor.
$KE = PE$
$\frac{1}{2}(M+m)v^2 = mgh$
$v^2 = \frac{2mgh}{M+m}$
$v = \sqrt{\frac{2mgh}{M+m}}$