TL;DR
1) Assume you have 100grams of compound, if the amount of Q is 49.1% of this, how many grams of Q do you have? Do the same for Z
2) Determine the amount in moles for Q and Z using the molar mass. To do this divide mass from step 1 by the molar mass in the table. You now have the ratio of Q to Z which can be written as a formula. For instance if you have 4 moles Q and 7 moles Z, you would write Q4Z7.
3) Reduce the molar mass ratio of Q and Z by dividing by a common denominator (if possible). In the empirical formula, it should be written with the most reduced ratio possible. For instance, H2O2 should be re-written HO because we can divide both by 2.
Here’s the full explanation of the process:
First, let’s define an empirical formula.
While a molecular formula shows the exact number of each element in a molecule, the empirical formula is the simplest whole number ratio of the elements. For example, two completely different molecules have the molecular formulas HO and H2O2, but share the empirical formula HO, because the RATIO of H to O in each molecule is 1 to 1.
With this in mind, here are the (explained) steps you can take to answer your question:
1) We are given the composition by percentages of MASS. An easy way to think about this, is if we have 100grams of compound, and it is 40% element A by mass, that means that for every 100grams of compound, there are 40grams of element A. For your problem, how many grams of Q and Z are there for every 100grams of the compound (molecule)?
2) When we write empirical formulas (and molecular formulas), they are in terms of NUMBER OF ATOMS not mass. The good news is we can relate mass to number of atoms through their MOLAR MASS. When considering empirical formulas, since we are dealing with the ratios between the elements, the ratio of atoms is equivalent to the ratio of moles. For instance, HO can be said to have 1 H atom for every 1 O atom, -OR- 1 H mol for every 1 O mol. Okay. So, you have your values in grams of Q and Z, for every 100grams of compound. Given the molar mass of Q, how many moles of Q do you have?
To find the moles from molar mass, divide mass by the given molar mass. For instance, if I have 40grams of Q, I divide 40grams by 20.05grams/mol to get a value in terms of moles. Doing this with your own values determined above, how many moles do you have of Q and Z?
3) To get the final empirical formula, check if your moles of Q and Z have a common denominator they can be divided by, as the empirical formula is the simplest whole integer representation of the ratio. For instance, if you end up with Q6Z4, the empirical formula will be Q3Z2, dividing the original values each by 2.