Solution (source code)

= Solution

A nonzero contribution occurs when a failure, rather than a censoring, is the earlier observation while both members remain at risk. By the <paired log-rank reduction to a sign test>, the two possible contributions are $+1/2$ for an earlier A failure and $-1/2$ for an earlier B failure. Under the exchangeable null and the usual <independent censoring> assumptions they are equally likely, conditional on being informative. Hence
$$
\boxed{\mathbb E[U_i\mid U_i\ne0]=0,\qquad
\operatorname{Var}(U_i\mid U_i\ne0)=\tfrac14.}
$$
Once the first member leaves the <risk set>, the second member's later observation adds no group-comparison information within this stratum.