Let `M_(A)` and `M_(B)` be the molar masses of the gases A and B. According to available data :
No. of moles of gas `A(n_(A)) = ("Mass of gas A")/("Molar gas") = ((1g))/((M_(a)g mol^(-1)))`
No. of moles of gas B `(n_(B)) = ("Mass of gas B")/("Molar gas") = ((2g))/((M_(B) g mol^(-1)))`
`:. (n_(A))/(n_(B)) = ((1g))/((M_(A) g mol^(-1))) xx ((M_(B) g mol^(-1)))/((2g)) = (M_(B))/(2M_(A))`
Now, pressure of gas `A (P_(A)) = 2` bar
Pressure of gas A & gas B `(P_(A) + P_(B)) = 3` bar
`P_(B) = (3-2) = 1` bar
According to ideal gas equation,
`P_(A)V = n_(A)RT` and `P_(B)V = n_(B)RT`
`(P_(A))/(P_(B)) = (n_(A))/(n_(B))` or `(n_(A))/(n_(B)) = ((2 "bar"))/((1 "bar")) = 2/1`
Equating (i) and (ii) `(M_(B))/(2M_(A)) = 2/1` or `M_(B) = 4M_(A)`