Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
up vote 2 down vote accepted

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.

share|cite|improve this answer

If your numbers are as you say, random, then taking a uniform sample will reflect the entire distribution. Thus, select 1000 random samples from your data set, and plot these. This will probably be what you're looking for.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.