# same random digraphs in two separate commands? browsing

• I have created a Maple-graded question that presents students with a random digraph (see $graphdisplay below) and asks for the corresponding adjacency matrix. Algorithm$n=range(3,5,1);

$m=range($n,$n*($n - 1)/2,1);

$graphdisplay=plotmaple("GraphTheory[DrawGraph](GraphTheory[RandomGraphs][RandomDigraph]($n,$m)),plotoptions='width=512,height=512'");$ans=maple("GraphTheory[AdjacencyMatrix](GraphTheory[RandomGraphs][RandomDigraph]($n,$m))");

It seems to me that the random digraphs generated by these two commands should be different, yet they turn up the same and $ans gives the correct adjacency matrix every time. I thought I had made an error but the problem seems to function just fine with Answer:$ans

Grading Code: LinearAlgebra[Equal]($RESPONSE,$ans);

Could someone please explain what is going on?

• A more thorough search through the Maple TA Online Help has shed some more light on this question. Including the command randomize(): in Maple-based variable definitions sets the initial state of the random number generator using a number based on the system clock instead of the default seed in Maple.

Thus, using

$graphdisplay=plotmaple("randomize():GraphTheory[DrawGraph](GraphTheory[RandomGraphs][RandomDigraph]($n,$m)),plotoptions='width=512,height=512'");$ans=maple("randomize():GraphTheory[AdjacencyMatrix](GraphTheory[RandomGraphs][RandomDigraph]($n,$m))");

would result in the two different random digraphs (which I do not want in this particular case).