DynamicModule[
{correct=RandomInteger[{1,3}],choice=1,open=None,finalChoice=None,switch=False,opened=False,showResult=False, staywin = 0, staygame = 0, switchwin = 0, switchgame = 0},
Column[
{Style["モンティホール問題",18,Bold],
Dynamic@Grid[
{Table[
Which[showResult&&i==correct,"🎯",showResult,"✖",opened&&i==open,"✖",True,"🚪"],{i,1,3}]},
Frame->All],Spacer[10],
Row[
{"最初に選ぶドア：",PopupMenu[Dynamic[choice],{1->"ドア1",2->"ドア2",3->"ドア3"}]}],Spacer[5],Button["司会者がドアを開ける",

open=RandomChoice[Complement[{1,2,3},{correct,choice}]];

opened=True;,Enabled->Dynamic[!opened]],Spacer[10],Row[{"変更する？ ",RadioButtonBar[Dynamic[switch],{False->"しない",True->"する"},Enabled->Dynamic[opened&&!showResult]]}],
Spacer[10],Button["結果を見る",
finalChoice=If[switch,First@Complement[{1,2,3},{choice,open}],choice];
showResult=True;
If[switch,switchgame++;
If[finalChoice==correct,switchwin++],
staygame++;
If[finalChoice==correct,staywin++]],
Enabled -> Dynamic[opened && !showResult]],Spacer[10],Dynamic[If[showResult,If[finalChoice==correct,Style["🎉 当たり！",18,Darker[Green]],Style["✖ ハズレ！",18,Red]],""]],Spacer[20],Button["新しいゲーム",correct=RandomInteger[{1,3}];
choice=1;
open=None;
finalChoice=None;
switch=False;
opened=False;
showResult=False;],
Dynamic@Column[{Style["統計",16,Bold],Grid[{{"","勝ち","試行","勝率"},{"変更しない",staywin,staygame,If[staygame==0,"-",Row[{NumberForm[100. staywin/staygame,{4,1}],"%"}]]},{"変更する",switchwin,switchgame,If[switchgame==0,"-",Row[{NumberForm[100. switchwin/switchgame,{4,1}],"%"}]]}},Frame->All]}]}]]