Help:=proc(): print(`SU(m,p), E(m,p) `): end: #SU(m,p): simulating an extemeley risk-averse player in the Shepp Urn #Try: #SU(m,p); SU:=proc(m,p) local i,m1,p1,r: m1:=m: p1:=p: for i from 1 while (p-p1)-(m-m1)=k then t:=k: elif p0 and p>0 and k>0 then t:=m/(m+p)*E1(m-1,p,k+1)+p/(m+p)*E1(m,p-1,k-1)+1: fi: t: end: #The expected number of rounds for a super-risk-averse player in the Shepp Urn if #currently there are m minus balls, p plus balls E:=proc(m,p): E1(m,p,p-m): end: #E(100,110) # 33683086189085193138363517127662830063471100444206895955179886 # -------------------------------------------------------------- # 297474726318397739666969118328344655976262651151936062181333 #evalf(%) # 113.2300771