Following the geographical migration in the United States during the pre-war econonomic depression, American comedian Will Rogers1 allegedly said:

When the Okies2 left Oklahoma and moved to California, they raised the average intelligence level in both states.

He was obviously joking, but the effect is possible in principle. Consider for example the following two integer sequences: \[ \begin{eqnarray}A &=& [5, 6, 7, 8, 9] \\ B &=& [1, 2, 3, 4] \end{eqnarray} \] If we move element 5 from sequence $$A$$ to sequence $$B$$, the average of both sequences increases.

This so-called Will Rogers phenomenon3 produces a somewhat paradoxical effect when medical doctors find a better way to detect illness. As a result, relatively healthy people are moved from the "well" category to the "ill" category, and the average health of both populations improves even before treatment takes place.

Assignment

We represent an integer sequence as a sequence (list or tuple) of integers (int), where you may assume that these sequence is not empty. Your task:

Example

>>> average((5, 6, 7, 8, 9))
7.0
>>> average([1, 2, 3, 4])
2.5

>>> seq1 = [5, 6, 7, 8, 9]
>>> seq2 = [1, 2, 3, 4]
>>> seq3 = [5]
>>> move1(seq1, seq2, seq3)
>>> seq1
[6, 7, 8, 9]
>>> seq2
[1, 2, 3, 4, 5]
>>> seq3
[5]

>>> seq1 = (5, 6, 7, 8, 9)
>>> seq2 = [1, 2, 3, 4]
>>> seq3 = [5]
>>> move2(seq1, seq2, seq3)
([6, 7, 8, 9], [1, 2, 3, 4, 5])
>>> seq1
(5, 6, 7, 8, 9)
>>> seq2
[1, 2, 3, 4]
>>> seq3
[5]

>>> iswillrogers([5, 6, 7, 8, 9], [1, 2, 3, 4], [5])
True
>>> iswillrogers((5, 6, 7, 8, 9), (1, 2, 3, 4), (7, 9))
False

Epilogue

The Will Rogers phenomenon4 occurs in practice when comparing groups of patients with carcinoma 5— classified into stages according to the TNM system6. For example, Felsenstein et al. compared two groups of patients suffering from lung cancerinoma, respectively diagnosed in 1953–54 and in 1977. While the distribution of patients over the TNM stages I–III was the same in both groups, survival after 6 months was found to be better for all stages in the 1977 group.

In 1977, however, modern methods such as computed tomography, ultrasound and isotope testing had been used extensively for stage classification purposes. If the patients were classified in 1977 without using these modern diagnostic techniques, a significant number would have been classified with a more favorable stage. If survival after 6 months was recalculated using this classification, it would not differ from the patients treated in 1953–54.

Improved survival in 1977 thus appeared not to be a result of improved therapy, but was the result of a more accurate classification into TNM stages using new diagnostic techniques. This study shows the danger of conclusions based on comparisons with historical control groups, even if apparently using the same classification scheme.

Resources