Two containers of equal volume contain the same gas at pressures P1 and P2 and absolute temperatures T1 and T2 respectively. On joining the vessels, the gas reaches a common pressure P and common temperature T. The ratio PT is equal to
P12T1+P22T2
As the gas does not escape the number of moles of the gas is constant.
n1=P1V1RT1; n2=P2V2RT2after joiningn1+n2=P(V1+V2)RTHence, P1V1RT1+P2V2RT2=P(V1+V2)RT⇒P12T1+P22T2=PT (as V1=V2)