title: Probability Three Randomly Chosen Numbers Ap
signature: probability_three_randomly_chosen_numbers_ap <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      abs(actual - expected) < 1e-09
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          46L, 
          0.0163062743707905
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          5L, 
          0.15151515151515152
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          44L, 
          0.017047655947307245
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          15L, 
          0.05005561735261402
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          72L, 
          0.010417169037858692
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          2L, 
          0.4
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          86L, 
          0.008721225027887637
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          17L, 
          0.04415584415584416
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          30L, 
          0.025006946373992776
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          42L, 
          0.01785967399007796
      )))
  
  }
  
  main()
source_py: def probability_three_randomly_chosen_numbers_ap(n):
      return ((3.0 * n) / ((4.0 * (n * n)) - 1))
source_cpp: double probability_three_randomly_chosen_numbers_ap(int n) {
    return ( 3.0 * n ) / ( 4.0 * ( n * n ) - 1 );
  }