Molecular formula of y = XOH
Let atomic weight of metal X is a.
Then, molecular mass of XOH = a + 16 + 1 = 40 (Given)
a = 40 - 17 = 23
Thus, metal X is sodium (Na) because 23 is the atomic weight of sodium metal. Sodium reacts with as
`2Na+underset("Cold")(2H_(2)O)toundersetY(2NaOH)+H_(2)uparrow`
Sodium (Na) gives hydrogen gas (Z) on reaction with cold water.
So, Y is NaOH (sodium hydroxide)
Z is `H_(2)` (hydrogen gas).