# Matthew Russell # Experimental Math # Homework 6 # I give permission to post this ##################################################################################### # Write a program # ConWay1(L,R,i) # that inputs two directed graphs on {1, ...n} # (where n=nops(L)=nops(R)) # representing a partizan game, # and an integer i between 1 and n, # representing a game-position # (alias "game" in Conway's sense) # and outputs it in Conway's format, # as a pair of sets of simpler "games" # where the very bottoms are empty sets. Conway1:=proc(L,R,i) return [L[i],R[i]]: end: ##################################################################################### # Using ConWay1(L,R,i) above # write a one-line program, # ConWay(L,R), # that inputs two directed graphs in the above format # and outputs the list of length n:=nops(L) (=nops(R)) # whose i-th entry is ConWay1(L,R) ConWay:=proc(L,R) return [seq(ConWay1(L,R,i),i=1..nops(L))]: end: ##################################################################################### # Define the signature of a partizan game # given as a pair of directed graphs (L,R) # the expression # a*"Zero"+b*"Positive"+c*"Negative"+ d*"Fuzzy" # where a+b+c+d=n, and there are a "Zero" positions, b "Positive" positions etc. # Write a program # Sig(L,R) # that inputs a pair of directed graphs # with the same number of vertices and outputs its signature. Sig:=proc(L,R) end: ##################################################################################### # By using RandDi(n,k) in C5.txt, 2*K times, # write a program # AveSig(n,k,K), # that picks K random games # and outputs their average signature. # What do you get for AveSig(10,3,100)? # Do you get similar results all the time?