For a closed pipe (one end closed), the fundamental frequency is $f_c = \frac{v}{4L}$, where $v$ is the speed of sound and $L$ is the length.
For an open pipe (both ends open), the fundamental frequency is $f_o = \frac{v}{2L}$.
Given: Beat frequency = $|f_o - f_c| = \frac{v}{2L} - \frac{v}{4L} = \frac{v}{4L} = 4$ Hz.
So, $\frac{v}{4L} = 4 \implies \frac{v}{L} = 16$.
When lengths are halved, new length $L' = \frac{L}{2}$.
New frequencies: $f_c' = \frac{v}{4(L/2)} = \frac{v}{2L} = \frac{16}{2} = 8$ Hz (since $\frac{v}{L} = 16$), and $f_o' = \frac{v}{2(L/2)} = \frac{v}{L} = 16$ Hz.
New beat frequency = $|f_o' - f_c'| = 16 - 8 = 8$ Hz.