#hw1SalmanManzoor.txt with (combinat): #AM(G): takes as input a graph [n,E] and outputs the adjacency matrix, #represented as a list of length n of lists of length n, #such that M[i][j]=1 if {i,j} belongs to E and 0 otherwise. AM:=proc(G) local n,E,i,j,A: n:=G[1]: E:=G[2]: A:=[[0$n]$n]: for i from 1 to n do for j from 1 to n do if member({i,j}, E) then A[i][j]:=1: fi: od: od: A; end: #Image(pi,G): takes as input a permutation pi of {1,...,n} and #a graph G=[n,E] and outputs the image under pi Image:=proc(pi,G) local n,k,E,i: n:=G[1]: E:=G[2]: k:=nops(E): for i from 1 to k do E[i]:={pi[E[i][1]], pi[E[i][2]]}: od: [n,E]; end: #ULgraphs(n): outputs a set of graphs with ONE member of each equivalence class #of labelled graphs under the equivalence relation of graph isomorphism for #the given number of vertices ULgraphs:=proc(n) local i,j,k,S,E,s,H,P,F,D,p: E:={seq(seq({i,j},j=i+1..n), i=1..n)}; S:=powerset(E): H:={seq([n,s],s in S)}: P:=permute(n): F:={}: p:=length(P): do D:=H[1]: F:=F union {D}: for k from 1 to p do H:=H minus {Image(P[k],D)}: od: until isEmpty(H): end: #[seq(nops(ULgraphs(i)),i=1..6)] yields [1,1,2,4,11,34] which aligns with #sequence A000088 #{ = + |B>}* = ( + )* = + #From = * , we see must be a real number to be equal to its own conjugate. #First axiom follows from distributivity of complex multiplication. a(b+c) = ab+ac for complex a,b,c. So the 2n terms of + can be combined to form the n terms of + |B>} . #Second axiom follows from linearity of the complex conjugate, (ab + cd)* = (a*b* + c*d*)