# Generate n random numbers from (a, b) interval with predefined density

How can I generate n random numbers from (a, b) interval such that these numbers are densely concentrated around min and max and getting progressively sparse in the middle.

• Could you define more precisely what do you mean by "densely concentrated around min and max and getting progressively sparse in the middle"? It can understood differently by different people. I guess beta distribution with parameters <1 can work for you, but this needs clarification.
– Tim
Mar 22 '18 at 8:49
• Welcome to Cross Validated. Some related questions have already been answered, e.g. stats.stackexchange.com/questions/324878/… try searching this site and if your question is more specific than the questions here please update which specific part you are asking about. Mar 22 '18 at 8:50

shape1 <- 1/4

This will give you numbers between 0 and 1. Shift and scale these to match your desired $a$ and $b$.