# sort

### Example 9.18: Constructing the fastest relay team via enumeration

January 5, 2012 |

In competitive swimming, the medley relay is a team event in which four different swimmers each swim one of the four strokes: freestyle, breaststroke, backstroke, and butterfly. In general, every swimmer might be able swim any given stroke. How can w...

### Example 7.19: find the closest pair of observations

December 28, 2009 |

Suppose we need to find the closest pair of observations on some variable x. For example, we might be concerned that some data had been accidentally duplicated. We return the ID's of the two closest observations, and their distance from each other. In both languages, we'll first create the data, ...

### Example 7.11: Plot an empirical cumulative distribution function from scratch

August 31, 2009 |

In example 7.8, we used built-in functions to produce an empirical CDF plot. But the empirical cumulative distribution function (CDF) is simple to calculate directly, and it might be useful to have more control over its appearance than is aﬀorded by...