Bootstrap a paired candidate difference
Given equal-length paired finite numeric outcomes, estimate the mean of B minus A. Resample task indices with replacement, preserving each pair, for a deterministic local seed. Each resample has the original task count. Return difference, low/high central percentile-bootstrap endpoints using nearest-rank indexing, and tasks. Validate nonempty equal lengths, finite numbers excluding booleans, repeats at least two, and confidence strictly between zero and one. This small method does not guarantee coverage for tiny, biased, or dependent samples.
Your task
- Complete the starter function using the contract above.
- Use the examples and visible tests to check normal inputs, boundaries, and rejected inputs.
- Run tests to record your result, then compare with the explained reference solution.
Examples
InputA=[1,0,1,0,1], B=[1,1,1,0,1]
Outputdifference .2; interval includes zero with supplied seed/configuration
InputAll paired differences equal one
Outputdifference=low=high=1
Implement the function, then run the tests.
Ctrl / ⌘ + Enter to test · Shift + Tab leaves editor