On this page
A gas-mixing simulation gives you a box, a few gas cylinders and a pressure gauge. That is all you need to test a core rule of gas chemistry. The trick is to predict every reading before you look at it. A wrong prediction shows you a gap before an exam does.
What does Dalton's law of partial pressures say?
The total pressure of a mixture of ideal gases is equal to the sum of the partial pressures of the gases in it, as OpenStax Chemistry 2e puts it.
A gas's partial pressure is the pressure it would exert if it were alone in the container (OpenStax).
The mole fraction of gas A is its moles divided by the total moles: X_A = n_A / n_total. Partial pressure follows from it: P_A = X_A × P_total (OpenStax).
In an ideal gas, molecules ignore each other, so pressure depends on how many particles there are, not what kind. The story of how John Dalton reached this idea is in our piece on Dalton and the law of partial pressures.
How do you set up a gas mixture simulation?
Keep the volume and temperature fixed at first, so the number of moles is the only thing you change. Then P = nRT/V, where R, the molar gas constant, is 8.314 J mol⁻¹ K⁻¹ (NIST CODATA). If the units of R trip you up, our guide to choosing the right value of the gas constant R helps.
A handy box: 24.94 L at 300 K. With those settings, each mole of any gas adds very close to 100 kPa (8.314 × 300 ÷ 0.02494 m³ ≈ 100,000 Pa).
Worked example: what will the gauge read?
Use the 24.94 L, 300 K box. Cover the answers and predict each line first.
Add 1.0 mol N₂. Total pressure is 100 kPa. X_N₂ = 1, so P_N₂ = 100 kPa.
Add 0.5 mol O₂. Total moles are 1.5, so the total is 150 kPa. X_O₂ = 0.5/1.5 = 0.333, so P_O₂ = 50 kPa. P_N₂ stays at 100 kPa, but X_N₂ falls to 0.667.
Add 1.0 mol He. Total moles are 2.5, so the total is 250 kPa. The mole fractions are N₂ 0.4, O₂ 0.2, He 0.4. The partial pressures are 100, 50 and 100 kPa, which add up to 250.
Check the rule: 0.4 × 250 = 100 kPa for N₂. That matches step 1, because adding helium did not change how hard the nitrogen pushes.
The main lesson is in step 3. Helium atoms are much lighter than nitrogen molecules, yet a mole of helium adds exactly as much pressure as a mole of nitrogen. If you expected less, you were thinking about mass rather than particle count.
Does the mole fraction rule hold when you heat or expand the box?
Try two more changes in the simulation:
Double the temperature to 600 K. Every partial pressure doubles and the total becomes 500 kPa. The mole fractions do not change, because no moles were added.
Go back to 300 K and double the volume. Every partial pressure halves and the total becomes 125 kPa. The mole fractions still do not change.
This is the pattern to remember: temperature and volume scale all the partial pressures together, while adding a gas changes the mole fractions.
Where does Dalton's law show up outside the box?
The air around you is a gas mixture. Dry air at Earth's surface is 78.08% nitrogen and 20.95% oxygen by volume, and the surface pressure is 1014 mb, according to NASA's Earth fact sheet. For ideal gases, volume fraction equals mole fraction, so the partial pressure of oxygen is about 0.2095 × 1014 ≈ 212 mb, or 21.2 kPa. Do the same calculation for nitrogen as practice. The answer is about 792 mb.
If you want to see how gases move once they are mixed, try our Graham's law gas diffusion simulation next.
What mistakes do students make with partial pressures?
Using mass fractions instead of mole fractions. Convert grams to moles first.
Assuming a heavier gas exerts more pressure. Per mole at the same temperature and volume, every ideal gas exerts the same pressure.
Thinking that adding gas B lowers the partial pressure of gas A. At fixed volume and temperature it does not. Only A's mole fraction falls.
Applying the law to gases that react. If two gases react, the moles change, so work out the moles after the reaction first.
You can run this kind of predict-then-check experiment in the Fermi Simulation Lab, which has interactive simulations for ideas that are easier to see than to read. When you move on to exam-style mixture numericals, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than just printing an answer.



