Difference between revisions of "RowOperations1"

From WeBWorK_wiki
Jump to navigation Jump to search
m (Add {\displaystyle })
(add historical tag and give links to newer problems.)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
  +
{{historical}}
  +
  +
<p style="font-size: 120%;font-weight:bold">This problem has been replaced with [https://openwebwork.github.io/pg-docs/sample-problems/LinearAlgebra/RowOperations.html a newer version of this problem]</p>
  +
 
<h2>Row Operations</h2>
 
<h2>Row Operations</h2>
   
Line 6: Line 10:
 
</p>
 
</p>
 
* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/LinAlg/RowOperations1.pg FortLewis/Authoring/Templates/LinAlg/RowOperations1.pg]
 
* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/LinAlg/RowOperations1.pg FortLewis/Authoring/Templates/LinAlg/RowOperations1.pg]
  +
* PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/LinAlg/RowOperations1_PGML.pg FortLewis/Authoring/Templates/LinAlg/RowOperations1_PGML.pg]
   
 
<br clear="all" />
 
<br clear="all" />

Latest revision as of 05:26, 18 July 2023

This article has been retained as a historical document. It is not up-to-date and the formatting may be lacking. Use the information herein with caution.

This problem has been replaced with a newer version of this problem

Row Operations

Click to enlarge

This PG code shows how to ask students to compute the result of elementary row operations.


Templates by Subject Area

PG problem file Explanation

Problem tagging data

Problem tagging:

DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGcourse.pl",
);
$showPartialCorrectAnswers = 0;
TEXT(beginproblem()); 

Initialization:

Context('Matrix');

do {

$A = Matrix([
[non_zero_random(-5,5,1),non_zero_random(-5,5,1)],
[non_zero_random(-5,5,1),non_zero_random(-5,5,1)],
[non_zero_random(-5,5,1),non_zero_random(-5,5,1)],
]);

} until (($A->row(1) != $A->row(2)) && 
         ($A->row(1) != $A->row(3)) && 
         ($A->row(2) != $A->row(3)));

$k = random(2,9,1);

$op = "R_{1} + $k R_{2} \rightarrow R_{1}";

$answer = Matrix([
  $A->row(1) + $k*($A->row(2)),
  $A->row(2),
  $A->row(3),
  ]);

Setup: Construct a matrix with three distinct rows. Create a string $op of Tex code that describes the row operation. Use $A->row(i) to extract the ith row of the matrix A as a MathObject. Use $A->row(1) + $k*($A->row(2)) to perform the row operation and place it into the first row of the answer matrix.

Context()->texStrings;
BEGIN_TEXT
Give the result of applying the row operation \( $op \) to the given matrix.
$BR
$BR
\( $A {\displaystyle\mathop{\longrightarrow}^{$op}} \)
\{ $answer->ans_array \}
END_TEXT
Context()->normalStrings;

Main Text:


ANS( $answer->cmp() );

COMMENT('MathObject version.');

ENDDOCUMENT();

Answer Evaluation:

Templates by Subject Area