• + 1 comment
    from itertools import product 
    from fractions import Fraction
    
    P = list(product([1]*4+[0]*3, [1]*5+[0]*4, [1]*4+[0]*4))
    
    N = sum(1 for x in P if sum(x)==2)
    
    print(Fraction(N, len(P)))