This question is in response to @brightmagnus answer whose link is Pressure in Fluids,in particular horizontal pressure
The question :
Is the atmospheric pressure due to the weight of air or collisions of the molecules?
If according to bright magnus' answer it is due to both weight and collisions then if at sea level we close the cap of a bottle, then the pressure in the bottle will the pressure outside because the weight of the air above is transmitted through the cap.
But if we take this same bottle at Everest or say space the weight of the air above would be significantly less at Everest and in the case of space there will be no air outside the bottle to transmit the pressure. But still the pressure in the bottle will be the same as it was at sea level.
Why is it so? How has small column of air in the bottle got the same pressure as the entire atmosphere ( the bottle off course is of tough material and doesn't blast).
Also if the total pressure is due to both the weight of the air and the collisions of the molecules then why do we not include a pressure term due to collision of molecules in the equation for total pressure which is P =hpg and which includes the part of pressure only dusri weight. I am getting confused here. Can The same argument be extended to water?
Edit
First , I would like to add my own answer. I think that at surface of the earth , when the bottle is open , the pressure at its bottom surface is hpg. When we close the cap, the external pressure remains hpg. The air inside the bottle tries to attain equilibrium and the velocity of the air molecules inside increases (or decreases) to attain a pressure equal to the external (to balance it) according to P =1/3pv^2.
Then when it's taken outside earth's atmosphere , the velocities of the molecules remain the same(since there is no air outside ) and so doea the density and hence the Pressure. Now I would like to extend the question Suppose , I have a packed box of height h filled with air in space, the pressure inside it is P=1/3pv^2 (no gravity). Now suddenly the box is taken into a gravitational field. What would be the pressure inside ? I think it would somewhere between 1/3pv^2 + hpg (where v is original velocity of the molecules when they were outside the gravitational field and the new velocity would hence accordingly adjust)
But we give the entire pressure just by hpg. I understand that when the box is initially in a gravitational field the weight manifests itself as force per unit area due to the molecules colliding with velocity v. But when the box was not initially in gravitational field, the molecules in it did exert a pressure due to their velocity. But when it is brought in gravitational field shouldn't the total pressure be the sum of 1/3pv^2 and hpg?