Frecuencia 7

0

100

200

0

0.2

0.8

1

0.6

0.4

Nº de lanzamientos

Frec. relativa

Animación

300

400

500

dado1 = Sequence(Random[1, 6], i, 1, 500)
dado2 = Sequence(Random[1, 6], i, 1, 500)
suma = Sequence(Element[dado1, i] + Element[dado2, i], i, 1, 500)
fabsoluta = Sequence(CountIf[x ≟ 7, Sequence[Element[suma, i], i, 1, j]], j, 1, 500)
frelativa = Sequence(Element[fabsoluta, i] / i, i, 1, 500)
u = Vector((0, 0), (0, 1.1))
n = 0 (slider from 0 to 500, step 1)
fr = Element(frelativa, n)
P: (0, fr)
texto4: "" + (LaTeX[fr]) + ""
g = Segment(P, (n, fr))
d1 = Element(dado1, n)
d2 = Element(dado2, n)
s = Element(suma, n)
fa = Element(fabsoluta, n)
texto6: "\text{Frec. relativa del 7} = \frac{" + (LaTeX[fa]) + "}{" + (LaTeX[n]) + "} =" + (LaTeX[fr]) + ""
texto5: "\text{Suma de los dados} = " + (LaTeX[s]) + ""
A = (580.9644958841886, 1.1839650834989093)
B = (580.9644958841886, 0.9917355961261762)
C = (805.2322311523778, 0.9874638297401155)
D = (803.0963479593472, 1.1839650834989093)
f = PolyLine(Sequence[(i, Element[frelativa, i]), i, 1, n])
lista_1 = Sequence(Segment[(-5, (0.1 * i)), (0, (0.1 * i))], i, 0, 10)
v = Vector((0, 0), (530, 0))
lista_2 = Sequence(Segment[((100 * i), 0), ((100 * i), -0.015)], i, 0, 5)