Displaying 1 result from an estimated 1 matches for "random_num".
Did you mean:
random_name
2011 Mar 06
2
Monte carlo help
...{
a <- 1/7;
} else if (hours == 6) {
a <- 1/7;
} else if (hours == 7) {
a <- 1/7;
} else if (hours == 8) {
a <- 1/7;
} else if (hours == 9) {
a <- 1/7;
} else if (hours == 10) {
a <- 1/7;
} else if (hours == 11) {
a <- 1/7;
}
random_num <- runif(1);
if (random_num < a)
students <- 1
else
students <- 0;
if (students == 1) {
if (tutors > 0) {
solved <- solved+1;
tutors <- tutors-1;
}else{
unsolved = unsolved+1;
}
}
total_stud <- tot...