da vl4d » 26/09/2007, 18:18
Su "input" $S = {s_1, \cdots, s_{n+1}}$,
notiamo che ogni $s_i \in S$ puo' essere scritto $s_i=2^m \cdot q$ con $q$ dispari. (*)
Notiamo inoltre che ${1,\cdots, 2n}$ contiene $n$ numeri dispari.
Prepariamo allora $n$ insiemi $S_1, S_3 \cdots, S_{2n-1}$
I)Per ogni $i=1,\cdots, n$ :
1) Poniamo $S_{d} = S_{d}\cup {s_i}$ quando esiste $m$ t.c. $s_i = 2^m\cdot d$
2) Se $|S_d| = 2$, ritorniamo $S_d$, altrimenti andiamo in I)
La complessita' dell'algo e' $O(n)$ se supponiamo
di conoscere gia' la rappresentazione in (*),
altrimenti non sono cosi' sicuro... Di sicuro resta $O(nlog n)$...
Proprio un bel problema comunque, l'idea era questa?
Go to the roots, of these calculations! Group the operations.
Classify them according to their complexities rather than their appearances!
This, I believe, is the mission of future mathematicians. This is the road on which I am embarking in this work.
Evariste Galois