Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,87 @@
|
|||
ClearAll[Unload, Load, Spin, Fire]
|
||||
Unload[] := ConstantArray[False, 6]
|
||||
Load[state_List] := Module[{s = state},
|
||||
While[s[[2]],
|
||||
s = RotateRight[s, 1]
|
||||
];
|
||||
s[[2]] = True;
|
||||
s
|
||||
]
|
||||
Spin[state_List] := RotateRight[state, RandomInteger[{1, 6}]]
|
||||
Fire[state_List] := Module[{shot},
|
||||
shot = First[state];
|
||||
{RotateRight[state, 1], shot}
|
||||
]
|
||||
ClearAll[LSLSFSF]
|
||||
LSLSFSF[] := Module[{state, shot},
|
||||
state = Unload[];
|
||||
state = Load[state];
|
||||
state = Spin[state];
|
||||
state = Load[state];
|
||||
state = Spin[state];
|
||||
{state, shot} = Fire[state];
|
||||
If[shot,
|
||||
Return[True]
|
||||
];
|
||||
state = Spin[state];
|
||||
{state, shot} = Fire[state];
|
||||
If[shot,
|
||||
Return[True]
|
||||
];
|
||||
Return[False]
|
||||
]
|
||||
ClearAll[LSLSFF]
|
||||
LSLSFF[] := Module[{state, shot},
|
||||
state = Unload[];
|
||||
state = Load[state];
|
||||
state = Spin[state];
|
||||
state = Load[state];
|
||||
state = Spin[state];
|
||||
{state, shot} = Fire[state];
|
||||
If[shot,
|
||||
Return[True]
|
||||
];
|
||||
{state, shot} = Fire[state];
|
||||
If[shot,
|
||||
Return[True]
|
||||
];
|
||||
Return[False]
|
||||
]
|
||||
ClearAll[LLSFSF]
|
||||
LLSFSF[] := Module[{state, shot},
|
||||
state = Unload[];
|
||||
state = Load[state];
|
||||
state = Load[state];
|
||||
state = Spin[state];
|
||||
{state, shot} = Fire[state];
|
||||
If[shot,
|
||||
Return[True]
|
||||
];
|
||||
state = Spin[state];
|
||||
{state, shot} = Fire[state];
|
||||
If[shot,
|
||||
Return[True]
|
||||
];
|
||||
Return[False]
|
||||
]
|
||||
ClearAll[LLSFF]
|
||||
LLSFF[] := Module[{state, shot},
|
||||
state = Unload[];
|
||||
state = Load[state];
|
||||
state = Load[state];
|
||||
state = Spin[state];
|
||||
{state, shot} = Fire[state];
|
||||
If[shot,
|
||||
Return[True]
|
||||
];
|
||||
{state, shot} = Fire[state];
|
||||
If[shot,
|
||||
Return[True]
|
||||
];
|
||||
Return[False]
|
||||
]
|
||||
n = 10^5;
|
||||
Count[Table[LSLSFSF[], n], True]/N[n]
|
||||
Count[Table[LSLSFF[], n], True]/N[n]
|
||||
Count[Table[LLSFSF[], n], True]/N[n]
|
||||
Count[Table[LLSFF[], n], True]/N[n]
|
||||
Loading…
Add table
Add a link
Reference in a new issue