title: Probability Three Randomly Chosen Numbers Ap
signature: function probabilityThreeRandomlyChosenNumbersAp(n: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return Math.abs(actual - expected) < 1e-09;
  }
  
  function driver(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(46, 0.0163062743707905);
    console.log(`TEST-0...${result}`);
  
    result = driver(5, 0.15151515151515152);
    console.log(`TEST-1...${result}`);
  
    result = driver(44, 0.017047655947307245);
    console.log(`TEST-2...${result}`);
  
    result = driver(15, 0.05005561735261402);
    console.log(`TEST-3...${result}`);
  
    result = driver(72, 0.010417169037858692);
    console.log(`TEST-4...${result}`);
  
    result = driver(2, 0.4);
    console.log(`TEST-5...${result}`);
  
    result = driver(86, 0.008721225027887637);
    console.log(`TEST-6...${result}`);
  
    result = driver(17, 0.04415584415584416);
    console.log(`TEST-7...${result}`);
  
    result = driver(30, 0.025006946373992776);
    console.log(`TEST-8...${result}`);
  
    result = driver(42, 0.01785967399007796);
    console.log(`TEST-9...${result}`);
  
  };
  
  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 );
  }