Sean A
χ X : { 0 , … , 2 n } → { 0 , 1 }
Sea f
A veces es importante averiguar el par real a ∈ A
¿Es posible calcular una función testigo en el tiempo O ( n log n ) ?
O(nlogn)
Sean A
χ X : { 0 , … , 2 n } → { 0 , 1 }
Sea f
A veces es importante averiguar el par real a ∈ A
¿Es posible calcular una función testigo en el tiempo O ( n log n ) ?
O(nlogn)
Respuestas:
Aquí estoy explicando cómo obtener el tiempo de ejecución aleatorio O ( n ∗ p o l y l o g n ) . Necesitamos una secuencia de observaciones:
Un testigo de un valor v es un par de números ( a , b ) ∈ A × B tal que a + b = v . Deje que P A ( x ) = ∑ i ∈ A x i y P B ( x ) se definan de manera análoga. Observe que el coeficiente de x v en P A ( x ) ∗ P B ( x
Assume v
Entonces, hemos terminado con el caso de que hay un solo testigo. Así que considere el caso de que v tiene k testigos ( a 1 , b 1 ) , ... , ( a k , b k ) . Sea i ( k ) = ⌈ lg √
We are almost done. Compute the above random samples for resolutions i=1,…,⌈lgn⌉
The algorithm: For every value v
Strangely enough, the preprocessing time is O(nlog3n)
Ok, I've been holding off since really Sariel should get credit for an answer, but I'm tired of waiting, so here is my cut at a near-linear randomized algorithm.
This blows up the running time by three logarithmic factors; probably that can be reduced.
This answer gives a determinstic O(n polylogn)
It appears that Sariel and David's algorithm can be derandomized through an approach similar to this paper. [2] While going through the process I found there is a more general problem that implies this result.
The k
k -reconstruction problemThere are hidden sets S1,…,Sn⊂{1,…,m}
S1,…,Sn⊂{1,…,m} , we have two oracles SizeSize and SumSum that take a query set QQ .
- Size(Q)
Size(Q) returns (|S1∩Q|,|S2∩Q|,…,|Sn∩Q|)(|S1∩Q|,|S2∩Q|,…,|Sn∩Q|) , the size of each intersection.- Sum(Q)
Sum(Q) returns (∑s∈S1∩Qs,∑s∈S2∩Qs,…,∑s∈Sn∩Qs)(∑s∈S1∩Qs,∑s∈S2∩Qs,…,∑s∈Sn∩Qs) , the sum of elements in each intersection.The k
k -reconstruction problem asks one to find nn subsets S′1,…,S′n such that S′i⊂Si and |S′i|=min(k,|Si|) for all i.
Let f be the running time of calling the oracles, and assume f=Ω(m+n), then one can find the sets in deterministic O(fklogn polylog(m)) time. [1]
Now we can reduce the finding witness problem to 1-reconstruction problem. Here S1,…,S2n⊂{1,…,2n} where Si={a|a+b=i,a∈A,b∈B}.
Define the polynomials χQ(x)=∑i∈Qxi, IQ(x)=∑i∈Qixi
The coefficient for xi in χQχB(x) is |Si∩Q| and in IQχB(x) is ∑s∈Si∩Qs. Hence the oracles take O(nlogn) time per call.
This gives us an O(n polylog(n)) time deterministic algorithm.
[1] Yonatan Aumann, Moshe Lewenstein, Noa Lewenstein, Dekel Tsur: Finding witnesses by peeling. ACM Transactions on Algorithms 7(2): 24 (2011)
[2] Noga Alon, Moni Naor: Derandomization, witnesses for Boolean matrix multiplication and construction of perfect hash functions. Algorithmica 16(4-5) (1996)