Applying the formula
def count_heads ( n , r ) : NEW_LINE INDENT output = fact ( n ) / ( fact ( r ) * fact ( n - r ) ) NEW_LINE output = output / ( pow ( 2 , n ) ) NEW_LINE return output NEW_LINE DEDENT