$2Al + 2H_2O + 2NaOH \to 2NaAlO_2 + 3H_2$
$n_{Al} = \dfrac{2}{3}n_{H_2} = \dfrac{2}{3}. \dfrac{6,72}{22,4} = 0,2(mol)$
$2Al + 6HCl \to 2AlCl_3 + 3H_2$
$Mg + 2HCl \to MgCl_2 + H_2$
$n_{H_2} = \dfrac{3}{2}n_{Al} +n_{Mg}$
$\Rightarrow n_{Mg} = \dfrac{8,96}{22,4} - 0,2.\dfrac{3}{2} = 0,1(mol)$
Suy ra :
$m_{Mg} = 0,1.24 = 2,4(gam) ; m_{Al} = 0,2.27 = 5,4(gam)$