We study a problem motivated by a question related to quantum error-correcting codes. Combinatorially, it involves the graph parameter f(G) = min{vertical bar A vertical bar + vertical bar{x is an element of V \ A : d(A)(x) is odd}vertical bar : A not equal empty set}, where V is the vertex set of G and d(A)(x) is the number of neighbors of x in A. We give asymptotically tight estimates of f for the random graph G(n,p) when p is constant. Also, if f(n) = max{f(G) : vertical bar V (G)vertical bar = n}, then we show that f(n) <= (0.382 + o(1))n.