Assuming that individuals are altruistic, this paper employs an overlapping generations model with lifetime uncertainty to study the partially funded public pension in China. By comparing the market economy equilibrium with the social optimum allocation, we find the optimal firm contribution rate. Our simulation results show that this rate increases when the life expectancy rises, while decreases when the population growth rate falls. It decreases in the joint case of risen life expectancy and fallen population growth rate because it is much more sensitive to the latter than to the former. The result has some policy implications.