title: Probability Three Randomly Chosen Numbers Ap
signature: func probabilityThreeRandomlyChosenNumbersAp(n int) float64 {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual float64, expected float64) bool {
      return math.Abs(actual - expected) < 1e-09
  }
  
  func driver(n int, expected float64) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(46, 0.0163062743707905)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(5, 0.15151515151515152)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(44, 0.017047655947307245)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(15, 0.05005561735261402)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(72, 0.010417169037858692)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(2, 0.4)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(86, 0.008721225027887637)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(17, 0.04415584415584416)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(30, 0.025006946373992776)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(42, 0.01785967399007796)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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 );
  }