Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 27, 2024
1 parent 91078a7 commit 3c49977
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/fifty/snippet/8_perfect_bridge_hand.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# --8<-- [start:solution1]
from math import factorial
from fractions import Fraction
from math import factorial


def calc_prob():
prob = 4
for i in range(13):
print(i, 13-i)
numerator = (13 - i) * Fraction(factorial(39 - 3 * i), factorial(3) * factorial(36 - 3 * i))
denominator = Fraction(factorial(52 - 4 * i), factorial(4) * factorial(48 - 4 * i))
print(i, 13 - i)
numerator = (13 - i) * Fraction(
factorial(39 - 3 * i), factorial(3) * factorial(36 - 3 * i)
)
denominator = Fraction(
factorial(52 - 4 * i), factorial(4) * factorial(48 - 4 * i)
)
prob *= Fraction(numerator, denominator)
return prob

0 comments on commit 3c49977

Please sign in to comment.