Let the molar mass of the polyhydroxy compound be M and it contains n number of OH groups.
Then molar mass of completely acetylated compound will be (M+42×n) and that of the completely methylated compound be (M+14×n).
Since 15 g of Q is completely acetylated to form 31.8 g of the acetylated compound, the number of moles of both compounds will be the same.
15M×(M+42n)=31.8
⇒n=16.8 M630
Hence, mass of completely methylated compound when 30 g of Q is completely methylated.
=30M×(M+14n)
=30M×(M+14×16.8 M630)
=41.2 g