Thanks for elaborating.
From the example you provided, if you keep the temperature constant, air pressure increases with density, because the more molecules per unit volume, the greater the push exerted by collisions.
Going back to the question you asked, which has a greater effect, number of collisions per unit time or the density of the molecules, for this you need the formula:
p = R r Tp is pressure,
r is density
T is temperature (in degrees Kelvin),
R is the specific gas constant, which varies from gas to gas.
For dry air, R is 287 J K-1 kg-1.
Try changing the variables to see which has a greater effect.This very important relationship is known as the
Equation of State, and simply means:
(1) for constant density, pressure increases with temperature (that is, if the molecules have a higher average kinetic energy, they exert a greater push on their surroundings);
(2) for constant temperature, pressure increases with density (the more molecules per unit volume, the greater the push exerted by collisions);
(3) for constant pressure, temperature and density are inversely related (that is, if there are fewer molecules in a given volume, they need to be travelling at a greater average speed to exert the same pressure).
Therefore, we can see that any change in any one variable is likely to cause changes in the others. For example, if we heat a mass of air, we increase its pressure, if the air is allowed to expand to equalise the pressure difference with the surrounding air, the density will decrease. When this happens, it will be lighter than the same volume of surrounding air, and will rise.
Refer to this link and I hope this clears it up
https://www.st-andrews.ac.uk/~dib2/climate/pressure.html