Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. # Let Matt be a list of head, heart, and feet
  2. matt <- list(head=numeric(), heart=numeric(), feet=numeric())
  3. # and his PhD be a sequence of dates in the degree that he seeked.
  4. hisPhD <- seq(as.Date("2011-08-15"), as.Date("2017-03-27"), by=1)
  5.  
  6. # for each day in his PhD
  7. for(day in hisPhD){
  8. # many random ideas did he greet.
  9. ideas <- rnorm(10)
  10.  
  11. # The bad ones were those that were less than stellar (<95%)
  12. bad <- ideas[which(ideas < qnorm(0.95))]
  13. # and the exceptionally bad kept him up on his feet.
  14. matt$feet <- c(matt$feet, bad[which(bad < qnorm(0.001))])
  15.  
  16. # But each day his head filled with the ideas that were not that bad
  17. not_that_bad <- ideas[which(!ideas%in%bad)]
  18. matt$head <- c(matt$head, not_that_bad)
  19. # and he thought that was neat.
  20.  
  21. # And every now and then a special idea would come.
  22. really_great_idea <- ideas[which(ideas > qnorm(0.999))]
  23. # A really great idea that would make his heart beat!
  24. matt$heart <- c(matt$heart, really_great_idea)
  25.  
  26. # As the days went on, his good ideas grew
  27. print(length(matt$heart))
  28. }
  29. # until he was ready to defend his seat.
  30.  
  31. # Upon seeing the vastness of knowledge in his head,
  32. hist(matt$head)
  33. # everyone agreed he would not face defeat.
  34.  
  35. # His heart ideas had exceeded random chance, even a Student could see.
  36. t.test(matt$heart)
  37.  
  38. # And so Matt has grown, since he began his degree.
  39. # Approximately half an idea per day.
  40. length(matt$head)/as.numeric(hisPhD[length(hisPhD)]-hisPhD[1])
  41.  
  42. # And so we declare that Matt cannot be beat.
  43. if(all(matt != "beat")) print("DECLARE! Yay")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement