In this study a two stage stochastic mixed integer linear programming (MILP) model is developed for the optimized design of a distributed power system, with components that are prone to errors. When a component fails is uncertain. The model will optimize the topology of an network based on costs minimization while dealing with this failure uncertainty. The total costs depend on the investment costs, operational costs as well as penalty costs for not delivering energy. When an energy demand is not met this amount will be multiplied with an penalty factor to determine the penalty costs. The penalty factor depends on the building category and is arbitrary. The height of the penalty factor appears to a very important factor in the optimized network topology. Mathematical programming proved to be an ecient way to optimize energy networks based on redundancy. It can be concluded that in the Dutch distributed power system for low demand buildings redundancy is not feasible. Only at extreme high penalty factors local options (converter or renewable storage) are benecial. Higher demand buildings (commercial or industrial) can benet from redundant lines at a reasonable penalty factor according to the model. When a sustainable solution is demanded the optimized network will shift to the renewable storage for any demand.