Probability problem: length of new segments I have a line of length $l$. I divide the line in $n$ segments. I do this by choosing $n - 1$ random points (I mean that the $n - 1$ points are uniformly distributed from $0$ to $l$).
I want to add a new random point. If this new point does not coincide with an old one, it will "destroy" an old segment and create two new segments:
4 points, 5 segments:
----------|---------|---------------|-----|-------

1 new point, 6 segments:
----------|---------|---|-----------|-----|-------
                        ^

The question I'm trying to answer is: how long are these two new segments on average?
From the construction method, I think that the answer is $l / (n + 1)$ (that is, the length over the new number of segments). However I'm not sure for two reasons:


*

*I can't find a way to prove it;

*$l / (n + 1)$ is the average length of all segments, but I'm interested only in the new ones.


Could you shed some light on this?

It seems like the length of the new segments will be $\frac{1}{2n}$. This is probably due to the fact that once you pick $n-1$ random points, you already have segments that are on average, of length $1/n$. Then when you pick another random point, you first have to select which segment, and then pick a point from that segment. We can treat this as picking a random point from a segment of length $1/n$ which breaks it up into two segments of length $\frac{1}{2n}$. Here is my code for picking points in the $(0,1)$ interval.
import random
import matplotlib.pyplot as plt


n = 5
total = 0

def f(n):
    total = 0
    for j in range(10000):
        points =  [ random.uniform(0, 1) for k in range(n-1)]
        points.append(0), points.append(1)
        points = sorted(points)
        seg = random.randint(0, n-1) #first point of the chosen segment
        segment1, segment2 = points[seg], points[seg+1]
        newpoint = random.uniform(segment1, segment2)
        total += abs(newpoint-segment1)
    return (total/10000)

X = [n for n in range(1, 101)]
Y = [f(n) for n in range(1, 101)]

plt.plot(X,Y)
plt.show()

Plotting the values for $1 \le n \le 100$ gives me the following graph. The red line is the graph of $\frac{1}{2n}$ and the blue dots are the value from the program.

