P(A_1) =

P(B|A_1) =

P(B|A_3) =

Ver con enteros

N =

P(A_2)=

P(B|A_2)=

a_1 = 0.15 (slider from 0 to 1, step 0.01)
ba_1 = 0.6 (slider from 0 to 1, step 0.01)
CasillaDeEntradaA1 = Textfield(a_1)
CasillaDeEntradaBA1 = Textfield(ba_1)
ba_3 = 0.4 (slider from 0 to 1, step 0.01)
CasillaDeEntradaBA3 = Textfield(ba_3)
A = (-2.78, 1.24)
b_1: y = y(A)
B = (-0.06, 4.1)
c = Segment(A, B)
d: y = y(B)
C = (4.14, 4.66)
e = Segment(B, C)
B'_3 = Mirror(B, d)
C' = Mirror(C, d)
e' = Segment(B'_3, C')
A' = Mirror(A, b_1)
B'_1 = Mirror(B, b_1)
c' = Segment(A', B'_1)
B'_2 = Mirror(B, b_1)
C''' = Mirror(C, b_1)
e'_1 = Segment(B'_2, C''')
B' = Mirror(B, b_1)
C'' = Mirror(C', b_1)
e'' = Segment(B', C'')
MA = Midpoint(c)
MAB = Midpoint(e)
MAB' = Midpoint(e')
MA' = Midpoint(c')
MA'B = Midpoint(e'')
MA'B' = Midpoint(e'_1)
textoPA1: "" + a_1 + ""
textoPA1B: "" + ba_1 + ""
textoPA1B': "" + (1 - ba_1)
textoPA'B': "" + (1 - ba_3)
textoPA3B: "" + ba_3
r = 0.8 (slider from 0 to 5, step 0.1)
f = true
n: 1000
campoDeTexto1 = Textfield(n)
textonA1: "" + ((a_1 * n))
textonC': "" + (((a_1 * (1 - ba_1)) * n))
textonO: "" + n + ""
textonC: "" + (((a_1 * ba_1) * n))
D = (10.14, -4.56)
E: D - (1, 0)
F: D + (0, 1)
g = Ray(D, F)
h = Ray(D, E)
G = Point(h)
H = Point(g)
desli = 1 (slider from 0 to 1, step 0.005)
u = Vector(G, D)
I: G + (desli * u)
i_2 = OrthogonalLine(I, u)
j = OrthogonalLine(H, g)
J = Intersect(i_2, j)
polígono1, j_1, h_1, d_1, i_1 = Polygon(J, H, D, I)
K = Midpoint(B, B'_1)
k = Segment(A, K)
v = Vector(B, C)
L: K + v
L' = Mirror(L, k)
l = Segment(K, L)
m = Segment(K, L')
a_2 = 0.3 (slider from 0 to 1 - a_1, step 0.01)
CasillaDeEntradaA2 = Textfield(a_2)
textoPA2: "" + a_2 + ""
AK = Midpoint(A, K)
ba_2 = 0.35 (slider from 0 to 1, step 0.01)
CasillaDeEntrada1 = Textfield(ba_2)
KL = Midpoint(L, K)
KL' = Midpoint(L', K)
textoPA2B: "" + ba_2 + ""
textoPA2B': "" + (1 - ba_2)
textoPA1yB: "P(A_1 \cap B) =" + (LaTeX[a_1]) + "·" + (LaTeX[ba_1]) + "= " + (LaTeX[(a_1 * ba_1)]) + ""
textoPA1yB': "P(A_1\cap \bar{B}) = " + (LaTeX[a_1]) + "·" + (LaTeX[1 - ba_1]) + "=" + (LaTeX[(a_1 * (1 - ba_1))]) + ""
textoPA3yB': "P(A_3 \cap \bar{B}) =" + (LaTeX[1 - a_1]) + "·" + (LaTeX[1 - ba_3]) + "=" + (LaTeX[((1 - a_1) * (1 - ba_3))]) + ""
textoPA2yB: "P(A_2 \cap B) =" + (LaTeX[a_2]) + "·" + (LaTeX[ba_2]) + "= " + (LaTeX[(a_2 * ba_2)]) + ""
textoPA2yB': "P(A_2 \cap B) =" + (LaTeX[a_2]) + "·" + (LaTeX[1 - ba_2]) + "= " + (LaTeX[(a_2 * (1 - ba_2))]) + ""
a_3: 1 - a_1 - a_2
textoPA': "" + a_3 + ""
textoPA3yB: "P(A_3\cap B) =" + (LaTeX[a_3]) + "·" + (LaTeX[ba_3]) + "=" + (LaTeX[(a_3 * ba_3)]) + ""
textonA3: "" + ((a_3 * n)) + ""
textonA2: "" + ((a_2 * n)) + ""
textonC'': "" + (((a_3 * ba_3) * n)) + ""
textonC''': "" + (((a_3 * (1 - ba_3)) * n)) + ""
textonL: "" + (((a_2 * ba_2) * n))
textonL': "" + (((a_2 * (1 - ba_2)) * n))
i = 2 (slider from 1 to 3, step 1)
pb: (a_1 * ba_1) + (a_2 * ba_2) + (a_3 * ba_3)
textoTotal2: "P(B)=\frac{ " + (LaTeX[((n * a_1) * ba_1)]) + "+" + (LaTeX[((n * a_2) * ba_2)]) + " +" + (LaTeX[((n * a_3) * ba_3)]) + "}{ " + (LaTeX[n]) + "}=" + (LaTeX[pb]) + " "
textoTotal1: "P(B)= " + (LaTeX[(a_1 * ba_1)]) + "+" + (LaTeX[(a_2 * ba_2)]) + "+" + (LaTeX[(a_3 * ba_3)]) + "=" + (LaTeX[pb]) + ""
textoBayes3: "P(A_3|B)=\frac{ " + (LaTeX[((n * a_3) * ba_3)]) + "}{ " + (LaTeX[((n * a_1) * ba_1)]) + "+" + (LaTeX[((n * a_2) * ba_2)]) + " +" + (LaTeX[((n * a_3) * ba_3)]) + "}=\frac{" + (LaTeX[((n * a_3) * ba_3)]) + "}{" + (LaTeX[(n * pb)]) + "}=" + (LaTeX[(a_3 * ba_3 / pb)]) + " "
textoBayes2: "P(A_2|B)=\frac{ " + (LaTeX[((n * a_2) * ba_2)]) + "}{ " + (LaTeX[((n * a_1) * ba_1)]) + "+" + (LaTeX[((n * a_2) * ba_2)]) + " +" + (LaTeX[((n * a_3) * ba_3)]) + "}=\frac{" + (LaTeX[((n * a_2) * ba_2)]) + "}{" + (LaTeX[(n * pb)]) + "}=" + (LaTeX[(a_2 * ba_2 / pb)]) + " "
textoBayes1: "P(A_1|B)=\frac{ " + (LaTeX[((n * a_1) * ba_1)]) + "}{ " + (LaTeX[((n * a_1) * ba_1)]) + "+" + (LaTeX[((n * a_2) * ba_2)]) + " +" + (LaTeX[((n * a_3) * ba_3)]) + "}=\frac{" + (LaTeX[((n * a_1) * ba_1)]) + "}{" + (LaTeX[(n * pb)]) + "}=" + (LaTeX[(a_1 * ba_1 / pb)]) + " "
textoBayes02: "P(A_2|B)=\frac{ " + (LaTeX[(a_2 * ba_2)]) + "}{ " + (LaTeX[(a_1 * ba_1)]) + "+" + (LaTeX[(a_2 * ba_2)]) + " +" + (LaTeX[(a_3 * ba_3)]) + "}=" + (LaTeX[(a_2 * ba_2 / pb)]) + " "
textoBayes01: "P(A_1|B)=\frac{ " + (LaTeX[(a_1 * ba_1)]) + "}{ " + (LaTeX[(a_1 * ba_1)]) + "+" + (LaTeX[(a_2 * ba_2)]) + " +" + (LaTeX[(a_3 * ba_3)]) + "}=" + (LaTeX[(a_2 * ba_2 / pb)]) + " "
textoBayes03: "P(A_3|B)=\frac{ " + (LaTeX[(a_3 * ba_3)]) + "}{ " + (LaTeX[(a_1 * ba_1)]) + "+" + (LaTeX[(a_2 * ba_2)]) + " +" + (LaTeX[(a_3 * ba_3)]) + "}=" + (LaTeX[(a_2 * ba_2 / pb)]) + " "