Let X be any subset of the interval [−1, 1]. A subset I of the unit sphere in R n will be called X-avoiding if u, v / ∈ X for any u, v ∈ I . The problem of determining the maximum surface measure of a {0}-avoiding set was first stated in a 1974 note by Witsenhausen;there the upper bound of 1/n times the surface measure of the sphere is derived from a simple averaging argument. A consequence of the Frankl-Wilson theorem is that this fraction decreases exponentially, but until now the 1/3 upper bound for the case n= 3 has not moved. We improve this bound to 0.313 using an approach inspired by Delsarte's linear programming bounds for codes, combined with some combinatorial reasoning. In the second part of the paper, we use harmonic analysis to show that, for n≥ 3, there always exists an X-avoiding set of maximum measure. We also show with an example that a maximizer need not exist when n= 2.