0

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 Answers1

1

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).

  • Ah! So cool, thanks! Happen to know if there’s a similar solution for the scenario where I have a vector containing all the pairwise ratios? – Mike Lawrence Apr 04 '21 at 13:03
  • 1
    I think not. I think in that case one of the unknowns is arbitrary (but not zero), and then you can evaluate all the other unknowns in terms of that one, so there's a one-dimensional family of solutions. – Gerry Myerson Apr 04 '21 at 13:25
  • Ah, gotcha. Thanks! – Mike Lawrence Apr 04 '21 at 13:26