I have done this so far..., but i don't have any idea how to apply recursion here, and i am not sure if i am doing this task correctly.
new_env<-env()
master<-function(x){
f1<-function(){
print('f1')
}
master2 <- function(){
f2<-function(){
print('f2')
}
los = ceiling(runif(1)*3)
if (los == 1){
f1()
}
else if (los ==2){
f2()
}
else {
new_env$f3()
}
}
for (i in 1:x){
master2()
}
}
new_env$f3<-function(){
print('f3')
}
master(20)