# How to get a random function with a truncated normal distribution? [duplicate]

My goal is to have a function that given an input value will output a random value that follow a truncated normal distribution, could you please suggest a function that can do that ? Or guide me a good reference

• What inputs are you referring to? Location, scale and the truncation interval? – knrumsey May 20 '19 at 2:33
• @knrumsey the input is a value say 0.5, I want to generate a random number but with a truncated normal distribution – Mohamed May 20 '19 at 3:05
• @Mohamed, that is not enough information to specify the distribution. I don't even know what $0.5$ means. To generate from a truncated normal, you need to specify the location $\mu$, scale $\sigma$ and truncation interval $[a,b]$. – knrumsey May 20 '19 at 4:05
• Besides those listed above, also see stats.stackexchange.com/questions/179618/… – Glen_b May 20 '19 at 9:25