When a door or window is opened in a building with A/C on a hot day, is the cold air trying to escape or is the hot air trying to enter?

Both, air is a gas and will seek the path of least resistance. Gas molecules respond to temperature, and higher heat reduces air density meaning it will fill a space quicker than the denser colder air. The cold air will "escape" (be pushed out by the hot air) and the hot air will fill the space. The less dense hot air will also float above the cold dense air, which will make the space feel warmer the higher you get in it. By opening a door or window you've also broken the building envelope and will force the A/C to attempt to cool indefinitely which will add wear to your equipment, prevent adequate cooling, and potentially cause the evaporation coil to become so chilled and damp it frosts over and eventually overheats your A/C unit. The evap. coil is designed to allow for airflow while simultaneously cooling the air passing through it, which in turn keeps the unit interior cool. The ice blocks the air flow, which will result in an overheat.

Think of a room like a bucket, and the air is water, if I start out with a bucket full of warm water and continuously fill it with a small stream of cold water, and a large stream of hot water over the course of time the hot water will end up the majority content of the bucket. The cold water may help ever so slightly in reducing the overall temperature of the bucket but only barely, and as the bucket fills to the brim it'll begin to overflow. I'll still be adding cold water, but to a more or less full bucket of hot water. It'll never have enough time to cool the whole bucket as it overflows. The cold water isn't necessarily escaping so much as it is being negated by the more abundant hot water.

/r/askscience Thread