Solution (source code)

= Solution

Calculate the observed <sample correlation coefficient> $\widehat r$. In each <paired bootstrap>, draw 100 indices independently with replacement from $1,\ldots,100$ and select the corresponding whole pairs. Compute the <bootstrap> correlation $r_b^*$ from each resample; do not resample the two margins independently, since that would destroy their empirical dependence.

Let $q_p$ be the empirical $p$-quantile of those <bootstrap> correlations. The <percentile bootstrap confidence interval> is
$$
\boxed{[q_{0.025},q_{0.975}].}
$$
This is the requested algorithmic interval; the actual endpoints require the observed pairs. Its coverage is approximate, based on the sampling law of the correlation being well approximated by the <bootstrap> law. Both sample variances must be positive. Resamples having a constant margin have undefined correlation and cannot be repaired by arbitrarily assigning correlation zero. One may regenerate these exceptional resamples, explicitly conditioning on well-defined correlations; under the usual nondegenerate large-sample conditions their probability is negligible. Frequent degeneracy instead indicates that this ordinary correlation-bootstrap construction is unsuitable.