Bino Stat
Date: 27 March 2013

Valószínűségek

Szintek

golyók száma egyszerre

210

120

1 golyó dobása

100 dobása

sebesség

Randomize

210

252

45

45

120

10

10

1

1

Binomiális együtthatók

1

1

1

1

2

1. szint

2. sznt

3. szint

4. szint

5. szint

6. szint

7. szint

8. szint

9. szint

10. szint

Lehetőségek száma

# Successes

ShowTraces

EraseTraces

1

1

1

1

1

1

1

1

1

1

1

1

1

1

3

3

4

4

6

5

5

10

10

6

6

15

15

20

7

7

21

21

35

35

8

8

28

28

56

56

70

9

9

36

36

84

84

126

126

Golyók gyakorisága

100 golyó ejtése

0. szint

pontosan = 3 (slider from 0 to Trials, step 1)
SuccessDenoms: {2, 3, 4, 5, 5}
SuccessNums: {1, 1, 1, 1, 2}
ProbabilitySuccess = 5 (slider from 1 to 5, step 1)
ProbSuccessFailDenom = Element(SuccessDenoms, ProbabilitySuccess)
ProbSuccessNum = Element(SuccessNums, ProbabilitySuccess)
Trials = 9 (slider from 4 to 10, step 1)
SumStarts = Sequence((100 * Mod[i - 1, Trials]) + (Trials * Div[i - 1, Trials]) + 1, i, 1, (Trials * 100))
OneHundredDrops: 0.5 - Sequence[Div[Random[1, ProbSuccessFailDenom], ProbSuccessFailDenom - (ProbSuccessNum - 1)], l, 1, (Trials * 100)]
S_x = 7
ClassBoundaries = Sequence(m, m, S_x - Trials / 2 - 0.5, S_x + Trials / 2 + 0.5)
CeilClassBounds: ceil(ClassBoundaries)
SumsInOrder = Sequence(S_x - Sum[Take[OneHundredDrops, Element[SumStarts, m], Element[SumStarts, m] + Trials - 1]], m, 1, 100)
Animate100 = 109 (slider from 0 to 100 + Trials, step 0.25)
FinishedCount = If(Animate100  <  Trials - 0.25, 0, Animate100 - Trials)
Results = Take(SumsInOrder, 1, FinishedCount)
Outcomes = Frequency(ClassBoundaries, Results)
BounceFactor = If(floor(Animate100) ≟ Animate100, 0, 0.03)
Scale = 1 (slider from 0.5 to 1.5, step 0.1)
S_y = 20
Ball_1Vert = Mod(Animate100 - 1, Trials)
Ball_1Count = Sum(Take[OneHundredDrops, (Div[Animate100 - 1, Trials] * Trials) + 1, Animate100])
TrialsForExperiment: (Trials * 100)
WhichBallOf100 = 1 (slider from 1 to 100, step 1)
BallDrop = 4 (slider from 0 to Trials, step 1)
PickOneBallCount = If(BallDrop ≟ 0, 0, Sum[Take[OneHundredDrops, Element[SumStarts, WhichBallOf100], Element[SumStarts, WhichBallOf100] + BallDrop - 1]])
PickOneBallPt: (S_x - PickOneBallCount, S_y - BallDrop - 1)
matrix = Sequence(Sequence[(S_x + i - (0.5 * j), S_y - j), i, 0, j], j, 1, Trials + 1)
PickOneBall = Circle(PickOneBallPt, 0.4)
c_2 = Circle(PickOneBallPt, 0.4)
TotalOutcomes = Sum(Outcomes)
Ball_1: (S_x - Ball_1Count + ((Random[-10, 10] * Scale) * BounceFactor), S_y - Ball_1Vert - 2 + ((Random[-10, 10] * Scale) * BounceFactor))
Ping_1 = Circle(Ball_1, 0.4)
Ball_1Start: (Div[Animate100 - 1, Trials] * Trials) + 1
Ball_1End: Animate100
Ball_2Start: (Div[Animate100 - 2, Trials] * Trials) + 1 + 100
Ball_2End: Animate100 - 1 + 100
Ball_2Count = Sum(Take[OneHundredDrops, Ball_2Start, Ball_2End])
Ball_2Vert = Mod(Ball_1Vert - 1, Trials)
Ball_2: (S_x - Ball_2Count + ((Random[-10, 10] * Scale) * BounceFactor), S_y - Ball_2Vert - 2 + ((Random[-10, 10] * Scale) * BounceFactor))
Ping_2 = Circle(Ball_2, 0.4)
Ball_3Start: (Div[Animate100 - 3, Trials] * Trials) + 1 + 200
Ball_3End: Animate100 - 2 + 200
Ball_3Vert = Mod(Ball_1Vert - 2, Trials)
Ball_3Count = Sum(Take[OneHundredDrops, Ball_3Start, Ball_3End])
Ball_3: (S_x - Ball_3Count + ((Random[-10, 10] * Scale) * BounceFactor), S_y - Ball_3Vert - 2 + ((Random[-10, 10] * Scale) * BounceFactor))
Ping_3 = Circle(Ball_3, 0.4)
Check = Take(OneHundredDrops, 201, 300)
AnimateSpeed = 3.6 (slider from 0.1 to 5, step 0.1)
Ball_4Start: (Div[Animate100 - 4, Trials] * Trials) + 1 + 300
Ball_4End: Animate100 - 3 + 300
Ball_4Count = Sum(Take[OneHundredDrops, Ball_4Start, Ball_4End])
Ball_4Vert = Mod(Ball_1Vert - 3, Trials)
Ball_4: (S_x - Ball_4Count + ((Random[-10, 10] * Scale) * BounceFactor), S_y - Ball_4Vert - 2 + ((Random[-10, 10] * Scale) * BounceFactor))
Ping_4 = Circle(Ball_4, 0.4)
Ball_5Start: (Div[Animate100 - 5, Trials] * Trials) + 1 + 400
Ball_5End: Animate100 - 4 + 400
Ball_5Count = Sum(Take[OneHundredDrops, Ball_5Start, Ball_5End])
Ball_5Vert = Mod(Ball_1Vert - 4, Trials)
Ball_5: (S_x - Ball_5Count, S_y - Ball_5Vert - 2 + ((Random[-1, 1] * Scale) * BounceFactor))
Ping_5 = Circle(Ball_5, 0.4)
Try1: {1, 5, 9, 13}
Try2: {2, 6, 10, 14}
Ball_6Start: (Div[Animate100 - 6, Trials] * Trials) + 1 + 500
Ball_6End: Animate100 - 5 + 500
Ball_6Vert = Mod(Ball_1Vert - 5, Trials)
Ball_6Count = Sum(Take[OneHundredDrops, Ball_6Start, Ball_6End])
Ball_6: (S_x - Ball_6Count + ((Random[-10, 10] * Scale) * BounceFactor), S_y - Ball_6Vert - 2 + ((Random[-10, 10] * Scale) * BounceFactor))
Ping_6 = Circle(Ball_6, 0.4)
Ball_7Start: (Div[Animate100 - 7, Trials] * Trials) + 1 + 600
Ball_7End: Animate100 - 6 + 600
Ball_7Vert = Mod(Ball_1Vert - 6, Trials)
Ball_7Count = Sum(Take[OneHundredDrops, Ball_7Start, Ball_7End])
Ball_7: (S_x - Ball_7Count + ((Random[-10, 10] * Scale) * BounceFactor), S_y - Ball_7Vert - 2 + ((Random[-10, 10] * Scale) * BounceFactor))
Ping_7 = Circle(Ball_7, 0.4)
Try3 = Mod(2.5, 1)
Ping_1Start = Circle((S_x, S_y - 1 - Mod[Animate100, 1]), 0.4)
Ping_3Start = Circle((S_x, S_y - 1 - Mod[Animate100, 1]), 0.4)
Ping_2Start = Circle((S_x, S_y - 1 - Mod[Animate100, 1]), 0.4)
Ping_4Start = Circle((S_x, S_y - 1 - Mod[Animate100, 1]), 0.4)
Ping_5Start = Circle((S_x, S_y - 1 - Mod[Animate100, 1]), 0.4)
Ping_6Start = Circle((S_x, S_y - 1 - Mod[Animate100, 1]), 0.4)
Slots = Sequence(Segment[(Element[ClassBoundaries, i], 0), (Element[ClassBoundaries, i], S_y - Trials - 1.5)], i, 1, Trials + 2)
Vector_y = Element(Outcomes, IndexOf[floor(Element[SumsInOrder, Animate100 - Trials]), CeilClassBounds])
Vector_x = Element(SumsInOrder, Animate100 - Trials)
Ping_7Start = Circle((S_x, S_y - 1 - Mod[Animate100, 1]), 0.4)
V_y1 = Element(Outcomes, IndexOf[ceil(Element[SumsInOrder, ceil(Animate100 - Trials)]), ceil(ClassBoundaries)])
Ball_1Try: 100 - Ball_1Vert
Ball_8Start: (Div[Animate100 - 8, Trials] * Trials) + 1 + 700
Ball_8End: Animate100 - 7 + 700
Ball_8Count = Sum(Take[OneHundredDrops, Ball_8Start, Ball_8End])
Ball_8Vert = Mod(Ball_1Vert - 7, Trials)
Ball_8: (S_x - Ball_8Count + ((Random[-10, 10] * Scale) * BounceFactor), S_y - Ball_8Vert - 2 + ((Random[-10, 10] * Scale) * BounceFactor))
Ping_8 = Circle(Ball_8, 0.4)
Ping_8Start = Circle((S_x, S_y - 1 - Mod[Animate100, 1]), 0.4)
Ball_9Start: (Div[Animate100 - 9, Trials] * Trials) + 1 + 800
Ball_9End: Animate100 - 8 + 800
Ball_9Vert = Mod(Ball_1Vert - 8, Trials)
Ball_9Count = Sum(Take[OneHundredDrops, Ball_9Start, Ball_9End])
Ball_9: (S_x - Ball_9Count + ((Random[-10, 10] * Scale) * BounceFactor), S_y - Ball_9Vert - 2 + ((Random[-10, 10] * Scale) * BounceFactor))
Ping_9 = Circle(Ball_9, 0.4)
Ping_9Start = Circle((S_x, S_y - 1 - Mod[Animate100, 1]), 0.4)
Ball_0Start: (Div[Animate100 - 10, Trials] * Trials) + 1 + 900
Ball_0End: Animate100 - 9 + 900
Ball_0Vert = Mod(Ball_1Vert - 9, Trials)
Ball_0Count = Sum(Take[OneHundredDrops, Ball_0Start, Ball_0End])
Ball_0: (S_x - Ball_0Count + ((Random[-10, 10] * Scale) * BounceFactor), S_y - Ball_0Vert - 2 + ((Random[-10, 10] * Scale) * BounceFactor))
Ping_0 = Circle(Ball_0, 0.4)
Ping_0Start = Circle((S_x, S_y - 1 - Mod[Animate100, 1]), 0.4)
ProbOneHalf: 1 / 2 - Div[Random[1, 2], 2]
ProbOneThird: 1 / 2 - Div[Random[1, 3], 3]
ProbOneFourth: 1 / 2 - Div[Random[1, 4], 4]
ProbOneFifth: 1 / 2 - Div[Random[1, 5], 5]
ProbTwoFifth: 1 / 2 - Div[Random[1, 5], 4]
FailNums: {1, 2, 3, 4, 3}
ProbFailNum = Element(FailNums, ProbabilitySuccess)
matrix2 = Sequence(Sequence[(S_x + i - (0.5 * j), S_y - j), i, 0, j], j, 1, Trials + 1)
Com53: {{1, 1, 1, 0, 0, 0, 0}, {1, 1, 0, 1, 0, 0, 0}}
Pascal = true
Histoxtics = Sequence(Segment[(Element[ClassBoundaries, i], 0), (Element[ClassBoundaries, i], (-0.25))], i, 1, Trials + 2)
XAxisLabelPoint: (Trials / 2 + 1 + S_x, 0)
Try: {}
NumberOfSuccesses: pontosan
SumsAsOutcomes = Sequence(Trials / 2 - Sum[Take[OneHundredDrops, Element[SumStarts, m], Element[SumStarts, m] + Trials - 1]], m, 1, 100)
TraceStartColor: Random[1, 100] / 100
B = 0 (slider from 0 to 100, step 1)
TraceStart = Element(SumStarts, B)
Trace_A = Sum(Take[OneHundredDrops, 1, 1 + TraceStart])
TraceShow: NumberOfSuccesses ≟ Element[SumsAsOutcomes, B]
GrowHisto = Histogram(false, ClassBoundaries, Results, true, 0.2)
u_2 = If(Mod[Animate100, 1] ≟ 0.5 ∨ Mod[Animate100, 1] ≟ 0.5, Vector[(Vector_x, S_y - Trials - 2), (Vector_x, ((Vector_y * 0.2) + S_y - Trials - 2) / 2)])
TracesHide = true
B2: Element[Outcomes, NumberOfSuccesses + 1] + 1
AllOutcomes = Sequence(i, i, 0, Trials)
B3 = Element(Frequency[AllOutcomes, Take[SumsAsOutcomes, 1, B]], NumberOfSuccesses + 1)
Trace = If(TraceShow ∧ (¬TracesHide), Sequence[Segment[(S_x - 0.4 + (0.8 / B2 * B3) - Sum[Take[OneHundredDrops, TraceStart, TraceStart + i]], S_y - i - 2), (S_x - 0.4 + (0.8 / B2 * B3) - Sum[Take[OneHundredDrops, TraceStart, TraceStart + i + 1]], S_y - i - 3)], i, 0, Trials - 2])
Trace2 = If(TraceShow ∧ (¬TracesHide), Segment[(S_x, S_y - 1), (S_x - 0.4 + (0.8 / B2 * B3) - Sum[Take[OneHundredDrops, TraceStart, TraceStart]], S_y - 2)])
maxverticalscale: (Div[Max[Outcomes] + 5, 5] * 5)
LocateYaxisLabel: (Element[ClassBoundaries, 1] - 1, (maxverticalscale * 0.1))
LabelHistoOutcomes = Sequence(Text[LaTeX[Element[Outcomes, i]], (Element[ClassBoundaries, i] + 0.3, (Element[Outcomes, i] * 0.2) + 0.1)], i, 1, Trials + 1)
u_1 = If(Mod[Animate100, 1] ≟ 0.75 ∨ Mod[Animate100, 1] ≟ 0.75, Vector[(Vector_x, (S_y - Trials - 2 + (Vector_y * 0.2)) / 2.05), (Vector_x, (Vector_y * 0.23))])
NumberOfFailures: Trials - NumberOfSuccesses
ExpectedOutcome: (((Binomial[Trials, NumberOfSuccesses] * (ProbSuccessNum / ProbSuccessFailDenom)^(NumberOfSuccesses)) * (ProbFailNum / ProbSuccessFailDenom)^(NumberOfFailures)) * 100)
ExPoint: (Element[ClassBoundaries + 0.5, NumberOfSuccesses + 0.5], (-1.1))
ExPoint2: (x(ExPoint), (-0.5))
u = Vector(ExPoint, ExPoint2)
ExPoint3: (x(ExPoint) + 1, y(ExPoint))
a = Segment(ExPoint3, ExPoint)
text28: "Checking \; path \; \# \;  " + (LaTeX[B]) + " \; for \; " + (LaTeX[NumberOfSuccesses]) + " \; success(es)..."
BinoProb: ExpectedOutcome / 100
list1 = Sequence(Text[LaTeX[i - 1], (Element[ClassBoundaries, i] + 0.4, (-0.4))], i, 1, Trials + 1)
VerticalScale = Sequence(Text[LaTeX[i], (Element[ClassBoundaries, 1] - 1.4, (i * 0.2) - 0.1)], i, 0, maxverticalscale, 5)
yaxis = Segment((Element[ClassBoundaries, 1] - 0.5, 0), (Element[ClassBoundaries, 1] - 0.5, (maxverticalscale * 0.2)))
BlackXAxis = Segment((Element[ClassBoundaries, 1], 0), (Element[ClassBoundaries, Trials + 2], 0))
verticaltics = Sequence(Segment[(Element[ClassBoundaries, 1] - 0.5, (i * 0.2)), (Element[ClassBoundaries, 1] - 0.75, (i * 0.2))], i, 0, maxverticalscale, 5)
text3: "Valószínűségek \;(bal/jobb): \ovalbox{p=\frac{ " + (LaTeX[ProbSuccessNum]) + "}{" + (LaTeX[ProbSuccessFailDenom]) + " }}⇒\ovalbox{q=1-p=\frac{" + (LaTeX[ProbFailNum]) + "}{" + (LaTeX[ProbSuccessFailDenom]) + "}}"
text80: "P\;(X=" + (LaTeX[NumberOfSuccesses]) + ")=\bigg(\begin{array}{} " + (LaTeX[Trials]) + " \\ " + (LaTeX[NumberOfSuccesses]) + " \end{array} \bigg)\bigg(\frac{" + (LaTeX[ProbSuccessNum]) + "}{" + (LaTeX[ProbSuccessFailDenom]) + "}\bigg)^{" + (LaTeX[NumberOfSuccesses]) + "}\bigg(\frac{" + (LaTeX[ProbFailNum]) + "}{" + (LaTeX[ProbSuccessFailDenom]) + "}\bigg)^{" + (LaTeX[NumberOfFailures]) + "}=" + (LaTeX[BinoProb]) + "}"