Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.42 KB | None | 0 0
  1. fair_distributions_naive_imp <- function(k) {
  2.     count <- 0
  3.     iterations = 0
  4.     for (n in 1:k) {
  5.       for (m in n:k) {
  6.        iterations = iterations + 1
  7.        if (is_fair_distribution(n, m)) {
  8.           count = count + 2
  9.           break
  10.        }
  11.     }      
  12.   }
  13.   count
  14.   iterations
  15. }
  16.  
  17. powers <- c(1, 2, 3, 4, 5,10)
  18. powers.low <- c(1, 2, 3, 4)
  19. for (p in powers){
  20.  print(fair_distributions_naive_imp(10^p))
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement