p=

A = (-3.38, 0.48)
B = (-0.54, 3.24)
a = Segment(A, B)
b: y = y(A)
A' = Mirror(A, b)
B' = Mirror(B, b)
a' = Segment(A', B')
C = (2.84, 4.58)
c = Segment(B, C)
d: y = y(B)
B'_1 = Mirror(B, d)
C' = Mirror(C, d)
c' = Segment(B'_1, C')
B'_2 = Mirror(B, b)
C'_1 = Mirror(C, b)
c'_1 = Segment(B'_2, C'_1)
D = Mirror(B'_1, b)
C'' = Mirror(C', b)
c'' = Segment(D, C'')
e: y = y(C)
E = (5.88, 5.3)
f = Segment(C, E)
C'_2 = Mirror(C, e)
E' = Mirror(E, e)
f' = Segment(C'_2, E')
C'_3 = Mirror(C, d)
E'_1 = Mirror(E, d)
f'_1 = Segment(C'_3, E'_1)
F = Mirror(C'_2, d)
E'' = Mirror(E', d)
f'' = Segment(F, E'')
C'_4 = Mirror(C, b)
E'_2 = Mirror(E, b)
f'_2 = Segment(C'_4, E'_2)
G = Mirror(C'_2, b)
E''_1 = Mirror(E', b)
f''_1 = Segment(G, E''_1)
H = Mirror(C'_3, b)
I = Mirror(E'_1, b)
g = Segment(H, I)
F' = Mirror(F, b)
E''' = Mirror(E'', b)
f''' = Segment(F', E''')
C''_1 = Mirror(C', b)
p = 0.25 (slider from 0 to 1, step 0.01)
q: 1 - p
CajaDeEntrada1 = Textfield(p)
pruebas = 1 (slider from 1 to 4, step 1)
S = Midpoint(a)
P = Midpoint(a')
SS = Midpoint(c)
SP = Midpoint(c')
PS = Midpoint(c'')
PP = Midpoint(c'_1)
SSS = Midpoint(f)
SSP = Midpoint(f')
SPS = Midpoint(f'')
SPP = Midpoint(f'_1)
PSS = Midpoint(g)
PSP = Midpoint(f''')
PPS = Midpoint(f''_1)
PPP = Midpoint(f'_2)
total: p + q
tS: "" + (LaTeX[p]) + ""
tP: "" + (LaTeX[q]) + ""
tPP: "" + (LaTeX[q]) + ""
tPS: "" + (LaTeX[p]) + ""
tSS: "" + (LaTeX[p]) + ""
tSP: "" + (LaTeX[q]) + ""
ES1 = (11.5, -4.4)
tSSS: "" + (LaTeX[p]) + ""
tSPP: "" + (LaTeX[q]) + ""
tSSP: "" + (LaTeX[q]) + ""
tPPP: "" + (LaTeX[q]) + ""
tPPS: "" + (LaTeX[p]) + ""
tPSS: "" + (LaTeX[p]) + ""
tSPS: "" + (LaTeX[p]) + ""
texto1: "" + (LaTeX[q]) + ""
J = (8.96, 5.64)
h = Line(E, e)
i = Segment(E, J)
J' = Mirror(J, h)
E'_3 = Mirror(E, h)
J'_1 = Mirror(J, h)
i' = Segment(E'_3, J'_1)
J'_2 = Mirror(J, e)
J'' = Mirror(J', e)
K = Mirror(J'_1, e)
J'_3 = Mirror(J, d)
J''_1 = Mirror(J', d)
L = Mirror(J'_1, d)
M = Mirror(J'_2, d)
J''' = Mirror(J'', d)
K' = Mirror(K, d)
J'_4 = Mirror(J, b)
J''_2 = Mirror(J', b)
N = Mirror(J'_1, b)
O = Mirror(J'_2, b)
J'''_1 = Mirror(J'', b)
K'_1 = Mirror(K, b)
Q = Mirror(J'_3, b)
R = Mirror(J''_1, b)
L' = Mirror(L, b)
M' = Mirror(M, b)
T = Mirror(J''', b)
K'' = Mirror(K', b)
j = Segment(E', K)
k = Segment(E', J'_2)
l = Segment(E'', M)
m = Segment(E'', J''')
n = Segment(E'_1, L)
r = Segment(E'_1, J'_3)
s = Segment(I, Q)
t = Segment(I, R)
a_1 = Segment(E''', K'')
b_1 = Segment(E''', M')
c_1 = Segment(E''_1, O)
d_1 = Segment(E''_1, J'''_1)
e_1 = Segment(E'_2, N)
f_1 = Segment(E'_2, J'_4)
texto6: "q=" + q + ""
texto7: "P(éxito)=" + (LaTeX[p]) + ""
texto8: "P(\bar{A})=" + (LaTeX[q]) + ""
texSS: "P(2 \; éxitos)=" + (LaTeX[p]) + "·" + (LaTeX[p]) + " = " + (LaTeX[(p * p)]) + " "
texSP: "P(1 \; éxito)=2·" + (LaTeX[tS]) + "·" + (LaTeX[tSP]) + " = " + (LaTeX[((2 * p) * q)]) + " "
texPP: "P(0 \; éxitos)=" + (LaTeX[q]) + "·" + (LaTeX[q]) + " = " + (LaTeX[(q * q)]) + ""
texto2: "P(3 \; éxitos)=" + (LaTeX[p]) + "^3= " + (LaTeX[((p * p) * p)]) + " "
texto3: "P(2 \; éxitos)=3·" + (LaTeX[p]) + "^2·" + (LaTeX[q]) + " = " + (LaTeX[(((3 * p) * p) * q)]) + " "
texto4: "P(1 \; éxito)=3·" + (LaTeX[p]) + "·" + (LaTeX[q]) + "^2 = " + (LaTeX[(((3 * p) * q) * q)]) + " "
texto5: "P(0 \; éxitos)=" + (LaTeX[q]) + "^3= " + (LaTeX[((q * q) * q)]) + " "