title: Probability Three Randomly Chosen Numbers Ap
signature: function probability_three_randomly_chosen_numbers_ap(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return abs(actual - expected) < 1e-09
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(46, 0.0163062743707905);
      @printf("TEST-0...%s\n",result);
      
      result = driver(5, 0.15151515151515152);
      @printf("TEST-1...%s\n",result);
      
      result = driver(44, 0.017047655947307245);
      @printf("TEST-2...%s\n",result);
      
      result = driver(15, 0.05005561735261402);
      @printf("TEST-3...%s\n",result);
      
      result = driver(72, 0.010417169037858692);
      @printf("TEST-4...%s\n",result);
      
      result = driver(2, 0.4);
      @printf("TEST-5...%s\n",result);
      
      result = driver(86, 0.008721225027887637);
      @printf("TEST-6...%s\n",result);
      
      result = driver(17, 0.04415584415584416);
      @printf("TEST-7...%s\n",result);
      
      result = driver(30, 0.025006946373992776);
      @printf("TEST-8...%s\n",result);
      
      result = driver(42, 0.01785967399007796);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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 );
  }