Check out example codes for "random processing". It will help you in understanding the concepts better.

Code Example 1

for (int i = 0; i < 100; i++) {
  float r = random(0,50); //Low, High
  line(50, i, 50+r, i);
}

Learn ReactJs, React Native from akashmittal.com