title: Probability Three Randomly Chosen Numbers Ap
signature: function probabilityThreeRandomlyChosenNumbersAp($n) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return abs($actual - $expected) < 1e-09;
  }
  
  function driver($n, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($n), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        46, 
        0.0163062743707905));
      
      printf("TEST-1...%s\n",driver(
        5, 
        0.15151515151515152));
      
      printf("TEST-2...%s\n",driver(
        44, 
        0.017047655947307245));
      
      printf("TEST-3...%s\n",driver(
        15, 
        0.05005561735261402));
      
      printf("TEST-4...%s\n",driver(
        72, 
        0.010417169037858692));
      
      printf("TEST-5...%s\n",driver(
        2, 
        0.4));
      
      printf("TEST-6...%s\n",driver(
        86, 
        0.008721225027887637));
      
      printf("TEST-7...%s\n",driver(
        17, 
        0.04415584415584416));
      
      printf("TEST-8...%s\n",driver(
        30, 
        0.025006946373992776));
      
      printf("TEST-9...%s\n",driver(
        42, 
        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 );
  }