We consider a random vector $\vec{v} = \left(x_{1}, x_{2}, \dots, x_{n}\right)$ built from $n$ real random variables drawn from a real continuous uniform distribution $\mathcal{U\left(a, b\right)}$, $a$ and $b$ being the same for all $x_{i}$.
What is the distribution $D$ of the $L^{2}$-norm of such random vectors $\vec{v}$: $\left\lVert\vec{v}\right\rVert_{2} = \sqrt{x_{1}^{2}+x_{2}^{2}+\dots+x_{n}^{2}}$?
In other words, what is the analytical expression of the distribution obtained through this numerical experiment:
# Packages
import numpy as np
import random as rd
import matplotlib.pyplot as plt
# Parameters
a = 5
b = 20
n = 10
count = 100000
# Compute a random norm
def random_norm(a, b, n):
v = [rd.uniform(a, b) for i in range(0, n)]
return sum([x ** 2 for x in v]) ** (1./2.)
# Generate random vectors and compute their norm
norms = [random_norm(a, b, n) for i in range(0, count)]
# Plot the resulting distribution
plt.hist(norms, 100)
plt.show()