from itertools import permutations
from fractions import Fraction

# 1 for red
# 0 for blue
x = [1, 1, 1]
y = [0, 0, 0, 0]

# all combinations, excluded first blue
p = list(filter(lambda m: m[0] == 1, permutations(x + y, 2)))

# all combinations with second blue
e = list(filter(lambda m: m[1] == 0, p))

# result: 2/3
print(Fraction(len(e), len(p)))
790fde6908068055c1c4ea0118ed02c2c5c0c5a6
<mask token>

<mask token>
print(Fraction(len(e), len(p)))

<mask token>
x = [1, 1, 1]
y = [0, 0, 0, 0]
p = list(filter(lambda m: m[0] == 1, permutations(x + y, 2)))
e = list(filter(lambda m: m[1] == 0, p))
print(Fraction(len(e), len(p)))

from itertools import permutations
from fractions import Fraction
x = [1, 1, 1]
y = [0, 0, 0, 0]
p = list(filter(lambda m: m[0] == 1, permutations(x + y, 2)))
e = list(filter(lambda m: m[1] == 0, p))
print(Fraction(len(e), len(p)))

from itertools import permutations
from fractions import Fraction

# 1 for red
# 0 for blue
x = [1, 1, 1]
y = [0, 0, 0, 0]

# all combinations, excluded first blue
p = list(filter(lambda m: m[0] == 1, permutations(x + y, 2)))

# all combinations with second blue
e = list(filter(lambda m: m[1] == 0, p))

# result: 2/3
print(Fraction(len(e), len(p)))