We apply the method of projecting functions onto convex cones in Hilbert spaces to derive sharp upper bounds for the expectations of spacings from i.i.d. samples coming from restricted families of distributions. Two families are considered: distributions with decreasing density and with decreasing failure rate. We also characterize the distributions for which the bounds are attained.