Theory for random arrays predicts a mean sidelobe level given by the inverse of the number of elements. In practice, however, the sidelobe level fluctuates much around this mean. In this paper two optimization methods for thinned arrays are given: one is for optimizing the weights of each element, and the other one optimizes both the layout and the weights. The weight optimization algorithm is based on linear programming and minimizes the peak sidelobe level for a given beamwidth. It is used to investigate the conditions for finding thinned arrays with peak sidelobe level at or below the inverse of the number of elements. With optimization of the weights of a randomly thinned array, it is possible to come quite close and even below this value, especially for 1D arrays. Even for 2D sparse arrays a large reduction in peak sidelobe level is achieved. Even better solutions are found when the thinning pattern is optimized also. This requires an algorithm that uses mixed integer linear programming. In this case solutions with lower peak sidelobe level than the inverse number of elements can be found both in the 1D and the 2D cases.