Lösungen / Statistik 2/10

Remove["Global`*"]

1.

Table[Binomial[4, m], {m, 0, 4}]

hyp[nN_, n_, mM_, m_] := 
      Binomial[mM, m] Binomial[nN - mM, n - m]/Binomial[nN, n]

poi[nN_, n_, mM_, m_] := 
      Binomial[n, m] (mM/nN)^
          m (1 - (mM/nN))^(n - m)

quot[nN_, n_, mM_, m_] := 
      hyp[nN, n, mM, m]/poi[nN, n, mM, m]

Table[hyp[1000, 10, 5, m], {m, 0, 10}] // N

Table[poi[1000, 10, 5, m], {m, 0, 10}] // N

Table[quot[1000, 10, 5, m], {m, 0, 10}] // N

Plot[quot[1000, 10, 5, m], {m, 0, 10}];

Table[quot[10000, 100, 20, m], {m, 0, 20}] // N

Plot[quot[10000, 100, 20, m], {m, 0, 20}];

2.

a

1

lHyp[nN_, n_, p_, c_] := 
      Sum[Binomial[p nN, m] 
          Binomial[nN (1 - p), n - m]/Binomial[nN, n], {m, 0, 
          c}]

Table[lHyp[120, 3, p, 2], {p, 0, 1, 0.1}]

Plot[lHyp[120, 3, p, 0], {p, 0, 1}, 
        PlotRange -> {0, 1}];

Plot[lHyp[120, 3, p, 1], {p, 0, 1}, 
        PlotRange -> {0, 1}];

Plot[lHyp[120, 3, p, 2], {p, 0, 1}, 
        PlotRange -> {0, 1}];

Plot[lHyp[120, 3, p, 3], {p, 0, 1}, 
        PlotRange -> {0, 1}];

2

lPoi[n_, p_, c_] := 
      Sum[Binomial[n, m] p^m (1 - p)^(n - m), {m, 0, c}]

Table[lPoi[3, p, 2], {p, 0, 1, 0.1}]

Plot[lPoi[3, p, 0], {p, 0, 1}, 
        PlotRange -> {0, 1}];

Plot[lPoi[3, p, 1], {p, 0, 1}, 
        PlotRange -> {0, 1}];

Plot[lPoi[3, p, 2], {p, 0, 1}, 
        PlotRange -> {0, 1}];

Plot[lPoi[3, p, 3], {p, 0, 1}, 
        PlotRange -> {0, 1}];

b

1

Plot[lHyp[120, 10, p, 3], {p, 0, 1}, 
        PlotRange -> {0, 1}];

GraphicsArray[
        Table[Plot[lHyp[120, 10, p, k], {p, 0, 1}, 
            PlotRange -> {0, 1}], {k, 0, 10}]];

Select the graphics. Then go to "Cell, Animate selected graphics"

2

Plot[lPoi[10, p, 3], {p, 0, 1}, 
        PlotRange -> {0, 1}];

GraphicsArray[
        Table[Plot[lPoi[10, p, k], {p, 0, 1}, PlotRange -> {0, 1}], {k, 
            0, 10}]];

Select the graphics. Then go to "Cell, Animate selected graphics"