From the chemical formula the total mass of the compound can be determined. The mass of the 1 mole of the compound is its molar mass. The atom by which the molecule is generated, the mass of these atoms are expressed in terms of amu or atomic unit mass, but after formation of a molecule in a particular ratio the mass of each of the atom becomes the total molecular weight of the generated molecule. In this case the molecule posses three atoms X, Y and Z which are in a ratio of 2:2:7. Thus the chemical formula of the compound can be written as [tex]X_{2}Y_{2}Z_{7}[/tex].
So the total mass of the compound in amu is {(2×47)+(2×42)+(7×16)} = {94+84+112}=290 amu.
Thus 1 mole of the compound contains 290 amu or 290 g by mass.
Henceforth 20 gram of the compound is equivalent to (20/290) = 0.068 mole.