Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Let Matt be a list of head, heart, and feet
- matt <- list(head=numeric(), heart=numeric(), feet=numeric())
- # and his PhD be a sequence of dates in the degree that he seeked.
- hisPhD <- seq(as.Date("2011-08-15"), as.Date("2017-03-27"), by=1)
- # for each day in his PhD
- for(day in hisPhD){
- # many random ideas did he greet.
- ideas <- rnorm(10)
- # The bad ones were those that were less than stellar (<95%)
- bad <- ideas[which(ideas < qnorm(0.95))]
- # and the exceptionally bad kept him up on his feet.
- matt$feet <- c(matt$feet, bad[which(bad < qnorm(0.001))])
- # But each day his head filled with the ideas that were not that bad
- not_that_bad <- ideas[which(!ideas%in%bad)]
- matt$head <- c(matt$head, not_that_bad)
- # and he thought that was neat.
- # And every now and then a special idea would come.
- really_great_idea <- ideas[which(ideas > qnorm(0.999))]
- # A really great idea that would make his heart beat!
- matt$heart <- c(matt$heart, really_great_idea)
- # As the days went on, his good ideas grew
- print(length(matt$heart))
- }
- # until he was ready to defend his seat.
- # Upon seeing the vastness of knowledge in his head,
- hist(matt$head)
- # everyone agreed he would not face defeat.
- # His heart ideas had exceeded random chance, even a Student could see.
- t.test(matt$heart)
- # And so Matt has grown, since he began his degree.
- # Approximately half an idea per day.
- length(matt$head)/as.numeric(hisPhD[length(hisPhD)]-hisPhD[1])
- # And so we declare that Matt cannot be beat.
- if(all(matt != "beat")) print("DECLARE! Yay")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement