同時投擲兩枚骰子的點數和
Author: 藍邦偉　老師

投擲兩顆骰子的點數和

2

3

4

5

6

7

8

9

10

11

12

k = 720 (slider from 0 to 1000, step 1)
a = 0.07 (slider from 0 to 1, step 0.01)
n = 1000 (slider from 1 to 1000, step 1)
list2 = Sequence(Random[0.0, 5.0] + a * 0.0, i, 1.0, n)
list1 = Sequence(Random[0.0, 5.0] + a * 0.0, i, 1.0, n)
list3 = Sequence(Element[list1, i] + Element[list2, i], i, 1.0, Min[k, n])
list4 = Sequence(CountIf[x ≟ i, list3], i, 0.0, 11.0)
m: floor(Max[list4] / 35.0) + 1.0
c = Segment((0.0, -0.135), (110.0, -0.135))
d = Segment((1.1754514564441552, 0.0), (1.1754514564441552, 35.0))
list5 = Sequence(Text["" + (Element[list4, i]), (10.0 * i - 6.0, Element[list4, i] / m + 1.0)], i, 1.0, 11.0)
b = BarChart({5.0, 15.0, 25.0, 35.0, 45.0, 55.0, 65.0, 75.0, 85.0, 95.0, 105.0, 115.0}, list4 / m, 7.0)
A = (40, 40)
B = (70, 40)
C = (80, 40)
D = (110, 40)
E = (40, 70)
F = (70, 70)
G = (110, 70)
H = (80, 70)
多邊形1, a_1, b_1, f, e = Polygon(A, B, F, E)
多邊形2, c_1, d_1, g, h = Polygon(C, D, G, H)
M: 0.5 * A + 0.5 * F
N: 0.5 * C + 0.5 * G
q = Circle(M, 7.0)
p = Circle(N, 7.0)
M_2: M - (0.0, 6.0)
M_1: M + (0.0, 6.0)
r = Circle(M_1, 4.0)
s = Circle(M_2, 4.0)
N_1: N + (0.0, 6.0)
N_2: N + (0.0, -(6.0))
t = Circle(N_1, 4.0)
e_1 = Circle(N_2, 4.0)
I = Midpoint(A, M)
J = Midpoint(M, F)
g_1 = Circle(I, 3.5)
f_1 = Circle(M, 3.5)
h_1 = Circle(J, 3.5)
K = Midpoint(C, N)
L = Midpoint(N, G)
k_1 = Circle(N, 3.5)
p_1 = Circle(K, 3.5)
q_1 = Circle(L, 3.5)
A_1: 3.0 / 10.0 * B + 7.0 / 10.0 * A
A_2: 7.0 / 10.0 * B + 3.0 / 10.0 * A
A_3: 7.0 / 10.0 * A + 3.0 / 10.0 * E
A_4: 7.0 / 10.0 * E + 3.0 / 10.0 * A
C_1: 7.0 / 10.0 * C + 3.0 / 10.0 * D
C_2: 7.0 / 10.0 * D + 3.0 / 10.0 * C
E_1: (x(A_1), y(A_3))
E_2: (x(A_1), y(A_4))
E_3: (x(A_2), y(A_3))
E_4: (x(A_2), y(A_4))
E_5: (x(C_1), y(A_3))
E_6: (x(C_1), y(A_4))
E_7: (x(C_2), y(A_4))
E_8: (x(C_2), y(A_3))
r_1 = Circle(E_1, 3.5)
s_1 = Circle(E_2, 3.5)
t_1 = Circle(E_3, 3.5)
c_2 = Circle(E_4, 3.5)
d_2 = Circle(E_5, 3.5)
e_2 = Circle(E_6, 3.5)
f_2 = Circle(E_7, 3.5)
g_2 = Circle(E_8, 3.5)
h_2 = Circle(M, 3.5)
k_2 = Circle(N, 3.5)
O = Midpoint(E, M)
P = Midpoint(M, B)
Q = Midpoint(M, A)
R = Midpoint(M, F)
S = Midpoint(H, N)
T = Midpoint(N, C)
U = Midpoint(N, D)
V = Midpoint(N, G)
p_2 = Circle(O, 3.5)
q_2 = Circle(Q, 3.5)
r_2 = Circle(P, 3.5)
s_2 = Circle(R, 3.5)
t_2 = Circle(S, 3.5)
c_3 = Circle(T, 3.5)
d_3 = Circle(U, 3.5)
e_3 = Circle(V, 3.5)
W = Midpoint(E, A)
Z = Midpoint(E, W)
B_1 = Midpoint(W, A)
Z_1: (x(A_1), y(B_1))
Z_2: (x(A_1), y(W))
Z_3: (x(A_1), y(Z))
Z_4: (x(A_2), y(B_1))
Z_5: (x(A_2), y(W))
Z_6: (x(C_1), y(B_1))
Z_7: (x(C_2), y(B_1))
Z_8: (x(C_1), y(W))
Z_9: (x(C_2), y(W))
Z_{10}: (x(C_2), y(Z))
Z_{11}: (x(C_1), y(Z))
Z_0: (x(A_2), y(Z))
k_3 = Circle(Z_2, 3.0)
h_3 = Circle(Z_3, 3.0)
f_3 = Circle(Z_1, 3.0)
g_3 = Circle(Z_0, 3.0)
p_3 = Circle(Z_5, 3.0)
q_3 = Circle(Z_4, 3.0)
r_3 = Circle(Z_6, 3.0)
s_3 = Circle(Z_7, 3.0)
t_3 = Circle(Z_8, 3.0)
c_4 = Circle(Z_9, 3.0)
d_4 = Circle(Z_{10}, 3.0)
e_4 = Circle(Z_{11}, 3.0)
l_2 = Length(list2)
l_1 = Length(list1)