title: Probability Three Randomly Chosen Numbers Ap
signature: fun probabilityThreeRandomlyChosenNumbersAp(n: Int): Double {
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.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.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Double, expected:Double):Boolean{
    return abs(actual - expected) < 1e-09
  }
  fun driver(n: Int, expected:Double):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(46, 0.0163062743707905)
      println("TEST-0...${result}")
      
      result = driver(5, 0.15151515151515152)
      println("TEST-1...${result}")
      
      result = driver(44, 0.017047655947307245)
      println("TEST-2...${result}")
      
      result = driver(15, 0.05005561735261402)
      println("TEST-3...${result}")
      
      result = driver(72, 0.010417169037858692)
      println("TEST-4...${result}")
      
      result = driver(2, 0.4)
      println("TEST-5...${result}")
      
      result = driver(86, 0.008721225027887637)
      println("TEST-6...${result}")
      
      result = driver(17, 0.04415584415584416)
      println("TEST-7...${result}")
      
      result = driver(30, 0.025006946373992776)
      println("TEST-8...${result}")
      
      result = driver(42, 0.01785967399007796)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: probabilityThreeRandomlyChosenNumbersAp
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn