I'm not a mathematician. But I came across a math-related question while trying to prove something in Python. So I hope that I'm fine posting over here.
I get a different distribution for the 2D & the 3D-case when I look at the angles between a vector that is normally distributed around another vector and I don't know if that is supposed to happen or not or I did do something wrong here.
I can explain the 2D case to me but not the 3D case
2D Case:
First I look at 2D Space in cartesian x, y-coordinates with a unit-vector $\vec{x}=\array(1,0)$
Now I want $n$ vectors that are normally distributed around $\vec{x}$.
In Python I do this with:
$n=10000$
$vX=np.random.normal(1, 0.02, size=n)$
$vY=np.random.normal(0, 0.02, size=n)$
$\vec{v}=(vX, vY)$
So if I now with the help of the dot-product look at all the angles between x and v I get a distribution that looks like this:
$\phi=\arccos\left(\frac{\vec{x}\cdot\vec{v}}{|\vec{x}|\cdot|\vec{v}|}\right)$
https://i.stack.imgur.com/su1o5.jpg
Which is totally what I expect since the randomly distributed vector $\vec{v}$ is centered around $\vec{x}$ and thus the most probable angle is $0°$.
3D Case:
If I switch to the 3D case now I just add 1 dimension to the vectors with the unit-vector being $\vec{x}=\array(1,0,0)$ and the normally distributed vector being
$vX=np.random.normal(1, 0.02, size=n)$
$vY=np.random.normal(0, 0.02, size=n)$
$vZ=np.random.normal(0, 0.02, size=n)$
$\vec{v}=(vX, vY, vZ)$
Then I calculate the angle between the random vectors $\vec{v}$ and $\vec{x}$ again and get the following distribution.
https://i.stack.imgur.com/2W68X.jpg
I can't imagine now why the most probable angle is not $0°$ anymore and this doesn't make sense to me since the vector $\vec{v}$ (in my imagination) is still centered around $\vec{x}$.
I don't want a hard mathematical proof here in case my result is true but in this case would be very pleased if it can be explained in layman-terms.
I hope that my question is clear.
Thanks a lot in advance.
Without going into details, this is expected.
Details lite: If your random point is $x=(x_1, x_2,\ldots,x_n)$ and your fixed vector is $c=(1,0,\ldots,0)$ (and it might as well be), the angle is determined by the square of its cosine, $\cos^2 \theta = (x,c)^2/\|x\|^2$ which is $x_1^2/(x_1^2 + x_2^2 + \ldots x_n^2)$. The term $x_1^2$ gets washed out by the others more and more as $n$ gets bigger. As you move from $n=2$ to $3$, and so on.