Sanas:

Podridas:

Se cogen

Se cogen:

A = (-2, 1)
B = (1.02, 3.86)
a = Segment(A, B)
b: y = y(A)
A' = Mirror(A, b)
B' = Mirror(B, b)
a' = Segment(A', B')
C = (4.5, 5.26)
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 = (8, 6)
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)
sanas = 10
podridas = 2
CajaDeEntrada1 = Textfield(sanas)
CajaDeEntrada2 = Textfield(podridas)
secogen = 2 (slider from 1 to 3, step 1)
CajaDeEntrada3 = Textfield(secogen)
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: sanas + podridas
tS: "\frac{" + (LaTeX[sanas]) + "}{" + (LaTeX[total]) + "}"
tP: "\frac{" + (LaTeX[podridas]) + "}{" + (LaTeX[total]) + "}"
tPP: "\frac{" + (LaTeX[podridas - 1]) + "}{" + (LaTeX[total - 1]) + "}"
tPS: "\frac{" + (LaTeX[sanas]) + "}{" + (LaTeX[total - 1]) + "}"
tSS: "\frac{" + (LaTeX[sanas - 1]) + "}{" + (LaTeX[total - 1]) + "}"
tSP: "\frac{" + (LaTeX[podridas]) + "}{" + (LaTeX[total - 1]) + "}"
h = -0.455 (slider from -1 to -0.18, step 0.005)
ES1 = (11.5, -4.4)
ES2: ES1 + (h * (15, 0))
ES3: ES1 + (0, 10.5)
ES4: (x(ES2), y(ES3))
polígono1, es1, es2, es4, es3 = Polygon(ES1, ES2, ES4, ES3)
tSPP: "\frac{" + (LaTeX[podridas - 1]) + "}{" + (LaTeX[total - 2]) + "}"
tSPS: "\frac{" + (LaTeX[sanas - 1]) + "}{" + (LaTeX[total - 2]) + "}"
tPSP: "\frac{" + (LaTeX[podridas - 1]) + "}{" + (LaTeX[total - 2]) + "}"
tSSP: "\frac{" + (LaTeX[podridas]) + "}{" + (LaTeX[total - 2]) + "}"
tPSS: "\frac{" + (LaTeX[sanas - 1]) + "}{" + (LaTeX[total - 2]) + "}"
tSSS: "\frac{" + (LaTeX[sanas - 2]) + "}{" + (LaTeX[total - 2]) + "}"
tPPP: "\frac{" + (LaTeX[podridas - 2]) + "}{" + (LaTeX[total - 2]) + "}"
tPPS: "\frac{" + (LaTeX[sanas]) + "}{" + (LaTeX[total - 2]) + "}"
texPP: tP + "·" + tPP + " = " + (FractionText[(podridas * (podridas - 1) / ((total * (total - 1))))]) + " = " + ((podridas * (podridas - 1) / ((total * (total - 1)))))
texSS: tS + "·" + tSS + " = " + (FractionText[(sanas * (sanas - 1) / ((total * (total - 1))))]) + " = " + ((sanas * (sanas - 1) / ((total * (total - 1)))))
texPS: tP + "·" + tPS + " = " + (FractionText[(sanas * podridas / ((total * (total - 1))))]) + " = " + ((sanas * podridas / ((total * (total - 1)))))
texSP: tS + "·" + tSP + " = " + (FractionText[(sanas * podridas / ((total * (total - 1))))]) + " = " + ((podridas * sanas / ((total * (total - 1)))))