I am struggling with creating data for a histogram.
I have made a vector that is of the form P =size_of_P(4), .4, .65, .8, 1
I am creating a random number and I want to count where it falls over and over again. the size of the histogram boxes are box1 [0 .4], box2[.4 .65] box3[.65 .8] box4[.8 1]. For each random number I get I want to place it or simply count it in the correct box. I am not exactly sure how to implement this.
The real issue with this is that if G = .1 then it is less than every value of P so they all get a +1. I only want it to happen for the first time that G < P[i] not for every time it is. Any suggestions?