I'm having a little R situation that I can't get my head around.
Supposedly the code for this should only take two or 3 lines
What I have to do is figure out how many samples of 10 variables I have to take before I have seen every number once.
In other words, how many rolls of a dice (in this case with 10 sides) it takes before I have seen every side
so far I have something along these lines
param<-1:10
count<-0
seen<-0
for (i in 1:10) {
if (sample(param, size=1)==i);
if i in seen;
count+=1
seen+=1
elif count+=1
when seen==10 return(count)
}
but this is waaay too long, also I know the formatting of it isn't right (pretty sure I'm trying to use python code at some points) but this is the first time I have done a loop in R.
Any help would be much appreciated!
yes, this is for a project but I can't think of anything else. yes, i have tried looking at other questions/answers for help but my brain is just in a muddle now