パロンドのゲーム(パロンドのパラドックス)とは,2つの確実に負け越すゲームを組み合わせると,なぜか勝ち越せてしまうというものである.
2種類の賭けのゲームA,Bが用意されている.A,Bともに勝てば元金1円獲得し,負ければ1円失い,
元金がなくなるまで繰り返しかけるものとする.
Aは,毎回勝てる確率が48%で,繰り返せば,確率的に確実に負けてしまう.
Bは,その時の元金が3の倍数であれば,勝つ確率は1%,そうでなければ,勝つ確率は,85%である.
Bも,賭けを続ければ,確率的に確実に元本はなくなっていく.
ここで,ゲームCを,50%の確率でゲームAかゲームBを行うものとすると,A,Bいずれも繰り返せば負けるはずなのに,Cは確率的に元本が増加するのである.
初めてきくと,かなり不思議に聞こえるかもしれないが,ゲームBをよく調べればその理由はすぐわかる
**************************************************************************
Parrondo.sas
パロンドのゲーム
**************************************************************************;
options nocenter compress=yes;
options ls=100 ps=30;
%let pa=0.48; /*ゲームAで勝つ確率*/
%let pb1=0.01;/*ゲームBで元金が3の倍数の時に勝つ確率*/
%let pb2=0.85;/*ゲームBで元金が3の倍数でない時に勝つ確率*/
data A;
bal=0;/*元本(初期値=0)*/
do trial=1 to 10000;
if ranuni(0)<&pa then bal+1;
else bal=bal-1;
output;
end;
run;
symbol1 i=line ;
proc plot ;where mod(trial,300)=1;
*proc gplot;
plot bal*trial;
run;quit;
/*
bal |
0 + A
| A A
| A A
|
| A A A A
| A A
| A A A
| A
| A A
-200 + A A
| A A
| A A A A
| A A A A
| A A
| A A
| A
|
|
-400 +
---+---------+---------+---------+---------+---------+---------+---------+--
1 1501 3001 4501 6001 7501 9001 10501
trial
*/
data B;
bal=0;
do trial=1 to 10000;
if mod(bal,3)=0 then do;
if ranuni(0)<&pb1 then bal+1;
else bal=bal-1;
end;
else do;
if ranuni(0)<&pb2 then bal+1;
else bal=bal-1;
end;
output;
end;
run;
proc plot ;where mod(trial,300)=1;
*proc gplot;
plot bal*trial;
run;quit;
/*
bal |
0 + A
| A A A A A A A
| A
| A A A A
| A A A A
| A
-100 + A A
| A
| A A A A
| A
| A
| A A
-200 + A A A
| A A
|
|
|
|
-300 +
---+---------+---------+---------+---------+---------+---------+---------+--
1 1501 3001 4501 6001 7501 9001 10501
trial
*/
data C;
bal=0;
do trial=1 to 10000;
if ranuni(0)<0.5 then do;
if ranuni(0)<&pa then bal+1;
else bal=bal-1;
end;
else do;
if mod(bal,3)=0 then do;
if ranuni(0)<&pb1 then bal+1;
else bal=bal-1;
end;
else do;
if ranuni(0)<&pb2 then bal+1;
else bal=bal-1;
end;
end;
output;
end;
run;
proc plot ;where mod(trial,300)=1;
*proc gplot;
plot bal*trial;
run;quit;
/*
bal |
300 +
|
|
|
|
| A A A
200 + A A A A A A A A A A
| A A A A A A
| A A
| A A
| A A
| A A A
100 + A A
| A
|
| A
| A
|
0 + A
---+---------+---------+---------+---------+---------+---------+---------+--
1 1501 3001 4501 6001 7501 9001 10501
trial
*/