Subversion Repositories wimsdev

Rev

Rev 5900 | Rev 6133 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5900 Rev 5903
Line 59... Line 59...
59
\answer{The trace}{\trace}
59
\answer{The trace}{\trace}
60
</pre>
60
</pre>
61
We have first defined an integer ``range'', to be used to bound the
61
We have first defined an integer ``range'', to be used to bound the
62
random values a,b,c,d which are the elements of the matrix. And the trace is
62
random values a,b,c,d which are the elements of the matrix. And the trace is
63
of course defined by the sum of the elements on the diagonal. Please take
63
of course defined by the sum of the elements on the diagonal. Please take
64
care to the definition <tt>trace=(\a)+(\d)</tt>: the pairs of parentheses
64
care to the definition <span class="tt">trace=(\a)+(\d)</span>: the pairs of parentheses
65
are necessary, for the substitution is literary. If you define
65
are necessary, for the substitution is literary. If you define
66
<tt>trace=\a+\d</tt> and if a and d take the values of 3 and -15 respectively,
66
<span class="tt">trace=\a+\d</span> and if a and d take the values of 3 and -15 respectively,
67
you woule have <tt>trace=3+-15</tt>, a bad mathematical expression. <p>
67
you woule have <span class="tt">trace=3+-15</span>, a bad mathematical expression. <p>
68
Remark that in this exercise, the non-computed replies are admitted
68
Remark that in this exercise, the non-computed replies are admitted
69
(such as 2+15 or 3*105). <p>
69
(such as 2+15 or 3*105). <p>
70
You can
70
You can
71
!set parm=oef_answercnt=1&oef_choicecnt=0&oef_title=Trace of matrix 2x2&oef_format=tex&oef_computeanswer=yes&level=2&oef_parms=%5Cinteger%7Brange%3D20%7D%0D%0A%5Cinteger%7Ba%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bb%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bc%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bd%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Btrace%3D%28%5Ca%29%2B%28%5Cd%29%7D&oef_statement=Compute the trace of the matrix%0D%0A%24%5Cpmatrix%7B%5Ca%26%5Cb%5Ccr %5Cc%26%5Cd%7D%24.&ansprompt1=The trace&ansgood1=%5Ctrace&oef_hint= &oef_solution= $
71
!set parm=oef_answercnt=1&oef_choicecnt=0&oef_title=Trace of matrix 2x2&oef_format=tex&oef_computeanswer=yes&level=2&oef_parms=%5Cinteger%7Brange%3D20%7D%0D%0A%5Cinteger%7Ba%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bb%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bc%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bd%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Btrace%3D%28%5Ca%29%2B%28%5Cd%29%7D&oef_statement=Compute the trace of the matrix%0D%0A%24%5Cpmatrix%7B%5Ca%26%5Cb%5Ccr %5Cc%26%5Cd%7D%24.&ansprompt1=The trace&ansgood1=%5Ctrace&oef_hint= &oef_solution= $
72
!href cmd=reply&mode=guided&$parm load this example into the menu
72
!href cmd=reply&mode=guided&$parm load this example into the menu