# What does pressure of a gas really mean, is it the Pressure applied on the gas or the Pressure exerted by the gas on some boundary?

In Ideal Gas Equation $PV=nRT$ , $P$ is the pressure the gas exerts on the walls of the volume it is bounded in. But i've seen in some problems it is stated that the gas is under a pressure $x$ $N/m^2$ and this value is used for the $P$ in $PV=nRT$.

Which of these statement(s) is/are correct:
1) Pressure of a gas can be increased by compressing it.
2) Pressure of a gas can be increased by increasing it's temperature
3) Pressure of the gas can be increased by adding more gas in the container.
Is the pressure created in the three instances same or different?

P.S. I think i'm not able to phrase the question properly. So bear with me if you find any statement stupid or ambiguous and please answer whatever you understand.

The pressure exerted by the gas on the walls of the container is equal to the pressure applied by the walls to the gas. This is an expression of Newton's 3rd Law.

It makes no difference if the pressure is increased by compressing the gas, heating it or adding more molecules. It is the same kind pressure.

So a given system of $N$ particles has $3N$ position coordinates and $3N$ momentum components for each of the particles, and so the "true" system lives in a $6N$-dimensional space that we call "phase space."

We can't in general observe any of those individually, we only care about these big numbers: like how many total particles are there, how much volume is the box that they're stuck in, how much energy do they have. Some given value of those parameters needs to correspond to a "volume of phase space," containing all the microscopic states which would be compatible with the macroscopic parameters that we care about. Another important idea then is "entropy", which is an additive measure of these phase space volumes. Entropy is a function of the observable parameters of the system.

Now you can basically imagine that our uncertainties multiply and so a system in a sealed box with constant volume, number of particles, and energy, will basically just "wander" among the possible microscopic states randomly. If it does, then our best guess is "the system will be in the state of highest entropy," just because it has the biggest phase-space volume and the particle takes a random point in the phase space.

Now imagine that you have one big box made of two littler boxes which are sharing energy. The total entropy is, as we said, additive, so it is $S_1 + S_2.$ If we transfer a chunk of energy $\delta E$ from sub-box 2 to sub-box 1, it will increase the entropy only if: $$\delta S = \frac{\partial S_1}{\partial U}~\delta E + \frac{\partial S_2}{\partial U}(-\delta E) > 0.$$ Since energy spontaneously goes from hotter things to colder things, this gives us an immediate definition of $\frac{\partial S}{\partial U}$ as some sort of "coldness" of an object, where $S$ is this entropy function that calculates the phase space volume, and $U$ is the parameter of the internal energy to a box.

You might object that temperature could include parameters from various other sources, and this is potentially true: but we haven't needed any yet. We just define $T^{-1} = \frac{\partial S}{\partial U}$ and that is the "thermodynamic temperature." Two systems which share energy see energy flow spontaneously from higher temperature to lower temperature until both temperatures are the same, and this is simply due to our uncertainty about the microscopic state of the universe growing and multiplying.

Now do the same thing for volume. A box of total volume $V$ is made up of two sub-boxes with a movable partition which shares volume between the two: The exact same argument suggests that $\partial S / \partial V$ must be some sort of "wanting-more-volume-ness" that must become equal when you bring the two boxes into contact. We would say, the two boxes share volume until they come to the same pressure. In this case we generally normalize by temperature again and instead of inverting the relation with the $\bullet\mapsto\bullet^{-1}$ trick we just use a minus sign, $-P = T \frac{\partial S}{\partial V}.$

So there you have your answer. You can either view pressure as the force on the walls from the inside out, or from the outside in: these are the same precisely because two systems which are allowed to share volume (the walls are allowed to move) will come to the same pressure. If you have a solid box whose walls are not allowed to move, then obviously the pressure outside no longer has anything to do with what's happening inside and the relevant pressure is the one inside. But when you hear that an object is under a fixed pressure, it's saying that the object is sharing its volume with a very large reservoir of volume that therefore maintains a more-or-less constant pressure as the object in question expands or contracts.