## DESCRIPTION ## Linear Algebra ## ENDDESCRIPTION ## KEYWORDS('Quadratic form' 'Decomposition of Symmetric Matrix') ## Tagged by tda2d ## DBsubject('Linear Algebra') ## DBchapter('Matrices') ## DBsection('Quadratic Forms') ## Date('') ## Author('Shifrin') ## Institution('UGA') ## TitleText1('') ## EditionText1('') ## AuthorText1('') ## Section1('') ## Problem1('') DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PG.pl", "PGbasicmacros.pl", "PGchoicemacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl", "PGgraphmacros.pl", "PGmatrixmacros.pl", # "PGmorematrixmacros.pl" "weightedGrader.pl" ); TEXT(beginproblem()); install_weighted_grader(); $showPartialCorrectAnswers = 1;$L = new Matrix(2,2); $D = new Matrix(2,2);$LT = new Matrix(2,2); $A = new Matrix(2,2);$d11 = non_zero_random(-5,5,1); $d22 = random(-5,5,1);$l21 = random(-5,5,1); $D->assign(1,1,$d11); $D->assign(2,2,$d22); $L->assign(2,1,$l21); $LT->assign(1,2,$l21); foreach $i (1..2){ foreach$j (1..2){ if($j!=$i) { $D->assign($i,$j,0);}}} foreach$i (1..2){ foreach $j (1..2){ if($j==$i) {$L->assign($i,$j,1); $LT->assign($i,$j,1);} elsif($j>$i){$L->assign($i,$j,0); $LT->assign($j,$i,0);}}}$A = $L*$D*$LT;$ques=("The quadratic form $$\mathcal Q(\mathbf x) = \mathbf x^T A \mathbf x$$ is"); if($d11>0 and$d22>0){$ans="positive definite";} elsif(($d11==0 and $d22>=0) or ($d11>0 and $d22==0)){$ans="positive semidefinite";} elsif($d11<0 and$d22<0){$ans="negative definite";} elsif(($d11==0 and $d22 le 0) or ($d11<0 and $d22==0)){$ans="negative semidefinite";} else {$ans="indefinite";}$mc0 = new_multiple_choice(); $mc0->qa($ques, $ans);$mc0->makeLast("positive definite","negative definite","positive semidefinite", "negative semidefinite","indefinite"); BEGIN_TEXT If $$A=\{display_matrix_mm(A)\}$$, $BR then we can write $$A = LDL^T$$, where$PAR \{mbox( '$$L =$$', display_matrix([['$$1$$','$$0$$'],[ans_rule(5),'$$1$$']]) )\} $BR \{mbox('and', '$$D =$$', display_matrix([[ans_rule(5),'$$0$$'],['$$0$$',ans_rule(5)]]), '.')\}$PAR \{ $mc0->print_q() \} \{$mc0->print_a() \} END_TEXT WEIGHTED_ANS(num_cmp($l21),25, num_cmp($d11),25, num_cmp($d22),25, radio_cmp($mc0->correct_ans),25); ENDDOCUMENT(); # This should be the last executable line in the problem. ANS(num_cmp ra_flatten_matrix($C*$B));
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "http://webwork.maa.org/viewvc/npl/branches/UGA/5.3.1.pg?revision=1457&pathrev=1457", "fetch_time": 1369297306000000000, "content_mime_type": "text/plain", "warc_filename": "crawl-data/CC-MAIN-2013-20/segments/1368703035278/warc/CC-MAIN-20130516111715-00007-ip-10-60-113-184.ec2.internal.warc.gz", "warc_record_offset": 298858498, "warc_record_length": 1601, "token_count": 829, "char_count": 2303, "score": 3.515625, "int_score": 4, "crawl": "CC-MAIN-2013-20", "snapshot_type": "latest", "language": "en", "language_score": 0.35291075706481934, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00026-of-00064.parquet"}