According to the question,
Weight of oxygen = 1
Weight of Nitrogen = 4
Molar mass of O2 = 32 amu
Molar mass of N2 = 28 amu
(This means that if you take 32 grams of oxygen or 28 grams of nitrogen, it will contain approximately 6.022 × 1023 molecules)
Let the mass of oxygen taken be Y grams then according to the question, the mass of nitrogen is 4Y grams. Now to calculate the number of particles, we divide the mass taken by amu.
No. of particles for oxygen we get, Y/32.
No. of particles for nitrogen we get, 4Y/28.
Now the ratio of number of particles for oxygen by nitrogen is
= (Y/32)/(4Y/28)
= Y/32 × 28/4Y
= 7/32 …Required ratio