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?
 A: After the new point is added, the $n+1$ segments, labelled in left-to-right order, form an exchangeable sequence. In particular, they all have the same marginal distribution, hence the same mean value of $l/(n+1)$. 
But you are asking about the last two segments created, and I suspect there may be a "size bias" effect in play. When adding the $n^{\rm th}$ random point, the larger of the intervals in place are more likely than the smaller ones to receive this new point, so the new interval may be biased to be larger than a typical one of the $n$ subintervals. Indeed, conditional on the lengths (call them $L_1,\ldots, L_n$) of the $n$ segments in place after the first $n-1$ points have been selected, the expected value of one of the two new subintervals is
$$
\sum_{k=1}^n (L_k/l)\cdot(L_k/2)={1\over 2l}\sum_{k=1}^n L_k^2>{l\over 2n}.
$$
(The $>$ will be $=$ only when all but one of the $L_k$ is equal to $0$, an event of probability $0$.) It's not hard to check that $\Bbb E[L_k^2]={2l^2\over n(n+1)}$, so the mean value of the displayed expression is $l/(n+1)$ as expected.
A: 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.

