What is an exchangeable pair of random variables and how to construct them Let $\mathbb{P}$ be a probability distribution of a random variable $\sigma = (\sigma_1,...,\sigma_n).$ In the book I am reading it says that an exchangeable pair of r.v. can be created by choosing a coordinate I uniformly at random from $\{1,...,n\},$ and replace the $I^{\text{th}}$ coordinate of $\sigma$ by an element drawn from the conditional distribution of the $I^{\text{th}}$ coordinate given the rest. That will lead to the r.v. $\sigma '.$ It then says that the pair $(\sigma, \sigma ')$ is an exchangeable pair of r.v.
Can somebody explain this construction ? I do not understand why the order of the coordinates or random variables matters. I also do not understand the aim of creating the exchangeable pair of r.v. In the book there are usually functions of dependent random variables used.
Thanks for any answer.
 A: I guess you are pulling this from a book on Stein's method, in a section about the method of exchangeable pairs.
The point of Stein's method is to show that a random variable is close to, say, the Gaussian distribution, by showing that it approximately has a property that the Gaussian distribution has.
In the method of exchangeable pairs we use the following property of the standard Gaussian: for every $\lambda<1$, there exists an exchangeable pair $(Z,Z')$ such that $\Bbb E[Z-Z'\mid Z] = \lambda$ and $\mathrm{Var}(Z-Z'\mid Z) = \lambda(1-\lambda)$. This is a continuous version of the "resampling" procedure you described above.
Intuitively it means that you can resample part of the randomness without changing the overall variable too much. This is a property that i.i.d sums of a large number of things also have, so it's no surprise that you see that in Gaussian variables.
In applying Stein's method you will show that from a random variable that is not quite an i.i.d. sum (like the count of triangles in a random graph for instance) you can construct such an exchangeable pair, and you'll usually do it with such a resampling construct, by taking a triangle at random and resampling its edges. Then you will control the conditional expectation and variance.
Don't get too worked up with the theory of exchangeability. Usually exchangeability is interesting when you have long exchangeable sequences. An exchangeable pair is not very interesting from that point of view. Apparently ( https://souravchatterjee.su.domains//Lecture7.pdf ) for Stein's method of exchangeable pairs you don't even need the pair to be exchangeable but just to have $\sigma \sim \sigma'$.

Let us show that if $\sigma,\sigma'$ is defined as in your question then they form an exchangeable pair. Let $f$ be a positive measurable function. Denote by $\hat \sigma_i$ the vector $\sigma$ with the $i$-th coordinate removed. Denote $\mu^i_{\hat s_i}(ds_i)$ the conditional distribution of $\sigma_i$ given $\hat \sigma_i = \hat s_i$.
By definition
$$E[f(\sigma,\sigma')] = \sum_{i=1}^n \frac 1n \int_{\Bbb R^n}\left[ \int_R f\left(\begin{pmatrix} s_1\\ \ldots\\ s_i \\ \ldots\\ s_n\end{pmatrix}, \begin{pmatrix}s_1\\\ldots\\y \\ \ldots \\s_n\end{pmatrix}\right)\mu_{\hat s_i}(dy)\right]\Bbb P(\sigma_1 \in ds_1,\ldots \sigma_n \in ds_n)$$
But by definition of conditional distribution, one is able to rewrite the outer integral by conditioning out on $\sigma_i$.
$$= \sum_{i=1}^n \frac 1n \int_{\Bbb R^{n-1}}\left[ \int_R \int_R f\left(\begin{pmatrix} s_1\\ \ldots\\ x \\ \ldots\\ s_n\end{pmatrix}, \begin{pmatrix}s_1\\\ldots\\y \\ \ldots \\s_n\end{pmatrix}\right) \mu_{\hat s_i}(dy)\mu_{\hat s_i}(dx)\right]\Bbb P(\sigma_k \in ds_k,\forall k\neq i)$$
Now this expression is symmetric under replacing $f$ by $g(s,s'):=f(s',s)$, which one can see applying Fubini's theorem to the two inner integrals. Hence exchangeability.
