Abstract. We address the numerical approximation by finite-element methods of an optimal design problem for a two phase material in one space dimension. This problem, in the continuous setting, due to high frequency oscillations, often does not have a classical solution, and a relaxed formulation is needed to ensure existence. On the contrary, the discrete versions obtained by numerical approximation have a solution. In this article we prove the convergence of the discretizations and obtain convergence rates. We also show a faster convergence when the relaxed version of the continuous problem is taken into account when building the discretization strategy. In particular it is worth emphasizing that, even when the original problem has a classical solution so that relaxation is not necessary, numerical algorithms converge faster when implemented on the relaxed version.