clear sx sn
N=input('N = ');
x=rand(N,1);
M=50;
xs = sort(x);
sx = linspace(0,xs(1),M);
for i=1:N-1
  sx=[sx linspace(xs(i),xs(i+1),M)];
end
sx = [sx   linspace(xs(N),1,M)];
NM=length(sx);
for i=1:NM, sn(i)=length(find(xs<=sx(i)))/N; end
plot(sx,sx,sx,sn)
Du = max( [1:N]'/N -xs )
Dl = max( xs - [0:N-1]'/N)
Dr = max(abs(sx-sn)

 