probability for two vectors to lie on different regions created by hypeplane

458 Views Asked by At

Suppose we have two vectors $v_i,v_j$ and there is one hyperplane whose normal is chosen uniformly from the unit sphere. Then what will be the probability that $v_i$ lies on one side and $v_j$ lies on another side? I am reading this post and got stuck at one step.

1

There are 1 best solutions below

0
On BEST ANSWER

The normals of your hyperplanes are chosen uniformly from the unit sphere, so every direction has the same probability. If you project those normals onto a plane through the origin, and scale them back to unit length, you get uniform distribution on the unit circle since for reasons of symmetry, still every direction has the same probability.

Now consider the case of the plane spanned by two of your vectors, $v_i$ and $v_j$. You are interested in the probability of such a randomly chosen hyperplane separating the two. That probability is proportional to the angle between the two lines spanned by these vectors. In the following picture, a line (i.e. the intersection of your hyperplane with the plane spanned by $v_i$ and $v_j$) will separate $v_i$ from $v_j$ if it crosses the green area of the unit circle, and it will not separate them if it crosses the red area instead.

red and green areas

The angle between two vectors can be deduced from the dot product, and the dot product between two (column) vectors is the same as the matrix product of a row and a column vector. So $v_i^Tv_j$ is the same as $v_i\cdot v_j$ or $\langle v_i,v_j\rangle$ depending on what notation you are used to. It satisfies

$$v_i^Tv_j=v_i\cdot v_j=\cos\varphi\,\lVert v_i\rVert\,\lVert v_j\rVert$$

but as long as your $v_i$ and $v_j$ are of unit length (which is a constraint in the text you referenced but which isn't the case in my illustration above), the dot product is actually equal to the cosine of the angle.The angle you compute from that will range from zero (same direction, zero probability of separation) up to $180°=\pi$ (opposite direction, $100\%$ probability of separation), so you divide by $\pi$ to obtain the probability. Thus

$$ \operatorname{Prob}(\operatorname{sign}(r^Tv_i)\neq\operatorname{sign}(r^Tv_j)) =\frac{\arccos(v_i\cdot v_j)}{\pi} $$

as you see it in the document you referenced.