# Sampling vector so they will have a given euclidean distances matrix

Given a matrix $M\in\mathbb{R}^{P\times P}$ , is it possible to sample $P$ vectors $u_i\in\mathbb{R}^N$, $i=1..P$ so that $\|u_i-u_j\|=M_{ij}$.

Obviously for not any $M$ this is possible, i.e. it has to be symmetric, have zero diagonal, etc., but assume $M$ was created from a different set of vectors which satisfied this property.

By "sampling" above I mean that I would like to have a generative procedure with this property, and allow it to build on any existing sampling process, e.g. sampling matrices using Gaussian or Uniform distribution for each entry.

• The probability that $\|U_i-U_j\|=M_{ij}$ is zero for a continuous random vector. – Xi'an Nov 26 '15 at 14:08
• @Xi'an, I imagine a procedure which sample some matrix $X$ using some simple scheme (e.g. Gaussian or Uniform), then use some deterministic processing which depend on M and will result in $u_i$ with the requested property. – Uri Cohen Nov 26 '15 at 14:59
• Question answered at the sister site. – Uri Cohen Dec 2 '15 at 14:14