I have 100000 exponential random variables generated withrexp
and I am asked to generate 100000 binomial random variables from them using built in R functions.
I really don't know how can I generate one random variable from another. I searched some resources on internet but they were mostly about generating poisson from exponential which are very related because exponential distribution can be interpreted as time intervals of poisson. making poisson can be easily achieved by applying cumsum
on exponentials and using cut
function to make some bins including number of occurrences in a time interval.
But I don't know how is it possible to generate binomial from exponential.