In mathematics and theoretical computer science, the semi-membership problem for a set is the problem of deciding which of two possible elements is logically more likely to belong to that set; alternatively, given two elements of which exactly one is in the set, to distinguish the member from the non-member.
The semi-membership problem may be significantly easier than the membership problem. For example, consider the set S(x) of finite-length binary strings representing the dyadic rationals less than some fixed real number x. The semi-membership problem for a pair of strings is solved by taking the string representing the smaller dyadic rational, since if exactly one of the strings is an element, it must be the smaller, irrespective of the value of x. However, the language S(x) may not even be a recursive language, since there are uncountably many such x.
A function f on ordered pairs (x,y) of elements of a set S is a selector if f(x,y) is equal to either x or y and if f(x,y) is in S whenever at least one of x, y is in S. A set is semi-recursive if it has a recursive selector, and is P-selective if it is semi-recursive with a polynomial time selector.