ãã©ã³ãã¨ç¢ºçã®åé¡
ãã¿å
http://www.nyasoku.com/archives/50352203.html
ã¸ã§ã¼ã«ã¼ãé¤ãããã©ã³ãï¼ï¼æã®ä¸ããï¼æã®ã«ã¼ããæãåºãã表ãè¦ãªãã§ç®±ã®ä¸ã«ãã¾ã£ããããã¦ãæ®ãã®ã«ã¼ããããåã£ã¦ããï¼ææãåºããã¨ãããï¼æã¨ããã¤ã¢ã§ãã£ãã
ãã®ã¨ããç®±ã®ä¸ã®ã«ã¼ãããã¤ã¤ã§ãã確çã¯ããããã
ã¨ãã話ã§ã
- å¾ã«ä½ãå¼ãã¦ãæåã®ã«ã¼ãã«ã¯å½±é¿ããªãã®ã§1/4
- 49æä¸10æãã¤ã¤ã®å¯è½æ§ããããã10/49
ã¨ããè°è«ãããããã§ããå ã ã大å¦å ¥è©¦ã®åé¡ãããã赤æ¬ã§ã¯1/4ãçãã«ãªã£ã¦ãããã§ã
å ´ååããããªã
- 1. æåã®ã«ã¼ãããã¤ã¤ã§ã次ã®3æããã¤ã¤ã®å ´å
- 1/4 * 12/51 * 11/50 * 10/49
- 2. æåã®ã«ã¼ãããã¤ã¤ä»¥å¤ã§ã次ã®3æããã¤ã¤ã®å ´å
- 3/4 * 13/51 * 12/50 * 11/49
(1ã®å ´å)/(1ã®å ´å+2ã®å ´å) ã®å²åãåã£ã¦10/(39+10) = 10/49ã»ã»ã»ã£ã¦ã®ãåé¡ã«æ²¿ã£ãçãã«ãªãããªã49æä¸10æã ããã»ã»ã»ã£ã¦ã®ã¯ã3æãã¤ã¤ãå¼ããå¾ã«1æå¼ããã¨ãã®å ´åã§ãã£ã¦ãå³å¯ã«è¨ãã°ä»åã®åé¡ã«å¯¾ããçãã§ã¯ãªããçµå±ã¯åããã¨ãªã®ã§ããã
ã¾ãããå¾ããå¼ããã«ã¼ãã¯ä½ã®é¢ä¿ããªãã®ã§1/4ããªãã¦ãã³ã»ã³ã¹ãããã¨ããããã®ã¨ããã¨ããã®ã¯æããã«3æã®ãã¤ã¤ãæ å ±ã¨ãã¦èªèããå¾ã®è©±ã§ãããã
http://science4.2ch.net/test/read.cgi/math/1107189103/
44 ï¼ï¼ï¼ï¼äººç®ã®ç´ æ°ãã ï¼2005/12/07(æ°´) 13:00:06
ã¸ã§ã¼ã«ã¼ãé¤ãããã©ã³ãï¼ï¼æã®ä¸ããï¼æã®ã«ã¼ããæãåºãã
表ãè¦ãªãã§ç®±ã®ä¸ã«ãã¾ã£ãã
ããã¦ãæ®ãã®ã«ã¼ããããåã£ã¦ããï¼ï¼ææãåºããã¨ããã
ï¼ï¼æã¨ããã¤ã¢ã§ãã£ãã
ãã®ã¨ããç®±ã®ä¸ã®ã«ã¼ãããã¤ã¤ã§ãã確çã¯ãããããããã確ç«1/4ã¨ããããã§ãã
åé¨çã大å¤ã§ããã
追è¨
ãã¤ãºçã¢ããã¼ãã§èãã¦ã¿ãã¨ã
- äºè±¡A:1æç®ããã¤ã¤ã§ãã
- äºè±¡B:2, 3, 4æç®ããã¤ã¤ã§ãã
ã¨ããã¨ããäºè±¡Bã®ãã¨ã§ã®äºè±¡Aã®äºå¾ç¢ºçãæ±ããã¨ãããã¨ã«ãªãã¾ãã
P(A|B) = P(A)P(B|A)/(P(A)P(B|A)+P(not A)(B|not A))
ããã§
- P(A) = 1/4
- P(B|A) = 12/51 * 11/50 * 10/49
- P(not A) = 3/4
- P(B|not A) = 13/51 * 12/50 * 11/49
å¾ã£ã¦ãP(A)P(B|A)/(P(A)P(B|A)+P(not A)(B|not A)) = 10/49ãã¾ãçµå±ãã£ã¦ããã¨ã¯ä¸ç·ã
ãããããã¤ãºçã¢ããã¼ãã§èãããªããäºè±¡Bã観測ããæç¹ã®ãäºè±¡Aã®ç¢ºçãã¨ããè¨èããããããã確ç(probability)ãã¨ããè¨èã使ãããç´ããããã®ã§ãã£ã¦ãäºè±¡Bã観測ããæç¹ã®ãäºè±¡Aã®å°¤åº¦(likelihood)ãã¨è¨ã£ãã»ãããã£ã¨ããããããã
#include <stdio.h> #include <time.h> #define INTERVAL 10000000 #define SUFFLETIME 100 #define CARDS 52 #define ISDIAMOND(x) (x%4 == 0) extern void init_genrand(unsigned long); extern double genrand_real2(void); void init(int[], int); int main(){ int i, card[CARDS], c1=0, c2=0; init_genrand((unsigned int)time(NULL)); for(i=0; i<INTERVAL; i++){ init(card, CARDS); if(ISDIAMOND(card[1]) && ISDIAMOND(card[2]) && ISDIAMOND(card[3])){ (ISDIAMOND(card[0])) ? c1++ : c2++; } } printf("p = %f (%d/%d)\n", (double)c1/(double)(c1+c2), c1, c1+c2); return 0; } void init(int array[], int size) { int i, i2, r, tmp; for(i=0; i<size; i++){ array[i] = i; } for(i=0; i<SUFFLETIME; i++){ i2 = i%size; r = (int)(genrand_real2() * size); tmp = array[i2]; array[i2] = array[r]; array[r] = tmp; } }
ãããªè¨ç®ã«ä½¿ãå¿ è¦ãç¡ãã®ã§ããã念ã®ããä¹±æ°ã¯Mersenne Twister(http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/mt.html)ã使ã£ã¦ãã¾ãã
p = 0.203558 (26399/129688)
10/49 = 0.204ã§ãã
ã½ã¼ã¹ã³ã¼ããè¦ãã°ã3æã®ãã¤ã¤ãèªèãããã¨ã§ãã¨ããæ¡ä»¶ä»ããæ確ã§ããããããããããã¨ãå¤å®ã«ä½¿ãé åã®ã¤ã³ããã¯ã¹ã¯ã¦ãã¼ã¯ãª4åãªãã°ä½ã§ããããã¤ã¾ãã«ã¼ããå¼ãé çªã¯ä½ã§ãããã£ã¦ããã®ãç´æçã«åããããããªããã¨ã