Driver code
public static void main ( String [ ] args ) { int n = 10 ; int k = 5 ; float p = ( float ) 1.0 / 3 ; float probability = binomialProbability ( n , k , p ) ; System . out . print ( " Probability ▁ of ▁ " + k ) ; System . out . print ( " ▁ heads ▁ when ▁ a ▁ coin ▁ is ▁ tossed ▁ " + n ) ; System . out . println ( " ▁ times ▁ where ▁ probability ▁ of ▁ each ▁ head ▁ is ▁ " + p ) ; System . out . println ( " ▁ is ▁ = ▁ " + probability ) ; } }