5.6/22.4=0.25mol
5.1/0.25=20.4g/mol
(20.4-18)/(24-20.4)=2/3
2该合金中铝和镁的物质的量之比为(3×18)/(2×24)=3/4
1该合金中铝的质量分数3/7=42.86%