I have a set of rational numbers, and the only allowed operation is calculating the mean of a subset and adding it to the set. The goal is to generate zero.
I tried brute-forcing this problem with S = {7, -4} but failed.
Does this problem have a name and is there an efficient algorithm to solve it or show if there is a solution?
(7,-4), (7,-4,-4), (7,-1,-4,-4),(7,-1,-1,-4,-4),(7,-1,-1,-1,-4,-4),(7,0,-1,-1,-1,-4,-4)
You can duplicate numbers since you can take the mean of a 1 number subset and add it to the set. Then you are basically looking for a sum to zero
Algorithmically, sort original array, look for the closest two numbers to zero, if they are multiples of each other you are golden, if they are not then they are coprime and you can solve $ax+by=1 or -1$ then duplicate however 1's necessary to have a sum to zero.
Obviously your set must contain both positive and negative numbers for this to work