h0={1000,500,10, 500,10};
h03[β_]:=(h[[3]]-β/(1-β) * (h[[2]]-β/(1-β) h[[1]]))/(1-β);
h02[β_]:=(h[[2]]-β/(1-β) h[[1]])/(1-β);
h05[β_]:=(h[[5]]-β/(1-β) h[[4]])/(1-β);
y[β_]:=Min[h02[β],h03[β],h05[β]];
h={0,0,0,0,0};
Animate[
(* Simulujeme vkládání s pravděpodobností změny beta. *)
h[[1]]=(1-βsimul)h0[[1]];
h[[2]]=(1-βsimul)h0[[2]]+βsimul*h0[[1]];
h[[3]]=(1-βsimul)h0[[3]]+βsimul*h0[[2]];
h[[4]]=(1-βsimul)h0[[4]];
h[[5]]=(1-βsimul)h0[[5]]+βsimul*h0[[4]];
(* Rekonstrukce h0[[3]] a h0[[5]]. *)
Show[Plot[{h02[β],h03[β],h05[β],y[β]},{β,0,0.5}, AxesOrigin->{0,0},PlotRange->{-50,50},PlotStyle->{Automatic,Automatic,Automatic, {Red,Dashing[0.02],Thick}},PlotLegends->"Expressions"],
Graphics[{PointSize[0.02],Red,Point[{βsimul,0}]}]],
{βsimul, 0, 0.5,0.01}]