Diff for /loncom/homework/templates/HintMathResponse.problem between versions 1.3 and 1.4

version 1.3, 2007/05/21 22:11:07 version 1.4, 2009/07/06 17:12:47
Line 1 Line 1
 <problem>  <problem>
     <script type="loncapa/perl">  
   <script type="loncapa/perl">
 $a1 = &random(-6,6,4);  $a1 = &random(-6,6,4);
 $a2 = &random(-6,6,4);  $a2 = &random(-6,6,4);
 $n1 = &random(3,11,2);  $n1 = &random(3,11,2);
 $n2 = &random(2,10,2);  $n2 = &random(2,10,2);
 $function = "$a1*cos($n1*x)+$a2*sin($n2*x)";  $function = "$a1*cos($n1*x)+$a2*sin($n2*x)";
 $example=&xmlparse('An example would be <m eval="on">$(sin($n1\cdot x)+cos($n2\cdot x))/\sqrt{2}$</m>');  $example=&xmlparse('An example would be <m eval="on">$ (sin($n1\cdot x)+cos($n2\cdot x))/\sqrt{2} $</m>');
     </script>  </script>
   
     <startouttext />  <startouttext />
 Give an example of a function  Give an example of a function
 <ol>  <ol>
     <li>which is orthogonal to <algebra>$function</algebra> with respect to the      <li>which is orthogonal to <algebra>$function</algebra> with respect to the scalar product
         scalar product  
         <m>\[<g \mid h> = \frac{1}{\pi} \int_{-\pi}^{\pi}dx g(x) \cdot h(x)\]</m>          <m>\[<g \mid h> = \frac{1}{\pi} \int_{-\pi}^{\pi}dx g(x) \cdot h(x)\]</m>
     </li>      </li>
     <li>whose norm is 1.</li>      <li>whose norm is 1.</li>
 </ol>  </ol>
     <endouttext />  <endouttext />
   
     <mathresponse answerdisplay="$example" cas="maxima" args="$function">  <mathresponse answerdisplay="$example" cas="maxima" args="$function">
       <answer>
         <answer>  
 overlap:integrate((RESPONSE[1])*(LONCAPALIST[1]),x,-%pi,%pi)/%pi;  overlap:integrate((RESPONSE[1])*(LONCAPALIST[1]),x,-%pi,%pi)/%pi;
 norm:integrate((RESPONSE[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;  norm:integrate((RESPONSE[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;
 is(overlap=0 and norm=1);  is(overlap=0 and norm=1);
         </answer>      </answer>
   
         <textline readonly="no" size="50" />  
   
         <hintgroup showoncorrect="no">      <textline readonly="no" size="50" />
   
             <mathhint name="ortho" args="$function" cas="maxima">      <hintgroup showoncorrect="no">
           <mathhint name="ortho" args="$function" cas="maxima">
                 <answer>              <answer>
 overlap: integrate((LONCAPALIST[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;  overlap: integrate((LONCAPALIST[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;
 is(not overlap = 0);  is(not overlap = 0);
                 </answer>              </answer>
             </mathhint>          </mathhint>
   
             <mathhint name="norm" args="$function" cas="maxima">          <mathhint name="norm" args="$function" cas="maxima">
                 <answer>              <answer>
 norm: integrate((RESPONSE[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;  norm: integrate((RESPONSE[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;
 is(not norm = 1);  is(not norm = 1);
                 </answer>              </answer>
             </mathhint>          </mathhint>
                         
             <hintpart on="norm">          <hintpart on="norm">
                 <startouttext />              <startouttext />
 The function you have provided does not have a norm of one.  The function you have provided does not have a norm of one.
                 <endouttext />              <endouttext />
             </hintpart>          </hintpart>
   
             <hintpart on="ortho">          <hintpart on="ortho">
                 <startouttext />              <startouttext />
 The function you have provided is not orthogonal.  The function you have provided is not orthogonal.
                 <endouttext />              <endouttext />
             </hintpart>          </hintpart>
   
         </hintgroup>  
     </mathresponse>  
   
     <postanswerdate>      </hintgroup>
   </mathresponse>
   
         <startouttext />  <postanswerdate>
       <startouttext />
 <p>  <p>
     Note that with respect to the above norm, <m>$\cos(nx)$</m> is  Note that with respect to the above norm, <m>$ \cos(nx) $</m> is perpendicular to <m>$ \sin(nx) $</m> and perpendicular to <m>$ \cos(mx) $</m> for <m>$ n\ne m $</m>.
     perpendicular to <m>$\sin(nx)$</m> and perpendicular to <m>$\cos(mx)$</m>  
     for <m>$n\ne m$</m>.  
 </p>  </p>
         <endouttext />      <endouttext />
   </postanswerdate>
   
     </postanswerdate>  
 </problem>  </problem>

Removed from v.1.3  
changed lines
  Added in v.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>