# Distribution of the $L^2$ norm of a vector of components drawn from uniform distributions

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()
• Here is an answer for the distribution of a single squared uniform: math.stackexchange.com/questions/305997/… I would be surprised if there were a neat expression for the square root of their sum. – Christoph Hanck Feb 8 '19 at 10:42
• For the (simpler, special) case $a=0,$ the distribution of the sum of uniforms is derived and described at stats.stackexchange.com/questions/41467/…. Your case generalizes this a little, but the same complexities apply: in particular, when $a\ge 0,$ the distribution can be described only in a piecewise fashion with $n+2$ components; when $a\lt 0,$ it might get even more complicated. – whuber Feb 8 '19 at 12:53
• This is a generalization of stats.stackexchange.com/questions/317095/… which do have an answer – kjetil b halvorsen Feb 9 '19 at 17:51