Diffusion is a process in which a gas moves from a region of high concentration to a region of lower concentration.
rate of diffusion is inversely proportional to the square root of mass.
now, in a container, gas occupies the volume of the container.
so gas A and gas B have same volume when placed in the same container.
now mass is directly proportional to the density of the gas.
so, d1/d2 = (m1/m2)^1/2 = (p1v/p2v)^1/2 = (p1/p2)^1/2
d1, d2 rate of diffusion of gases a and b respectively.
similarly, m is the mass of the gas,
p is the density of the gas,
v is the volume of the gas.

u can easily remember the expression as,
when something is heavier (or denser), it's more difficult for it to travel than something that's lighter than it.
A = 4 B
let gas B be 1
therefore A = 4 x 1
                 = 4.
A : B = 4 : 1