Question: CellN = 2 0 1 ; TimeN = 1 0 0 ; TransmissionProb = 0 . 1 ; RecoveryProb = 0 . 0 ; SpontaneousProb

CellN =201;
TimeN =100;
TransmissionProb =0.1;
RecoveryProb =0.0;
SpontaneousProb =0.0;
MoveBy = Select[Tuples[{-1,0,1},2], # !={0,0} &]
NeighborN = Length[MoveBy]
CurrentWorld = Table[RandomInteger[{0,2}],{CellN},{CellN}];
ArrayPlot[CurrentWorld,
ColorRules ->{0-> Black, 1-> Green, 2-> Red},
ColorFunctionScaling -> False, Mesh -> False]
CurrentStep =1;
WorldPlot =
ArrayPlot[CurrentWorld,
ColorRules ->{0-> Black, 1-> Green, 2-> Red},
ColorFunctionScaling -> False, Mesh -> False];
Dynamic[Text[Style[CurrentStep, Blue, Italic, 20]]]
Dynamic[WorldPlot]
UpdateState[{i_Integer, j_Integer}] :=
Module[
{},
If[CurrentWorld[[i, j]]==2, Return[0]];
TwoN =
Count[CurrentWorld[[##]] & @@@ (Mod[#,{CellN, CellN},
1] & /@ (ConstantArray[{i, j}, NeighborN]+ MoveBy)),2];
If[TwoN ==0,
If[CurrentWorld[[i, j]]==0,
Return[RandomChoice[{1- RecoveryProb, RecoveryProb}->{0,
1}]]];
If[CurrentWorld[[i, j]]==1,
Return[RandomChoice[{1- SpontaneousProb, SpontaneousProb}->{1,
2}]]];
];
If[TwoN >0,
If[CurrentWorld[[i, j]]==0, Return[0]];
If[CurrentWorld[[i, j]]==1,
Return[RandomChoice[{1- TransmissionProb,
TransmissionProb}->{1,2}]]]
]]
For[t =1, t <= TimeN, t++,
CurrentStep = t;
CurrentWorld =
Table[UpdateState[{i, j}],{i,1, CellN},{j,1, CellN}];
WorldPlot =
ArrayPlot[CurrentWorld,
ColorRules ->{0-> Black, 1-> Green, 2-> Red},
ColorFunctionScaling -> False, Mesh -> False];
Pause[0];
]
What would be the highest recovery probability if the transmission probability is 0.1 where the world turns completely green please use the code on mathematica?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!