The best way is to do it one at a time.
you want a spot anywhere in the grey area, where every spot has the same chance as another to appear.
You first do a random real for the x axis. (Random point between 'a' and 'b', these are points)
Then you check where that position is:
If your X point is lower than 'c' or larger than 'd', it is simple, and you can do a random number for the y as a normal rectangle.
But if your random number is between 'c' and 'd', you need to do something else.
You create a random real between 0 and 'e' + 'f' (these are lengths).
If that number is larger than 'e', then you add 'g' to it and add the position (Y-Max in this case, but you could also do it from down to top if you like).
If it is smaller than or equal to 'e', you can just add the position of the green rect to it.
Pros:
- this doesnt include loops
- this only uses two random generated numbers
- this is fairly simple to code
- this is pretty do-able in GUI
Cons:
- You have to admit that I am a genius