Probabilistic problems of beam and frame optimization under longevity constraint