b # on what % of the b samples did algorithm A beat expectations? return p-value(x) # if very few did, our observed δ is probably not accidental The full algorithm for the bootstrap is shown in Fig. 4 .9. It is given a test set x, a number of samples b, and counts the percentage of the b bootstrap test sets in which