From ideal gas equation,
PV=nRT
PV=(mM)RT∴ M=mRTPV
Where m and M are given mass and the molar mass respectively.
After adding B the pressure in the flask increases by 0.5 atm.
On applying ideal gas equation for the gases A and B taking volume and temperature to be same for both,
MA=2×RT1×V; MB=3×RT0.5×V
∴ MAMB=2RTV×0.5V3RT=2×0.53=13
Therefore, the ratio MA:MB=1:3
MBMA=3