EF and BD are diagonals of rectangle EBFD, thus, EF = BD. Length of EF is minimal only if BD is perpendicular to AC (BD as altitude through B of triangle ABC). Therefore,

$\sin \alpha = \dfrac{BD}{AB} = \dfrac{BC}{AC}$

$\dfrac{BD}{40} = \dfrac{30}{50}$

$BD = 24 \, \text{ cm}$

$\sin \beta = \dfrac{y}{BD} = \dfrac{AB}{AC}$

$\dfrac{y}{24} = \dfrac{40}{50}$

$y = 19.2 \, \text{ cm}$ *answer*