#C28.txt: April 30, 2018, Math640(RU) Help:=proc(): print(`VN(A,x,y), VN2(A,x,y), MC(n,N) , RC3() , RC2(), RC3e() `): end: #VN(A,x,y): inputs a matrix A , m by n say, where player Row has #m different strategies and player Column has n different strategies #and the payoffs are A[m][n] and -A[m][n]. Outputs the expected #gain for Row VN:=proc(A,x,y) local m,n,i,j: m:=nops(A): n:=nops(A[1]): add(add(A[i][j]*x[i]*y[j],j=1..n),i=1..m): end: #VN2(A,x,y): the payoffs for 2 by 2 matrix and strategies [x,1-x], [y,1-y] VN2:=proc(A,x,y): A[1][1]*x*y+A[1][2]*x*(1-y)+A[2][1]*(1-x)*y+A[2][2]*(1-x)*(1-y): end: #RP(n): a random point in [0,1]^n RP:=proc(n) local ra,i: ra:=rand(0.0..1.0): [seq(ra(),i=1..n)]: end: #RD(n): a random distance between 2 points in the n-dim unit cube RD:=proc(n) local x,y: x:=RP(n): y:=RP(n): sqrt(add((x[i]-y[i])^2,i=1..n)): end: #MC(n,N): the average of the distances between two random points in [0,1]^n done N times MC:=proc(n,N) local i: add(RD(n),i=1..N)/N: end: #RC3(): the exact value of the 3-dim Robbins constant RC3:=proc() local x,y,z: int(int(int( sqrt(x^2+y^2+z^2)*(1-x)*(1-y)*(1-z)*8,x=0..1),y=0..1),z=0..1); end: #RC3e(): The excact value of the Robbins constant (due to David Robbins) RC3e:=proc() 1/105*(4+17*sqrt(2)-6*sqrt(3)+21*log(1+sqrt(2))+42*log(2+sqrt(3))-7*Pi) end: #RC2(): the exact value of the 2-dim Robbins constant RC2:=proc() local x,y: int(int( sqrt(x^2+y^2)*(1-x)*(1-y)*4,x=0..1),y=0..1); end: #RC44(): the exact value of the 4-dim Robbins constant RC4:=proc() local x,y,z,w: int(int(int(int( sqrt(x^2+y^2+z^2+w^2)*(1-x)*(1-y)*(1-z)*(1-w)*16,x=0..1),y=0..1),z=0..1),w=0..1); end: