Initially, both bulbs have a volume V, pressure pi, and temperature T1.
Using the Ideal Gas Law (PV=nRT), the number of moles in each bulb is:
n1=RT1piV, n2=RT1piV
ntotal=n1+n2=RT12piV
In the final state, the bulbs reach a common pressure Pf. Bulb 1 remains at temperature T1, while bulb 2 is raised to temperature T2.
n1′=RT1PfV, n2′=RT2PfV
The total number of moles remains the same:
ntotal=n1′+n2′
ntotal=RPfV(T11+T21)
ntotal=RPfV(T1T2T1+T2)
RT12piV=RPfV(T1T2T1+T2)
Pf=2pi(T1+T2T2)