title: Probability Three Randomly Chosen Numbers Ap
signature: class Solution {
  
      public Double probabilityThreeRandomlyChosenNumbersAp(Integer n) {
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 );
  }
question_info.extension: java
question_info.entry_fn_name: probabilityThreeRandomlyChosenNumbersAp
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 0.0163062743707905, "inputs": {"n": 46}}, {"idx": 1, "outputs": 0.15151515151515152, "inputs": {"n": 5}}, {"idx": 2, "outputs": 0.017047655947307245, "inputs": {"n": 44}}, {"idx": 3, "outputs": 0.05005561735261402, "inputs": {"n": 15}}, {"idx": 4, "outputs": 0.010417169037858692, "inputs": {"n": 72}}, {"idx": 5, "outputs": 0.4, "inputs": {"n": 2}}, {"idx": 6, "outputs": 0.008721225027887637, "inputs": {"n": 86}}, {"idx": 7, "outputs": 0.04415584415584416, "inputs": {"n": 17}}, {"idx": 8, "outputs": 0.025006946373992776, "inputs": {"n": 30}}, {"idx": 9, "outputs": 0.01785967399007796, "inputs": {"n": 42}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Double expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(46, 0.0163062743707905);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(5, 0.15151515151515152);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(44, 0.017047655947307245);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(15, 0.05005561735261402);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(72, 0.010417169037858692);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(2, 0.4);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(86, 0.008721225027887637);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(17, 0.04415584415584416);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(30, 0.025006946373992776);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(42, 0.01785967399007796);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Double expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Double actual, Double expected){
          return Math.abs(actual - expected) < 1e-09;
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__