This paper presents an optimization model of a defined benefit national pension plan problem given population changes. This paper also analyzes the optimal investment strategy and contribution policy using the dynamic programming approach. The objective of the problem is to minimize contribution to the fund as well as the fluctuation of fund level. Two sources of uncertainty are introduced in this paper, namely stochastic salary and risky-asset return. To observe changes in the optimal control of pension plans according to population structure, future populations are introduced in pension plan model as an exogenous variable. Analyzing the solutions of the problem according to various population structures is described via a case study based on real conditions in South Korea, and sensitivity to parameters is studied. According to the results of our case study, greater proportions of a fund should be invested in risky assets under a decreasing population scheme (as opposed to an increasing population scheme). Furthermore, the contribution rate has different directions for increasing and decreasing populations, though this rate converges to same value as that of the case study.