<S10->S2->S13->S4->S14 S1->S11->S2->S13->S5->S14 S1->S10->S2->S13->S4->S14 S1->S11->S2->S13->S5->S14 Problem 3 n=3; S=Array[Sn,6n+2] Incidence=IncidenceN; Incidence//TableForm a) Print["1:",Incidence[[1]]]; For[i=2, \ MatrixPower[Incidence,i-1][[1,6n+2]]==0, \ i++, \ Print[i,":",MatrixPower[Incidence,i][[1]]]]; There are a minimum of 11 one-way trips required and 4 different strategies to do the task. b) Looking at the incidence matrix and the 1st row of the power series, here are the strategies: S1->S13->S2->S14->S3->S16->S5->S18->S7->S19->S6->S20 S1->S15->S2->S14->S3->S16->S5->S18->S7->S19->S6->S20 S1->S13->S2->S14->S3->S16->S5->S18->S7->S19->S8->S20 S1->S15->S2->S14->S3->S16->S5->S18->S7->S19->S8->S20 Problem 4 n=4; S=Array[Sn,6n+2] Incidence=IncidenceN; Incidence//TableForm We can check the accuracy of this incidence matrix against the textbook. a) MPow=Array[0&,{6n+2,6n+2}]; MPow=Incidence; For[i=1, \ (MPow[[1,6n+2]]==0) && (i<6n+2), \ i++, \ MPow=MPow.Incidence]; Print[i,":",MPow[[1]]]; We conclude that, since in this case the task was not feasible over 6n+2=26 steps, it is not feasible at all. b) - Problem 5 A=Array[0&,{10,10}]; L={{1,2},{1,10},{2,3},{3,1},{4,5},{4,10},{5,6},{6,4}, \ {7,8},{7,10},{8,9},{8,10},{9,7},{10,1},{10,4},{10,7}}; Do[A[[L[[i,1]],L[[i,2]]]]=1,{i,1,Length[L]}]; A a) Print["1:",A[[3]]]; For[i=2, \ MatrixPower[A,i-1][[3,7]]==0, \ i++, \ Print[i,":",MatrixPower[A,i][[3]]]]; There are a minimum of 3 flights required. SPow=Array[0&,{10,10}]; Do[SPow=(SPow+IdentityMatrix[10]).A,{i,1,10}]; SPow It is possible to get between any two states, since all the entries above are nonzero. SPow=Array[0&,{10,10}]; Do[SPow=(SPow+IdentityMatrix[10]).A;Print[SPow// \ MatrixForm],{i,1,10}]; 6 flights are the least number of flights large enough to get between any pair of states, since 6 is the least power-sum of A without any zero entries. Problems on Coding Theory codeMtx=Array[Min,{5,5}] Clear[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]; S=" "; P="."; Q="?"; charLst={S,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o, \ p,q,r,s,t,u,v,w,x,y,z,P,Q}; Problem 1 msgLst={w,h,a,t,S,i,s,S,t,h,e,S,o,p,e,n,i,n,g,S, \ l,i,n,e,S,o,f,S,m,o,b,y,S,d,i,c,k,Q,S,S}; msgMtx=Partition[msgLst,8] Do[numeric[charLst[[ii+1]]]=ii,{ii,0,28}] nMsgMtx=Map[numeric,msgMtx,{2}] cnMsgMtx=codeMtx.nMsgMtx Problem 2 cnMsgMtx={{24,29,54,38,6,27,36}, \ {48,58,88,68,7,54,72}, \ {60,78,108,93,8,72,89}, \ {72,98,128,118,9,90,106}, \ {81,117,136,131,10,95,118}}; nMsgMtx=Inverse[codeMtx].cnMsgMtx Do[alpha[ii]=charLst[[ii+1]],{ii,0,28}] msgMtx=Map[alpha,nMsgMtx,{2}] msgLst={{""}}; Do[msgLst[[1]]=Join[msgLst[[1]],msgMtx[[ii]]],{ii,1,5}] msgLst//TableForm Problem 3 msgLst={t,h,i,s,S,i,s,S,t,h,e,S,e,n,d,S,o,f,S,t, \ h,e,S,c,h,a,p,t,e,r,P,S,k,e,e,p,S,g,o,i, \ n,g,",",S,i,t,S,g,e,t,s,S,e,v,e,n,S,b,e, \ t,t,e,r,P,S}; msgMtx=Partition[msgLst,13] numeric[","]=29; nMsgMtx=Map[numeric,msgMtx,{2}]; cnMsgMtx=codeMtx.nMsgMtx