Dynamics of naive and memory repertoires in the two-compartment model. We plot the repertoire in the naive and memory compartments and the total number of lineages stimulated as a function of time. We find that independent homeostasis in naive and memory compartments allows the repertoire to be maintained even in the absence of input from the thymus, which is set to zero in the simulations. In a, the naive and memory compartments are assumed to have a fixed size, and in b, the size of the naive compartment decreases and that of the memory compartment increases linearly with time. Parameters as in Fig. 3 except input from thymus, a = 0; levels of cross-reactivity, cx = 0.001 (naive) and cy = 0.05 (memory); background death rates, dx = 0.003 and dy = 0.05; the total population, kx + ky = 106 cells, is assumed to be divided equally between naive and memory compartments (kx = ky = 5 × 105 cells) in a whereas in b there is a slow shift from naive to memory populations, with 80% of the cells having a naive phenotype initially and then declining to 20% by the end of the simulations.