probability distribution of end-end distance

Dear all,
Can anyone help me with the script file, for obtaining a plot of the probability distribution of end to end distance of a polymer chain?

Thanks and regards,
Deepa