title: Probability Three Randomly Chosen Numbers Ap
signature: probabilityThreeRandomlyChosenNumbersAp :: Integer -> Double
  probabilityThreeRandomlyChosenNumbersAp n = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Double -> Double -> Bool
  validateSolution actual expected = do
      (abs (actual-expected)) < 1e-09
  
  driver :: Integer -> Double -> String
  driver n expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME n) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (46) (0.0163062743707905) )
  
      printf "TEST-1...%s\n" (driver (5) (0.15151515151515152) )
  
      printf "TEST-2...%s\n" (driver (44) (0.017047655947307245) )
  
      printf "TEST-3...%s\n" (driver (15) (0.05005561735261402) )
  
      printf "TEST-4...%s\n" (driver (72) (0.010417169037858692) )
  
      printf "TEST-5...%s\n" (driver (2) (0.4) )
  
      printf "TEST-6...%s\n" (driver (86) (0.008721225027887637) )
  
      printf "TEST-7...%s\n" (driver (17) (0.04415584415584416) )
  
      printf "TEST-8...%s\n" (driver (30) (0.025006946373992776) )
  
      printf "TEST-9...%s\n" (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 );
  }