also... 5 Züge... das bedeutet, dass eine blaue gezogen wird... ohne Zurücklegen... un ohne Beachtung der Reihenfolge... dafür gibt es ne Formel... Hypergeometrische Verteilung oder so... oder man macht sich Gedanken (=Spielbaum), wieviele Möglichkeiten es gibt, eine blaue in 4 gelben unterzubringen...:
- BGGGG --> (4/8)*(4/7)*(3/6)*(2/5)*(1/4)
- GBGGG --> (4/8)*(4/7)*(3/6)*(2/5)*(1/4)
- GGBGG --> (4/8)*(3/7)*(4/6)*(2/5)*(1/4)
- GGGBG --> (4/8)*(3/7)*(2/6)*(4/5)*(1/4)
- Summe der WK der Pfade: 2/35=u=P(X=4)
da ich für v zu blöd bin, habe ich es mit Monte-Carlo-Simulation versucht:
> c++ -o a a.c -O3 && dd if=/dev/urandom bs=4 count=1|./a
1+0 records in
1+0 records out
4 bytes copied, 6.1339e-05 s, 65.2 kB/s
(1:0.000%)(2:0.000%)(3:0.000%)
(4:1.439%)(5:5.701%)(6:14.292%)(7:28.581%)(8:49.988%)
> cat a.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
int main() {
uint32_t seed; read(0,&seed,sizeof(seed)); srandom(seed);
const uint32_t C = 1000U*1000U;
uint32_t cc[8];
for (uint32_t j=0; j<8; j++) cc[j] = 0;
for (uint32_t i=C; i>0; i--) {
uint32_t j, b, g;
for (j=0, b=4, g=4; g>0; j++) {
const uint32_t R = random();
const bool isB = R%(b+g) < b;
if (isB) b--; else g--;
}
cc[j-1]++;
}
for (uint32_t j=0; j<8; j++) printf("(%u:%.3f%%)",j+1,cc[j]*1e2/C);
printf("\n");
return 0;
}
und dann P(X=8)=v... keine Ahnung, wie man das mit dem Spielbaum macht...
hab das seit Jahren nich mehr gemacht... und bin müde...