We develop a model where individuals differ in productivity and in longevity. Benefits from the public pay-as-you-go pension system take the form of a collective annuity, with both a contributive (Bismarckian) component (based on the worker’s past earnings) anda flat (Beveridgean) part. Voters choose the size (generosity) of the system and its degree of income redistribution (or type).While individual longevity does not affect preferences for type and size of the program, these are influenced by both the average longevity and by the correlation between longevity and productivity. When the size of the annuity program is chosen by majority voting for a given type, we obtain that the size of the Beveridgean scheme decreases smoothly with increases in average longevity, while the support for a Bismarckian pension abruptly drops to zero once a threshold is crossed. When both size and type are determined by majority voting, we obtain either large and mostly Bismarckian systemsor smaller Beveridgean systems, as is empirically observed. Also, a larger correlation between longevity and productivity makes the collective annuity more redistributive, although sometimes at the expense of its size.