ez:=proc(): print(` po(c,pi,S), HS(n,k,c), SS(n,k,c), SSs(n,k,c) `): end: with(combinat): #po(c,pi,S): the payoff if the Searcher's strategy is pi and the hider's startegy is to put it in S po:=proc(c,pi,S) local i,i1,S1: S1:=convert(S,set): for i from 1 to nops(pi) while S1 minus {op(1..i,pi)} <>{} do od: add(c[pi[i1]],i1=1..i): end: #HS(n,k,c): the Hider's mixed stategy followed by the value in Thomas Lidbetter's Beautiful Hide and Seek game where #there are n boxes, whose search costs are c[1], ..., c[n] and k balls. The Hider has to choose k boxes and wants #the seeker to pay as much as possible, and naturally, the seeker wants to pay as little as possible HS:=proc(n,k,c) local gu,mu,y,Y,i,j,v,var: gu:=permute([seq(i,i=1..n)]): mu:=choose([seq(i,i=1..n)],k): Y:=[seq(y[mu[i]],i=1..nops(mu))]: var:=solve({add(y[mu[i]],i=1..nops(mu))-1,seq(add(po(c,gu[i],mu[j])*y[mu[j]],j=1..nops(mu))-v,i=1..nops(gu))},{op(Y),v}): if var=NULL then RETURN(FAIL): fi: subs(var,Y),subs(var,v): end: #SS(n,k,c): the Seeker's mixed stategy followed by the value in Thomas Lidbetter's Beautiful Hide and Seek game where #there are n boxes, whose search costs are c[1], ..., c[n] and k balls. The Hider has to choose k boxes and wants #the seeker to pay as much as possible, and naturally, the seeker wants to pay as little as possible SS:=proc(n,k,c) local gu,mu,x,X,i,j,v,var: gu:=permute([seq(i,i=1..n)]): mu:=choose([seq(i,i=1..n)],k): X:=[seq(x[gu[i]],i=1..nops(gu))]: var:=solve({add(x[gu[i]],i=1..nops(gu))-1,seq(add(po(c,gu[i],mu[j])*x[gu[i]],i=1..nops(gu))-v,j=1..nops(mu))},{op(X),v}): if var=NULL then RETURN(FAIL): fi: subs(var,X),subs(var,v): end: #SSs(n,k,c): the Seeker's mixed stategy followed by the value in Thomas Lidbetter's Beautiful Hide and Seek game where #there are n boxes, whose search costs are c[1], ..., c[n] and k balls. The Hider has to choose k boxes and wants #the seeker to pay as much as possible, and naturally, the seeker wants to pay as little as possible SSs:=proc(n,k,c) local gu,mu,x,i,j,v,var,z,eq,X1: gu:=permute([seq(i,i=1..n)]): mu:=choose([seq(i,i=1..n)],k): X1:=[seq(z[mu[i]],i=1..nops(mu))]: eq:={add(x[gu[i]],i=1..nops(gu))-1,seq(add(po(c,gu[i],mu[j])*x[gu[i]],i=1..nops(gu))-v,j=1..nops(mu))}: eq:=subs({seq(x[gu[i]]=z[sort([op(1..k,gu[i])])]/(k!*(n-k)!),i=1..nops(gu))},eq): var:=solve(eq,{op(X1),v}): if var=NULL then RETURN(FAIL): fi: subs(var,X1),subs(var,v): end: