3 ms·
The power set of |n| elements is exponential not polynomial. The powerset of 1000 elements has |2^1000| elements. It's easy to get 1000 data points.
by brudgers 8y ago
The power set of |n| elements is exponential not polynomial. The powerset of 1000 elements has |2^1000| elements. It's easy to get 1000 data points.
- mindcrime 8y agoYeah, so I guess whether or not this would be practical would depend on how large the OP's initial data set is. One thing you could possibly do, if the set doesn't have negative numbers, is throw out any numbers larger than X, since they can't be part of an answer. If the OP needs all the matching answers, I don't think there's any way to do it that doesn't essentially reduce to generating the power set though. If they just need one answer, there might be a simpler way.