title: Probability Three Randomly Chosen Numbers Ap
signature: def probabilityThreeRandomlyChosenNumbersAp(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Double , expected: Double): Boolean = {
      (actual - expected).abs < 1e-09
  }
  
  def driver(n: Int, expected: Double): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        46, 
        0.0163062743707905    
      )}")   
  
  
      println(s"TEST-1...${driver(
        5, 
        0.15151515151515152    
      )}")   
  
  
      println(s"TEST-2...${driver(
        44, 
        0.017047655947307245    
      )}")   
  
  
      println(s"TEST-3...${driver(
        15, 
        0.05005561735261402    
      )}")   
  
  
      println(s"TEST-4...${driver(
        72, 
        0.010417169037858692    
      )}")   
  
  
      println(s"TEST-5...${driver(
        2, 
        0.4    
      )}")   
  
  
      println(s"TEST-6...${driver(
        86, 
        0.008721225027887637    
      )}")   
  
  
      println(s"TEST-7...${driver(
        17, 
        0.04415584415584416    
      )}")   
  
  
      println(s"TEST-8...${driver(
        30, 
        0.025006946373992776    
      )}")   
  
  
      println(s"TEST-9...${driver(
        42, 
        0.01785967399007796    
      )}")   
  
  }
  
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 );
  }