確率（袋から玉を取り出す）

袋から玉を取り出す確率を求めます。
全体の場合の数と試行の場合の数の比を考えます。

【解説】

7個の玉をそれぞれ区別できるものとすると、
7個の中から2個を取り出す取り出し方は
${}_7C_2=\frac{7\times 6}{2\times 1}=21$通り

A = (-1.06, 0.32)
c = Circle(A, 0.5)
B = (-1.64, -0.98)
C = (0.14, -0.54)
e = Circle(C, 0.5)
D = (-1.36, -2.24)
f = Circle(D, 0.5)
E = (-0.22, -1.84)
n = Random(2, 5)
m: 7 - n
ストローク1 = AttachCopyToView(PolyLine[(4.78, 3.7600000000000002), (4.88, 3.7800000000000002), (4.96, 3.8000000000000003), (5.04, 3.8200000000000003), (5.16, 3.84), (5.26, 3.86), (5.38, 3.86), (5.46, 3.86), (5.54, 3.86), (5.6000000000000005, 3.8000000000000003), (5.66, 3.7600000000000002), (5.72, 3.7), (5.78, 3.68), (5.8, 3.62), (5.82, 3.56), (5.82, 3.48), (5.78, 3.42), (5.7, 3.38), (5.62, 3.3000000000000003), (5.54, 3.2600000000000002), (5.48, 3.24), (5.4, 3.22), (5.32, 3.2), (5.24, 3.2), (5.14, 3.14), (5.08, 3.1), (5.0200000000000005, 3.06), (4.98, 2.98), (4.92, 2.96), (4.88, 2.88), (4.86, 2.8000000000000003), (4.82, 2.72), (4.78, 2.66), (4.76, 2.6), (4.74, 2.52), (4.72, 2.46), (4.7, 2.4), (4.68, 2.34), (4.66, 2.24), (4.62, 2.18), (4.6000000000000005, 2.12), (4.58, 2.04), (4.5600000000000005, 1.96), (4.54, 1.9000000000000001), (4.5200000000000005, 1.82), (4.5, 1.76), (4.48, 1.7), (4.46, 1.6400000000000001), (4.46, 1.52), (4.46, 1.3800000000000001), (4.44, 1.32), (4.42, 1.26), (4.42, 1.16), (4.4, 1.02), (4.4, 0.92), (4.4, 0.8), (4.4, 0.72), (4.4, 0.62), (4.38, 0.52), (4.38, 0.42), (4.38, 0.32), (4.38, 0.22), (4.38, 0.1), (4.38, -0.02), (4.38, -0.14), (4.32, -0.24), (4.32, -0.36), (4.32, -0.44), (4.32, -0.54), (4.32, -0.66), (4.32, -0.76), (4.32, -0.84), (4.32, -0.92), (4.32, -1.02), (4.32, -1.1), (4.32, -1.18), (4.32, -1.26), (4.32, -1.34), (4.32, -1.42), (4.32, -1.5), (4.32, -1.58), (4.32, -1.68), (4.32, -1.76), (4.32, -1.86), (4.34, -1.94), (4.36, -2), (4.38, -2.06), (4.44, -2.14), (4.48, -2.2), (4.54, -2.2600000000000002), (4.62, -2.34), (4.7, -2.4), (4.76, -2.48), (4.84, -2.52), (4.92, -2.58), (4.98, -2.6), (5.0600000000000005, -2.6), (5.14, -2.6), (5.24, -2.6), (5.32, -2.6), (5.44, -2.6), (5.5200000000000005, -2.6), (5.6000000000000005, -2.6), (5.76, -2.6), (5.84, -2.6), (5.92, -2.6), (6, -2.6), (6.12, -2.6), (6.2, -2.6), (6.3, -2.6), (6.4, -2.6), (6.5200000000000005, -2.6), (6.62, -2.6), (6.7, -2.6), (6.78, -2.6), (6.86, -2.6), (6.96, -2.6), (7.1000000000000005, -2.6), (7.18, -2.6), (7.26, -2.58), (7.32, -2.56), (7.38, -2.52), (7.44, -2.5), (7.5, -2.48), (7.5600000000000005, -2.42), (7.58, -2.36), (7.68, -2.3000000000000003), (7.72, -2.24), (7.8, -2.14), (7.84, -2.08), (7.86, -2.02), (7.9, -1.96), (7.94, -1.8800000000000001), (7.96, -1.76), (7.98, -1.7), (8, -1.6400000000000001), (8.02, -1.58), (8.06, -1.52), (8.06, -1.44), (8.120000000000001, -1.34), (8.16, -1.24), (8.16, -1.16), (8.18, -1.04), (8.2, -0.98), (8.2, -0.88), (8.22, -0.8), (8.26, -0.7000000000000001), (8.28, -0.62), (8.28, -0.54), (8.28, -0.46), (8.3, -0.34), (8.3, -0.26), (8.3, -0.12), (8.3, 0.04), (8.3, 0.14), (8.3, 0.26), (8.3, 0.38), (8.3, 0.52), (8.3, 0.6), (8.3, 0.68), (8.3, 0.76), (8.28, 0.9), (8.26, 0.96), (8.26, 1.04), (8.26, 1.12), (8.24, 1.18), (8.22, 1.24), (8.2, 1.3), (8.18, 1.3800000000000001), (8.16, 1.46), (8.120000000000001, 1.56), (8.06, 1.6), (8, 1.72), (7.98, 1.82), (7.96, 1.8800000000000001), (7.9, 1.98), (7.88, 2.04), (7.82, 2.12), (7.76, 2.18), (7.7, 2.2800000000000002), (7.640000000000001, 2.36), (7.58, 2.4), (7.5600000000000005, 2.46), (7.5, 2.52), (7.46, 2.62), (7.4, 2.66), (7.34, 2.7), (7.28, 2.74), (7.24, 2.8000000000000003), (7.18, 2.82), (7.1000000000000005, 2.84), (7.04, 2.88), (6.98, 2.94), (6.92, 2.96), (6.86, 3), (6.8, 3.02), (6.76, 3.08), (6.72, 3.14), (6.68, 3.2), (6.640000000000001, 3.2600000000000002), (6.58, 3.34), (6.5600000000000005, 3.4), (6.5600000000000005, 3.48), (6.5, 3.52), (6.5, 3.6), (6.5, 3.68), (6.46, 3.7600000000000002), (6.46, 3.84), (6.46, 3.92), (6.46, 4), (6.46, 4.1), (6.48, 4.16), (6.54, 4.18), (6.62, 4.18), (6.7, 4.18), (6.78, 4.18), (6.86, 4.18), (6.94, 4.18), (7.0200000000000005, 4.18), (7.1000000000000005, 4.18), (7.18, 4.18), true], 1, (-3.2, -3.2600000000000002), (12.26, 6.22), (-339.99999999999994, 495), (433, 21.00000000000003))
A_1 = (0.34, 1)
c_1 = Circle(A_1, 0.5)
D_1 = (-1.1, 1.82)
f_1 = Circle(D_1, 0.5)
text2: "赤玉" + m + "個、青玉" + n + "個の入った袋から、同時に2個を取り出すとき、
両方とも赤玉である確率はいくらか。"
m1: m - 1
mm: (m * (m - 1) / 2)
g = GCD(21, mm)
d: 21 / g
k: mm / g
C_1 = (-1.32, -0.88)
e_1 = Circle(C_1, 0.5)
C_2 = (-0.1, -1.78)
e_2 = Circle(C_2, 0.5)
step = 0 (slider from 0 to 3, step 1)
text4: "赤玉" + (LaTeX[m]) + "個の中から２個取り出す取り出し方は
${}_" + (LaTeX[m]) + "C_2=\frac{" + (LaTeX[m]) + "\times" + (LaTeX[m1]) + "}{2\times 1}=" + (LaTeX[mm]) + "$通り"
text5: "したがって求める確率は
$\frac{" + (LaTeX[mm]) + "}{21}=\frac{" + (LaTeX[k]) + "}{" + (LaTeX[d]) + "$"
text6: "したがって求める確率は
$\frac{ " + (LaTeX[mm]) + "}{21}$"