# Random numbers with counting columns

I am pretty new to using GeoGebra scripts, so I hope someone can help me get started with the following task:

I need to have generated say n = 500 random real numbers in the interval from 0 to 1. Two integers, a and b, are supposed to act as counting variables. Initially they are set to 0. One by one each element in the list with random numbers should be evaluated if is below 0.4 or above. If it is below, a should be updated by 1, if not, b should be updated by 1. Everytime an an element in the list has been evaluated, two rectangles A and B (columns) with heights representing the current value of a and b respectively, should be updated as well. In the end the height of column A will have an height equal to the number of elements in the list which are less than or equal to 0.4, and column B will hold the number of elements in the list which are greater than 0.4.

I hope someone can help.

Erik V.

How's that to start?

Loading...Comments have been locked on this page!