Lösungen/Solutions/F2S2Ue/Ex01

L = Lektion/ Leçon   -- Sprechstunde / heures de consultation
W = Work / Arbeit / Travail
A=Anhang/Annexe/Appendice

Ueb/Ex 1      W

Remove["Global`@*"]

<< Statistics`DiscreteDistributions`

a   Kurs / Script

b

berdist = BernoulliDistribution[0.3]

PDF[berdist, x]

f[x_] := PDF[berdist, x]; f[z]

ListPlot[Table[{x, f[x]}, {x, 0, 2}], 
        PlotStyle -> {PointSize[0.03]}];

ListPlot[Table[{x, PDF[berdist, x]}, {x, 0, 5}], 
        PlotStyle -> {PointSize[0.03]}];

c

CDF[berdist, x]

{CDF[berdist, -1], CDF[berdist, 0], CDF[berdist, 1], 
      CDF[berdist, 2]}

ListPlot[Table[{x, CDF[berdist, x]}, {x, -1, 2}], 
        PlotStyle -> {PointSize[0.03]}];

d

Mean[berdist]

Mean[BernoulliDistribution[q]]

Variance[BernoulliDistribution[0.3]]

Variance[BernoulliDistribution[q]]

StandardDeviation[BernoulliDistribution[0.3]]

StandardDeviation[BernoulliDistribution[q]]

Quantile[berdist, 0.5]

Quantile[berdist, 0]

Quantile[berdist, 0.7]

Quantile[berdist, 0.75]

Quantile[berdist, 1]

Quantile[berdist, 2]

Ueb/Ex 2      W

bdist = BinomialDistribution[34, 0.3]

PDF[bdist, x]

ListPlot[Table[{x, PDF[bdist, x]}, {x, 0, 34}], 
        PlotStyle -> {PointSize[0.03]}];

CDF[bdist, x]

ListPlot[Table[{x, CDF[bdist, x]}, {x, 0, 34}], 
        PlotStyle -> {PointSize[0.03]}];

Mean[bdist]

Mean[BinomialDistribution[n, p]]

Variance[bdist]

Variance[BinomialDistribution[n, p]]

StandardDeviation[bdist]

StandardDeviation[BinomialDistribution[n, p]]

Quantile[bdist, 0.5]

ExpectedValue[x^3, bdist, x]

RandomArray[bdist, {2, 3}]

Ueb/Ex 3      W

P = 
      Sum[ Binomial[10, k] (4/32)^k (1 - 4/32)^(10 - k), {k, 
          6, 10}]

N[%]

bdist3 = BinomialDistribution[10, 4/32]

1 - CDF[bdist3, 5]

N[%]

Ueb/Ex 4      W

a

p = 0.5;
P = 
      Sum[ Binomial[120, k] (0.5)^k (1 - 0.5)^(120 - k), {k, 
          50, 120}]

bdist4 = BinomialDistribution[120, 0.5];
1 - CDF[bdist4, 49]

b

p = 0.5;
P = 
      Sum[ Binomial[120, k] (0.5)^k (1 - 0.5)^(120 - k), {k, 
          0, 60}]

bdist4 = BinomialDistribution[120, 0.5];
CDF[bdist4, 60]

bdist4 = BinomialDistribution[120, 0.5];
CDF[bdist4, 50]

Ueb/Ex 5      W

P = 
      Sum[ Binomial[10, k] (5/60)^k (1 - 5/60)^(10 - k), {k, 
          0, 3}]

N[%]

bdist5 = BinomialDistribution[10, 5/60];
CDF[bdist5, 3]

N[%]

Sum[ 
        Binomial[10, k] (5/60)^k (1 - 5/60)^(10 - k), {k, 4, 
          10}] // N

Chance, dass mindestens 4 das Gerät brauchen ist klein!  /  Chance que au moins 4 utilisent Nana est petite!

Sum[ 
        Binomial[10, k] (5/60)^k (1 - 5/60)^(10 - k), {k, 0, 
          2}] // N

Sum[ 
        Binomial[10, k] (5/60)^k (1 - 5/60)^(10 - k), {k, 0, 
          1}] // N

Sum[ 
        Binomial[10, k] (5/60)^k (1 - 5/60)^(10 - k), {k, 0, 
          0}] // N