Skip to main content
introduced tex, improved formatting
Source Link

I was thinking in solving the following problem for the general case :

**) Given a stringlist of integers and sets in the form $integer(element_1 , element_2,\cdots)$pairs $((n_i, A_i))_{i=1}^k$, the output is true ifwhere for every seteach $i$ we takehave that $n_i $ is a number of elements from the set equal to thenon-negative integer to left of the set without contradicting the other sets, and return false otherwise.$A_i$ is a set, does there exist a set $A$ such that $|A\cap A_i|=n_i$?

Example 1 : Given as an input the stringlist : $3(a,b,c)4(a,b,c,d,e,f)2(a,b,c,d)$ the output$(3, \{a,b,c\}), (4, \{a,b,c,d,e,f\}), (2, \{a,b,c,d\})$ the answer will be falsenegative, because from the first set we are forced to take all the 3 elements a$a$,b$b$ and c$c$ but from the last set we must take just 2 elements but it's already containing 3 elements that we forced to pick.

Example 2 : Given as an input the stringlist : $2(a,b,c)3(a,b,c,d)4(a,b,c,d,e,f)$$(2, \{a,b,c\}), (3, \{a,b,c,d\}), (4, \{a,b,c,d,e,f\})$ the output will be trueanswer is positive, for instance we can pick : a,b,d,f without contradicting any of the sets$\{a,b,d,f\}$.

My question is : is the General case of this problem solvable in Exp,SubExp,Quasi-Poly,Poly time ? space ?

I was thinking in solving the following problem for the general case :

**) Given a string of integers and sets in the form $integer(element_1 , element_2,\cdots)$ , the output is true if for every set we take a number of elements from the set equal to the integer to left of the set without contradicting the other sets and return false otherwise.

Example 1 : Given as an input the string : $3(a,b,c)4(a,b,c,d,e,f)2(a,b,c,d)$ the output will be false because from the first set we are forced to take all the 3 elements a,b and c but from the last set we must take just 2 elements but it's already containing 3 elements that we forced to pick.

Example 2 : Given as an input the string : $2(a,b,c)3(a,b,c,d)4(a,b,c,d,e,f)$ the output will be true for instance we can pick : a,b,d,f without contradicting any of the sets.

My question is : is the General case of this problem solvable in Exp,SubExp,Quasi-Poly,Poly time ? space ?

I was thinking in solving the following problem for the general case :

**) Given a list of pairs $((n_i, A_i))_{i=1}^k$, where for each $i$ we have that $n_i $ is a non-negative integer, and $A_i$ is a set, does there exist a set $A$ such that $|A\cap A_i|=n_i$?

Example 1 : Given as an input the list : $(3, \{a,b,c\}), (4, \{a,b,c,d,e,f\}), (2, \{a,b,c,d\})$ the answer will be negative, because from the first set we are forced to take all the 3 elements $a$,$b$ and $c$ but from the last set we must take just 2 elements but it's already containing 3 elements that we forced to pick.

Example 2 : Given as an input the list : $(2, \{a,b,c\}), (3, \{a,b,c,d\}), (4, \{a,b,c,d,e,f\})$ the answer is positive, for instance we can pick $\{a,b,d,f\}$.

My question is : is the General case of this problem solvable in Exp,SubExp,Quasi-Poly,Poly time ? space ?

Source Link
user95470
user95470

a question about complexity of Boolean problem

I was thinking in solving the following problem for the general case :

**) Given a string of integers and sets in the form $integer(element_1 , element_2,\cdots)$ , the output is true if for every set we take a number of elements from the set equal to the integer to left of the set without contradicting the other sets and return false otherwise.

Example 1 : Given as an input the string : $3(a,b,c)4(a,b,c,d,e,f)2(a,b,c,d)$ the output will be false because from the first set we are forced to take all the 3 elements a,b and c but from the last set we must take just 2 elements but it's already containing 3 elements that we forced to pick.

Example 2 : Given as an input the string : $2(a,b,c)3(a,b,c,d)4(a,b,c,d,e,f)$ the output will be true for instance we can pick : a,b,d,f without contradicting any of the sets.

My question is : is the General case of this problem solvable in Exp,SubExp,Quasi-Poly,Poly time ? space ?