Solution (source code)

= Solution

The equal-<variance> two-sample <Student's t-test> pools the within-group sums of squares. If $s_A^2$ and $s_B^2$ are the two unbiased sample <variances>, the required positive square root is
$$
\boxed{S=\sqrt{\frac{\sum_{i=1}^m(A_i-\overline A)^2+\sum_{j=1}^n(B_j-\overline B)^2}{m+n-2}}
=\sqrt{\frac{(m-1)s_A^2+(n-1)s_B^2}{m+n-2}}.}
$$
For ten observations in each group, $S^2=(s_A^2+s_B^2)/2$ and the usual unpaired reference <Student's t-distribution> has $18$ <statistical degrees of freedom>, provided the assumed independence between groups is justified.