n = 1000;
u = 100;
B  =  {};

    
For[ i = 1,  
      i ≤ n, i++, 
A  =  
        Table[0 ,  {u}]; 
While[
        Min[A] == 0, 
x  =  
          Random[Integer, {1, 
              u}]; 
A[[x]]++;
]; 
c  =  
        Sum[ A[[i]], {i, u} ]; 
B  =  
        Append[B, c];
]

    
M  =  
        Table[ Sum[ B[[i]], {i, k} ]/k, {k, 
            n} ];

    
Print[ N[M[[n]]] , " -> ", N[u Log[u]]];    

G1  =  
      ListPlot[M, PlotJoined -> True]
G2  =  
      ListPlot[ Table[u Log[u],  {n}], 
        PlotJoined -> True ]
Show[{G1, G2}]

\(\(\( (*\ 
      versione\ ultra - \(\(ottimizzata!!\)!\)\ praticamente\ calcola\ il\ vettore\ M\ delle\ medie\ direttamente\ nel\ ciclo\ tramite\ l' 
          istruzione\ If\ facendo\ molte\ meno\ somme\ *) \)\(
\)\(
\)\(\(n = 
        1000;\)

    \(u = 100;\)

    \(M\  = \ {};\)


    For[\ i = 1, \ 
      i ≤ n, \(i++\), 
A\  = \ 
        Table[0\ , \ {u}]; 
While[
        Min[A] == 0, 
x\  = \ 
          Random[Integer, {1, 
              u}]; 
\(A[\([x]\)]++\);
]; 
If[
        i ≠ 1, 
M\  = \ 
          Append[M, \ \(M[\([i - 1]\)]\ \((i - 1)\)\  + \ Sum[\ A[\([j]\)], {j, u}\ ]\)\/i\ ], 
M\  = \ 
          Append[\ M, 
            Sum[\ A[\([j]\)], {j, 
                u}\ ]\ ]
];
]


    \(Print[\ N[M[\([n]\)]]\ , " -> ", 
        N[u\ Log[u]]];\)\ 


    Show[\ {ListPlot[M, 
          PlotJoined -> True], 
ListPlot[\ 
          Table[u\ Log[u], \ {n}], 
          PlotJoined -> True\ ]}]\)\)\)