Possible to reverse this operation?

44 Views Asked by At

Say I have a vector f of length n and I obtain all pairwise products of its elements:

vector[(n*(n-1))/2] f_prods ;
int i_prod = 0 ;
for(i_n in 1:(n-1)){
    for(j_n in (i_n+1):n){
        i_prod += 1 ;
        f_prods[i_prod] = f[i_n]*f[j_n] ;
    }
}

Is it possible to reverse this operation at all? That is, if I have the f_prods vector can I derive what the original vector f was? It’d be fine for my purposes to even get an approximation of f that’s been shifted and/or scaled.

1

There are 1 best solutions below

3
On BEST ANSWER

If $xy=a$, $xz=b$, and $yz=c$ then $abc=(xyz)^2$, so (up to sign) $xyz=\sqrt{abc}$, allowing you to recover $x=(xyz)/(yz)=\sqrt{abc}/c$, and so on. Note that $x,y,z$ can be taken to be any three entries of your unknown vector, so you can recover the entire vector (up to sign).