Wick's Theorem and Functional Derivative In the Quantum Field Theory An Integrated Approach, Fradkin, the author derived the partition functional for a free scalar field (after analytic continuation to imaginary time ) as
$$Z_{E}[J]=Z_{E}[0] e^{\frac{1}{2} \int d^{D} x \int d^{D} x^{\prime} J(x) G_{0}^{E}\left(x-x^{\prime}\right) J\left(x^{\prime}\right)}\tag{5.141}$$
where
$$Z_{E}[0]=\int \mathcal{D} \xi e^{-\frac{1}{2} \int d^{D} x \xi(x)\left[-\partial^{2}+m^{2}\right] \xi(x)}.\tag{5.142}$$
($Z_{E}[0]$ is not important for the present case.)
It was argued that, the Wick's theorem is equivalent to
$$\begin{aligned}
\left\langle\phi\left(x_{1}\right) \cdots \phi\left(x_{N}\right)\right\rangle &=\left.\frac{1}{Z_{E}[0]} \frac{\delta^{N} Z_{E} \left[J\right]}{\delta J\left(x_{1}\right) \cdots \delta J\left(x_{N}\right)}\right|_{J=0} \\
&=\left\langle\phi\left(x_{1}\right) \phi\left(x_{2}\right)\right\rangle \cdots\left\langle\phi\left(x_{N-1}\right) \phi\left(x_{N}\right)\right\rangle\\
&+\text { permutations. }
\end{aligned}\tag{5.155}$$
I was not able to derive this expression, nor able to show the total number of terms in this equation is $$(2 k-1)(2 k-3) \cdots=\frac{(2 k) !}{2^{k} k !}\tag{5.156}$$
I am aware of a few alternative proofs to Wick's theorem, but I would like to know how to show this result using this partition function approach.
Specifically, how am I supposed to get all these permutation terms, and how should I count the total number of terms in the equation?
 A: *

*The 1st equality in eq. (5.155) follows from the definition of an Euclidean correlator function
$$\begin{align} \langle F[\phi] \rangle_J~=~&\frac{1}{Z[J]}\int\!{\cal D}\phi~ F[\phi] \exp\left\{ -S[\phi] + J_{\ell}\phi^{\ell}\right\}\cr
~=~&\frac{1}{Z[J]}F\left[\frac{\delta}{\delta J}\right] Z[J].\end{align}$$
Here we have used deWitt condensed notation. $\Box$


*Now let's outline the 2nd equality in eq. (5.155).
First of all, let us notationally simplify eq. (5.141) as
$$ Z[J]~=~e^{\frac{1}{2}J_{\ell}G^{\ell m}J_m}. \tag{5.141'}$$
Since in eq. (5.155) we are only interested in the term with $N=2k$ sources, we can replace the exponential (5.141') with the $k$th Taylor term
$$ Z[J]~\sim~\frac{1}{k!}\left(\frac{1}{2}J_{\ell}G^{\ell m}J_m\right)^{k}. \tag{5.141"}$$
The $N$ differentiations $\frac{\delta}{\delta J_{\ell_{1}}}\ldots \frac{\delta}{\delta J_{\ell_{N}}}$ in eq. (5.155) become a matter of choosing $k$ pairs of $N$ elements, and create $k$ contractions. The 1st pair can be chosen in $\binom{N}{2}$ ways, the 2nd pair can be chosen in $\binom{N-2}{2}$ ways, and so forth. We don't care about the order of the $k$ pairs, so we should divide with $k!$. Eq. (5.156) is the corresponding number of possible combinations. $\Box$
