Answer: Yes, magnesium will replace hydrogen because magnesium is higher on the activity series list.
Explanation:
A single replacement reaction is one in which a more reactive element displaces a less reactive element from its salt solution.
A general single displacement reaction can be represented as :
[tex]X+YZ\rightarrow XZ+Y[/tex]
[tex]Mg+2HCl\rightarrow MgCl_2+H_2[/tex]
When magnesium is added to hydrochloric acid, magnesium being more reactive than hydrogen displaces hydrogen atom its salt solution and lead to formation of magnesium chloride and hydrogen gas.