same random digraphs in two separate commands?

  • I have created a Maple-graded question that presents students with a random digraph (see $graphdisplay below) and asks for the corresponding adjacency matrix.



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



    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



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

Log in to reply