# Scaling range of $n$ numbers to $m$ numbers

I have $n$ values ($n \approx 10^8$) ... I want to plot these, where the $i$-th value is plotted at point $(x,y)$, $x=i$ and $y=$value$[i]$.

Note: The values do NOT follow any pattern or function. They are RANDOM values - that represent load on a machine.

I don't want to handle all $10^8$ values. Instead, I want to plot only $1000$ values that can show a rough idea of how the plot looks.

I've done: (to get $1000$ values from $n$ values) Let $ng=(n/1000)$, for every $ng$ values, take the average and plot it. So I'll have $1000$ values that can represent $n$ values.

Now, my question is, I want a better way to find out $1000$ values. When I try to recalculate for some arbitrary interval, it is highly inaccurate.

//Feel free to suggest appropriate tags and a more appropriate title.

-

Taking the average will reduce the dispersion. Think if all the values are randomly $\pm 1$. Averaging will get you a value very close to $0$. It would probably be better to randomly select 1000 values and plot them without averaging.