Suppose there's a spaceship that has a hole in it. Gas is expanding through the hole from the spaceship to outer space (vacuum). According to pressure volume work ($P\Delta V$) the work done by the gas is infinity. According to my homework assignment, it's $0$. Can someone please explain why?
According to Wikipedia:
$P$ denotes the pressure inside the system and outside the system, against which the system expands; the two pressures are practically equal for a reversible process;
How can $P$ denote two different quantities? Can't this rule be applied for situations where the pressures inside and outside the system are different?