When working with distributions in R, each distribution has four functions, namely:
dXXX - density function.
rXXX - generate random number from this distribution.
pXXX - returns the area to the left of the given value.
qXXX - returns the quantil…