<div dir="ltr">I would appreciate it if someone could assist me with coding the following problem.<div><br></div><div><div style="text-align:center">Give an example of an idempotent matrix.</div><div style="text-align:center"><br></div><div style="text-align:left">Ideally, I would like students to input their answer using the format (row_1,...,row_m) using a matrix of any size, so that ([1,1],[0,0]) and </div><div style="text-align:left">([2,-2,-4],[-1,3,4],[1,-2,-3]) would both be acceptable answers. </div><div style="text-align:left">(A matrix <i>A</i> is <b>idempotent</b> if <i>A</i>^2=<i>A</i>.)</div><div style="text-align:left"><br></div><div style="text-align:left">If I understand correctly, using a mathresponse problem is problematic in this case because there is some preprocessing of the students submission that makes it difficult to use in the answer algorithm, but one way around this is to use customresponse combined with the &cas() function. </div><div style="text-align:left"><br></div><div style="text-align:left">In order that Maxima understands the students submission, the expression 'matrix' needs to be appended to the front. Also, matrix exponentiation is denoted by A^^n in Maxima. If it is easier to test a numerical condition, one could verify that rank(A^^2 - A) = 0.</div><div style="text-align:left"><br></div><div style="text-align:left">Thanks,</div><div style="text-align:left">Justin</div><div style="text-align:left"><br></div><div style="text-align:left">P.S. Ideally, I would like to stipulate that students provide a nontrivial example (excluding the zero matrix and the identity matrix) but that is the topic of another discussion.<br></div><div style="text-align:left"><br></div><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><br></div><div><br></div><div style="color:rgb(102,102,102)">Justin Gray | Senior Lecturer</div><span style="color:rgb(102,102,102)">Department of Mathematics | Simon Fraser University</span><br style="color:rgb(102,102,102)"><span style="color:rgb(102,102,102)">8888 University Drive, Burnaby | V5A 1S6 | Canada</span><br style="color:rgb(102,102,102)"><span style="color:rgb(102,102,102)">Tel: +1 778.782.4237</span><br></div><div dir="ltr"><span style="color:rgb(102,102,102)"><br></span></div><div dir="ltr"><img src="cid:0786efd7371599bc51452b5fedd54d152d0fae84@zimbra" style="color:rgb(0,0,0);font-family:verdana,helvetica,sans-serif;font-size:16px"><span style="color:rgb(102,102,102)"><br></span></div></div></div></div></div>
</div></div>