diff --git a/Contrib/UPRM/Prebasica/coordenadas_cartesianas/Hallar_Coordenadas_de_un_Punto.pg b/Contrib/UPRM/Prebasica/coordenadas_cartesianas/Hallar_Coordenadas_de_un_Punto.pg new file mode 100644 index 0000000000..0a8267a451 --- /dev/null +++ b/Contrib/UPRM/Prebasica/coordenadas_cartesianas/Hallar_Coordenadas_de_un_Punto.pg @@ -0,0 +1,100 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que pregunta por la coordenadas +# de un punto en el plano cartesiano dada +# su representacion gráfica. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/coordenadas_cartesianas/Hallar_Coordenadas_de_un_Punto.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Plano cartesiano) +## DBsection(Representacion de puntos) +## Level(1) +## KEYWORDS('grafica', 'puntos','plano','coordenadas') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl" +); + +TEXT(beginproblem()); + +$refreshCachedImages=1; + +Context("Point"); +$a = random(-9,9,1); +$b = random(-9,9,1); +$p = Point($a,$b); + +@direccion = ("unidad(es) a la derecha del","unidad(es) a la izquierda del","unidad(es) arriba del","unidad(es) debajo del",,"sobre el eje"); + +if ($a == 0 || $b == 0){ + $indexX = 4; + $indexY = 4; + }elsif($a*$b > 0){ + if ($a > 0){ + $indexX = 0; + $indexY = 2; + }else{ + $indexX = 1; + $indexY = 3; + } + }else{ + if ($a > 0){ + $indexX = 0; + $indexY = 3; + }else{ + $indexX = 1; + $indexY = 2; + } +} + +$gr = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],size=>[450,450]); + +# adicionando un punto +$gr->stamps( closed_circle($a,$b,'blue') ); + +# adicionandole una etiqueta al punto +$gr->lb(new Label($a+0.1,$b+.6,'(a,b)','black','center','middle')); + +BEGIN_TEXT +$BCENTER +\{ image(insertGraph($gr),width=>200,height=>200,tex_size=>450 ) \} +$BR +$BR +(Click en la gráfica para agrandar) +$ECENTER +$BR +¿Cuáles son las coordenadas del punto \((a,b)\) mostrado en la gráfica anterior? +$BR +$BR +\((a,b)=\) \{ans_rule(30)\} \{ AnswerFormatHelp("points") \} +END_TEXT + +ANS( $p->cmp()); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Identificar la ubicación del punto$EBOLD: +$PAR +El punto se encuentra \(\{abs($a)\}\) $direccion[$indexX] eje \(y\) y \(\{abs($b)\}\) $direccion[$indexY] eje \(x\). +$PAR +Por lo tanto las coordenadas del punto son: \($p\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/coordenadas_cartesianas/Punto_Medio_A.pg b/Contrib/UPRM/Prebasica/coordenadas_cartesianas/Punto_Medio_A.pg new file mode 100644 index 0000000000..fa72c55f3b --- /dev/null +++ b/Contrib/UPRM/Prebasica/coordenadas_cartesianas/Punto_Medio_A.pg @@ -0,0 +1,99 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que pregunta por la coordenadas x o y +# del punto medio del segmento representado +# en el plano cartesiano por dos puntos dados +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/coordenadas_cartesianas/Punto_Medio.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Plano cartesiano) +## DBsection(Punto medio) +## Level(1) +## KEYWORDS('grafica', 'puntos','plano','coordenadas','segmento', 'punto medio') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl" +); + +TEXT(beginproblem()); + +$refreshCachedImages=1; + +@eje = ("\(x\)", "\(y\)"); +$index = random(0,1,1); + +Context("Point"); +$A = Point(random(-9,9,1),random(-9,9,1)); +$B = Point(random(-9,9,1),random(-9,9,1)); +$Pm = ($A+$B)/2; + +#Extrayendo coordenadas de A, B y Pm +($aA, $bA) = $A->value; +($aB, $bB) = $B->value; +($Xm, $Ym) = $Pm->value; + +if ($index==0){ + $answer = $Xm; +}else{ + $answer = $Ym; +} + +$gr = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],size=>[450,450]); + +# adicionando los dos puntos +$gr->stamps( closed_circle($aA, $bA, 'blue') ); +$gr->stamps( closed_circle($aB, $bB, 'red') ); + +# adicionandole etiquetas a los puntos +$gr->lb(new Label($aA+0.1,$bA+.6,'A','blue','center','middle')); +$gr->lb(new Label($aB+0.1,$bB+.6,'B','red','center','middle')); + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image(insertGraph($gr),width=>200,height=>200,tex_size=>450 ) \} +$BR +$BR +(Click en la gráfica para agrandar) +$ECENTER +$BR +Encuentre la coordenada $eje[$index] del punto medio del segmento de recta que une los puntos \(A\) y \(B\) mostrados en la gráfica anterior. +$BR +$BR + $eje[$index] = \{ans_rule(30)\} \{ AnswerFormatHelp("numbers") \} +END_TEXT +Context()->normalStrings; + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar los puntos: \(A = $A\) y \(B = $B\). +$PAR +$BBOLD Paso 2:$EBOLD Calcular el promedio de \(x\) y \(y\). +$PAR +\(\phantom{blablabla}\) el promedio de \(x\) es: \(\frac{$aA+$aB}{2}=$Xm\) +$PAR +\(\phantom{blablabla}\) el promedio de \(y\) es: \(\frac{$bA+$bB}{2}=$Ym\) +$PAR +Por lo tanto el valor de la coordenada de $eje[$index] es: $answer. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/coordenadas_cartesianas/Punto_Medio_B.pg b/Contrib/UPRM/Prebasica/coordenadas_cartesianas/Punto_Medio_B.pg new file mode 100644 index 0000000000..061cb60096 --- /dev/null +++ b/Contrib/UPRM/Prebasica/coordenadas_cartesianas/Punto_Medio_B.pg @@ -0,0 +1,78 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que pregunta por la coordenadas +# del punto medio entre dos puntos dados +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/coordenadas_cartesianas/Punto_Medio.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Plano cartesiano) +## DBsection(Punto medio) +## Level(1) +## KEYWORDS('grafica', 'puntos','plano','coordenadas','segmento', 'punto medio') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl" +); + +TEXT(beginproblem()); + +$refreshCachedImages=1; + +@eje = ("\(a\)", "\(b\)"); +$index = random(0,1,1); + +Context("Point"); +$A = Point(random(-50,50,1),random(-50,50,1)); +$B = Point(random(-50,50,1),random(-50,50,1)); +$Pm = ($A+$B)/2; + +#Extrayendo coordenadas de Pm +($aA,$bA) = $A->value; +($aB,$bB) = $B->value; +($a, $b) = $Pm->value; + +if ($index==0){ + $answer = $a; +}else{ + $answer = $b; +} + +BEGIN_TEXT +Sea \((a,b)\) el punto medio entre \($A\) y \($B\). Calcular el valor de $eje[$index]. +$BR +$BR +$eje[$index] = \{ans_rule(30)\} \{ AnswerFormatHelp("numbers") \} +END_TEXT + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar los puntos: \(A = $A\) y \(B = $B\). +$PAR +$BBOLD Paso 2:$EBOLD Calcular el promedio de \(x\) y \(y\). +$PAR +\(\phantom{blablabla}\) el promedio de \(x\) es: \(\frac{$aA+$aB}{2}=$a\) +$PAR +\(\phantom{blablabla}\) el promedio de \(y\) es: \(\frac{$bA+$bB}{2}=$b\) +$PAR +Por lo tanto el valor de $eje[$index] es: $answer +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/decimales/comparacion_decimales.pg b/Contrib/UPRM/Prebasica/decimales/comparacion_decimales.pg new file mode 100644 index 0000000000..6a6757cd1d --- /dev/null +++ b/Contrib/UPRM/Prebasica/decimales/comparacion_decimales.pg @@ -0,0 +1,88 @@ +# DESCRIPTION +# +# Tipo: falso/cierto +# Compara dos decimales +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/decimales/comparacion_decimales.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Decimales) +## DBsection(Comparacion) +## Level(1) +## KEYWORDS('decimales','comparar') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl" +); + +$showPartialCorrectAnswers = 0; + +Context("Numeric"); +$n = random(1,4,1); +@powers = (10,100,1000,10000); +$tenPower = random(0,3); +$a = random(1,100)/$powers[$tenPower]; +$b = random(1,10)/($powers[$tenPower]*10) + $a/10; + +@arrayRelacion = ("mayor", "menor"); +$index = random(0,1,1); + +if ($index == 0){ + if ($a > $b){ + $answer = "C"; + $answer2 = "derecha"; + }else{ + $answer = "F"; + $answer2 = "izquierda"; + } +}else{ + if ($a < $b){ + $answer = "C"; + $answer2 = "izquierda"; + }else{ + $answer = "F"; + $answer2 = "derecha"; + } +} + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("El número $a es $arrayRelacion[$index] que $b.", $answer); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + +TEXT(beginproblem()); + +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT + +## Provide the answer string +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +Ya que $a se encuentra a la $answer2 de $b en la recta numérica, entonces la respuesta es $BBOLD $answer $EBOLD. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/decimales/decimales_forma_grafica.pg b/Contrib/UPRM/Prebasica/decimales/decimales_forma_grafica.pg new file mode 100644 index 0000000000..1b9c76bec9 --- /dev/null +++ b/Contrib/UPRM/Prebasica/decimales/decimales_forma_grafica.pg @@ -0,0 +1,79 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Relacionando decimales por medio +# de operaciones + o - en forma gráfica. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/decimales/decimales_forma_grafica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Decimales) +## DBsection(Comparacion) +## Level(1) +## KEYWORDS('decimales','comparar','relacionar') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl" +); + +Context("Numeric"); +$a = random(-30,-10,.1); +$b = random(10,50,.1); + +@operacion = ("sumar", "restar"); +$opeRandIndex = random(0,1); +$direccion = random(0,1); + +if ($direccion == 0){ + $partEnunciado = "\(a\) para llegar a \(b\)"; +}else{ + $partEnunciado = "\(b\) para llegar a \(a\)"; +} + +if ( ($operacion[$opeRandIndex] eq "sumar" && $direccion == 0) || ($operacion[$opeRandIndex] eq "restar" && $direccion == 1) ){ + $answer = Compute( $b-$a ); +}else{ + $answer = Compute( $a-$b); +} + +TEXT(beginproblem()); + +BEGIN_TEXT +$BCENTER +\{ image( "rect_num.png", width=>300 ) \} +$ECENTER +Sea \(a = $a\) y \(b = $b\). ¿Qué número se le debe $operacion[$opeRandIndex] a $partEnunciado? +$BR +$BR +Contestación: \{ans_rule(30)\} \{ AnswerFormatHelp("numbers") \} +END_TEXT + +## Provide the answer string +ANS( $answer->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Lo que debemos $operacion[$opeRandIndex] a $partEnunciado lo podemos extraer observando las siguientes dos partes: + la distancia de \(a\) hasta \(0\) igual a \(\{abs($a)\}\) y de \(0\) hasta \(b\) igual a \(\{abs($b)\}\). +$PAR +$BBOLD Paso 2:$EBOLD Sumar o restar estos dos valores anteriores dependiendo de la dirección. En este caso la dirección es de $partEnunciado, por lo tanto +$PAR +Por lo tanto la respuesta es: $answer. +$PAR ...sigue en proceso la solución, hay que reescribirla mejor. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/decimales/leer_decimales_en_la_recta.pg b/Contrib/UPRM/Prebasica/decimales/leer_decimales_en_la_recta.pg new file mode 100644 index 0000000000..e9649456af --- /dev/null +++ b/Contrib/UPRM/Prebasica/decimales/leer_decimales_en_la_recta.pg @@ -0,0 +1,107 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Encontrar decimal entre dos dados +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/decimales/leer_decimales_en_la_recta.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Decimales) +## DBsection(Comparacion) +## Level(1) +## KEYWORDS('decimales','recta') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"PGgraphmacros.pl", +"problemRandomize.pl", +); + +TEXT(beginproblem()); + +$refreshCachedImages=1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); +$a = random(6,7,.1); +$b = random(8,9,.1); + +$puntoRojo = Compute(random($a,$b,0.1)); + +$gr = init_graph(5,-2,10,2,axes=>[0,0],ticks=>[50,0],size=>[450,100]); +$gr->lb('reset'); + +# adicionando las marcas para la recta numérica +$myStartStricks = int($a); +$gr->lb(new Label($myStartStricks-1,0,'|','black','center','middle')); +$gr->lb(new Label($myStartStricks,0,'|','black','center','middle')); +$gr->lb(new Label($myStartStricks+1,0,'|','black','center','middle')); +$gr->lb(new Label($myStartStricks+2,0,'|','black','center','middle')); +$gr->lb(new Label($myStartStricks+3,0,'|','black','center','middle')); + + +# adicionando el punto rojo +$gr->stamps( closed_circle($puntoRojo,0,'red') ); + +# adicionandole las etiquetas a y b y sus marcas de color azul +$gr->lb(new Label($a,-.6,'a','blue','center','middle')); +$gr->lb(new Label($a,0,'.','blue','center','bottom')); +$gr->lb(new Label($b,-.6,'b','blue','center','middle')); +$gr->lb(new Label($b,0,'.','blue','center','bottom')); + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image(insertGraph($gr),width=>450,height=>100,tex_size=>650 ) \} +$ECENTER +$BR +$BR +Sea \(a = $a\) y \(b = $b\). ¿Cuál es el valor en la recta numérica del punto rojo en la imagen de arriba? +$BR +$BR +Contestación: \{ans_rule(30)\} \{ AnswerFormatHelp("numbers") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $puntoRojo->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Como el punto rojo está a la derecha de \(a=$a\) y/o a la izquierda de \(b=$b\) y las marcas mas pequeñas y abundantes están cada \(0.1\), su valor en la recta numérica es $puntoRojo. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/decimales/operaciones_con_decimales.pg b/Contrib/UPRM/Prebasica/decimales/operaciones_con_decimales.pg new file mode 100644 index 0000000000..45a8766aa5 --- /dev/null +++ b/Contrib/UPRM/Prebasica/decimales/operaciones_con_decimales.pg @@ -0,0 +1,75 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Operando con + o - dos decimales. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/decimales/operaciones_con_decimales.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Decimales) +## DBsection(Comparacion) +## Level(1) +## KEYWORDS('decimales','operar') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl" +); + +Context("Numeric"); + +$a = random(-30,50,.001); +$b = random(-20,40,.001); + +@operacion = ("suma","resta"); +$index = random(0,1); + +if ( $index == 0 ){ + $answer = Compute( $a + $b ); + $simbolo = " + "; +}else{ + $answer = Compute( $a - $b ); + $simbolo = " - "; +} + +TEXT(beginproblem()); +Context()->texStrings; +BEGIN_TEXT +Realizar la siguiente $operacion[$index]: +$BCENTER +($a) $simbolo ($b) +$ECENTER +$BR +$BR +Contestación: \{ans_rule(30)\} \{ AnswerFormatHelp("numbers") \} +END_TEXT + +## Provide the answer string +ANS( $answer->cmp(tolType => 'absolute', tolerance => .0001 ) ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +Podemos hacer la $operacion[$index] usando el algoritmo que nos enseñaron en escuela elemental escribiendo un número debajo del otro. Por tanto, +\[ + \begin{align*} + $a & \, $simbolo\\ + $b & \\ +\_\_\_\_\_\_\_& \\ + $answer & + \end{align*} +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/decimales/puntoEntreDos.png b/Contrib/UPRM/Prebasica/decimales/puntoEntreDos.png new file mode 100644 index 0000000000..c967ac680c Binary files /dev/null and b/Contrib/UPRM/Prebasica/decimales/puntoEntreDos.png differ diff --git a/Contrib/UPRM/Prebasica/decimales/rect_num.png b/Contrib/UPRM/Prebasica/decimales/rect_num.png new file mode 100644 index 0000000000..2d700b0e63 Binary files /dev/null and b/Contrib/UPRM/Prebasica/decimales/rect_num.png differ diff --git a/Contrib/UPRM/Prebasica/decimales/representacion_numeros_forma_decimal.pg b/Contrib/UPRM/Prebasica/decimales/representacion_numeros_forma_decimal.pg new file mode 100644 index 0000000000..d9d475cf84 --- /dev/null +++ b/Contrib/UPRM/Prebasica/decimales/representacion_numeros_forma_decimal.pg @@ -0,0 +1,91 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Escribiendo un número decimal en potencial de 10. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/decimales/representacion_numeros_forma_decimal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Decimales) +## DBsection(Representacion) +## Level(1) +## KEYWORDS('decimales','representar','base') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl" +); + +Context("Numeric"); +$a0 = random(1,9,1); +$a1 = random(1,9,1); +$a2 = random(1,9,1); +$a3 = random(1,9,1); +$a4 = random(1,9,1); + +@potencias = (10000, 1000, 100, 10); +$index = random(0,3,1); + +$real = $a4*(10000/$potencias[$index]) + $a3*(1000/$potencias[$index]) +$a2*(100/$potencias[$index]) +$a1*(10/$potencias[$index]) +$a0*(1/$potencias[$index]); + +$tmp_p0 = 1/$potencias[$index]; +$tmp_p1 = 10/$potencias[$index]; +$tmp_p2 = 100/$potencias[$index]; +$tmp_p3 = 1000/$potencias[$index]; +$tmp_p4 = 10000/$potencias[$index]; + +Context("Fraction"); +$p0 = Fraction("$tmp_p0"); +$p1 = Fraction("$tmp_p1"); +$p2 = Fraction("$tmp_p2"); +$p3 = Fraction("$tmp_p3"); +$p4 = Fraction("$tmp_p4"); + +$answer = Compute("$a4*$tmp_p4 + $a3*$tmp_p3 + $a2*$tmp_p2 + $a3*$tmp_p1 + $a4*$tmp_p0"); + +TEXT(beginproblem()); +Context()->texStrings; +BEGIN_TEXT +Escriba el número \($real\) como una suma de múltiplos de potencias de 10. +$BR +$BR +Contestación: \{ans_rule(30)\} \{ AnswerFormatHelp("numbers") \} +END_TEXT + +## Provide the answer string +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar la representación de cada dígito del número \($real\) +$PAR +$a4 representa \($p4\)'s +$BR +$a3 representa \($p3\)'s +$BR +$a2 representa \($p2\)'s +$BR +$a1 representa \($p1\)'s +$BR +$a0 representa \($p0\)'s +$PAR +$BBOLD Paso 2:$EBOLD Escribir la suma, entonces +\[ +$real = $a4 \cdot $p4 + $a3 \cdot $p3 + $a2 \cdot $p2 + $a1 \cdot $p1+$a0 \cdot $p0; +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/decimales/representacion_numeros_forma_decimal_A.pg b/Contrib/UPRM/Prebasica/decimales/representacion_numeros_forma_decimal_A.pg new file mode 100644 index 0000000000..d9d475cf84 --- /dev/null +++ b/Contrib/UPRM/Prebasica/decimales/representacion_numeros_forma_decimal_A.pg @@ -0,0 +1,91 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Escribiendo un número decimal en potencial de 10. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/decimales/representacion_numeros_forma_decimal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Decimales) +## DBsection(Representacion) +## Level(1) +## KEYWORDS('decimales','representar','base') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl" +); + +Context("Numeric"); +$a0 = random(1,9,1); +$a1 = random(1,9,1); +$a2 = random(1,9,1); +$a3 = random(1,9,1); +$a4 = random(1,9,1); + +@potencias = (10000, 1000, 100, 10); +$index = random(0,3,1); + +$real = $a4*(10000/$potencias[$index]) + $a3*(1000/$potencias[$index]) +$a2*(100/$potencias[$index]) +$a1*(10/$potencias[$index]) +$a0*(1/$potencias[$index]); + +$tmp_p0 = 1/$potencias[$index]; +$tmp_p1 = 10/$potencias[$index]; +$tmp_p2 = 100/$potencias[$index]; +$tmp_p3 = 1000/$potencias[$index]; +$tmp_p4 = 10000/$potencias[$index]; + +Context("Fraction"); +$p0 = Fraction("$tmp_p0"); +$p1 = Fraction("$tmp_p1"); +$p2 = Fraction("$tmp_p2"); +$p3 = Fraction("$tmp_p3"); +$p4 = Fraction("$tmp_p4"); + +$answer = Compute("$a4*$tmp_p4 + $a3*$tmp_p3 + $a2*$tmp_p2 + $a3*$tmp_p1 + $a4*$tmp_p0"); + +TEXT(beginproblem()); +Context()->texStrings; +BEGIN_TEXT +Escriba el número \($real\) como una suma de múltiplos de potencias de 10. +$BR +$BR +Contestación: \{ans_rule(30)\} \{ AnswerFormatHelp("numbers") \} +END_TEXT + +## Provide the answer string +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar la representación de cada dígito del número \($real\) +$PAR +$a4 representa \($p4\)'s +$BR +$a3 representa \($p3\)'s +$BR +$a2 representa \($p2\)'s +$BR +$a1 representa \($p1\)'s +$BR +$a0 representa \($p0\)'s +$PAR +$BBOLD Paso 2:$EBOLD Escribir la suma, entonces +\[ +$real = $a4 \cdot $p4 + $a3 \cdot $p3 + $a2 \cdot $p2 + $a1 \cdot $p1+$a0 \cdot $p0; +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/decimales/representacion_numeros_forma_decimal_B.pg b/Contrib/UPRM/Prebasica/decimales/representacion_numeros_forma_decimal_B.pg new file mode 100644 index 0000000000..e1864b55c1 --- /dev/null +++ b/Contrib/UPRM/Prebasica/decimales/representacion_numeros_forma_decimal_B.pg @@ -0,0 +1,95 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Escribiendo un número decimal en potencial de 10. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/decimales/representacion_numeros_forma_decimal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Decimales) +## DBsection(Representacion) +## Level(1) +## KEYWORDS('decimales','representar','base') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl" +); + +Context("Numeric"); +$a0 = random(1,9,1); +$a1 = random(1,9,1); +$a2 = random(1,9,1); +$a3 = random(1,9,1); +$a4 = random(1,9,1); + +@potencias = (10000, 1000, 100, 10); +$index = random(0,3,1); + +$real = $a4*(10000/$potencias[$index]) + $a3*(1000/$potencias[$index]) +$a2*(100/$potencias[$index]) +$a1*(10/$potencias[$index]) +$a0*(1/$potencias[$index]); + +$tmp_p0 = 1/$potencias[$index]; +$tmp_p1 = 10/$potencias[$index]; +$tmp_p2 = 100/$potencias[$index]; +$tmp_p3 = 1000/$potencias[$index]; +$tmp_p4 = 10000/$potencias[$index]; + +Context("Fraction"); +$p0 = Fraction("$tmp_p0"); +$p1 = Fraction("$tmp_p1"); +$p2 = Fraction("$tmp_p2"); +$p3 = Fraction("$tmp_p3"); +$p4 = Fraction("$tmp_p4"); + +$answer = Compute("$real"); + +TEXT(beginproblem()); +Context()->texStrings; +BEGIN_TEXT +Escriba la expresión +\[ +$a4 \cdot $p4 + $a3 \cdot $p3 + $a2 \cdot $p2 + $a1 \cdot $p1 + $a0 \cdot $p0 +\] +como un número en su forma decimal. +$BR +$BR +Contestación: \{ans_rule(30)\} \{ AnswerFormatHelp("numbers") \} +END_TEXT + +## Provide the answer string +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar la representación de cada término: +$PAR +$a4 representa \($p4\)'s +$BR +$a3 representa \($p3\)'s +$BR +$a2 representa \($p2\)'s +$BR +$a1 representa \($p1\)'s +$BR +$a0 representa \($p0\)'s +$PAR +$BBOLD Paso 2:$EBOLD Escribir la suma, entonces: +\[ +$a4 \cdot $p4 + $a3 \cdot $p3 + $a2 \cdot $p2 + $a1 \cdot $p1+$a0 \cdot $p0 = $real ; +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/desigualdades_lineales_dos_variables/desigualdades_lineales_2_variables_A.pg b/Contrib/UPRM/Prebasica/desigualdades_lineales_dos_variables/desigualdades_lineales_2_variables_A.pg new file mode 100644 index 0000000000..0f64c4d16a --- /dev/null +++ b/Contrib/UPRM/Prebasica/desigualdades_lineales_dos_variables/desigualdades_lineales_2_variables_A.pg @@ -0,0 +1,128 @@ +# DESCRIPTION +# +# Tipo: opción múltiple, única respuesta +# Dada una región sombreada en dos dimensiones encontrar la region sombreada. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/desigualdades_lineales_dos_variables/desigualdades_lineales_2_variables.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Desigualdades) +## DBsection(Dos variables) +## Level(1) +## KEYWORDS('desigualdades','representar','intervalos','grafica') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Inequalities-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +$a = non_zero_random(-6,6,0.5); + +@direccion = ("derecha", "izquierda", "arriba", "abajo"); + +@ineqn =( "x \geq $a", "x \leq $a", + "y \geq $a", "y \leq $a" ); #Arreglo de posibles inecuaciones a preguntar + +#$k = random(0,3,1); #Indice aleatorio de la inecuación a preguntar + +@perm = shuffle(4); #Barajando las inequaciones a preguntar +@ineqn = @ineqn[@perm]; +@inv = invert(@perm); #Recuperando el arreglo original + +$gr = init_graph(-10,-10,10,10, 'axes' => [0,0], grid=>[10,10], size=>[450,450]); +add_functions($gr, "$a for x in <-10,10> using color:blue and weight:2"); + +# The inequality graphed +#$gr -> stamps( closed_circle($low,0.0,'blue') ); + +#Haciendo una lista de preguntas y respuestas +$mc = new_checkbox_multiple_choice(); + +$mc -> qa ("La inecuación que representa la región sombreada es: \( $ineqn[0] \) ", "\( $ineqn[0] \) $BR"); + +$mc -> extra( +"\( $ineqn[1] \) $BR", +"\( $ineqn[2] \) $BR", +"\( $ineqn[3] \) $BR", +); + +$mc -> makeLast("Ninguna de las anteriores"); + +############################################################## +# +# Text +# +## to disable arithmetic operations in the answer. Student must simplify. + +Context()->texStrings; +BEGIN_TEXT +$BR +$BBOLD Problema en proceso ...$BR +Falta dibujar bien la parte sombreada y relacionarla con la solución$BR +Falta la solución +$EBOLD +$BR +$BR +$PAR +Considere la siguiente gráfica: +$PAR +$BCENTER + \{ image(insertGraph($gr), width=>250, height=>250, tex_size=>320); \} +$ECENTER +$BR +(Click en la gráfica para agrandar) +$BR +\{ $mc -> print_q() \} +$BR +\{ $mc -> print_a() \} +END_TEXT +Context()->normalStrings; + +############################################################## +# Answers +# + +install_problem_grader(~~&std_problem_grader); + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD +$PAR +$BBOLD Paso 2:$EBOLD +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/desigualdades_lineales_dos_variables/template.pg b/Contrib/UPRM/Prebasica/desigualdades_lineales_dos_variables/template.pg new file mode 100644 index 0000000000..f61c3aa252 --- /dev/null +++ b/Contrib/UPRM/Prebasica/desigualdades_lineales_dos_variables/template.pg @@ -0,0 +1,116 @@ +# DESCRIPTION +# +# Tipo: opción múltiple, única respuesta +# Dada una región sombreada en dos dimensiones encontrar la region sombreada. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/desigualdades_lineales_dos_variables/desigualdades_lineales_2_variables.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Desigualdades) +## DBsection(Dos variables) +## Level(1) +## KEYWORDS('desigualdades','representar','intervalos','grafica') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +Context("Inequalities-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +# This is an inequality of the form x>=low + +$low = non_zero_random(-9,5,2)/2; +$high = 5; +$diff = $high - $low; +$ans = Compute(" x >= $low " || "$low <= x"); + +$gr = init_graph(-6,-1,6,1, size=>[800,100]); +# x-axis +$gr -> moveTo(-6,0); +$gr -> lineTo(6,0,'black','1'); +# x-axis ticks entered as y-value, color, list of x-values +$gr -> h_ticks(0,"black",-11/2,-5,-9/2,-4,-7/2,-3,-5/2,-2,-3/2,-1,-1/2,0,1/2,1,3/2,2,5/2,3,7/2,4,9/2,5,11/2); +# labels for tickmarks +foreach my $j (-1..11) { + $gr->lb( new Label($j-5,-0.5,$j-5, 'black','center','middle')); +} + +# The inequality graphed + +$gr -> moveTo($low,0.0); +$gr -> arrowTo($high,0.0,'blue',3); +$gr -> stamps( closed_circle($low,0.0,'blue') ); +$gr->lb(new Label($low+1,0.5,'x','blue','center','middle')); + +############################################################## +# +# Text +# +## to disable arithmetic operations in the answer. Student must simplify. + +BEGIN_TEXT +Considere la siguiente gráfica: +$PAR +$BCENTER +\{ image(insertGraph($gr), width=>640, height=>100, tex_size=>320); \} +$ECENTER +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("inequalities") \} +END_TEXT + +Context("Numeric"); +Context()->normalStrings; +############################################################## +# Answers +# + +ANS( $ans->cmp() ) ; + +$showHint = 3; +BEGIN_HINT +From the picture find the fixed endpoint. If the arrow goes to the right then x can be larger. If the arrow goes to the left, then x can be smaller. +END_HINT + +$showHint = 5; +BEGIN_HINT +Look at the endpoint. If it is a solid point, then the endpoint should be included and you will need either \( \le \) or \( \ge \). If it is an open point, then the endpoint should not be included and you will need either \( < \) or \( > \). +END_HINT + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD +$PAR +$BBOLD Paso 2:$EBOLD +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/aplicaciones_desigualdades_A.pg b/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/aplicaciones_desigualdades_A.pg new file mode 100644 index 0000000000..b160893fef --- /dev/null +++ b/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/aplicaciones_desigualdades_A.pg @@ -0,0 +1,97 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada una situación, encontrar el intervalo solución. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/desigualdades_lineales_una_variable/aplicaciones_desigualdades.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Desigualdades) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('desigualdades','aplicaciones','intervalos') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Interval"); + +@nombre = ("Juan", "Ana", "Gloria", "Daniel", "Mario", "Luisa"); +$index = random(0,5); + +$porHora = random(4,18,1); +$x = random(5,20); +$sueldo = $porHora*$x; + +$maxHoras = random(25,40); + +$answer = Interval([$sueldo/$porHora,$maxHoras]); + +############################################################## +# +# Text +# + +BEGIN_TEXT +$nombre[$index] necesita ganar por lo menos $sueldo dólares, gana $porHora por hora y puede trabajar un máximo de $maxHoras horas por semana. Sea \(x\) la cantidad de horas que $nombre[$index] trabaja, determinar el intervalo asociado con \(x\). $BBOLD(Escriba el resultado en notación de intervalos)$EBOLD. +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("intervals") \} +END_TEXT + +#Context("Numeric"); +Context()->normalStrings; +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD $nombre[$index] necesita ganar por lo menos $sueldo dólares, gana $porHora por hora, entonces: +\[ +\begin{align*} +$porHora x & \geq $sueldo \\[.3cm] + x & \geq $x +\end{align*} +\] +$PAR +$BBOLD Paso 2:$EBOLD Puede trabajar un máximo de $maxHoras por semana, esto significa que +\[ +x \leq $maxHoras +\] +$PAR +$BBOLD Paso 3:$EBOLD $nombre[$index] debe trabajar un mínimo de \($x\) horas y un máximo de \($maxHoras\); en notación de intervalo se tiene \($answer\). +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/aplicaciones_desigualdades_B.pg b/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/aplicaciones_desigualdades_B.pg new file mode 100644 index 0000000000..7fa23bf055 --- /dev/null +++ b/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/aplicaciones_desigualdades_B.pg @@ -0,0 +1,93 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada una situación, encontrar el intervalo solución. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/desigualdades_lineales_una_variable/aplicaciones_desigualdades.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Desigualdades) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('desigualdades','aplicaciones','intervalos') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Interval"); + +$anchoPared = random(30,60,1); +$minAnchoCuadro = random(3,9); +$disLadoCuadro = random(2,10); +$x = $anchoPared - 2*$disLadoCuadro; + +$answer = Interval([$minAnchoCuadro,$x]); + +############################################################## +# +# Text +# + +BEGIN_TEXT +Un pared mide $anchoPared pies de ancho. Se desea colocar un cuadro que debe tener un ancho mínimo de $minAnchoCuadro pies y se debe dejar por lo menos $disLadoCuadro pies a cada lado del cuadro. Sea \(x\) el acho del cuadro, determinar el intervalo asociado con \(x\). $BBOLD(Escriba el resultado en notación de intervalos)$EBOLD. +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("intervals") \} +END_TEXT + +#Context("Numeric"); +Context()->normalStrings; +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD El cuadro debe tener un ancho mínimo de $minAnchoCuadro pies, entonces: +\[ + x \geq $minAnchoCuadro +\] +$PAR +$BBOLD Paso 2:$EBOLD Como se tiene que dejar por lo menos $disLadoCuadro en cada lado del cuadro y la pared tiene $anchoPared de ancho, entonces: +\[ +\begin{align*} + x +2\cdot$disLadoCuadro \leq $anchoPared \\[0.3cm] + x \leq $x +\end{align*} +\] +$PAR +$BBOLD Paso 3:$EBOLD Por lo tanto la pared debe tener un ancho mínimo de $minAnchoCuadro y un ancho máximo de $x pies. En notación de intervalo es $answer. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/resuelva_desigualdades_una_variable_A.pg b/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/resuelva_desigualdades_una_variable_A.pg new file mode 100644 index 0000000000..97d2cb3464 --- /dev/null +++ b/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/resuelva_desigualdades_una_variable_A.pg @@ -0,0 +1,161 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada una desigualdad, encontrar el intervalo solución. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/desigualdades_lineales_una_variable/resuelva_desigualdades_una_variable.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Desigualdades) +## DBsection(Solucion) +## Level(1) +## KEYWORDS('desigualdades','solucion','intervalos') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextFraction.pl", +"AnswerFormatHelp.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$a = non_zero_random(-9,9); +$b = $a*non_zero_random(-9,9); +$c = $a*random(-30,30); + +$x = Compute("($c-$b)/$a"); + +@simbolo = ("<", ">","\leq","\geq"); +$index = random(0,3); + +#Usado para crear la tabla en la solución +$f = Formula("$a x + $b"); +$x1 = $x-1; +$x2 = $x+1; +$y1 = $f->eval(x=>$x1); +$y2 = $f->eval(x=>$x2); + +#if ( $y1 < $c) { +# $valorVerdad1 = "Verdadero"; +#}else{ +# $valorVerdad1 = "Falso"; +#} +# +#if ( $y2 <$c) { +# $valorVerdad2 = "Verdadero"; +#}else{ +# $valorVerdad2 = "Falso"; +#} +##### Termina la tabla + +#La respuesta +Context("Inequalities"); +if ($index == 0){ + $answer = Interval( "(-inf,$x)" ); +}elsif($index == 1){ + $answer = Interval( "($x,inf)" ); +}elsif($index == 2){ + $answer = Interval( "(-inf,$x]" ); +}else{ + $answer = Interval( "[$x,inf)" ); +} + +#Haciendo la representación gráfica +$gr = init_graph($x-5,-2,$x+5,2, size=>[600,100]); + +#Dibujando el eje horizontal +$gr -> moveTo($x-5,0); +$gr -> lineTo($x+5,0,'blue','1'); + +$gr -> moveTo($x,0); +$gr -> lineTo($x+5,0,'green','1'); + +#Dibujando los separadores +$gr -> h_ticks(0,"black",$x-4,$x-3,$x-2,$x-1,$x,$x+1,$x+2,$x+3,$x+4); + +# Etiquetando los separadores +foreach my $j (-4..4) { + $gr->lb( new Label($x + $j,-0.5,$x + $j, 'black','center','middle')); +} + +#Punto de division de la recta y su etiqueta +$gr -> stamps( closed_circle($x,0.0,'blue') ); +$gr->lb(new Label($x,0.5,'x','blue','center','middle')); + +############################################################## +# +# Text +# + +BEGIN_TEXT +Resolver la desigualdad +\[ +$a x + $b $simbolo[$index] $c +\] +$BBOLD(Escriba el resultado en notación de intervalo)$EBOLD. +$PAR +\{ ans_rule(20) \} \{ AnswerFormatHelp("intervals") \} +END_TEXT + +#Context("Numeric"); +Context()->normalStrings; +############################################################## +# Answers +# + +ANS( $answer->cmp ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver la ecuación \($a x + $b = $c\). Entonces \(x = $x\). +$PAR +$BBOLD Paso 2:$EBOLD Dividir la recta usando \(x = $x\) como frontera: +$PAR +$BCENTER +\{ image(insertGraph($gr), width=>300, height=>50, tex_size=>320); \} +$PAR +(Click en la gráfica para agrandar) +$PAR +$ECENTER +$PAR +$BBOLD Paso 3:$EBOLD Determinar el intervalo que nos interesa seleccionando un punto de prueba de cada intervalo: +\[ +\begin{array}{|c|c|} +\hline +\text{Izquierda} & \text{Derecha} \\ \hline +x=$x1 & x = $x2 \\ \hline +$a\cdot ($x1) +$b $simbolo[$index] $c & $a\cdot ($x2) +$b $simbolo[$index] $c \\ \hline +$y1 $simbolo[$index] $c & $y2 $simbolo[$index] $c \\ \hline +\end{array} +\] +$PAR +Por lo tanto la solución es \($answer\). +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/template.pg b/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/template.pg new file mode 100644 index 0000000000..f61c3aa252 --- /dev/null +++ b/Contrib/UPRM/Prebasica/desigualdades_lineales_una_variable/template.pg @@ -0,0 +1,116 @@ +# DESCRIPTION +# +# Tipo: opción múltiple, única respuesta +# Dada una región sombreada en dos dimensiones encontrar la region sombreada. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/desigualdades_lineales_dos_variables/desigualdades_lineales_2_variables.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Desigualdades) +## DBsection(Dos variables) +## Level(1) +## KEYWORDS('desigualdades','representar','intervalos','grafica') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +Context("Inequalities-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +# This is an inequality of the form x>=low + +$low = non_zero_random(-9,5,2)/2; +$high = 5; +$diff = $high - $low; +$ans = Compute(" x >= $low " || "$low <= x"); + +$gr = init_graph(-6,-1,6,1, size=>[800,100]); +# x-axis +$gr -> moveTo(-6,0); +$gr -> lineTo(6,0,'black','1'); +# x-axis ticks entered as y-value, color, list of x-values +$gr -> h_ticks(0,"black",-11/2,-5,-9/2,-4,-7/2,-3,-5/2,-2,-3/2,-1,-1/2,0,1/2,1,3/2,2,5/2,3,7/2,4,9/2,5,11/2); +# labels for tickmarks +foreach my $j (-1..11) { + $gr->lb( new Label($j-5,-0.5,$j-5, 'black','center','middle')); +} + +# The inequality graphed + +$gr -> moveTo($low,0.0); +$gr -> arrowTo($high,0.0,'blue',3); +$gr -> stamps( closed_circle($low,0.0,'blue') ); +$gr->lb(new Label($low+1,0.5,'x','blue','center','middle')); + +############################################################## +# +# Text +# +## to disable arithmetic operations in the answer. Student must simplify. + +BEGIN_TEXT +Considere la siguiente gráfica: +$PAR +$BCENTER +\{ image(insertGraph($gr), width=>640, height=>100, tex_size=>320); \} +$ECENTER +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("inequalities") \} +END_TEXT + +Context("Numeric"); +Context()->normalStrings; +############################################################## +# Answers +# + +ANS( $ans->cmp() ) ; + +$showHint = 3; +BEGIN_HINT +From the picture find the fixed endpoint. If the arrow goes to the right then x can be larger. If the arrow goes to the left, then x can be smaller. +END_HINT + +$showHint = 5; +BEGIN_HINT +Look at the endpoint. If it is a solid point, then the endpoint should be included and you will need either \( \le \) or \( \ge \). If it is an open point, then the endpoint should not be included and you will need either \( < \) or \( > \). +END_HINT + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD +$PAR +$BBOLD Paso 2:$EBOLD +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/distancia_dos_puntos/hallar_distancia_dada_grafica.pg b/Contrib/UPRM/Prebasica/distancia_dos_puntos/hallar_distancia_dada_grafica.pg new file mode 100644 index 0000000000..81280bdc79 --- /dev/null +++ b/Contrib/UPRM/Prebasica/distancia_dos_puntos/hallar_distancia_dada_grafica.pg @@ -0,0 +1,110 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dados dos puntos en una gráfica encontrar su distancia. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/distancia_dos_puntos/hallar_distancia_dada_grafica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Plano cartesiano) +## DBsection(Distancia entre puntos) +## Level(1) +## KEYWORDS('grafica', 'puntos','plano','coordenadas','distancia') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"problemRandomize.pl", +"AnswerFormatHelp.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +Context("Point"); +$A = Point(random(-9,9,1),random(-9,9,1)); +$B = Point(random(-9,9,1),random(-9,9,1)); + +#Extrayendo coordenadas de A y B +($aA, $bA) = $A->value; +($aB, $bB) = $B->value; + +$gr = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],size=>[450,450]); + +# adicionando los dos puntos +$gr->stamps( closed_circle($aA, $bA, 'blue') ); +$gr->stamps( closed_circle($aB, $bB, 'red') ); + +# adicionandole etiquetas a los puntos +$gr->lb(new Label($aA+0.1,$bA+.6,'A','blue','center','middle')); +$gr->lb(new Label($aB+0.1,$bB+.6,'B','red','center','middle')); + +$d = sqrt( ($aA-$aB)**2 + ($bA-$bB)**2); + +$answer = Compute("$d"); + +$dx = $aA-$aB; +$dy = $bA-$bB; + +BEGIN_TEXT +$BCENTER +\{ image(insertGraph($gr),width=>200,height=>200,tex_size=>450 ) \} +$BR +$BR +(Click en la gráfica para agrandar) +$ECENTER +$BR +Encuentre la distancia entre los dos puntos mostrados en la gráfica anterior. +$PAR +$BBOLD(Entre su respuesta con al menos tres cifras decimales usando redondeo de ser necesario)$EBOLD +$BR +$BR +\(d(A,B)=\) \{ans_rule(30)\} \{ AnswerFormatHelp("number") \} +END_TEXT + +ANS( $answer->cmp(tolType => 'absolute', tolerance => .001 ) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El triángulo rectángulo que se usa para conseguir la distancia tiene vértices \( ($aA,$bA), ($aB,$bA)\) y \( ($aB,$bB) \). La distancia de los dos catetos son: +$BR +\[ +\begin{align*} + \phantom{bla}\text{Cateto horizontal} &= |$aA-$aB| = |$dx|\\[0.3cm] + \phantom{bla}\text{Cateto vertical} &= |$bA-$bB| = |$dy| +\end{align*} +\] +La distancia entre \( ($aA,$bA) \) y \( ($aB,$bB) \) es igual a la hipotenusa. Usando el Teorema de Pitágoras tenemos que: +\[ +d(A,B)^2 = ($dx)^2+($dy)^2, +\] +resolviendo para la distancia tenemos +\[ +\begin{align*} + d(A,B) &= \sqrt{($dx)^2+($dy)^2}, \\[.3cm] + &= $answer +\end{align*} +\] +Por lo tanto la respuesta es: $answer +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/distancia_dos_puntos/hallar_distancia_dados_dos_puntos.pg b/Contrib/UPRM/Prebasica/distancia_dos_puntos/hallar_distancia_dados_dos_puntos.pg new file mode 100644 index 0000000000..81fd40764e --- /dev/null +++ b/Contrib/UPRM/Prebasica/distancia_dos_puntos/hallar_distancia_dados_dos_puntos.pg @@ -0,0 +1,86 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dados dos puntos en una gráfica encontrar su distancia. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/distancia_dos_puntos/hallar_distancia_dados_dos_puntos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Plano cartesiano) +## DBsection(Distancia entre puntos) +## Level(1) +## KEYWORDS('puntos','plano','coordenadas','distancia') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"problemRandomize.pl", +"AnswerFormatHelp.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +Context("Point"); +$A = Point(random(-9,9,1),random(-9,9,1)); +$B = Point(random(-9,9,1),random(-9,9,1)); + +#Extrayendo coordenadas de A y B +($aA, $bA) = $A->value; +($aB, $bB) = $B->value; + +$dx = $aA-$aB; +$dy = $bA-$bB; + +$d2 = ($dx)**2 + ($dy)**2; + +#Context()->functions->enable("sqrt"); +$answer = Compute("sqrt($d2)"); + +BEGIN_TEXT +Encuentre la distancia del punto \($A\) al punto \($B\). +$PAR +$BBOLD(Puede entrar su respuesta usando radicales, si usa decimales entrarlos con al menos tres cifras en su parte decimal usando redondeo de ser necesario)$EBOLD +$BR +$BR +\(d =\) \{ans_rule(30)\} \{ AnswerFormatHelp("number") \} +END_TEXT + +ANS( $answer->cmp(tolType => 'absolute', tolerance => .001) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +La distancia entre dos puntos \((x_1,y_1)\) y \((x_2,y_2)\) del plano está dada por: +\[ +d = \sqrt{ (x_2 - x_1)^2 + (y_2 - y_1)^2 }, +\] +luego para los puntos \($A\) y \($B\) se tiene que: +\[ +\begin{align*} + d &= \sqrt{ ($aB - $aA)^2 + ($bB - $bA)^2 } \\[.3cm] + &= \sqrt{ $dx + $dy } \\[0.3cm] + &= \sqrt{$d2} = $answer +\end{align*} +\] +Por lo tanto la respuesta es: $answer +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/distancia_dos_puntos/pitagoras.pg b/Contrib/UPRM/Prebasica/distancia_dos_puntos/pitagoras.pg new file mode 100644 index 0000000000..5f69c799c9 --- /dev/null +++ b/Contrib/UPRM/Prebasica/distancia_dos_puntos/pitagoras.pg @@ -0,0 +1,89 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dado dos lados de un triángulo rectángulo encontrar el otro +# por medio del Teorema de Pitágoras. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/distancia_dos_puntos/pitagoras.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Plano cartesiano) +## DBsection(Teorema de Pitagoras) +## Level(1) +## KEYWORDS('triangulo','teorema de pitagoras') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"problemRandomize.pl", +"AnswerFormatHelp.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +Context("Point"); +$a = random(1,15); +$b = random(1,20); +$pc = $a**2 + $b**2; + +$c = Compute("sqrt($pc)"); + +$imageNumber = random(1,3); + +@tipo = ("\(a = $a\) y \(b = $b\)", "\(a = $a\) y \(c = \sqrt{$pc}\)", "\(b = $b\) y \(c = \sqrt{$pc}\)"); +$index = random(0,2); + +if ($index == 0){ + $answer = Compute("$c"); + $textSol = "c"; +}elsif($index == 1){ + $answer = Compute("$b"); + $textSol = "b"; +}else{ + $answer = Compute("$a"); + $textSol = "a"; +} + +BEGIN_TEXT +$PAR +$BBOLD +Quizás falta definir si usamos ternas pitagóricas o no. +$EBOLD +$PAR +$BCENTER +\{ image( "tri1".$imageNumber.".png", width=>150 ) \} +$ECENTER +$PAR +Según el triángulo rectángulo anterior, si $tipo[$index] entonces +$BR +$BR +\($textSol =\) \{ans_rule(30)\} \{ AnswerFormatHelp("number") \} +END_TEXT + +ANS( $answer->cmp(tolType => 'absolute', tolerance => .001) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +La solución: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/distancia_dos_puntos/tri11.png b/Contrib/UPRM/Prebasica/distancia_dos_puntos/tri11.png new file mode 100644 index 0000000000..ffaf4aad21 Binary files /dev/null and b/Contrib/UPRM/Prebasica/distancia_dos_puntos/tri11.png differ diff --git a/Contrib/UPRM/Prebasica/distancia_dos_puntos/tri12.png b/Contrib/UPRM/Prebasica/distancia_dos_puntos/tri12.png new file mode 100644 index 0000000000..95cc3f108a Binary files /dev/null and b/Contrib/UPRM/Prebasica/distancia_dos_puntos/tri12.png differ diff --git a/Contrib/UPRM/Prebasica/distancia_dos_puntos/tri13.png b/Contrib/UPRM/Prebasica/distancia_dos_puntos/tri13.png new file mode 100644 index 0000000000..3f0755a0ad Binary files /dev/null and b/Contrib/UPRM/Prebasica/distancia_dos_puntos/tri13.png differ diff --git a/Contrib/UPRM/Prebasica/division_polinomios/cociente_O_residuo_divisor_cuadratico.pg b/Contrib/UPRM/Prebasica/division_polinomios/cociente_O_residuo_divisor_cuadratico.pg new file mode 100644 index 0000000000..57a95ffdb8 --- /dev/null +++ b/Contrib/UPRM/Prebasica/division_polinomios/cociente_O_residuo_divisor_cuadratico.pg @@ -0,0 +1,129 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada un polinomio de grado 3 y un divisor de grado 2, +# encontrar el cociente o el residuo. Cual se elige aleatoriamente. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de los archivos +# pedro_prebasica/division_polinomios/cociente_divisor_cuadratico.db +# pedro_prebasica/division_polinomios/residuo_divisor_cuadratico.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Polinomios) +## DBsection(Operaciones) +## Level(1) +## KEYWORDS('polinomios','operaciones','division','forma larga') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +#Creando el polinomio y sus componentes A = B*Q + R + +#el divisor +$b2 = non_zero_random(-9,9); +$b1 = random(-9,9); +$b0 = random(-9,9); +@B = ($b2, $b1, $b0); + +#el cociente +$q1 = non_zero_random(-9,9); +$q0 = random(-9,9); +@Q = ($q1, $q0); + +#el residuo +$r1 = non_zero_random(-9,9); +$r0 = random(-9,9); +@R = ($r1, $r0); + +#el dividendo A usando el macro PGpolynomialmacros.pl, multiplicando BQ y sumándole R +@BQ = PolyMult(~~@B, ~~@Q); +@A = PolyAdd(~~@BQ, ~~@R); + +#adicionando la variable x a cada parte usando el macro PGpolynomialmacros.pl +$polyB = PolyString(~~@B,x); +$polyQ = PolyString(~~@Q,x); +$polyR = PolyString(~~@R,x); +$polyBQ = PolyString(~~@BQ,t); +$polyA = PolyString(~~@A,x); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +@pregunta = ("cociente", "residuo"); +$index = random(0,1); + +if ($index == 0){ + $answer = Formula($polyQ)->reduce(); + $label = "Q(x)"; +}else{ + $answer = Formula($polyR)->reduce(); + $label = "R(x)"; +} + +############################################################## +# +# Text +# + +BEGIN_TEXT +Sea \(P(x) = $polyA\), encuentre el $pregunta[$index] cuando \(P(x)\) es dividido por \(D(x)=$polyB\). +$PAR +\($label =\)\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Usando división larga:$EBOLD en proceso ... +$PAR +\[ + \polylongdiv{$polyA}{$polyB} +\] +$PAR +$BBOLD Algoritmo de la división:$EBOLD \(P(x) = D(x)Q(x) + R(x)\) +\[ +\underbrace{$polyA}_{P(x)} = ( \underbrace{$polyB}_{D(x)} )( \underbrace{$polyQ}_{Q(x)} ) + ( \underbrace{$polyR}_{R(x)} ) +\] +Por lo tanto el $pregunta[$index] es: +\[ +$label = \{$answer->TeX\} +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/division_polinomios/cociente_O_residuo_divisor_cubico.pg b/Contrib/UPRM/Prebasica/division_polinomios/cociente_O_residuo_divisor_cubico.pg new file mode 100644 index 0000000000..9cc58dcd2f --- /dev/null +++ b/Contrib/UPRM/Prebasica/division_polinomios/cociente_O_residuo_divisor_cubico.pg @@ -0,0 +1,131 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada un polinomio de grado 4 y un divisor de grado 3, +# encontrar el cociente o el residuo. Cual se elige aleatoriamente. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivos +# pedro_prebasica/division_polinomios/cociente_divisor_cubico.db +# pedro_prebasica/division_polinomios/residuo_divisor_cubico.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Polinomios) +## DBsection(Operaciones) +## Level(1) +## KEYWORDS('polinomios','operaciones','division','forma larga') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +#Creando el polinomio y sus componentes A = B*Q + R + +#el divisor +$b3 = non_zero_random(-9,9); +$b2 = random(-9,9); +$b1 = random(-9,9); +$b0 = random(-9,9); +@B = ($b3, $b2, $b1, $b0); + +#el cociente +$q1 = non_zero_random(-9,9); +$q0 = random(-9,9); +@Q = ($q1, $q0); + +#el residuo +$r2 = non_zero_random(-9,9); +$r1 = random(-9,9); +$r0 = random(-9,9); +@R = ($r2, $r1, $r0); + +#el dividendo A usando el macro PGpolynomialmacros.pl, multiplicando BQ y sumándole R +@BQ = PolyMult(~~@B, ~~@Q); +@A = PolyAdd(~~@BQ, ~~@R); + +#adicionando la variable x a cada parte usando el macro PGpolynomialmacros.pl +$polyB = PolyString(~~@B,x); +$polyQ = PolyString(~~@Q,x); +$polyR = PolyString(~~@R,x); +$polyBQ = PolyString(~~@BQ,x); +$polyA = PolyString(~~@A,x); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +@pregunta = ("cociente", "residuo"); +$index = random(0,1); + +if ($index == 0){ + $answer = Formula($polyQ)->reduce(); + $label = "Q(x)"; +}else{ + $answer = Formula($polyR)->reduce(); + $label = "R(x)"; +} + +############################################################## +# +# Text +# + +BEGIN_TEXT +Sea \(P(x) = $polyA\), encuentre el $pregunta[$index] cuando \(P(x)\) es dividido por \(D(x)=$polyB\). +$PAR +\($label =\)\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Usando división larga:$EBOLD en proceso ... +$PAR +\[ + \polylongdiv{$polyA}{$polyB} +\] +$PAR +$BBOLD Algoritmo de la división:$EBOLD \(P(x) = D(x)Q(x) + R(x)\) +\[ +\underbrace{$polyA}_{P(x)} = ( \underbrace{$polyB}_{D(x)} )( \underbrace{$polyQ}_{Q(x)} ) + ( \underbrace{$polyR}_{R(x)} ) +\] +Por lo tanto el $pregunta[$index] es: +\[ +$label = \{$answer->TeX\} +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/division_polinomios/template.pg b/Contrib/UPRM/Prebasica/division_polinomios/template.pg new file mode 100644 index 0000000000..0878bcb328 --- /dev/null +++ b/Contrib/UPRM/Prebasica/division_polinomios/template.pg @@ -0,0 +1,126 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada un polinomio de grado 3 y un divisor de grado 2, encontrar el residuo. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/division_polinomios/cociente_divisor_cuadratico.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Polinomios) +## DBsection(Operaciones) +## Level(1) +## KEYWORDS('polinomios','operaciones','division','forma larga') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +#Creando A = B*Q + R + +#el divisor +$b2 = non_zero_random(-9,9); +$b1 = random(-9,9); +$b0 = random(-9,9); +@B = ($b2, $b1, $b0); + +#el cociente +$q1 = non_zero_random(-9,9); +$q0 = random(-9,9); +@Q = ($q1, $q0); + +#el residuo +$r1 = non_zero_random(-9,9); +$r0 = random(-9,9); +@R = ($r1, $r0); + +#el dividendo +@BQ = PolyMult(~~@B, ~~@Q); +@A = PolyAdd(~~@BQ, ~~@R); + +$poly1 = PolyString(~~@B,x); +$poly2 = PolyString(~~@Q,x); +$poly3 = PolyString(~~@R,x); +$poly4 = PolyString(~~@BQ,x); +$poly5 = PolyString(~~@A,x); + + $months = Compute(8); + +############################################################## +# +# Text +# + +BEGIN_TEXT +Just \(A=BQ+R\) +$BR +\(A = @A\), term by term: $A[0], $A[1], $A[2], $A[3]. Polynomial way: \($A[0] x^3 + $A[1] x^2 + $A[2] x + $A[3]\) +$BR +\(B = @B\), term by term: $B[0], $B[1], $B[2]. Polynomial way: \($B[0] x^2 + $B[1] x + $B[2]\) +$BR +\(Q = @Q\), term by term: $Q[0], $Q[1]. Polynomial way: \($Q[0] x + $Q[1]\) +$BR +\(R = @R\), term by term: $R[0], $R[1]. Polynomial way: \($R[0] x + $R[1]\) +$BR +\(BQ =@BQ\) term by term: $BQ[0], $BQ[1], $BQ[2], $BQ[3]. Polynomial way: \($BQ[0] x^3 + $BQ[1] x^2 + $BQ[2] x + $BQ[3]\) +$PAR +Otra forma de B: \($poly1\) +$PAR +Y y de Q: \($poly2\) +$PAR +finalmente de R: \($poly3\) +$PAR +y el producto BQ: \($poly4\) +$PAR +finalmente A = BQ + R: \($poly5\) +$PAR +Como se imprime la salida de PolyString(~~@A,x) = $poly5 +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $months->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD +$PAR +$BBOLD Paso 2:$EBOLD +$PAR +$BBOLD Paso 3:$EBOLD +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_con_radicaless/ecuaciones_con_radicales.pg b/Contrib/UPRM/Prebasica/ecuaciones_con_radicaless/ecuaciones_con_radicales.pg new file mode 100644 index 0000000000..03d1737ad5 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_con_radicaless/ecuaciones_con_radicales.pg @@ -0,0 +1,139 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Solucionar ecuaciones lineales con radicales + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_con_radicales/ecuaciones_con_radicales.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones) +## DBsection(Radicales) +## Level(1) +## KEYWORDS('ecuaciones','radicales') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +Context("Fraction"); + +#Creando la expresion a\sqrt{bx + c} + d = e, usando variables aleatorias +$a = non_zero_random(1,9); +$b = random(1,9); +$c = random(-3,3); +$d = random(-9,9); +$e = random(1,25); + +$f = Formula("$a*sqrt($b x + $c)+$d")->reduce(); + +$bx_mas_c = Formula("$b x + $c")->reduce(); + +$e_menos_d_sobre_a = Fraction("($e-$d)/$a")->reduce(); + +$eda_elevado_2 = Fraction("$e_menos_d_sobre_a^2")->reduce(); + +$eda2_menos_c = Fraction("$eda_elevado_2 - $c")->reduce(); + +$final = Fraction("$eda2_menos_c/$b")->reduce(); + +$x = Fraction(" ( ( ($e-$d)/$a)**2 - $c)/$b ")->reduce(); + +$y = $f->eval(x=>$final); + +if ($y == $e){ + $answer = $x; + $simbolo = "="; +}else{ + $answer = NONE; + $simbolo = '\ne'; +} + +############################################################## +# +# Text +# + +BEGIN_TEXT +Resolver la ecuación +\[ +\{$f->TeX\} = $e +\] +$PAR +\(x =\)\{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT + +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Aislar el radical: +\[ +\begin{align*} +\{$f->TeX\} &= $e \\[0.3cm] +\sqrt{ \{$bx_mas_c->TeX\} }&= \{$e_menos_d_sobre_a->TeX\} +\end{align*} +\] +$PAR +$BBOLD Paso 2:$EBOLD Eliminar radical. Usamos \(( )^2\) para eliminar \(\sqrt{} \) +\[ +\begin{align*} +\sqrt{ \{$bx_mas_c->TeX\} } &= \{$e_menos_d_sobre_a->TeX\} \\[0.3cm] +\left( \sqrt{ \{$bx_mas_c->TeX\} }\right)^2 &= \left( \{$e_menos_d_sobre_a->TeX\} \right)^2 \\[0.3cm] +\{$bx_mas_c->TeX\} &= \{$eda_elevado_2->TeX\} +\end{align*} +\] +$PAR +$BBOLD Paso 3:$EBOLD Resolver ecuación lineal +\[ +\begin{align*} +\{$bx_mas_c->TeX\} &= \{$eda_elevado_2->TeX\} \\[0.3cm] +x &= \{$x->TeX\} +\end{align*} +\] +$PAR +$BBOLD Paso 4:$EBOLD Verificar valor \(x = \{$x->TeX\}\) en la ecuación radical +\[ +\begin{align*} +\{$f->TeX\} &= $e \\[0.3cm] +$y & $simbolo $e +\end{align*} +\] +$PAR +Por lo tanto la solución es \(x = \{$x->TeX\} \) +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado_A.pg b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado_A.pg new file mode 100644 index 0000000000..73c19ae0e2 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado_A.pg @@ -0,0 +1,112 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Técnica de completar el cuadrado, pregunta por el valor +# que hay que sumar o por los valores de a y b en (x-a)^2 = b. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones cuadraticas) +## DBsection(Completando el cuadrado) +## Level(1) +## KEYWORDS('ecuaciones','cuadraticas',"completar el cuadrado') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y'); +Context("Fraction"); + +#Creando las constantes +$a = 2*non_zero_random(-15,15); +$b = random(-9,9); + +if ($a> 0){ + $simbolo = "+"; +}else{ + $simbolo = "-"; +} + +$eq = Formula("x^2+$a x")->reduce(); + +$answer = Fraction(($a**2)/4)->reduce(); + +$b_mas_answer = $b+$answer; + +$square_root_answer = sqrt($answer); + + +############################################################## +# +# Text +# + +BEGIN_TEXT +Considere la ecuación cuadrática +\[ +\{$eq->TeX\} = $b +\] +hallar un número entero que se sume a ambos lados de la ecuación para completar el cuadrado en la parte izquierda de ella. +$PAR +Contestación = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT + +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Para completar el cuadrado en el lado izquierdo de la ecuación, usamos a \($a\), el coeficiente de \(x\), se divide por 2 y se eleva al cuadrado: +\[ + \left( \frac{$a}{2} \right)^2 = $answer +\] +$PAR +$BBOLD Paso 2:$EBOLD Sumar \($aa2\) a ambos lados de la ecuación para completar el cuadrado +\[ +\begin{align*} + \{$eq->TeX\}+$answer &= $b +$answer\\[0.2cm] + (x $simbolo $square_root_answer)^2 &= $b_mas_answer +\end{align*} +\] +$PAR +Por lo tanto la respuesta es \($answer\). +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado_B.pg b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado_B.pg new file mode 100644 index 0000000000..9105a5495c --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado_B.pg @@ -0,0 +1,120 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Técnica de completar el cuadrado. dado px^2+qx = r +# transformarla a la forma (x-a)^2 = b y + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones cuadraticas) +## DBsection(Completando el cuadrado) +## Level(1) +## KEYWORDS('ecuaciones','cuadraticas',"completar el cuadrado') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y'); +Context("Fraction"); + +#Creando las constantes +$a = 2*non_zero_random(-15,15); +$b = random(-9,9); + +if ($a> 0){ + $simbolo = "+"; +}else{ + $simbolo = "-"; +} + +$eq = Formula("x^2+$a x")->reduce(); + +$aa2 = Fraction(($a**2)/4)->reduce(); + +$tmp_answer1 = sqrt($aa2); + +$answer1 = Compute("$simbolo sqrt($aa2)")->reduce(); + +$answer2 = Compute($b+$aa2); + +############################################################## +# +# Text +# + +BEGIN_TEXT +Considere la ecuación cuadrática +\[ +\{$eq->TeX\} = $b +\] +se requiere llevarla a la forma +\[ +(x+a)^2 = b. +\] +Calcular los valores de \(a\) y \(b\), completando cuadrados en el lado izquierdo de la ecuación. +$PAR +\(a\) = \{ans_rule(20)\} +$BR +\(b\) = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT + +############################################################## +# Answers +# + +ANS( $answer1->cmp() ) ; +ANS( $answer2->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Para completar el cuadrado en el lado izquierdo de la ecuación, usamos a \($a\), el coeficiente de \(x\), se divide por 2 y se eleva al cuadrado: +\[ + \left( \frac{$a}{2} \right)^2 = $aa2 +\] +$PAR +$BBOLD Paso 2:$EBOLD Sumar \($aa2\) a ambos lados de la ecuación para completar el cuadrado +\[ +\begin{align*} + \{$eq->TeX\}+$aa2 &= $b +$aa2 \\[0.2cm] + (x $simbolo $tmp_answer1)^2 &= $answer2 +\end{align*} +\] +$PAR +Por lo tanto las respuestas son \(a = $answer1\) y \(b = $answer2\). +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado_C.pg b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado_C.pg new file mode 100644 index 0000000000..fd000c12e1 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado_C.pg @@ -0,0 +1,136 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Técnica de completar el cuadrado. Dado px^2+qx = r +# transformarla a la forma (x+a)^2 = b y + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_cuadraticas/solucion_completando_cuadrado.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones cuadraticas) +## DBsection(Completando el cuadrado) +## Level(1) +## KEYWORDS('ecuaciones','cuadraticas',"completar el cuadrado') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +Context("Fraction"); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +#Creando las constantes +$p = non_zero_random(-15,15); +$q = $p*non_zero_random(-9,9); +$r = $p*random(-20,20); + +$q_over_p = $q/$p; + +if ($q_over_p > 0){ + $simbolo = "+"; +}else{ + $simbolo = "-"; +} + +$eq = Formula("$p x^2 + $q x")->reduce(); + +$eq_sobre_p = Formula("x^2 + ($q/$p) x")->reduce(); + +$valor_a_sumar = Fraction( ( $q/(2*$p) )**2) ->reduce(); + +$r_sobre_p = $r/$p; + +$tmp_answer1 = sqrt($valor_a_sumar); + +$answer1 = Compute("$simbolo $tmp_answer1")->reduce(); + +$answer2 = Compute($r_sobre_p + $valor_a_sumar)->reduce(); + +############################################################## +# +# Text +# + +BEGIN_TEXT +Considere la ecuación cuadrática +\[ +\{$eq->TeX\} = $r +\] +se requiere llevarla a la forma +\[ +(x+a)^2 = b. +\] +Calcular los valores de \(a\) y \(b\), completando cuadrados en el lado izquierdo de la ecuación. +$PAR +\(a\) = \{ans_rule(20)\} +$BR +\(b\) = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT + +############################################################## +# Answers +# + +ANS( $answer1->cmp() ) ; +ANS( $answer2->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Dividir cada término de la ecuación por \($p\) +\[ + \begin{align*} + \{$eq->TeX\} &= $r \\[0.2cm] + \{$eq_sobre_p->TeX\} &= \frac{$r}{$p} \\[0.2cm] + \end{align*} +\] +$PAR +$BBOLD Paso 2:$EBOLD Para completar el cuadrado en el lado izquierdo de la ecuación, usamos a \($q_over_p\), el coeficiente de \(x\), se divide por 2 y se eleva al cuadrado: +\[ + \left( \frac{$q_over_p}{2} \right)^2 = \{$valor_a_sumar->TeX\} +\] +$PAR +$BBOLD Paso 3:$EBOLD Sumar \(\{$valor_a_sumar->TeX\}\) a ambos lados de la ecuación para completar el cuadrado +\[ +\begin{align*} + \{$eq_sobre_p->TeX\} + \{$valor_a_sumar->TeX\} &= $r_sobre_p + \{$valor_a_sumar->TeX\} \\[0.2cm] + \left( x $simbolo \{$tmp_answer1->TeX\} \right)^2 &= \{$answer2->TeX\} +\end{align*} +\] +$PAR +Por lo tanto las respuestas son \(a = \{$answer1->TeX\} \) y \(b = \{$answer2->TeX\}\). +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_entera_formula_cuadratica.pg b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_entera_formula_cuadratica.pg new file mode 100644 index 0000000000..fc5a81729f --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_entera_formula_cuadratica.pg @@ -0,0 +1,123 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Solucionar ecuaciones cuadráticas usando la +# fórmula cuadrática. Respuestas enteras, usando C(x-A)(x-B) +# para formar ax^2 + bx + c = 0, donde a=C, b=-C(A+B) y c = ABC + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_cuadraticas/solucion_formula_cuadratica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones cuadraticas) +## DBsection(Formula cuadratica) +## Level(1) +## KEYWORDS('ecuaciones','cuadraticas',"formula') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +Context("Fraction"); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +#Creando las constantes para ax^2+bx+c = 0 + +#Partiendo de C(x-A)(x-B) +$A = non_zero_random(-9,9); +$B = non_zero_random(-9,9); +$C = non_zero_random(-9,9); + +#Construimos ax^2+bx+c +$a = $C; +$b = -$C*($A+$B); +$c = $A*$B*$C; + +$eq = Formula("$a x^2 + $b x + $c")->reduce(); + +$b24ac = $b*$b - 4*$a*$c; +$raiz_cuad = sqrt($b24ac); +$dos_a = 2*$a; + +$answer1 = Compute( (-$b + sqrt( $b*$b - 4*$a*$c ))/(2*$a) )->reduce(); +$answer2 = Compute( (-$b - sqrt( $b*$b - 4*$a*$c ))/(2*$a) )->reduce(); + +############################################################## +# +# Text +# +Context()->texStrings; + +BEGIN_TEXT +Use la $BBOLD fórmula cuadrática$EBOLD para hallar las soluciones de la ecuación cuadrática +\[ +\{$eq->TeX\} = 0. +\] +$PAR +\(x_{+}\) = \{ans_rule(20)\} +$BR + \(x_{-}\) = \{ans_rule(20)\} +END_TEXT + +############################################################## +# Answers +# + +ANS( $answer1->cmp() ) ; +ANS( $answer2->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar los valores de \(a, b\) y \(c\) +\[ +a = $a,\quad b = $b\quad \text{y}\quad c = $c. +\] +$PAR +$BBOLD Paso 2:$EBOLD Reemplazar los valores en la fórmula cuadrática y simplificar: +\[ + \begin{align*} + x &= \frac{-b \pm \sqrt{b^2-4ac} }{2a} \\[0.3cm] + x &= \frac{ - ($b) \pm \sqrt{ ($b)^2 - 4($a)($c)} } { 2($a)} \\[0.3cm] + x &= \frac{ - $b \pm \sqrt{ $b24ac} } { $dos_a } \\[0.3cm] + x &= \frac{ - $b \pm $raiz_cuad } { $dos_a} + \end{align*} +\] +por consiguiente, tenemos que +\[ +x_{+} = $answer1 \quad\text{ y }\quad x_{-} = $answer2. +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_irracional_formula_cuadratica.pg b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_irracional_formula_cuadratica.pg new file mode 100644 index 0000000000..95c29fabdb --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_irracional_formula_cuadratica.pg @@ -0,0 +1,127 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Solucionar ecuaciones cuadráticas usando la +# fórmula cuadrática. Respuestas muy probables irracionales + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_cuadraticas/solucion_formula_cuadratica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones cuadraticas) +## DBsection(Formula cuadratica) +## Level(1) +## KEYWORDS('ecuaciones','cuadraticas',"formula') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +#Creando las constantes para ax^2+bx+c = 0 +$a = non_zero_random(-9,9); +$c = non_zero_random(-9,9); + +do { + $b = non_zero_random(-9,9); +}until ($b*$b > 4*$a*$c); + +$eq = Formula("$a x^2 + $b x + $c")->reduce(); + +$b24ac = $b*$b - 4*$a*$c; +$raiz_cuad = sqrt($b24ac); +$dos_a = 2*$a; + +$ans_num1 = Compute("(-$b + sqrt( $b*$b - 4*$a*$c))/(2*$a)")->reduce(); +$ans_num2 = Compute("(-$b - sqrt( $b*$b - 4*$a*$c ))/(2*$a)")->reduce(); + +Context()->flags->set( + reduceConstants => 1, + reduceConstantFunctions => 0, + ); + +$answer1 = Formula("(-$b + sqrt( $b*$b - 4*$a*$c))/(2*$a)"); +$answer2 = Formula("(-$b - sqrt( $b*$b - 4*$a*$c ))/(2*$a)"); + +############################################################## +# +# Text +# +Context()->texStrings; + +BEGIN_TEXT +Use la $BBOLD fórmula cuadrática$EBOLD para hallar las soluciones de la ecuación cuadrática +\[ +\{$eq->TeX\} = 0. +\] +$PAR +\(x_{+}\) = \{ans_rule(20)\} +$BR + \(x_{-}\) = \{ans_rule(20)\} +END_TEXT + +############################################################## +# Answers +# + +ANS( $answer1->cmp( ) ) ; +ANS( $answer2->cmp( ) ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar los valores de \(a, b\) y \(c\) +\[ +a = $a,\quad b = $b\quad \text{y}\quad c = $c. +\] +$PAR +$BBOLD Paso 2:$EBOLD Reemplazar los valores en la fórmula cuadrática y simplificar: +\[ + \begin{align*} + x &= \frac{-b \pm \sqrt{b^2-4ac} }{2a} \\[0.3cm] + x &= \frac{ - ($b) \pm \sqrt{ ($b)^2 - 4($a)($c)} } { 2($a)} \\[0.3cm] + x &= \frac{ - $b \pm \sqrt{$b24ac} } { $dos_a} + \end{align*} +\] +por consiguiente, tenemos que +\[ +x_{+} = $answer1 \quad\text{ y }\quad x_{-} = $answer2 +\] +o equivalentemente +\[ +x_{+} = $ans_num1 \quad\text{ y }\quad x_{-} = $ans_num2 +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_pequena_grande.pg b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_pequena_grande.pg new file mode 100644 index 0000000000..e749bba7be --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_pequena_grande.pg @@ -0,0 +1,135 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Solucionar ecuaciones cuadráticas usando la +# fórmula cuadrática. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_cuadraticas/solucion_formula_cuadratica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones cuadraticas) +## DBsection(Formula cuadratica) +## Level(1) +## KEYWORDS('ecuaciones','cuadraticas',"formula') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +@tipo_preg = ("pequeño", "grande"); +$index = random(0,1); + +Context("Fraction"); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +#Creando las constantes para ax^2+bx+c = 0 + +$A = non_zero_random(-9,9); +$B = non_zero_random(-9,9); +$C = non_zero_random(-9,9); + +$a = $C; +$b = -$C*($A+$B); +$c = $A*$B*$C; + +$eq = Formula("$a x^2 + $b x + $c")->reduce(); + +$b24ac = $b*$b - 4*$a*$c; +$raiz_cuad = sqrt($b24ac); +$dos_a = 2*$a; + +$root1 = Compute( (-$b + sqrt( $b*$b - 4*$a*$c ))/(2*$a) )->reduce(); +$root2 = Compute( (-$b - sqrt( $b*$b - 4*$a*$c ))/(2*$a) )->reduce(); + +if ($index == 0){ + if ($root1 < $root2){ + $answer = Compute($root1); + }else{ + $answer = Compute($root2); + } +}else{ + if ($root1 > $root2){ + $answer = Compute($root1); + }else{ + $answer = Compute($root2); + } +} + +############################################################## +# +# Text +# +Context()->texStrings; + +BEGIN_TEXT +Use la fórmula cuadrática para hallar el número entero más $tipo_preg[$index] que es solución de la ecuación cuadrática. +\[ +\{$eq->TeX\} = 0. +\] +$PAR +Contestación = \{ans_rule(20)\} +END_TEXT + +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar los valores de \(a, b\) y \(c\) +\[ +a = $a,\quad b = $b\quad \text{y}\quad c = $c. +\] +$PAR +$BBOLD Paso 2:$EBOLD Reemplazar los valores en la fórmula cuadrática y simplificar: +\[ + \begin{align*} + x &= \frac{-b \pm \sqrt{b^2-4ac} }{2a} \\[0.3cm] + x &= \frac{ - ($b) \pm \sqrt{ ($b)^2 - 4($a)($c)} } { 2$a} \\[0.3cm] + x &= \frac{ - $b \pm \sqrt{ $b24ac} } { $dos_a } \\[0.3cm] + x &= \frac{ - $b \pm $raiz_cuad } { $dos_a} + \end{align*} +\] +por consiguiente, tenemos que +\[ +x = $root1 \quad\text{ y }\quad x = $root2. +\] +Por lo tanto el entero más $tipo_preg[$index] es \(x = \{$answer->TeX\} \). +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_racional_formula_cuadratica.pg b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_racional_formula_cuadratica.pg new file mode 100644 index 0000000000..021d6bfb49 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_cuadraticas/solucion_racional_formula_cuadratica.pg @@ -0,0 +1,125 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Solucionar ecuaciones cuadráticas usando la +# fórmula cuadrática. Respuestas con alta probabilidad de tipo racional propio, +# usando (x-p/q)(x-r/s) para formar ax^2 + bx + c = 0, +# donde a=qs, b=-(ps+rq) y c = pr + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_cuadraticas/solucion_formula_cuadratica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones cuadraticas) +## DBsection(Formula cuadratica) +## Level(1) +## KEYWORDS('ecuaciones','cuadraticas',"formula') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +Context("Fraction"); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce( '(-x)-y','(-x)+y' ); + +#Creando las constantes para ax^2+bx+c = 0 + +#Partiendo de (x-p/q)(x-r/s) +$p = non_zero_random(-9,9); +$q = non_zero_random(-9,9); +$r = non_zero_random(-9,9); +$s = non_zero_random(-9,9); + +#Construimos ax^2+bx+c +$a = $q*$s; +$b = -($p*$s + $r*$q); +$c = $p*$r; + +$eq = Formula("$a x^2 + $b x + $c")->reduce(); + +$b24ac = $b*$b - 4*$a*$c; +$raiz_cuad = sqrt($b24ac); +$dos_a = 2*$a; + +$answer1 = Fraction($p, $q)->reduce(); +$answer2 = Fraction($r, $s)->reduce(); + +############################################################## +# +# Text +# +Context()->texStrings; + +BEGIN_TEXT +Use la $BBOLD fórmula cuadrática$EBOLD para hallar las soluciones de la ecuación cuadrática +\[ +\{$eq->TeX\} = 0. +\] +$PAR +\(x_{+}\) = \{ans_rule(20)\} +$BR + \(x_{-}\) = \{ans_rule(20)\} +END_TEXT + +############################################################## +# Answers +# + +ANS( $answer1->cmp(studentsMustReduceFractions=>1) ) ; +ANS( $answer2->cmp(studentsMustReduceFractions=>1) ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar los valores de \(a, b\) y \(c\) +\[ +a = $a,\quad b = $b\quad \text{y}\quad c = $c. +\] +$PAR +$BBOLD Paso 2:$EBOLD Reemplazar los valores en la fórmula cuadrática y simplificar: +\[ + \begin{align*} + x &= \frac{-b \pm \sqrt{b^2-4ac} }{2a} \\[0.3cm] + x &= \frac{ - ($b) \pm \sqrt{ ($b)^2 - 4($a)($c)} } { 2($a)} \\[0.3cm] + x &= \frac{ - $b \pm \sqrt{ $b24ac} } { $dos_a } \\[0.3cm] + x &= \frac{ - $b \pm $raiz_cuad } { $dos_a} + \end{align*} +\] +por consiguiente, tenemos que +\[ +x_{+} = $answer1 \quad\text{ y }\quad x_{-} = $answer2. +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales/ecuaciones_lineales_de_1_paso.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales/ecuaciones_lineales_de_1_paso.pg new file mode 100644 index 0000000000..c7b88ae76b --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales/ecuaciones_lineales_de_1_paso.pg @@ -0,0 +1,110 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Solucionar ecuaciones lineales tipo x + a = c, o, ax = c. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_lineales/ecuaciones_lineales_de_1_paso.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones) +## DBsection(Lineales) +## Level(1) +## KEYWORDS('ecuaciones','lineales') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y'); +Context("Fraction"); + +#Creando las constantes + +$a = non_zero_random(-19,19); +#$ia = Fraction(1,$a); +#$iaa = Compute(" - $a"); +$c = random(-50,50); +$tipo = random(0,2); + +@vars = ("a","b","c","d","e","f", "g","h","i","k","l","m","n","o","p","q","r","s", "t","u","v","w","x","y","z"); +$index = random(0,24); + +Context()->variables->add($vars[$index] => 'Real'); + +if ($tipo == 0){ + $ecuacion = Compute("$a*$vars[$index]")->reduce(); + $answer = Fraction($c,$a)->reduce(); +}elsif($tipo == 1){ + $ecuacion = Compute("$vars[$index]/$a")->reduce(); + $answer = Compute($a*$c)->reduce(); +}else{ + $ecuacion = Compute("$vars[$index] + $a")->reduce(); + $answer = Compute($c-$a)->reduce(); +} + +############################################################## +# +# Text +# + +BEGIN_TEXT +Resolver para \($vars[$index]\): +$BCENTER +\(\{$ecuacion->TeX\} = $c\) +$ECENTER +$PAR +\($vars[$index] =\)\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT + +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +Dejar el factor de \($vars[$index]\) igual a 1, multiplicado por el inverso, ó, eliminar el término constante del lado izquierdo de la ecuación según sea el caso. Simplificar las fracciones en caso de ser necesario. +\[ +\begin{align*} + \{$ecuacion->TeX\} &= $c \\[0.3cm] + $vars[$index] &= \{$answer->TeX\} +\end{align*} +\] +Por lo tanto la solución es \($vars[$index] = \{$answer->TeX\} \). +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales/ecuaciones_lineales_de_dos_pasos.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales/ecuaciones_lineales_de_dos_pasos.pg new file mode 100644 index 0000000000..6abdb6bd40 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales/ecuaciones_lineales_de_dos_pasos.pg @@ -0,0 +1,110 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Solucionar ecuaciones lineales tipo ax + b = c, con a, b y c enteros. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_lineales/ecuaciones_lineales_de_dos_pasos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones) +## DBsection(Lineales) +## Level(1) +## KEYWORDS('ecuaciones','lineales') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Fraction"); + +#Creando la expresion ax + b = e +$a = non_zero_random(-9,9); +$b = non_zero_random(-25,25); +$c = random(-50,50); + +$inv_add_b = -$b; +$c_menos_b = Compute("$c - $b")->reduce(); +$answer = Fraction($c_menos_b,$a); + +@vars = ('a','b','c','d','e','f','g','h','i','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'); +$index = random(0,24); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Resolver para \($vars[$index]\): +\[ +$a $vars[$index] + $b = $c +\] +$PAR +\($vars[$index] =\)\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Eliminar \($b\) y \($a\). Usamos \($inv_add_b\) y \(\div $a\) respectivamente. +$PAR +$BBOLD Paso 2:$EBOLD Aplicar la operación del Paso 1 que elimine \($b\). +\[ +\begin{align*} + $a $vars[$index] + $b &= $c \\[0.2cm] + $a $vars[$index] + $b +$inv_add_b &= $c + $inv_add_b\\[0.2cm] + $a $vars[$index] &= $c_menos_b +\end{align*} +\] +$PAR +$BBOLD Paso 3:$EBOLD Aplicar la operación indicada en el Paso 1 que elimine \($a\) y simplificar fracciones a su mínima expresión de ser necesario. +\[ +\begin{align*} + \frac{$a $vars[$index]}{$a} &= \frac{$c_menos_b}{$a}\\[0.2cm] + $vars[$index] & = $answer +\end{align*} +\] +$PAR +Por lo tanto la solución es \($vars[$index] = \{$answer->TeX\} \) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales/resolver_ecuaciones_lineales_una_variable_con_fracciones.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales/resolver_ecuaciones_lineales_una_variable_con_fracciones.pg new file mode 100644 index 0000000000..18a8982afb --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales/resolver_ecuaciones_lineales_una_variable_con_fracciones.pg @@ -0,0 +1,109 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Solucionar ecuaciones lineales tipo (a/b)x + p/q = c o similares. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_lineales/resolver_ecuaciones_lineales_una_variable_con_fracciones.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones) +## DBsection(Lineales) +## Level(1) +## KEYWORDS('ecuaciones','lineales') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +Context("Fraction"); + +#Creando la expresion ax + b = e, usando variables aleatorias +$p = non_zero_random(-9,9); +$q = non_zero_random(-9,9); + +$a = Fraction($p,$q); +$ia = Fraction($q,$p); + +$b = non_zero_random(-25,25); +$c = random(-50,50); + +$c_menos_b = Compute("$c - $b")->reduce(); + +@vars = ('a','b','c','d','e','f','g','h','i','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'); +$index = random(0,24); + +$answer = Fraction($c_menos_b*$q,$p); + +############################################################## +# +# Text +# + +BEGIN_TEXT +Resolver para \($vars[$index]\): +\[ +\{$a->TeX\} $vars[$index] + $b = $c +\] +$PAR +\($vars[$index] =\)\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT + +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Eliminar el término independiente de la izquierda si existe. +\[ +\begin{align*} + \{$a->TeX\} $vars[$index] + $b &= $c \\[0.3cm] + \{$a->TeX\} $vars[$index] &= \{$c_menos_b->TeX\} +\end{align*} +\] +$PAR +$BBOLD Paso 2:$EBOLD Dejar el factor de \($vars[$index]\) igual a 1, multiplicado por el inverso de \(\{$a->TeX\}\) +\[ +\{$ia->TeX\} \cdot\{$a->TeX\} $vars[$index] = \{$ia->TeX\} \cdot \{$c_menos_b->TeX\} +\] +$PAR +$BBOLD Paso 3:$EBOLD Simplificar fracciones a su mínima expresión de ser necesario +\[ +$vars[$index] = \{$answer->TeX\} +\] $PAR +Por lo tanto la solución es \($vars[$index] = \{$answer->TeX\} \) +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales/resolver_ecuaciones_lineales_una_variable_sin_fracciones.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales/resolver_ecuaciones_lineales_una_variable_sin_fracciones.pg new file mode 100644 index 0000000000..61e6906e40 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales/resolver_ecuaciones_lineales_una_variable_sin_fracciones.pg @@ -0,0 +1,137 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Solucionar ecuaciones lineales tipo: a(bx+c) + d + e(fx+g) + h = i +# o del tipo a(bx+c) + d = i + e(fx+g) + h + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/ecuaciones_lineales/resolver_ecuaciones_lineales_una_variable_sin_fracciones.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones) +## DBsection(Lineales) +## Level(1) +## KEYWORDS('ecuaciones','lineales') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl", +"parserImplicitEquation.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Creando la expresion a(bx+c) + d + e(fx+g) + h = i, +# ó, a(bx+c) + d = i + e(fx+g) + h con igual probabilidad para cada una + +$prob = random(0,1); + +#Creando el bloque de términos 1 +$a = non_zero_random(-9,-9); +$b = non_zero_random(-9,9); +$c = random(-15,15); +$d = non_zero_random(-20,20); + +#Creando el bloque de términos 2 +do { + $e = list_random(0, 0, 0, 0, 0, 0, 1, -1, 2, -2, 3, -3); + $f = non_zero_random(-9,9); +} until ( ($a*$b != $e*$f) && ($a*$b != -$e*$f)); +$g = random(-15,15); +$h = non_zero_random(-20,20); + +$i = random(-3,3); + +#la variable será aleatoria +@vars = ('a','b','c','d','e','f','g','h','i','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'); +$index = random(0,24); + +Context("ImplicitEquation"); +Context()->variables->add($vars[$index] =>'Real'); + +#Creando las partes +$exp1 = Formula("$a*($b $vars[$index] + $c) + $d"); +$exp2 = Formula("$e*($f $vars[$index] + $g) + $h"); +#$exp1 = Formula("$a $vars[$index] + $b"); +#$exp2 = Formula("$c $vars[$index] + $d"); + +if ($prob == 0){ + $eq = ImplicitEquation("$vars[$index] - 1 = 0"); +}else{ + $eq = ImplicitEquation("$vars[$index] + 3 = 0"); +} + +$answer = $eq; + +############################################################## +# +# Text +# +Context()->texStrings; +BEGIN_TEXT +Resolver para \($vars[$index]\): +$PAR +----> $BBOLD Haciendos pruebas, no funciona todavía$EBOLD +$PAR +\[ + $a($b $vars[$index] + $c) + $d + $e($f $vars[$index] + $g) + $h = $i +\] +or +\[ + $a($b $vars[$index] + $c) + $d = $i + $e($f $vars[$index] + $g) + $h +\] +Como se debe usar con ImplicitEquation: +\[ +$eq +\] +$PAR +\($vars[$index] =\)\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD +$PAR +$BBOLD Paso 2:$EBOLD +$PAR +$BBOLD Paso 3:$EBOLD +$PAR +Por lo tanto la solución es \($vars[$index] = \{$answer->TeX\} \) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/formula_para_relaciones_lineales.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/formula_para_relaciones_lineales.pg new file mode 100644 index 0000000000..a72c158f1f --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/formula_para_relaciones_lineales.pg @@ -0,0 +1,99 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que pregunta por la ecuacion de una recta +# dado algunos puntos sobre ella. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/formula_para_relaciones_lineales.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Forma y=mx+b) +## Level(1) +## KEYWORDS('lineal','pendiente') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + + +Context("Numeric"); + +$m = random(-3,3,1); +$b = random(-9,9,1); +$answer = Formula("$m x + $b")->reduce; + +@x = (); +@y = (); +foreach my $i (0..2) { + $x[$i] = random(-9+$i*6,-9+($i+1)*6,1); + $y[$i] = $answer->eval( x=>$x[$i]); +} + +Context()->texStrings; +BEGIN_TEXT +Dada la siguiente tabla de valores +$PAR +\[ \begin{array}{|c|c|c|c|c|c|} +\hline +x = & $x[0] & $x[1] & $x[2] \\ \hline +y = & $y[0] & $y[1] & $y[2] \\ \hline +\end{array}\] +$PAR +encuentre la ecuación de la línea recta en la forma \(y = mx+b\) que corresponde a los valores anteriores. +$BR +$BR +\(y = \) \{ans_rule(10)\} +\{ AnswerFormatHelp("formula") \} +END_TEXT +Context()->normalStrings; + +ANS( $answer->cmp()); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Debemos encontrar la ecuación de la línea recta en la forma \(y=mx+b\), donde \(m\) es la pendiente y \(b\) es el punto de corte de la línea recta con el eje \(y\). +$PAR +$BBOLD Paso 1$EBOLD: Calcular el valor de la pendiente. Dados dos puntos \((x_1,y_1)\) y \((x_2,y_2)\) tenemos que +\[ +m = \frac{y_2-y_1}{x_2-x_1}. +\] +Tenemos tres puntos \( ($x[0],$y[0]), ($x[1],$y[1])\) y \(($x[2],$y[2])\). Sin pérdida de generalidad, seleccionamos \( ($x[0],$y[0]) \) y \( ($x[1],$y[1]) \). +\[ +m = \frac{$y[1]-$y[0]}{$x[1]-$x[0]}=$m. +\] +Entonces la pendiente \(m = $m\). +$PAR +$BBOLD Paso 2$EBOLD: Encontrar el valor de \(b\). Utilizamos la fórmula \(y=mx+b\), la pendiente \(m=$m\) y un punto \((x_0,y_0)\) que pase por la recta. Sin pérdida de generalidad, se utiliza el punto \(($x[2],$y[2])\). Entonces +\begin{align*} +$y[2] &= $m\cdot $x[2] + b \\ + b&= $b +\end{align*} +La solución es \(y = ($m) x + ($b) = $answer\). +END_SOLUTION + +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/grafica_relacion_lineal_A.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/grafica_relacion_lineal_A.pg new file mode 100644 index 0000000000..85aad1c019 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/grafica_relacion_lineal_A.pg @@ -0,0 +1,138 @@ +# DESCRIPTION +# +# Tipo: seleccion multiple +# Problema que pregunta a los estudiantes +# elegir la gráfica de una recta dada entre 4 opciones +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/grafica_relacion_lineal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Forma y=mx+b) +## Level(1) +## KEYWORDS('grafica', 'lineal','interceptos','pendiente') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"PGchoicemacros.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"unionTables.pl", +"parserPopUp.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + + +$m = random(-3,3,1); +$b = random(-9,9,1); + +$f[0] = "$m*x + $b for x in <-10,10> using color:red and weight:2"; +$gr[0] = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],ticks=>[20,20]); +#$gr[0]->lb('reset'); +#$gr[0]->lb(new Label(9.5,0.4,'x','black','center','middle')); +#$gr[0]->lb(new Label(0.4,9.5,'y','black','center','middle')); + +$f[1] = "$m*x - $b for x in <-10,10> using color:red and weight:2"; +$gr[1] = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],ticks=>[20,20]); +#$gr[1]->lb('reset'); +#$gr[1]->lb(new Label(9.5,0.4,'x','black','center','middle')); +#$gr[1]->lb(new Label(0.4,9.5,'y','black','center','middle')); + +$f[2] = "- $m*x + $b for x in <-10,10> using color:red and weight:2"; +$gr[2] = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],ticks=>[20,20]); +#$gr[2]->lb('reset'); +#$gr[2]->lb(new Label(9.5,0.4,'x','black','center','middle')); +#$gr[2]->lb(new Label(0.4,9.5,'y','black','center','middle')); + +$f[3] = "- $m*x - $b for x in <-10,10> using color:red and weight:2"; +$gr[3] = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],ticks=>[20,20]); +#$gr[3]->lb('reset'); +#$gr[3]->lb(new Label(9.5,0.4,'x','black','center','middle')); +#$gr[3]->lb(new Label(0.4,9.5,'y','black','center','middle')); + +for $i (0..3) { + plot_functions( $gr[$i], $f[$i]); + $fig[$i]=image( insertGraph($gr[$i]),width=>200,height=>200,tex_size=>450 ); +} + +@eqn =( "$m x + $b", "$m x - $b", + "- $m x + $b", "- $m x - $b" ); #Arreglo de posibles rectas a preguntar + +$k = random(0,3,1); #Indice aleatorio de la recta a preguntar + +@perm = shuffle(4); +@fig = @fig[@perm]; #Barajando las figuras a dibujar +@inv = invert(@perm); #Recuperando el arreglo original para hacer un pareo con la contestación del arreglo @letter + +@letter = ("A", "B", "C", "D"); + +$popup = PopUp(["?","A","B","C","D"], $letter[$inv[$k]]); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +# Ecuación elegida e intercepto para ser usado en la solución. +$ry = Formula($eqn[$k])->reduce; #ry significa real y a ser usado +$rb = $ry->eval(x=>0); #rb significa el real intercepto extraído al evaluar por x=0 en ry. + +Context()->texStrings; +BEGIN_TEXT +¿Cuál de las gráficas (A-D) corresponde a la recta \(y=$ry\)? +$BR +$BR +\{ $popup->menu() \} +$BR +$BR +$BCENTER +\{ + BeginTable(). + AlignedRow([$fig[0],$fig[1]]). + TableSpace(5,0). + AlignedRow(["A","B"]). + TableSpace(25,6). + AlignedRow([$fig[2],$fig[3]]). + TableSpace(5,0). + AlignedRow(["C","D"]). +EndTable(); +\} +$BR +(Click en la gráfica para agrandar) +$ECENTER +END_TEXT +Context()->normalStrings; + +install_problem_grader(~~&std_problem_grader); +$showPartialCorrectAnswers = 0; + +ANS( $popup->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1$EBOLD: Identificar el valor de la pendiente \((m)\) y del intercepto en el eje vertical \((b)\): observables en la ecuación dada \( y = $ry\), pues \(y = mx+b\). +$PAR +$BBOLD Paso 2$EBOLD: Encontrar una gráfica consistente con la información anterior: la única gráfica que interseca al eje \(y\) en \((0,$rb)\) tal que el valor de \(y\) se incrementa en \($m\) cada vez que \(x\) se incrementa en 1 es $letter[$inv[$k]]. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/grafica_relacion_lineal_B.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/grafica_relacion_lineal_B.pg new file mode 100644 index 0000000000..8c7e3b1093 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/grafica_relacion_lineal_B.pg @@ -0,0 +1,92 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que pregunta a los estudiantes +# por la ecuacion de una recta dada su grafica. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/grafica_relacion_lineal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Forma y=mx+b) +## Level(1) +## KEYWORDS('grafica', 'lineal','interceptos','pendiente') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$m = random(-3,3,1); +$b = random(-9,9,1); +$y = Formula("$m x + $b")->reduce; + +# Dos puntos para encontrar la pendiente usado en la explicación +$x1 = 0; +$x2 = non_zero_random(-3,3,1); +$yx1 = $y->eval(x=>$x1); +$yx2 = $y->eval(x=>$x2); + +$gr = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],size=>[450,450]); + +add_functions($gr, "$y for x in <-10,10> using color:blue and weight:2"); + +BEGIN_TEXT +La fórmula para la relación lineal mostrada en la gráfica +$BR +$BR +$BCENTER +\{ image(insertGraph($gr),width=>200,height=>200,tex_size=>450 ) \} +$BR +$BR +(Click en la gráfica para agrandar) +$ECENTER +es: \( y = \) \{ans_rule(30)\} +\{ AnswerFormatHelp("formulas") \} +END_TEXT + + +ANS( $y->cmp()); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1$EBOLD: Encontrar la pendiente \(m\): usamos dos puntos cualesquiera de la recta, por ejemplo \(($x1,$yx1)\) y \(($x2,$yx2)\). Luego la pendiente es \(m=\frac{y_2-y_1}{x_2-x_1} = \frac{$yx2-$yx1}{$x2-$x1}=$m\). +$PAR +$BBOLD Paso 2$EBOLD: Encontrar el intercepto: el punto \((0,$b)\) está en la gráfica, por lo tanto sabemos que el intercepto con el eje \(y\) es \(b=$b\). +$PAR +$BBOLD Paso 3$EBOLD: Encontrar la ecuación: sustituyendo en \(y=mx+b\) obtenemos la solución \(y = $y\). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_A.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_A.pg new file mode 100644 index 0000000000..3feac36949 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_A.pg @@ -0,0 +1,98 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema en contexto que pide calcular una de las variables +# en m=dy/dx. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Problemas verbales) +## Level(1) +## KEYWORDS('lineal','pendiente','cambios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); +@directionX = ("positiva","negativa"); +@directionY = ("ascendemos","descendemos"); + +$indexDirectionX = random(0,1,1); +$indexDirectionY = random(0,1,1); + +$dx = random(1,9,1); +$dy = random(1,36,1); + +Context("Fraction"); +if ( ($indexDirectionX == 0 && $indexDirectionY == 0) || ($indexDirectionX == 1 && $indexDirectionY == 1) ){ + $answer = Compute("$dy/$dx"); + $rdx = $dx; + $rdy = $dy; +}else{ + $answer = Compute("- $dy/$dx"); + if ($indexDirectionX == 1){ + $rdx = - $dx; + $rdy = $dy; + }else{ + $rdy = - $dy; + $rdx = $dx; + } +} + +Context()->texStrings; +BEGIN_TEXT +Si caminamos $dx pies en la dirección $directionX[$indexDirectionX] del eje \(x\) a partir de una recta \(l\) y $directionY[$indexDirectionY] $dy pies en dirección del eje \(y\) hasta la misma recta, encuentre la pendiente de la recta \(l\). Digite su respuesta en forma reducida. +$BR +$BR +\( m = \) \{ ans_rule(20) \} +\{ AnswerFormatHelp("numbers") \} +END_TEXT + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1$EBOLD: Aplicar definición de pendiente: Si \(m\) es la pendiente, sabemos que: +\[ + m=\frac{\mbox{cambio en } y}{\mbox{cambio en } x}. +\] +Como caminamos $dx pies en la dirección $BBOLD $directionX[$indexDirectionX]$EBOLD de \(x\), entonces $BITALIC cambio en \(x=$rdx\)$EITALIC. +$PAR +$BBOLD Paso 2$EBOLD: Como $BBOLD $directionY[$indexDirectionY]$EBOLD $dy pies, entonces $BITALIC cambio en \(y= $rdy\)$EITALIC. Por consiguiente +\[ + m = $answer. +\] +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_B.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_B.pg new file mode 100644 index 0000000000..9803e71109 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_B.pg @@ -0,0 +1,94 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema en contexto que pide calcular una de las variables +# en m=dx/dy. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Problemas verbales) +## Level(1) +## KEYWORDS('lineal','pendiente','cambios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +@directionX = ("positiva","negativa"); +$indexDirectionX = random(0,1,1); + +$dx = random(1,9,1); +$m = random(-8,8,1); + +if ( $indexDirectionX == 1 ){ + $answer = $m* (- $dx); +}else{ + $answer = $m*$dx; +} + +$rdx = $answer/$m; +$answer = Compute("$answer"); + +Context()->texStrings; +BEGIN_TEXT +Si caminamos $dx pies en la dirección $directionX[$indexDirectionX] del eje \(x\) a partir de una recta \(l\) con pendiente $m, ¿qué distancia en pies nos movimos verticalmente para llegar de nuevo a la recta (+ es hacia arriba, - es hacia abajo)? +$BR +$BR +\( \Delta y = \) \{ ans_rule(20) \} +\{ AnswerFormatHelp("numbers") \} +END_TEXT +Context()->normalStrings; + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1$EBOLD: Aplicar definición de pendiente: Si \(m\) es la pendiente, sabemos que: +\[ + m=\frac{\mbox{cambio en } y}{\mbox{cambio en } x}. +\] +Sea \(n\) los pies que nos movemos verticalmente, entonces $BITALIC cambio en \(y=n\)$EITALIC. +$PAR +$BBOLD Paso 2$EBOLD: Como caminamos $dx pies en la dirección $directionX[$indexDirectionX] de \(x\), entonces $BITALIC cambio en \(x=$rdx\)$EITALIC. La pendiente \(m\) es $m. Entonces +\[ +\begin{align*} + $m &= \frac{n}{$rdx} \\[.3cm] + $rdx\times $m &= $rdx\times \frac{n}{$rdx} \\[.3cm] + $answer & = n +\end{align*} +\] +Por tanto, nos movemos $answer pies verticalmente. +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_C.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_C.pg new file mode 100644 index 0000000000..022492d0a9 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_C.pg @@ -0,0 +1,99 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema en contexto que pide calcular una de las variables +# en m=dx/dy. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Problemas verbales) +## Level(1) +## KEYWORDS('lineal','pendiente','cambios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +@directionY = ("subimos","bajamos"); +$indexDirectionY = random(0,1,1); + +#$m = random(-8,8,1); +$m = non_zero_random(-8,8,1); #cambiado a no cero pues se tendría que cambiar muchas cosas. +$dy = random(1,20,1); + +Context("Fraction"); + +if ( $indexDirectionY == 1 ){ + $answer = Compute("- $dy/$m"); + }else{ + $answer = Compute("$dy/$m"); +} + +$rdy = $answer*$m; + +Context()->texStrings; +BEGIN_TEXT +Si caminamos sobre el eje \(x\) a partir de una recta \(l\) con pendiente $m y $directionY[$indexDirectionY] $dy pies verticalmente, ¿qué distancia en pies nos movimos en la dirección del eje \(x\) para llegar de nuevo a la recta (+ es hacia la derecha, - es hacia la izquierda)? +$BR +$BR +\( \Delta x = \) \{ ans_rule(20) \} +\{ AnswerFormatHelp("numbers") \} +END_TEXT +Context()->normalStrings; + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1$EBOLD: Aplicar definición de pendiente: Si \(m\) es la pendiente, sabemos que: +\[ + m=\frac{\mbox{cambio en } y}{\mbox{cambio en } x}. +\] +Sea \(n\) los pies que nos movemos en la dirección de \(x\), entonces $BITALIC cambio en \(x=n\)$EITALIC. +$PAR +$BBOLD Paso 2$EBOLD: Como $directionY[$indexDirectionY] $dy pies, entonces $BITALIC cambio en \(y=$rdy\)$EITALIC. La pendiente \(m\) es $m. Entonces +\[ +\begin{align*} + $m &= \frac{$rdy}{n} \\[0.3cm] + n\times $m &= n\times \frac{$rdy}{n} \\[0.3cm] + $m n &= $rdy \\[0.3cm] + \frac{$m n}{$m} &= \frac{$rdy}{$m} \\[0.3cm] + n &= $answer +\end{align*} +\] +Por tanto, nos movemos \($answer\) pies en la dirección de \(x\). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_D.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_D.pg new file mode 100644 index 0000000000..0e46064aab --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente_D.pg @@ -0,0 +1,98 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que pregunta a los estudiantes +# por la pendiente de una recta dada su grafica. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/razon_de_cambio_y_pendiente.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Forma y=mx+b) +## Level(1) +## KEYWORDS('grafica', 'lineal','pendiente') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +$m = random(-3,3,1); +$b = random(-9,9,1); +$equaLineal = Formula("$m x + $b"); +$answer = Compute("$m"); + +@x = (); +@y = (); +$x[0] = random(-3,0,1); +$x[1] = random(1,3,1); +$y[0] = $equaLineal->eval( x=>$x[0]); +$y[1] = $equaLineal->eval( x=>$x[1]); + +$gr = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[20,20],size=>[450,450]); + +add_functions($gr, "$equaLineal for x in <-10,10> using color:blue and weight:2"); + +Context("Fraction"); +BEGIN_TEXT +¿Cuál es la pendiente de la recta que se muestra en la gráfica? +$BR +$BR +$BCENTER +\{ image(insertGraph($gr),width=>200,height=>200,tex_size=>450 ) \} +$BR +$BR +(Click en la gráfica para agrandar) +$ECENTER +\( m = \) \{ans_rule(10)\} +\{ AnswerFormatHelp("number") \} +END_TEXT + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1$EBOLD: Seleccionar dos puntos de la recta. Dos puntos que pasan a través de la recta en la gráfica de arriba son \(($x[0],$y[0])\) y \(($x[1],$y[1])\). +$PAR +$BBOLD Paso 2$EBOLD: Calcular el valor de la pendiente. Dado dos puntos +\[ +m = \frac{y_2-y_1}{x_2-x_1} +\] +Utilizamos los puntos \(($x[0],$y[0])\) y \(($x[1],$y[1])\), +\[ +m = \frac{$y[1]-$y[0]}{$x[1]-$x[0]}, +\] +por lo tanto la pendiente \(m=$answer\). +END_SOLUTION + +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_A.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_A.pg new file mode 100644 index 0000000000..13b930b874 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_A.pg @@ -0,0 +1,102 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que pregunta si una situacion real +# satisface una relacion lineal +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('lineal','aplicaciones','relacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGML.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + + +Context("Numeric"); + +@nombre = ("Juan","Cidmary","Ramon","Ashley","Daniel","Glorimar","Jason","Nilsa","Jesus","Karen"); +@banco = ("Banco Popular", "Banco Santander", "Scotiabank", "FirstBank", "CitiBank"); + +$randIndexNombre = random(0,9); +$randIndexBanco = random(0,4); + +$depositoInicial = random(5,15,1); +$tasaInteresMensual = random(.02,0.3,0.1); +$meses = random(2,7,1); +$interes = $tasaInteresMensual*$depositoInicial; +$relacion = Formula("$depositoInicial + $interes*x"); +$answer = $relacion->eval(x=>$meses); + +Context()->texStrings; +BEGIN_TEXT +$nombre[$randIndexNombre] inicia una cuenta en el $banco[$randIndexBanco] con $depositoInicial dólares y gana $interes dólares mensuales de intereses. Encuentre la cantidad de dinero en la cuenta que tendrá $nombre[$randIndexNombre] al transcurrir $meses meses. ($BBOLD NO escribir el símbolo de dólares $ $EBOLD) +$PAR +Respuesta: \{ans_rule(20)\} +END_TEXT +Context()->normalStrings; + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$PAR +$BBOLD Paso 1: $EBOLD Entender el problema. +$PAR +\(\phantom{eee}\) i. \(x =\) los meses del dinero trabajado en el banco, \(y =\) los dólares en la cuenta. +$PAR +\(\phantom{eee}\) ii. $nombre[$randIndexNombre] inicia con $depositoInicial dólares, es decir \(x=0\) y \(y=$depositoInicial\). +$PAR +\(\phantom{eee}\) iii. Cuando \(x\) aumenta en 1, \(y\) aumenta en $interes. +$PAR +$BBOLD Paso 2: $EBOLD Realizar una tabla. +$PAR +$BR +$BR +$BCENTER +\{ +begintable(9) . +row( " \(x = \) meses trabajados", 0,1,2,3,4,5,6,7 ) . +row( " \(y = \) dólares en la cuenta", $relacion->eval(x=>0),$relacion->eval(x=>1),$relacion->eval(x=>2),$relacion->eval(x=>3),$relacion->eval(x=>4),$relacion->eval(x=>5),$relacion->eval(x=>6),$relacion->eval(x=>7) ) . +endtable(); +\} +$ECENTER +$BR +$BR +Por lo tanto la cantidad de dinero en el banco al transcurrir $meses meses es $answer dólares. +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_B.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_B.pg new file mode 100644 index 0000000000..61f5b1d328 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_B.pg @@ -0,0 +1,81 @@ +# DESCRIPTION +# +# Tipo: falso/cierto +# Problema que pregunta si una situacion real +# satisface una relacion lineal +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('lineal','aplicaciones','relacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +$k = random(20,40); +$y = Formula("$k x"); +$randHoras = random(1,5); +$yrH = $y->eval(x=>$randHoras); + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("Si \(x\) representa las horas que hemos trabajado y \(y\) representa el dinero que hemos ganado y ganamos $yrH dólares por $randHoras hora(s), entonces la relación entre \(x\) y \(y\) es lineal.", "C"); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + + +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT + +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +Analizar el problema: +$PAR +$BBOLD i. $EBOLD \(x = \) horas trabajadas, \(y = \) dinero ganado. +$PAR +$BBOLD ii. $EBOLD Cuando \(x\) aumenta en $randHoras, \(y\) aumenta en $yrH, es decir, \(y\) es proporcional a \(x\) con pendiente o constante de proporcionalidad igual a $k. +$PAR +Como la relación entre horas trabajadas y dinero ganado es de proporcionalidad directa con constante de proporcionalidad o pendiente igual a $k, entonces la relación entre \(x\) y \(y\) $BBOLD es lineal$EBOLD, con ordenada al origen 0. Por tanto, la proposición es $BBOLD cierta$EBOLD. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_C.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_C.pg new file mode 100644 index 0000000000..180e101433 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_C.pg @@ -0,0 +1,81 @@ +# DESCRIPTION +# +# Tipo: falso/cierto +# Problema que pregunta si una situacion real +# satisface una relacion lineal +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('lineal','aplicaciones','relacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +$k = random(50,100); +$y = Formula("$k x"); +$randHoras = random(1,5); +$yrH = $y->eval(x=>$randHoras); + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("Si \(x\) representa las horas que hemos conducido y \(y\) representa la distancia que hemos recorrido y viajamos a una velocidad constante de $yrH kilómetros cada $randHoras hora(s), entonces la relación entre \(x\) y \(y\) es lineal.", "C"); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + + +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT + +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +Analizar el problema: +$PAR +$BBOLD i. $EBOLD \(x = \) horas conducidas, \(y = \) distancia recorrida. +$PAR +$BBOLD ii. $EBOLD Cuando \(x\) aumenta en $randHoras, \(y\) aumenta en $yrH, es decir, \(y\) es proporcional a \(x\) con pendiente o constante de proporcionalidad igual a $k. +$PAR +Como la relación entre horas conducidas y distancia recorrida es de proporcionalidad directa con constante de proporcionalidad o pendiente igual a $k, entonces la relación entre \(x\) y \(y\) $BBOLD es lineal$EBOLD, con ordenada al origen 0. Por tanto, la proposición es $BBOLD cierta$EBOLD. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_D.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_D.pg new file mode 100644 index 0000000000..1a79a3a57f --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_D.pg @@ -0,0 +1,81 @@ +# DESCRIPTION +# +# Tipo: falso/cierto +# Problema que pregunta si una situacion real +# satisface una relacion lineal +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('lineal','aplicaciones','relacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +$k = random(5,50,1); +$y = Formula("$k x"); +$randDolares = random(50,200); +$yrD = $y->eval(x=>$randDolares); + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("Si \(x\) representa los dólares que podemos gastar y \(y\) representa el número de bananas que podemos comprar y $yrD bananas cuestan $randDolares dólares, entonces la relación entre \(x\) y \(y\) es lineal.", "C"); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + + +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT + +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +Analizar el problema: +$PAR +$BBOLD i. $EBOLD \(x = \) dólares gastados, \(y = \) bananas compradas. +$PAR +$BBOLD ii. $EBOLD Cuando \(x\) aumenta en $randDolares, \(y\) aumenta en $yrD, es decir, \(y\) es proporcional a \(x\) con pendiente o constante de proporcionalidad igual a $k. +$PAR +Como la relación entre dólares gastados y bananas compradas es de proporcionalidad directa con constante de proporcionalidad o pendiente igual a $k, entonces la relación entre \(x\) y \(y\) $BBOLD es lineal$EBOLD, con ordenada al origen 0. Por tanto, la proposición es $BBOLD cierta$EBOLD. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_E.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_E.pg new file mode 100644 index 0000000000..33286ef589 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_E.pg @@ -0,0 +1,81 @@ +# DESCRIPTION +# +# Tipo: falso/cierto +# Problema que pregunta si una situacion real +# satisface una relacion lineal +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('lineal','aplicaciones','relacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +$k = random(40,80,1); +$y = Formula("$k x"); +$randTrabajadores = random(2,40); +$yrT = $y->eval(x=>$randTrabajadores); + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("Si \(x\) representa el número de trabajadores que contratamos y \(y\) representa el dinero gastado en salarios cada día y $randTrabajadores trabajadores cobran $yrT dólares por día, entonces la relación entre \(x\) y \(y\) es lineal.", "C"); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + + +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT + +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +Analizar el problema: +$PAR +$BBOLD i. $EBOLD \(x = \) trabajadores contratados, \(y = \) salario de trabajadores por día. +$PAR +$BBOLD ii. $EBOLD Cuando \(x\) aumenta en $randTrabajadores, \(y\) aumenta en $yrT, es decir, \(y\) es proporcional a \(x\) con pendiente o constante de proporcionalidad igual a $k. +$PAR +Como la relación de trabajadores contratados y el salario diario de trabajadores es de proporcionalidad directa con constante de proporcionalidad o pendiente igual a $k, entonces la relación entre \(x\) y \(y\) $BBOLD es lineal$EBOLD, con ordenada al origen 0. Por tanto, la proposición es $BBOLD cierta$EBOLD. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_F.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_F.pg new file mode 100644 index 0000000000..f44f843560 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_F.pg @@ -0,0 +1,82 @@ +# DESCRIPTION +# +# Tipo: falso/cierto +# Problema que pregunta si una situacion real +# satisface una relacion lineal +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('lineal','aplicaciones','relacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +$k = random(20,40); +$y = Formula("$k x"); +$randGalons = random(1,5); +$yrG = $y->eval(x=>$randGalons); + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("Si \(y\) representa los kilómetros que hemos conducido y \(x\) representa la gasolina que se ha quemado y quemamos $randGalons galón(es) de gasolina cada $yrG kilómetros, entonces la relación entre \(x\) y \(y\) es lineal.", "C"); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + + +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT + +## Provide the answer string +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +Analizar el problema: +$PAR +$BBOLD i. $EBOLD \(y =\) kilómetros conducidos, \(x =\) gasolina gastada. +$PAR +$BBOLD ii. $EBOLD Cuando \(x\) aumenta en $randGalons, \(y\) aumenta en $yrG, es decir, \(y\) es proporcional a \(x\) con pendiente o constante de proporcionalidad igual a $k. + +$PAR +Como la relación de kilómetros conducidos y gasolina gastada es de proporcionalidad directa con constante de proporcionalidad o pendiente igual a $k, entonces la relación entre \(x\) y \(y\) $BBOLD es lineal$EBOLD, con ordenada al origen 0. Por tanto, la proposición es $BBOLD cierta $EBOLD. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_G.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_G.pg new file mode 100644 index 0000000000..6e5d3c336c --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal_G.pg @@ -0,0 +1,100 @@ +# DESCRIPTION +# +# Tipo: falso/cierto +# Problema que pregunta si una situacion real +# satisface una relacion lineal, siempre es falso. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/relacion_lineal.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('lineal','aplicaciones','relacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +#Eligiendo dos formulas para relaciones lineales diferentes +$k1 = random(10,20); +$k2 = random(21,40); +$y1 = Formula("$k1 x"); +$y2 = Formula("$k2 x"); +$randX1 = random(1,5); +$randX2 = random(6,12); +$yRandX1 = $y1->eval(x=>$randX1); +$yRandX2 = $y2->eval(x=>$randX2); + +@representaX = ("las horas que hemos conducido", "las horas que hemos trabajado", "los dólares que nosotros podemos gastar", "el número de trabajadores que contratamos", "los kilómetros que hemos conducido"); + +@representaY = ("la distancia que hemos recorrido", "el dinero que hemos ganado", "el número de bananas que nosotros podemos comprar", "el dinero gastado en salarios cada día", "la gasolina que se ha gastado"); + +@dosRelacionesXyY = ("al principio viajamos a $yRandX1 kilómetros por cada $randX1 hora(s) pero una hora después se redujo nuestra velocidad en $yRandX1 kilómetros por cada $randX2 horas","ganamos $yRandX1 dólares por cada $randX1 hora(s) en las primeras ocho horas y luego ganamos $yRandX2 dólares por cada $randX2 horas","las primeras $yRandX1 bananas cuestan $randX1 dólares y después de que cuesten a $randX2 dólares, cuentan $yRandX2 bananas","el salario de cada trabajador es $yRandX1 dólares por cada $randX1 día(s) para los primeros diez días y luego los costos $yRandX2 dólares por cada $randX2 día(s)","inicialmente gastamos $yRandX1 galón(es) de gasolina cada $randX1 millas pero después de 100 millas entonces se quema $yRandX2 galones de gasolina cada $randX2 millas"); + +@solRepresentaX = ("horas conducidas","horas trabajadas","dólares gastados","trabajadores contratados","kilómetros conducidos"); + +@solRepresentaY = ("distancia recorrida","dinero ganado","bananas compradas","dinero de salario diario","gasolina gastada"); + +$index = random(0,4,1); + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("Si \(x\) representa $representaX[$index] y \(y\) representa $representaY[$index] y $dosRelacionesXyY[$index], entonces la relación entre \(x\) y \(y\) es lineal.", "C"); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + + +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT + +## Provide the answer string +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +Analizar el problema: +$PAR +$BBOLD i. $EBOLD \(y =\) $solRepresentaY[$index], \(x =\) $solRepresentaX[$index]. +$PAR +$BBOLD ii. $EBOLD \(x\) menor a $randX2: cuando \(x\) aumenta en $randX1, \(y\) aumenta en $yRandX1, es decir, la pendiente es $k1. +$PAR +$BBOLD iii. $EBOLD \(x\) es mayor a $randX2: cuando \(x\) aumenta en $randX2, \(y\) aumenta en $yRandX2, es decir, tiene pendiente $k2. +$PAR +Como la relación de $representaX[$index] y $representaY[$index] es de proporcionalidad directa con constantes de proporcionalidad o pendientes diferentes \(m_1 = \) $k1 y \(m_2 =\)$k2, entonces la relación entre \(x\) y \(y\) $BBOLD no es lineal$EBOLD, con ordenada al origen 0. Por tanto, la proposición es $BBOLD falsa $EBOLD. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_paralelas_A.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_paralelas_A.pg new file mode 100644 index 0000000000..d671c06d80 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_paralelas_A.pg @@ -0,0 +1,133 @@ +# DESCRIPTION +# +# Tipo: falso/cierto +# Dada dos recta decir si son paralelas o no. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_paralelas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Rectas) +## DBsection(Paralelas) +## Level(1) +## KEYWORDS('rectas','paralelas') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +# coeficientes de la primera recta a1x + b1y = c1 +$a1 = non_zero_random(-9,9); +$b1 = non_zero_random(-9,9); +$c1 = non_zero_random(-9,9); + +#Dandole "igual" probabilidad usando la otra recta a2x + b2y = c2 +$prob = random(0,1); + +if ($prob == 0){ + $a2 = non_zero_random(-9,9); + $b2 = non_zero_random(-9,9); +}else{ + $mult = non_zero_random(-4,4); + $a2 = $mult*$a1; + $b2 = $mult*$b1; +} +$c2 = non_zero_random(-9,9); + +Context()->variables->add(y => 'Real'); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$eq1 = Formula("$a1 x + $b1 y")->reduce(); +$eq2 = Formula("$a2 x + $b2 y")->reduce(); + +Context("Fraction"); + +$m1 = Fraction(-$a1,$b1)->reduce(); +$m2 = Fraction(-$a2,$b2)->reduce(); + +$b1 = Fraction($c1,$b1)->reduce(); +$b2 = Fraction($c2,$b2)->reduce(); + +if ($m1 == $m2){ + $answer = "C"; + $simbolo = "="; +}else{ + $answer = "F"; + $simbolo = "\ne"; +} + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("Las rectas anteriores son paralelas.", $answer); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + +TEXT(beginproblem()); + +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +$PAR +\[ +\begin{align*} +\{$eq1->TeX\} &= $c1 \\[0.2cm] +\{$eq2->TeX\} &= $c2 +\end{align*} +\] +\{ $tf_list_ptr -> print_q \} +END_TEXT + +## Provide the answer string +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Dos recta son paralelas si sus pendientes son iguales, es decir si \(m_1 = m_2\). +$PAR +$BBOLD Paso 1:$EBOLD Encontrar las pendientes, representando cada recta en la forma \(y=mx+b\) +\[ +\begin{align*} +\{$eq1->TeX\} = $c1 & \qquad\Rightarrow\qquad y=\{$m1->TeX\} x + \{$b1->TeX\} \\[0.2cm] +\{$eq2->TeX\} = $c2 & \qquad\Rightarrow\qquad y=\{$m2->TeX\} x + \{$b2->TeX\}. +\end{align*} +\] +Como \(m_1 = \{$m1->TeX\} $simbolo \{$m2->TeX\} = m_2\) entonces la proposición es $BBOLD$answer$EBOLD. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_paralelas_B.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_paralelas_B.pg new file mode 100644 index 0000000000..ee0538582b --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_paralelas_B.pg @@ -0,0 +1,113 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que pregunta por laecuaciónn de una recta +# dado un punto y otra recta paralela. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/rectas_paralelas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Rectas paralelas) +## Level(1) +## KEYWORDS('lineal','pendiente','paralelas','rectas') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl", +"parserAssignment.pl" +); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +# coeficientes de la recta paralela dada ax + by = c +$a1 = non_zero_random(-9,9); +$a2 = non_zero_random(-9,9); +$a3 = non_zero_random(-9,9); + +#punto dado +$p = random(-9,9); +$q = random(-9,9); + +Context("Fraction"); +$m = Fraction(-$a1,$a2); +$a3_sobre_a2 = Fraction($a3,$a2); +$b = Compute("$q - $m*$p"); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$answer = Formula("-($a1/$a2) x + ($q+($a1/$a2)*$p)")->reduce(); + +TEXT(beginproblem()); + +Context()->texStrings; +BEGIN_TEXT +Encuentre la ecuación de la recta en la forma \(y=mx+b\) que pasa por el punto \( ($p,$q) \) y es paralela a la recta +\[ +$a1 x + $a2 y = $a3. +\] +$PAR +\(y = \) \{ans_rule(10)\} \{ AnswerFormatHelp("formula") \} +END_TEXT +Context()->normalStrings; + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Dos recta son paralelas si sus pendientes son iguales, es decir si \(m_1 = m_2\). +$PAR +$BBOLD Paso 1:$EBOLD La fórmula de la recta a obtener es \(y=mx+b\). +$PAR +$BBOLD Paso 2:$EBOLD Calcular el valor de la pendiente \(m\). Como \($a1 x + $a2 y = $a3\) es paralela a la recta a encontrar, entonces las pendientes son iguales. Despejando para \(y\) tenemos +\[ + y = $m x + $a3_sobre_a2, +\] +por lo tanto la pendiente es \(m = $m\). +$PAR +$BBOLD Paso 3:$EBOLD Sustituir \(m = $m\) en la ecuación del Paso 1: +\[ +y = $m x + b +\] +$PAR +$BBOLD Paso 4:$EBOLD Calcular el valor del intercepto \(b\). Sustituir \( ($p,$q) \) en la ecuación del Paso 3 y despejar para \(b\) +\[ +\begin{align*} +$q &= $m ($p) + b\\[0.2cm] + b &= $b +\end{align*} +\] +Por lo tanto la ecuación es \(y = $m x + $b\). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_perpendiculares_A.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_perpendiculares_A.pg new file mode 100644 index 0000000000..fa274987b5 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_perpendiculares_A.pg @@ -0,0 +1,134 @@ +# DESCRIPTION +# +# Tipo: falso/cierto +# Dada dos recta decir si son paralelas o no. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_perpendiculares.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Rectas) +## DBsection(Perpendiculares) +## Level(1) +## KEYWORDS('rectas','perpendiculares') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +# coeficientes de la primera recta a1x + b1y = c1 +$a1 = non_zero_random(-9,9); +$b1 = non_zero_random(-9,9); +$c1 = non_zero_random(-9,9); + +#Dandole "igual" probabilidad usando la otra recta a2x + b2y = c2 +$prob = random(0,1); + +if ($prob == 0){ + $a2 = non_zero_random(-9,9); + $b2 = non_zero_random(-9,9); +}else{ + $mult = non_zero_random(-4,4); + $a2 = -$b1; + $b2 = $a1; +} +$c2 = non_zero_random(-9,9); + +Context()->variables->add(y => 'Real'); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$eq1 = Formula("$a1 x + $b1 y")->reduce(); +$eq2 = Formula("$a2 x + $b2 y")->reduce(); + +Context("Fraction"); + +$m1 = Fraction(-$a1,$b1)->reduce(); +$m2 = Fraction(-$a2,$b2)->reduce(); +$m1m2 = Compute($m1*$m2); + +$b1 = Fraction($c1,$b1)->reduce(); +$b2 = Fraction($c2,$b2)->reduce(); + +if ($m1*$m2 == -1){ + $answer = "C"; + $simbolo = "="; +}else{ + $answer = "F"; + $simbolo = "\ne"; +} + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("Las rectas anteriores son perpendiculares.", $answer); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + +TEXT(beginproblem()); + +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +$PAR +\[ +\begin{align*} +\{$eq1->TeX\} &= $c1 \\[0.2cm] +\{$eq2->TeX\} &= $c2 +\end{align*} +\] +\{ $tf_list_ptr -> print_q \} +END_TEXT + +## Provide the answer string +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Dos rectas son perpendiculares si la pendiente de una es la inversa negativa de la otra, es decir que \(m_1 = -\frac{1}{m_2}\) o equivalentemente si \(m_1m_2 = -1\). +$PAR +$BBOLD Paso 1:$EBOLD Encontrar las pendientes, representando cada recta en la forma \(y=mx+b\) +\[ +\begin{align*} +\{$eq1->TeX\} = $c1 & \qquad\Rightarrow\qquad y=\{$m1->TeX\} x + \{$b1->TeX\} \\[0.2cm] +\{$eq2->TeX\} = $c2 & \qquad\Rightarrow\qquad y=\{$m2->TeX\} x + \{$b2->TeX\}. +\end{align*} +\] +Como \(m_1 m_2 = $m1\cdot $m2 = $m1m2 $simbolo -1\) entonces la proposición es $BBOLD$answer$EBOLD. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_perpendiculares_B.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_perpendiculares_B.pg new file mode 100644 index 0000000000..029267b0fd --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_perpendiculares_B.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que pregunta por la ecuaciónn de una recta +# dado un punto y otra recta perpendicular. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_1/rectas_perpendiculares.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Rectas paralelas) +## Level(1) +## KEYWORDS('lineal','pendiente','perpendiculares','recta') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +# coeficientes de la recta perpendicular dada a1x + a2y = a3 +$a1 = non_zero_random(-9,9); +$a2 = non_zero_random(-9,9); +$a3 = non_zero_random(-9,9); + +#punto dado +$p = random(-9,9); +$q = random(-9,9); + +#Definiendo la pendiente e intercepto de la recta a encontrar basado en la recta dada +Context("Fraction"); +$m1 = Fraction(-$a1, $a2); +$m2 = Fraction($a2,$a1); +$b = Compute("$q - $m2*$p")->reduce(); +$a3_sobre_a2 = Fraction($a3,$a2); + +Context("Numeric"); +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y','-(n)'); + +$answer = Formula("$m2 x + $b")->reduce(); + +TEXT(beginproblem()); + +Context()->texStrings; +BEGIN_TEXT +Encuentre la ecuación de la recta en la forma \(y=mx+b\) que pasa por el punto \( ($p,$q) \) y es perpendicular a la recta +\[ +$a1 x + $a2 y = $a3. +\] +$PAR +\(y = \) \{ans_rule(10)\} \{ AnswerFormatHelp("formula") \} +END_TEXT +Context()->normalStrings; + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Dos rectas son perpendiculares si la pendiente de una es la inversa negativa de la otra, es decir que \(m_1 = -\frac{1}{m_2}\) o equivalentemente si \(m_1m_2 = -1\). +$PAR +$BBOLD Paso 1:$EBOLD La fórmula de la recta a obtener es \(y=m_2 x+b\). +$PAR +$BBOLD Paso 2:$EBOLD Calcular el valor de la pendiente \(m_2\). Como \($a1 x + $a2 y = $a3\) es perpendicular a la recta a encontrar, entonces la pendiente de la recta dada (\(m_1\) ) debe satisfacer \(m_1m_2 = -1\). Despejando para \(y\) tenemos +\[ + y = $m1 x + $a3_sobre_a2, +\] +por lo tanto la pendiente es \(m_1 = $m1\). +$PAR +$BBOLD Paso 3:$EBOLD Sustituir \(m_2 = -\frac{1}{m_1} = $m2\) en la ecuación del Paso 1: +\[ +y = $m2 x + b +\] +$PAR +$BBOLD Paso 4:$EBOLD Calcular el valor del intercepto \(b\). Sustituir \( ($p,$q) \) en la ecuación del Paso 3 y despejar para \(b\) +\[ +\begin{align*} +$q &= $m2($p) + b\\[0.2cm] + b &= $b +\end{align*} +\] +Por lo tanto la ecuación es \(y = $m2 x + $b\). +END_SOLUTION + +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_verticales_horizontales.pg b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_verticales_horizontales.pg new file mode 100644 index 0000000000..cd1df10413 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_verticales_horizontales.pg @@ -0,0 +1,101 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que pregunta por la ecuación de una +# recta horizontal o vertical dada su grafica. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_lineales_2_variables_parte_2/rectas_verticales.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Verticales o Horizontales) +## Level(1) +## KEYWORDS('grafica', 'lineal','horizontal','vertical') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"parserAssignment.pl", +"problemRandomize.pl" +); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$refreshCachedImages=1; + +$a = random(-9,9); +$rand = random(0,1); + +Context("Numeric")->variables->add(y=>'Real'); +parser::Assignment->Allow; + +$gr = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],size=>[450,450]); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y','-n'); + +if ($rand == 0){ + $eq = Formula("y = $a"); + $eje1 = "y"; + $eje2 = "x"; + + add_functions($gr, "$a for x in <-10,10> using color:blue and weight:2"); +}else{ + $eq = Formula("x = $a"); + $eje1 = "x"; + $eje2 = "y"; + + #Dibujando la línea vertical + $gr -> moveTo($a,-10); + $gr -> lineTo($a,10,'blue','2'); +} + +TEXT(beginproblem()); + +Context()->texStrings; +BEGIN_TEXT +¿Cuál es la ecuación de la recta que aparece en la siguiente gráfica? +$BR +$BR +$BCENTER +\{ image(insertGraph($gr),width=>200,height=>200,tex_size=>450 ) \} +$BR +$BR +(Click en la gráfica para agrandar) +$ECENTER +Constentación: \{ans_rule(30)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + + +ANS( $eq->cmp()); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +La recta interseca al eje \($eje1\) y es paralela al eje \($eje2\), entonces la ecuación de la recta es \($eje1 = $a\). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_racionales/desde_la_OPL.pg b/Contrib/UPRM/Prebasica/ecuaciones_racionales/desde_la_OPL.pg new file mode 100644 index 0000000000..49161f6a28 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_racionales/desde_la_OPL.pg @@ -0,0 +1,116 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Resolver ecuaciones racionales +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el OPL +# Library/Rochester/setAlgebra08LinearEqns/sw1_6_29.pg +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones racionales) +## DBsection(Denominador monomio) +## Level(1) +## KEYWORDS('ecuaciones','monomios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl", +"parserImplicitEquation.pl" #Para usar cuando la respuesta sea una ecuación +); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +# coeficientes ecuación de tipo a/(x+1) - b/(2) = c/(3x+3) +$a = random(3,9,1); +$b = random(1,5,2); +$c = random(2,8,2); + +Context("Fraction"); +$seis_a = 6*$a; +$tres_b = 3*$b; +$dos_c = 2*$c; +$dos_c_menos_seis_a = 2*$c - 6*$a; +$seis_a_menos_dos_c = 6*$a - 2*$c ; + +$frac = Fraction("-$dos_c_menos_seis_a","3*$b"); + +$num = 6*$a-2*$c-3*$b; +$deno = 3*$b; + +$answer = Fraction($num,$deno); + +TEXT(beginproblem()); + +Context()->texStrings; +BEGIN_TEXT +Solucionar la siguiente ecuación +\[ +\frac{$a}{x+1} - \frac{$b}{2} = \frac{$c}{3x+3} +\] +$PAR +\(x = \) \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Factorizar \(3\) del denominador en el término de la derecha +\[ +\frac{$a}{x+1} - \frac{$b}{2} = \frac{ $c }{3(x+1)} +\] +$PAR +$BBOLD Paso 2:$EBOLD Multiplicar a ambos lados por el común denominador, \( 6(x+1) \). Ojo aquí aclarar este paso al multiplicar por términos con variables. +\[ +6(x+1)\left( \frac{$a}{x+1} - \frac{$b}{2} \right) = 6(x+1) \left( \frac{ $c }{3(x+1)} \right) +\] +aplicando la propiedad distributiva y simplificando factores +\[ +$seis_a - $tres_b (x+1) = $dos_c +\] +$PAR +$BBOLD Paso 4:$EBOLD Agrupando términos +\[ +- $tres_b (x+1) = $dos_c - $seis_a = $dos_c_menos_seis_a +\] +dividiendo por \(-$tres_b\) +\[ +x+1 = \frac{$dos_c_menos_seis_a}{-$tres_b} = \frac{$seis_a_menos_dos_c}{$tres_b} +\] +$PAR +$BBOLD Paso 5:$EBOLD Despejando para \(x\) y simplificando +\[ +x = \frac{$seis_a_menos_dos_c}{$tres_b} -1 = \frac{$num}{$deno} +\] +$PAR +por lo tanto la solución es \(x = $answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_racionales/ecuaciones_racionales_con_binomios.pg b/Contrib/UPRM/Prebasica/ecuaciones_racionales/ecuaciones_racionales_con_binomios.pg new file mode 100644 index 0000000000..b00a5630b4 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_racionales/ecuaciones_racionales_con_binomios.pg @@ -0,0 +1,96 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Resolver ecuaciones racionales denominador binomio +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_racionales/ecuaciones_racionales_con_binomios.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones racionales) +## DBsection(Denominador monomio) +## Level(1) +## KEYWORDS('ecuaciones','monomios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl", +"parserImplicitEquation.pl" +); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +# coeficientes ecuación de tipo a1/(b1x+c1) + a2/(b2x+c2) = a3/(b3x+c2) +$a1 = non_zero_random(-9,9); +$b1 = non_zero_random(-9,9); +$c1 = random(-9,9); + +$a2 = non_zero_random(-9,9); +$b2 = non_zero_random(-9,9); +$c2 = random(-9,9); + +$a3 = non_zero_random(-9,9); +$b3 = non_zero_random(-9,9); +$c3 = random(-9,9); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); +Context("ImplicitEquation"); + +$eq = Formula("$a1/($b1 x + $c1) + $a2/($b2 x + $c2) = $a3/($b3 x + $c3)")->reduce; + +$answer = Formula(3); + +TEXT(beginproblem()); + +Context()->texStrings; +BEGIN_TEXT +Resuelva la siguiente ecuación +\[ +\frac{$a1}{$b1 x + $c1} + \frac{$a2}{$b2 x + $c2} = \frac{$a3}{$b3 x + $c3} +\] +probando... problema no terminado +\[ +$eq +\] +$PAR +\(x = \) \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Por lo tanto la ecuación es \(x = $answer\). +END_SOLUTION + +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_racionales/ecuaciones_racionales_con_monomios.pg b/Contrib/UPRM/Prebasica/ecuaciones_racionales/ecuaciones_racionales_con_monomios.pg new file mode 100644 index 0000000000..52a0ea2983 --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_racionales/ecuaciones_racionales_con_monomios.pg @@ -0,0 +1,91 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Resolver ecuaciones racionales denominador monomio +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_racionales/ecuaciones_racionales_con_monomios.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones racionales) +## DBsection(Denominador monomio) +## Level(1) +## KEYWORDS('ecuaciones','monomios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl", +"parserImplicitEquation.pl" #Para usar cuando la respuesta sea una ecuación +); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +# coeficientes ecuación de tipo a1/(b1x) + a2/(b2x) = a3/(b3x) +$a1 = non_zero_random(-9,9); +$b1 = non_zero_random(-9,9); + +$a2 = non_zero_random(-9,9); +$b2 = non_zero_random(-9,9); + +$a3 = non_zero_random(-9,9); +$b3 = non_zero_random(-9,9); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); +Context("ImplicitEquation"); + +$eq = ImplicitEquation("$a1/($b1 x) + $a2/$b2 = $a3/($b3 x)")->reduce; + + +TEXT(beginproblem()); + +Context()->texStrings; +BEGIN_TEXT +Resuelva la siguiente ecuación +\[ +\frac{$a1}{$b1 x} + \frac{$a2}{$b2} = \frac{$a3}{$b3 x} +\] +probando... problema no terminado +\[ +$eq +\] +$PAR +\(x = \) \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +ANS( $eq->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/ecuaciones_racionales/template.pg b/Contrib/UPRM/Prebasica/ecuaciones_racionales/template.pg new file mode 100644 index 0000000000..a81ff8a6ed --- /dev/null +++ b/Contrib/UPRM/Prebasica/ecuaciones_racionales/template.pg @@ -0,0 +1,84 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Resolver ecuaciones racionales denominador monomio +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/ecuaciones_racionales/ecuaciones_racionales_con_monomios.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones racionales) +## DBsection(Denominador monomio) +## Level(1) +## KEYWORDS('ecuaciones','monomios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl", +"parserImplicitEquation.pl", +"parserSolutionFor.pl" +); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +# coeficientes ecuación de tipo a1/(b1x) + a2/(b2x) = a3/(b3x) +$a1 = non_zero_random(-9,9); +$b1 = non_zero_random(-9,9); + +$a2 = non_zero_random(-9,9); +$b2 = non_zero_random(-9,9); + +$a3 = non_zero_random(-9,9); +$b3 = non_zero_random(-9,9); + +Context("Vector")->variables->are(x=>'Real',y=>'Real'); +$f = SolutionFor("x^2 = cos(y)","(1,0)"); + +TEXT(beginproblem()); + +Context()->texStrings; +BEGIN_TEXT +$PAR +$BBOLD Esto es para borrar, sirve para pruebas.$EBOLD +$PAR +A solution to \($f->{f}\) is +$PAR +$BCENTER +\((x,y)\) = \{ans_rule(30)\} +$ECENTER +END_TEXT +Context()->normalStrings; +ANS($f->cmp); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_algebraicas/identificar_expresiones_algebraicas_tmp.pg b/Contrib/UPRM/Prebasica/expresiones_algebraicas/identificar_expresiones_algebraicas_tmp.pg new file mode 100644 index 0000000000..9fb0d183d7 --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_algebraicas/identificar_expresiones_algebraicas_tmp.pg @@ -0,0 +1,114 @@ +# DESCRIPTION +# +# Tipo: seleccionar la correcta +# Diferenciar entre monomio, trinomio y trinomio + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/expresiones_algebraicas/identificar_expresiones_algebraicas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Expresiones algebraicas) +## DBsection(Polinomios) +## Level(1) +## KEYWORDS('monomios','binomios','trinomios','polinomios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#los exponentes +$n1 = random(5,15); +$n2 = random(1,4); +$n3 = random(1,4); + +#los coeficientes +$a = non_zero_random(-25,25); +$b = non_zero_random(-25,25); +$c = non_zero_random(-25,25); + +@vars = ("a","b","c","d","e","f", "g","h","i","k","l","m","n","o","p","q","r","s", "t","u","v","w","y","z"); +$index = random(0,24); + +$prob = random(1,3); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->variables->add($vars[$index] => 'Real'); + +Context()->strings->add(monomio=>{caseSensitive=>0}, binomio=>{caseSensitive=>0}, trinomio=>{caseSensitive=>0}); + +if ($prob == 1){ + $exp = Formula("$a $vars[$index]^$n1")->reduce; + $answer = Compute("monomio"); + $num_term = 1; +}elsif($prob == 2){ + $exp = Formula("$a $vars[$index]^$n1 + $b $vars[$index]^$n2")->reduce; + $answer = Compute("binomio"); + $num_term = 2; +}else{ + $exp = Formula("$a $vars[$index]^$n1 + $b $vars[$index]^$n2 + $c $vars[$index]^$n3")->reduce; + $answer = Compute("trinomio"); + $num_term = 3; +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La expresion algebraica +\[ +$exp +\] +es un monomio, binomio o trinomio: \{ans_rule(10)\} +END_TEXT +Context()->normalStrings; + +############################################################## +# Answers +# + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +La expresión algebraica \($exp\) es un \($answer\) ya que tiene \($num_term\) términos. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_algebraicas/identificar_expresiones_algebraicass.pg b/Contrib/UPRM/Prebasica/expresiones_algebraicas/identificar_expresiones_algebraicass.pg new file mode 100644 index 0000000000..5c4855a3f3 --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_algebraicas/identificar_expresiones_algebraicass.pg @@ -0,0 +1,134 @@ +# DESCRIPTION +# +# Tipo: seleccionar la correcta +# Diferenciar entre monomio, trinomio y trinomio + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/expresiones_algebraicas/identificar_expresiones_algebraicas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Expresiones algebraicas) +## DBsection(Polinomios) +## Level(1) +## KEYWORDS('monomios','binomios','trinomios','polinomios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#los exponentes +$n1 = random(5,15); +$n2 = random(1,4); +$n3 = random(1,4); + +#los coeficientes +$a = non_zero_random(-25,25); +$b = non_zero_random(-25,25); +$c = non_zero_random(-25,25); +Context("Numeric"); + +@vars = ("a","b","c","d","e","f", "g","h","i","k","l","m","n","o","p","q","r","s", "t","u","v","w","y","z"); +$index = random(0,24); + +$prob = random(1,4); + +Context()->variables->add($vars[$index] => 'Real'); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +if ($prob == 1){ + $exp = Formula("$a $vars[$index]**$n1")->reduce; + $answer = "Monomio"; + $num_term = 1; + $frase = "es un $BBOLD$Monomio$EBOLD ya que tiene \($num_term\) términos."; +}elsif($prob == 2){ + $exp = Formula("$a $vars[$index]**$n1 + $b $vars[$index]**$n2")->reduce; + $answer = "Binomio"; + $num_term = 2; + $frase = "es un $BBOLDBinomio$EBOLD ya que tiene \($num_term\) términos."; +}elsif($prob == 3){ + $exp = Formula("$a $vars[$index]**$n1 + $b $vars[$index]**$n2 + $c $vars[$index]**$n3")->reduce; + $answer = "Trinomio"; + $num_term = 3; + $frase = "es un $BBOLDTrinomio$EBOLD ya que tiene \($num_term\) términos."; +}else{ + $exp = Formula("$a $vars[$index]**(-$n1) + $b $vars[$index]**$n2")->reduce; + $answer = "Ninguna de estas"; + $frase = "no es ni monomio, ni binomio ni trinomio ya que uno de los exponentes es negativo."; +} + +$radio = RadioButtons( + ["Monomio","Binomio","Trinomio","Ninguna de estas"], + $answer, # correct answer + last => ["Ninguna de estas"], # can be a list +); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La expresion algebraica +\[ +$exp +\] +es un +$BR +$BR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +############################################################## +# Answers +# + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +La expresión algebraica \($exp\) $frase +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_algebraicas/resta_de_polinomios.pg b/Contrib/UPRM/Prebasica/expresiones_algebraicas/resta_de_polinomios.pg new file mode 100644 index 0000000000..10b25e4e76 --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_algebraicas/resta_de_polinomios.pg @@ -0,0 +1,127 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dados dos polinomios de grado entre 5 y 3 encontrar su resta. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de los archivos +# pedro_prebasica/expresiones_algebraicas/resta_de_polinomios.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Polinomios) +## DBsection(Operaciones) +## Level(1) +## KEYWORDS('polinomios','operaciones','resta') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Creando el polinomio 1 +$a4 = random(-2,2); +$a3 = random(-1,1); +$a2 = non_zero_random(-15,15); +$a1 = random(-15,15); +$a0 = random(-15,15); +@A = ($a4, $a3, $a2, $a1, $a0); + +#Creando el polinomio 2 +$b4 = random(-2,2); +$b3 = random(-1,1); +$b2 = non_zero_random(-15,15); +$b1 = random(-15,15); +$b0 = random(-15,15); +@B = ($b4, $b3, $b2, $b1, $b0); +@inv_B = (-$b4, -$b3, -$b2, -$b1, -$b0); + +#calculando la resta usando el macro PGpolynomialmacros.pl +@A_menos_B = PolySub(~~@A, ~~@B); + +#@vars = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'y', 'z'); +#$index = random(0,23); + +#Context()->variables->add($vars[$index]=>'Real'); + +#adicionando la variable x a cada parte usando el macro PGpolynomialmacros.pl +$polyA = PolyString(~~@A,x); +$polyB = PolyString(~~@B,x); +$polyA_menos_B = PolyString(~~@A_menos_B,x); +$poly_inv_B = PolyString(~~@inv_B,x); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$out_A = Formula($polyA)->reduce(); +$out_B = Formula($polyB)->reduce(); +$inv_out_B = Formula($poly_inv_B)->reduce(); + +$answer = Formula($polyA_menos_B)->reduce(); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Realizar la resta +\[ +\left($polyA\right) \quad - \quad \left($polyB\right) +\] +Escribir el resultado en forma descendente. +$PAR +Resultado: \{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Eliminar los paréntesis recordando que la operación de resta hace cambiar el signo a cada término. +\[ +$out_A \quad + \quad $inv_out_B +\] +$PAR +$BBOLD Paso 2:$EBOLD Agrupar términos semejantes y sumar y/o restar sus coeficientes. Por lo tanto la solución es: +\[ +$answer +\] +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_algebraicas/suma_de_polinomios.pg b/Contrib/UPRM/Prebasica/expresiones_algebraicas/suma_de_polinomios.pg new file mode 100644 index 0000000000..1132fba7a9 --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_algebraicas/suma_de_polinomios.pg @@ -0,0 +1,124 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dados dos polinomios de grado entre 5 y 3 encontrar su suma. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de los archivos +# pedro_prebasica/expresiones_algebraicas/suma_de_polinomios.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Polinomios) +## DBsection(Operaciones) +## Level(1) +## KEYWORDS('polinomios','operaciones','suma') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Creando el polinomio 1 +$a4 = random(-2,2); +$a3 = random(-1,1); +$a2 = non_zero_random(-15,15); +$a1 = random(-15,15); +$a0 = random(-15,15); +@A = ($a4, $a3, $a2, $a1, $a0); + +#Creando el polinomio 2 +$b4 = random(-2,2); +$b3 = random(-1,1); +$b2 = non_zero_random(-15,15); +$b1 = random(-15,15); +$b0 = random(-15,15); +@B = ($b4, $b3, $b2, $b1, $b0); + +#calculando la suma usando el macro PGpolynomialmacros.pl +@A_mas_B = PolyAdd(~~@A, ~~@B); + +#@vars = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'y', 'z'); +#$index = random(0,23); + +#Context()->variables->add($vars[$index]=>'Real'); + +#adicionando la variable x a cada parte usando el macro PGpolynomialmacros.pl +$polyA = PolyString(~~@A,x); +$polyB = PolyString(~~@B,x); +$polyA_mas_B = PolyString(~~@A_mas_B,x); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$out_A = Formula($polyA)->reduce(); +$out_B = Formula($polyB)->reduce(); + +$answer = Formula($polyA_mas_B)->reduce(); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Realizar la suma +\[ +\left( $out_A \right) \quad + \quad \left( $out_B \right) +\] +Escribir el resultado en forma descendente. +$PAR +Resultado: \{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Eliminar los parentesis +\[ +$out_A \quad + \quad $out_B +\] +$PAR +$BBOLD Paso 2:$EBOLD Agrupar términos semejantes y sumar y/o restar sus coeficientes. Por lo tanto la solución es: +\[ +$answer +\] +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_algebraicas/templateRadioButtons.pg b/Contrib/UPRM/Prebasica/expresiones_algebraicas/templateRadioButtons.pg new file mode 100644 index 0000000000..5c4855a3f3 --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_algebraicas/templateRadioButtons.pg @@ -0,0 +1,134 @@ +# DESCRIPTION +# +# Tipo: seleccionar la correcta +# Diferenciar entre monomio, trinomio y trinomio + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/expresiones_algebraicas/identificar_expresiones_algebraicas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Expresiones algebraicas) +## DBsection(Polinomios) +## Level(1) +## KEYWORDS('monomios','binomios','trinomios','polinomios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#los exponentes +$n1 = random(5,15); +$n2 = random(1,4); +$n3 = random(1,4); + +#los coeficientes +$a = non_zero_random(-25,25); +$b = non_zero_random(-25,25); +$c = non_zero_random(-25,25); +Context("Numeric"); + +@vars = ("a","b","c","d","e","f", "g","h","i","k","l","m","n","o","p","q","r","s", "t","u","v","w","y","z"); +$index = random(0,24); + +$prob = random(1,4); + +Context()->variables->add($vars[$index] => 'Real'); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +if ($prob == 1){ + $exp = Formula("$a $vars[$index]**$n1")->reduce; + $answer = "Monomio"; + $num_term = 1; + $frase = "es un $BBOLD$Monomio$EBOLD ya que tiene \($num_term\) términos."; +}elsif($prob == 2){ + $exp = Formula("$a $vars[$index]**$n1 + $b $vars[$index]**$n2")->reduce; + $answer = "Binomio"; + $num_term = 2; + $frase = "es un $BBOLDBinomio$EBOLD ya que tiene \($num_term\) términos."; +}elsif($prob == 3){ + $exp = Formula("$a $vars[$index]**$n1 + $b $vars[$index]**$n2 + $c $vars[$index]**$n3")->reduce; + $answer = "Trinomio"; + $num_term = 3; + $frase = "es un $BBOLDTrinomio$EBOLD ya que tiene \($num_term\) términos."; +}else{ + $exp = Formula("$a $vars[$index]**(-$n1) + $b $vars[$index]**$n2")->reduce; + $answer = "Ninguna de estas"; + $frase = "no es ni monomio, ni binomio ni trinomio ya que uno de los exponentes es negativo."; +} + +$radio = RadioButtons( + ["Monomio","Binomio","Trinomio","Ninguna de estas"], + $answer, # correct answer + last => ["Ninguna de estas"], # can be a list +); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La expresion algebraica +\[ +$exp +\] +es un +$BR +$BR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +############################################################## +# Answers +# + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +La expresión algebraica \($exp\) $frase +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_algebraicas_con_exponentes_racionales/evaluar_exponentes_racionales.pg b/Contrib/UPRM/Prebasica/expresiones_algebraicas_con_exponentes_racionales/evaluar_exponentes_racionales.pg new file mode 100644 index 0000000000..2f845e3cf0 --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_algebraicas_con_exponentes_racionales/evaluar_exponentes_racionales.pg @@ -0,0 +1,150 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Evaluar radicales: tipo (a^n)^{k/n} +# Donde a,n y k son enteros positivos + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/expresiones_algebraicas_con_exponentes_racionales/evaluar_exponentes_racionales.db +# +# Última actualización: Edwin F. 08/01/2014 +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Radicales) +## DBsection(Evaluar) +## Level(1) +## KEYWORDS('radicales','raiz cuadrada') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"parserRadioButtons.pl", +"UPRMgraphMacros.pl", +"contextInequalities.pl", +"unionTables.pl", + +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#creando las componentes del radical (a^n)^{k/n} + +$a = random(2,5); +$n = random(2,6); +do{ + $k = random(2,4); +}until($k != $n); + +$an = $a**$n; +$ak = $a**$k; + +$radical = "$an^{\frac{$k}{$n}}"; + +#Subrutina que repite un radical una cantidad de n veces +#retorna una cadena en formato TeX. +sub repetir { + local ($strg, $n) = ($_[0], $_[1]); + my $cadena = ""; + + foreach my $i (1..$n){ + $cadena = $cadena."$strg\times"; + } + $cadena = substr $cadena, 0, -6; + return $cadena; +} + +Context("LimitedNumeric"); + +$answer = Compute("$ak"); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Hallar el valor de +\[ + $radical +\] +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Crear una ecuación que se pueda resolver \( $an^{ \frac{1}{$n} } \) +\[ + \{repetir("$an^{ \frac{1}{$n} }",$n)\} = $an +\] +$PAR +$BBOLD Paso 2:$EBOLD +Resolver la ecuación +\[ + \begin{align*} + $an &= \{repetir("$an^{ \frac{1}{$n} }",$n)\} \\ + $an &= \{repetir($a,$n)\} + \end{align*} +\] +entonces \($an^{ \frac{1}{$n} } = $a \) +$PAR +$BBOLD Paso 3:$EBOLD +Resolver ecuación para \($radical\) +\[ + \begin{align*} + $an^{ \frac{1}{$n} } &= $a \\ + \Rightarrow \left( $an^{ \frac{1}{$n} } \right)^{$k} &= $a^{$k} \\ + \Rightarrow $radical &= $ak + \end{align*} +\] +$PAR +por lo tanto la solución es \( $answer \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_algebraicas_con_exponentes_racionales/evaluar_radicales.pg b/Contrib/UPRM/Prebasica/expresiones_algebraicas_con_exponentes_racionales/evaluar_radicales.pg new file mode 100644 index 0000000000..127ebdccf7 --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_algebraicas_con_exponentes_racionales/evaluar_radicales.pg @@ -0,0 +1,180 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Evaluar radicales: tipos +# i. sqrt{a^2} +# ii. sqrt[m]{a^n} +# iii. (a^n)^(1/m) +# Donde a es un entero positivo, y n entero no negativo +# múltiplo de m. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/expresiones_algebraicas_con_exponentes_racionales/evaluar_radicales.db +# +# Última actualización: Edwin F. 08/01/2014 +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Radicales) +## DBsection(Evaluar) +## Level(1) +## KEYWORDS('radicales','raiz cuadrada') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"parserRadioButtons.pl", +"UPRMgraphMacros.pl", +"contextInequalities.pl", +"unionTables.pl", + +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#eligiendo el tipo de radical +$prob = random(0,2); + +Context("LimitedNumeric"); + +if ( $prob == 0){ + + $a = random(2,20); + $a2 = $a*$a; + $an = $a**$n; + + $radical = "\sqrt{$a2}"; + $answer = Compute("$a"); + $explicacion = "Expresar \($a2\) como un cuadrado perfecto + \[ + $a^2 + \] + por propiedad de los radicales tenemos \( \sqrt{a^2} = a \) + \[ + \begin{align*} + \sqrt{$a2} &= \sqrt{$a^2} \\ + \sqrt{$a2} &= $a + \end{align*} + \]"; + +}elsif ( $prob == 1 ){ + + $a = random(2,6); + $m = random(3,5); + #$k = random(1,4); + #$n = $m*$k; + $n = $m; + + $an = $a**$n; + + $radical = "\sqrt[$m]{$an}"; + $answer = Compute("$a"); + $explicacion = "Expresar \($an\) como + \[ + $a^$m, + \] + por propiedad de los radicales tenemos \( \sqrt[n]{b^n} = b \) + \[ + \begin{align*} + \sqrt[$m]{$an} &= \sqrt[$m]{$a^{$n}} \\ + \sqrt[$m]{$a^{$n}} &= $a, + \end{align*} + \]"; + +}else{ + + $a = random(2,6); + $m = random(3,5); + #$k = random(1,4); + #$n = $m*$k; + $n = $m; + + $an = $a**$n; + + $radical = "$an^{\frac{1}{$m}}"; + $answer = Compute("$a"); + $explicacion = "Se tiene que + \[ + $an^{\frac{1}{$m}} = \sqrt[$m]{$an}, + \] + luego se puede expresar \($an\) como + \[ + $a^{$n}, + \] + por propiedad de los radicales tenemos \( \sqrt[n]{b^n} = b \) + \[ + \begin{align*} + \sqrt[$m]{$an} &= \sqrt[$m]{$a^{$n}} \\ + \sqrt[$m]{$a^{$n}} &= $a, + \end{align*} + \]"; + +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Hallar el valor de +\[ + $radical +\] +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$explicacion +por lo tanto la solución es \( $answer \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_algebraicas_con_exponentes_racionales/expresion_racional_numerica.pg b/Contrib/UPRM/Prebasica/expresiones_algebraicas_con_exponentes_racionales/expresion_racional_numerica.pg new file mode 100644 index 0000000000..b205983838 --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_algebraicas_con_exponentes_racionales/expresion_racional_numerica.pg @@ -0,0 +1,126 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Aplicar propiedades de los radicales +# para encontrar el valor de la variable en +# los exponentes. Ejp. \sqrt[m]{g^rg^s} = g^n, n=? + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/expresiones_algebraicas_con_exponentes_racionales/expresion_racional_numerica.db +# +# Última actualización: Edwin F. 08/01/2014 +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Radicales) +## DBsection(Propiedades) +## Level(1) +## KEYWORDS('radicales','propiedades') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"parserRadioButtons.pl", +"UPRMgraphMacros.pl", +"contextInequalities.pl", +"unionTables.pl", + +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#las componentes de la exp \sqrt[m]{g^rg^s} = g^n + +$m = random(3,8); +$r = random(2,9); +$s = random(2,9); + +$rms = $r+$s; + +$exp = "\sqrt[$m]{ g^{$r}g^{$s} }"; + +Context("Fraction"); + +$answer = Fraction($rms,$m); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Considere la siguiente expresión +\[ + $exp = g^n +\] +Calcule el valor de \(n\). +$PAR +\(n=\) \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Utilizar la propiedad \( a^p a^q = a^{p+q} \) +\[ + $exp = \sqrt[$m]{g^{$r+$s}} = \sqrt[$m]{g^{$rms}} +\] +$PAR +$BBOLD Paso 2:$EBOLD Utilizar la propiedad \( \sqrt[$m]{a} = a^{\frac{1}{$m}} \) +\[ + \sqrt[$m]{g^{$rms}} = \left( g^{$rms} \right)^{\frac{1}{$m}} +\] +$PAR +$BBOLD Paso 3:$EBOLD Utilizar la propiedad \( \left( a^p \right)^q = a^{pq} \) y simplificar la fracción si es el caso +\[ + \left( g^{$rms} \right)^{\frac{1}{$m}} = g^{\frac{$rms}{$m}}, +\] +$PAR +por lo tanto la solución es \( $answer \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras_A.pg b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras_A.pg new file mode 100644 index 0000000000..6ae8d0450b --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras_A.pg @@ -0,0 +1,96 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Decir el exponente a^b + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Expresiones algebraicas) +## DBsection(Exponentes) +## Level(1) +## KEYWORDS('exponentes','enteros') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y'); + +@vars = ("m","n","p","q","r","y","z","k","a","b"); +$prob = random(0,1); +if ($prob == 0){ + $base = $vars[random(0,9)]; +}else{ + $base = random(-50,50); +} + +$exponente = random(-100,100); + +$expresion = "$base^{$exponente}"; + +$answer = Compute("$exponente"); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +El exponente de +\[ +$expresion +\] +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El exponente es el término al que está elevado \($base\), es decir, \($exponente\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras_B.pg b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras_B.pg new file mode 100644 index 0000000000..f70e3d2740 --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras_B.pg @@ -0,0 +1,106 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dado a x a x a ... x a, o a^n escribirla de la otra forma. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Expresiones algebraicas) +## DBsection(Exponentes) +## Level(1) +## KEYWORDS('exponentes','enteros') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y','-(n)'),'-(x.y)'; + +@vars = ("m","n","p","q","r","y","z","k","a","b"); +$index = random(0,9); +$prob = random(0,1); +if ($prob == 0){ + Context()->variables->add($vars[$index] => 'Real'); + $base = $vars[$index]; +}else{ + $base = random(-50,50); +} + +$exponente = random(3,7); + +$expresion = "$base^{$exponente}"; + +foreach my $i (1..$exponente-1) { + $cadena .= "$base *"; +} + +$cadena .= "$base"; + +$answer = Compute("$cadena"); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La expresión +\[ +$expresion +\] +escrita como producto es: \{ans_rule(40)\} \{ AnswerFormatHelp("formula") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Como \($base^$exponente\) tienen exponente \($exponente\), entonces \($base\) se multiplica \($exponente\) veces, es decir: +\[ +$base^$exponente = $cadena +\] +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras_C.pg b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras_C.pg new file mode 100644 index 0000000000..e9859b6e8c --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras_C.pg @@ -0,0 +1,107 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Decir el exponente a^b + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_potencias_enteras.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Expresiones algebraicas) +## DBsection(Exponentes) +## Level(1) +## KEYWORDS('exponentes','enteros') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y'); + +@vars = ("m","n","p","q","r","y","z","k","a","b"); +$index = random(0,9); +$prob = random(0,1); +if ($prob == 0){ + Context()->variables->add($vars[$index] => 'Real'); + $base = $vars[$index]; +}else{ + $base = random(0,50); +} + +$exponente = random(2,9); + +$expresion = "$base^{$exponente}"; + +foreach my $i (1..$exponente-1) { + $cadena .= "$base\cdot"; +} + +$cadena .= "$base"; + +$answer = Compute("$expresion"); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La expresion +\[ +$cadena +\] +escrita como notación exponencial es: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Como \($base\) se multiplica \($exponente\) veces, entonces \($base\) tiene exponente \($exponente\), es decir: +\[ + $cadena = $base^$exponente. +\] +Por lo tanto la respuesta es: \($expresion\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_A.pg b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_A.pg new file mode 100644 index 0000000000..e704f452ce --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_A.pg @@ -0,0 +1,100 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Aplicar propiedad (a^n)/a^m = a^(n-m) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Expresiones algebraicas) +## DBsection(Propiedades de los exponentes) +## Level(1) +## KEYWORDS('exponentes','enteros','propiedades') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y'); + +@vars = ("m","n","p","q","r","y","z","k","a","b"); +$index = random(0,9); +Context()->variables->add($vars[$index] => 'Real'); +$n = random(-20,20); +$m = non_zero_random(-15,15); + +$prob = random(0,1); +if ($prob == 0){ + $exp = Compute("($vars[$index]^$n) / ($vars[$index]^$m)"); +}else{ + $exp = "$vars[$index]^{$n} \div $vars[$index]^{$m} "; +} + +$answer = Compute("$vars[$index]^($n-$m)")->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Escriba la siguiente expresión como una sola potencia: +\[ +$exp +\] +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("formula") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Utilizando la propiedad \( \frac{a^n}{b^m} = a^{n-m}\), se obtiene +\[ +$exp = $vars[$index]^{$n-$m} = $answer, +\] +por lo tanto la respuesta es: \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_B.pg b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_B.pg new file mode 100644 index 0000000000..e8b1c55988 --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_B.pg @@ -0,0 +1,100 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Aplicar propiedad (a^n)^m = a^(n*m) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Expresiones algebraicas) +## DBsection(Propiedades de los exponentes) +## Level(1) +## KEYWORDS('exponentes','enteros','propiedades') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y'); + +$a= non_zero_random(-9,9); +@vars = ("m","n","p","q","r","y","z","k","a","b"); +$index = random(0,9); +Context()->variables->add($vars[$index] => 'Real'); +$n = random(2,6); +$m = random(2,6); + +$exp = Compute("($a $vars[$index]^$n)^$m"); + +$answer = Compute("($a)^$m $vars[$index]^($n*$m)")->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Simplifique al máximo la siguiente expresión +\[ +$exp +\] +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("formula") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Utilizando la propiedad \( (ab)^c = a^cb^c \), se obtiene +\[ +$exp = $a^$n ($vars[$index]^$n)^$m. +\] +$BBOLD Paso 2:$EBOLD Utilizando la propiedad \( (a^b)^c = a^{bc} \), se obtiene: +\[ + $exp = $a^$n ($vars[$index]^$n)^$m = $answer. +\] +Por lo tanto la respuesta es: \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_C.pg b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_C.pg new file mode 100644 index 0000000000..73ba78815a --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_C.pg @@ -0,0 +1,95 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Aplicar propiedad (a^n)(a^m) = a^(n+m) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Expresiones algebraicas) +## DBsection(Propiedades de los exponentes) +## Level(1) +## KEYWORDS('exponentes','enteros','propiedades') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y'); + +@vars = ("m","n","p","q","r","y","z","k","a","b"); +$index = random(0,9); +Context()->variables->add($vars[$index] => 'Real'); +$n = random(-20,20); +$m = non_zero_random(-15,15); + +$exp = Compute("($vars[$index]^$n)($vars[$index]^$m)"); + +$answer = Compute("$vars[$index]^($n+$m)")->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Escriba la siguiente expresión como una sola potencia: +\[ +$exp +\] +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("formula") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Utilizando la propiedad \( a^nb^m = a^{n+m} \), se obtiene +\[ +$exp = $vars[$index]^{$n+$m} = $answer, +\] +por lo tanto la respuesta es: \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_D.pg b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_D.pg new file mode 100644 index 0000000000..8199f8121a --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades_D.pg @@ -0,0 +1,101 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Aplicar propiedad (x^n/b)^m = x^(n*m) / b^m + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/expresiones_con_exponentes_enteros/expresiones_algebraicas_propiedades.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Expresiones algebraicas) +## DBsection(Propiedades de los exponentes) +## Level(1) +## KEYWORDS('exponentes','enteros','propiedades') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y'); + +$a= non_zero_random(-9,9); +@vars = ("m","n","p","q","r","y","z","k","a","b"); +$index = random(0,9); +Context()->variables->add($vars[$index] => 'Real'); +$n = random(2,6); +$m = random(2,6); +$nm = $n*$m; + +$exp = "\left( \frac{$vars[$index]^$n}{$a} \right)^$m"; + +$answer = Compute("($vars[$index]^($n*$m))/(($a)^$m)")->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Simplifique al máximo la siguiente expresión +\[ +$exp +\] +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("formula") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Utilizando la propiedad \( \left( \frac{a}{b} \right)^c = \frac{a^c}{b^c} \), se obtiene +\[ +$exp = \frac{ \left( $vars[$index]^$n \right)^$m}{\left( $a \right)^$m} +\] +$BBOLD Paso 2:$EBOLD Utilizando la propiedad \( \left( a^n \right)^m = a^{bc} \) se tiene: +\[ + $exp = \frac{$vars[$index]^{$nm}}{\left($a\right)^$m} = $answer. +\] +Por lo tanto la respuesta es: \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/simplificar_expresiones_algebraicas_con_potencias.pg b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/simplificar_expresiones_algebraicas_con_potencias.pg new file mode 100644 index 0000000000..d53771f780 --- /dev/null +++ b/Contrib/UPRM/Prebasica/expresiones_con_exponentes_enteros/simplificar_expresiones_algebraicas_con_potencias.pg @@ -0,0 +1,133 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Aplicar varias propiedades a expresiones similares a \left( \frac{(ak1)x^{bk2}y^{ck3} }{ax^b y^c} \right)^d + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/expresiones_con_exponentes_enteros/simplificar_expresiones_algebraicas_con_potencias.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Expresiones algebraicas) +## DBsection(Propiedades de los exponentes) +## Level(1) +## KEYWORDS('exponentes','enteros','propiedades', 'simplificar') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y'); + +#eliminando la variable por defecto x del contexto, +# para que luego pueda salir elegida y no nuestre una advertencia +# si se escoje +Context()->variables->remove("x"); + +#eligiendo las variables +@vars = ("a","b","c","d","e","g","p","q","w","x"); +$index1 = random(0,9); +do { + $index2 = random(0,9); +} until ($index1 != $index2); + +Context()->variables->add($vars[$index1] => 'Real'); +Context()->variables->add($vars[$index2] => 'Real'); + +$a = random(2,6); +$b = random(2,6); +$c = random(2,6); +$d = random(2,8); +$k1 = non_zero_random(-6,6); +$ak1 = $a*$k1; +$k2 = random(1,6); +$bk2 = $b*$k2; +$k3 = random(1,6); +$ck3 = $c*$k3; + +$ev1 = $bk2 - $b; +$ev2 = $ck3 - $c; + +$exp = "\left( \frac{ $ak1 $vars[$index1]^{$bk2} $vars[$index2]^{$ck3} }{$a $vars[$index1]^$b $vars[$index2]^$c} \right)^$d"; + +$answer = Compute("(($k1)^$d)*$vars[$index1]^($d*($k2-1))*$vars[$index2]^($d*($k3-1))")->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Simplifique al máximo la siguiente expresión +\[ +$exp +\] +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("formula") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Dividir la fracción en términos semejantes: +\[ +$exp = \left( \frac{$ak1}{$a} \cdot \frac{$vars[$index1]^{$bk2}}{$vars[$index1]^$b} \cdot \frac{$vars[$index2]^{$ck3}}{$vars[$index2]^$c} \right)^{$d} +\] +$PAR +$BBOLD Paso 2:$EBOLD Simplificamos cada uno de los factores, las dos últimas utilizando la propiedad \( \frac{a^n}{a^m} = a^{n-m} \), se obtiene +\[ +\left( \frac{$ak1}{$a} \cdot \frac{$vars[$index1]^{$bk2}}{$vars[$index1]^$b} \cdot \frac{$vars[$index2]^{$ck3}}{$vars[$index2]^$c} \right)^{$d} = \left( $k1 $vars[$index1]^{$bk2 - $b} $vars[$index2]^{$ck3 - $c} \right)^{$d} = \left( $k1 $vars[$index1]^{$ev1} $vars[$index2]^{$ev2} \right)^{$d} +\] +$PAR +$BBOLD Paso 3:$EBOLD Utilizando la propiedad \( (ab)^n = a^n b^n \), se obtiene +\[ +\left( $k1 $vars[$index1]^{$ev1} $vars[$index2]^{$ev2} \right)^{$d}= \left( $k1 \right)^{$d} \left( $vars[$index1]^{$ev1} \right)^{$d} \left( $vars[$index2]^{$ev2}\right)^{$d} +\] +$PAR +$BBOLD Paso 4:$EBOLD Utilizando la propiedad \( \left(a^n\right)^m = a^{nm}\), se obtiene +\[ +\left( $k1 \right)^{$d} \left( $vars[$index1]^{$ev1} \right)^{$d} \left( $vars[$index2]^{$ev2}\right)^{$d} = $answer. +\] +Por lo tanto la respuesta es: \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factor_comun/factor_comun_maximo_comun_divisor_A.pg b/Contrib/UPRM/Prebasica/factor_comun/factor_comun_maximo_comun_divisor_A.pg new file mode 100644 index 0000000000..82b8ee227b --- /dev/null +++ b/Contrib/UPRM/Prebasica/factor_comun/factor_comun_maximo_comun_divisor_A.pg @@ -0,0 +1,126 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizacion: encontrar el factor común dado una lista de tres términos +# tipo: ax^n + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factor_comun/factor_comun_maximo_comun_divisor.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Factor común) +## Level(1) +## KEYWORDS('factorizacion','factor comun') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +#las constantes de los términos: a x^n1, b x^n2, c x^n3 +$k = list_random(1,2,3,5,7); +$a = $k*non_zero_random(-20,20); +$b = $k*non_zero_random(-20,20); +$c = $k*non_zero_random(-20,20); + +$n1 = random(2,20); +$n2 = random(2,20); +$n3 = random(2,20); + +#eligiendo la variable +$var1 = list_random('a','b','m','n','x','y','z','w','p','q','r','s','t','u','v'); + +#adicionando las variables al contexto +Context()->variables->are($var1=>"Real", uc($var1)=>"Real"); + +#Si se aplica el método reduce() en los objetos del "Contexto" declarado. +#No usar estas reglas al aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('y-x','-(x+y)'); + +$t1 = Compute("$a$var1**($n1)")->reduce; +$t2 = Compute("$b$var1**($n2)")->reduce; +$t3 = Compute("$c$var1**($n3)")->reduce; + +$fcc = gcd(gcd($a,$b),$c); +$mns = min($n1,$n2,$n3); + +$answer = Formula("$fcc $var1**($mns)")->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +El máximo común divisor (MCD) de +\[ +$t1,\quad $t2,\quad $t3 +\] +es: +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Encontrar el MCD de los coeficientes numéricos: +\[ + \text{MCD}($a,$b,$c) = $fcc +\] +$PAR +$BBOLD Paso 2:$EBOLD Encontrar el MCD de la variable: +\[ + \text{MCD}_$var1($var1^{$n1},$var1^{$n2},$var1^{$n3}) = $var1^{$mns} +\] +$PAR +$BBOLD Paso 3:$EBOLD Multiplicar lo obtenido en el paso 1 y 2: +\[ +\text{MCD} = $answer +\] +$PAR +Por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factor_comun/factor_comun_maximo_comun_divisor_B.pg b/Contrib/UPRM/Prebasica/factor_comun/factor_comun_maximo_comun_divisor_B.pg new file mode 100644 index 0000000000..cdaefa1bff --- /dev/null +++ b/Contrib/UPRM/Prebasica/factor_comun/factor_comun_maximo_comun_divisor_B.pg @@ -0,0 +1,135 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizacion: encontrar el factor común dado una lista de tres términos + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factor_comun/factor_comun_maximo_comun_divisor.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Factor común) +## Level(1) +## KEYWORDS('factorizacion','factor comun') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +#las constantes de los términos: a x^n1 y^m1, b x^n2 y^m2, c x^n3 y^m3 +$k = list_random(1,2,3,5,7); +$a = $k*non_zero_random(-20,20); +$b = $k*non_zero_random(-20,20); +$c = $k*non_zero_random(-20,20); + +$n1 = random(2,20); +$m1 = random(2,20); +$n2 = random(2,20); +$m2 = random(2,20); +$n3 = random(2,20); +$m3 = random(2,20); + +#eligiendo las variables +$var1 = list_random('a','b','m','n','x','y','z','w','p','q','r','s','t','u','v'); +do { + $var2 = list_random('a','b','m','n','x','y','z','w','p','q','r','s','t','u','v'); +} until ($var2 ne $var1); + +#adicionando las variables al contexto +Context()->variables->are($var1=>"Real", uc($var1)=>"Real", $var2=>"Real", uc($var2)=>"Real"); + +#Si se aplica el método reduce() en los objetos del "Contexto" declarado. +#No usar estas reglas al aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('y-x','-(x+y)'); + +$t1 = Compute("$a$var1**($n1) $var2**($m1)")->reduce; +$t2 = Compute("$b$var1**($n2) $var2**($m2)")->reduce; +$t3 = Compute("$c$var1**($n3) $var2**($m3)")->reduce; + +$fcc = gcd(gcd($a,$b),$c); +$mns = min($n1,$n2,$n3); +$mms = min($m1,$m2,$m3); + +$answer = Formula("$fcc $var1**($mns) $var2**($mms)")->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +El máximo común divisor (MCD) de +\[ +$t1,\quad $t2,\quad $t3 +\] +es: +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Encontrar el MCD de los coeficientes numéricos: +\[ + \text{MCD}($a,$b,$c) = $fcc +\] +$PAR +$BBOLD Paso 2:$EBOLD Encontrar el MCD de las variables: +\[ +\begin{align*} + \text{MCD}_$var1($var1^{$n1},$var1^{$n2},$var1^{$n3}) = $var1^{$mns} \\[0.2cm] + \text{MCD}_$var2($var2^{$m1},$var2^{$m2},$var2^{$m3}) = $var2^{$mms} +\end{align*} +\] +$PAR +$BBOLD Paso 3:$EBOLD Multiplicar lo obtenido en el paso 1 y 2: +\[ +\text{MCD} = $answer +\] +$PAR +Por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factor_comun/factorizacion_A.pg b/Contrib/UPRM/Prebasica/factor_comun/factorizacion_A.pg new file mode 100644 index 0000000000..6e7e706515 --- /dev/null +++ b/Contrib/UPRM/Prebasica/factor_comun/factorizacion_A.pg @@ -0,0 +1,149 @@ +# DESCRIPTION +# +# Tipo: Selección múltiple, única respuesta +# Factorizacion: factor común tipo: +# ax^n1 + bx^n2 + cx^n3 = mcd(a,b,c)x^min(n1,n2,n3)*( lo que queda ) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factor_comun/factorizacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Factor común) +## Level(1) +## KEYWORDS('factorizacion','factor comun') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +#las constantes de la expresión a factorizar: a x^n1+ b x^n2 + c x^n3 +$k = random(1,10); +$a = $k*non_zero_random(-20,20); +$b = $k*non_zero_random(-20,20); +$c = $k*non_zero_random(-20,20); + +$n1 = random(2,20); +$n2 = random(2,20); +$n3 = random(2,20); + +#eligiendo la variable +$var1 = list_random('a','b','m','n','x','y','z','w','p','q','r','s','t','u','v'); + +#adicionando la variable al contexto +Context()->variables->are($var1=>"Real", uc($var1)=>"Real"); +Context()->noreduce('(-x)-y', '(-x)+y'); + +$exp = Compute("$a$var1**($n1) + $b$var1**($n2) + $c$var1**($n3)")->reduce; +$exp_aux = "$a$var1^{$n1}+$b$var1^{$n2}+$c$var1^{$n3}"; + +$fcc = gcd(gcd($a,$b),$c); +$mns = min($n1,$n2,$n3); + +$mcd_term = Formula("$fcc$var1**($mns)")->reduce; + +$t1 = Compute("$a/$fcc$var1**($n1-$mns)")->reduce; +$t2 = Compute("$b/$fcc$var1**($n2-$mns)")->reduce; +$t3 = Compute("$c/$fcc$var1**($n3-$mns)")->reduce; + +$temp_exp = Compute("$mcd_term*$t1+$mcd_term*$t2+$mcd_term*$t3")->reduce; + +#Opciones a mostrar, r1, r2, r3, junto con la respuesta r. +$r = Compute("$mcd_term($t1+$t2+$t3)")->reduce->TeX; +$r1 = Compute("$fcc($a/$fcc$var1**($n1)+$b/$fcc$var1**($n2)+$c/$fcc$var1**($n3))")->reduce->TeX; +$r2 = Compute("$var1($a$var1**($n1-1)+$b$var1**($n2-1)+$c$var1**($n3-1))")->reduce->TeX; +$r3 = Compute("$fcc$var1( $a/$fcc$var1**($n1-1)+$b/$fcc$var1**($n2-1)+$c/$fcc$var1**($n3-1))")->reduce->TeX; + +$radio = RadioButtons( [ + "\($r\)", + "\($r1\)", + "\($r2\)", + "\($r3\)", + "Ninguna de las otras"], + "\($r\)", + last =>["Ninguna de las otras"], + labels => "ABC", + separator => "$BR$BR" +); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorice la siguiente expresión +\[ +$exp +\] +$PAR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Calcular el máximo común divisor (MCD) de los términos, en este caso es: +\[ + $mcd_term +\] +$PAR +$BBOLD Paso 2:$EBOLD Aislar el MCD en cada expresión +\[ +$exp = $temp_exp +\] +$PAR +$BBOLD Paso 2:$EBOLD Usar la ley distributiva para factorizar el MCD asegurándose poner entre paréntesis la expresión restante +\[ +$temp_exp = $r +\] +$PAR +Por lo tanto la respuesta es: \($r\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factor_comun/factorizacion_B.pg b/Contrib/UPRM/Prebasica/factor_comun/factorizacion_B.pg new file mode 100644 index 0000000000..8bdd379218 --- /dev/null +++ b/Contrib/UPRM/Prebasica/factor_comun/factorizacion_B.pg @@ -0,0 +1,139 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizacion: factor común tipo: +# ax^n1y^m1 + bx^n2y^m2 + cx^n3y^m3 = mcd(a,b,c)x^min(n1,n2,n3)y^min(m1,m2,m3)*( lo que queda ) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factor_comun/factorizacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Factor común) +## Level(1) +## KEYWORDS('factorizacion','factor comun') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("LimitedFactor"); + +#las constantes de la expresión a factorizar: a x^n1 y^m1 + b x^n2 y^m2 + c x^n3 y^m3 +$k = list_random(1,2,3,5,7); +$a = $k*non_zero_random(-20,20); +$b = $k*non_zero_random(-20,20); +$c = $k*non_zero_random(-20,20); + +$n1 = random(2,20); +$m1 = random(2,20); +$n2 = random(2,20); +$m2 = random(2,20); +$n3 = random(2,20); +$m3 = random(2,20); + +#eligiendo las variables +$var1 = list_random('a','b','m','n','x','y','z','w','p','q','r','s','t','u','v'); +do { + $var2 = list_random('a','b','m','n','x','y','z','w','p','q','r','s','t','u','v'); +} until ($var2 ne $var1); + +#adicionando las variables al contexto +Context()->variables->are($var1=>"Real", uc($var1)=>"Real", $var2=>"Real", uc($var2)=>"Real"); + +#Si se aplica el método reduce() en los objetos del "Contexto" declarado. +#No usar estas reglas al aplicar las técnicas de reducción a expresiones. +Context()->noreduce('y-x','-(x+y)'); + +#$exp = Compute("$a$var1**($n1)$var2**($m1)+$b$var1**($n2)$var2**($m2)+$c$var1**($n3)$var2**($m3)")->reduce; + +$exp = "$a$var1^{$n1}$var2^{$m1}+$b$var1^{$n2}$var2^{$m2}+$c$var1^{$n3}$var2^{$m3}"; + +$fcc = gcd(gcd($a,$b),$c); +$mns = min($n1,$n2,$n3); +$mms = min($m1,$m2,$m3); + +$mcd_term = Formula("$fcc $var1**($mns) $var2**($mms)")->reduce; +$t1 = Compute("$a/$fcc$var1**($n1-$mns) $var2**($m1-$mms)")->reduce; +$t2 = Compute("$b/$fcc$var1**($n2-$mns) $var2**($m2-$mms)")->reduce; +$t3 = Compute("$c/$fcc$var1**($n3-$mns) $var2**($m3-$mms)")->reduce; + +$temp_exp = Compute("$mcd_term*$t1+$mcd_term*$t2+$mcd_term*$t3")->reduce; + +$answer = Compute("$mcd_term($t1+$t2+$t3)")->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorice la siguiente expresión +\[ +$exp +\] +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Calcular el máximo común divisor (MCD) de los términos, en este caso es: +\[ + $mcd_term +\] +$PAR +$BBOLD Paso 2:$EBOLD Aislar el MCD en cada expresión +\[ +$exp = $temp_exp +\] +$PAR +$BBOLD Paso 2:$EBOLD Usar la ley distributiva para factorizar el MCD asegurándose poner entre paréntesis la expresión restante +\[ +$temp_exp = $answer +\] +$PAR +Por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factor_comun/factorizacion_C.pg b/Contrib/UPRM/Prebasica/factor_comun/factorizacion_C.pg new file mode 100644 index 0000000000..9de5ee78c3 --- /dev/null +++ b/Contrib/UPRM/Prebasica/factor_comun/factorizacion_C.pg @@ -0,0 +1,155 @@ +# DESCRIPTION +# +# Tipo: Selección múltiple, única respuesta +# Factorizacion: factor común tipo: +# ax^n1y^m1 + bx^n2y^m2 + cx^n3y^m3 = mcd(a,b,c)x^min(n1,n2,n3)y^min(m1,m2,m3)*( lo que queda ) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factor_comun/factorizacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Factor común) +## Level(1) +## KEYWORDS('factorizacion','factor comun') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +#las constantes de la expresión a factorizar: a x^n1 y^m1 + b x^n2 y^m2 + c x^n3 y^m3 +$k = list_random(1,2,3,5,7); +$a = $k*non_zero_random(-20,20); +$b = $k*non_zero_random(-20,20); +$c = $k*non_zero_random(-20,20); + +$n1 = random(2,20); +$m1 = random(2,20); +$n2 = random(2,20); +$m2 = random(2,20); +$n3 = random(2,20); +$m3 = random(2,20); + +#eligiendo las variables +$var1 = list_random('a','b','m','n','x','y','z','w','p','q','r','s','t','u','v'); +do { + $var2 = list_random('a','b','m','n','x','y','z','w','p','q','r','s','t','u','v'); +} until ($var2 ne $var1); + +#adicionando las variables al contexto +Context()->variables->are($var1=>"Real", uc($var1)=>"Real", $var2=>"Real", uc($var2)=>"Real"); +Context()->noreduce('y-x'); + +$exp = Compute("$a$var1**($n1)$var2**($m1)+$b$var1**($n2)$var2**($m2)+$c$var1**($n3)$var2**($m3)")->reduce; + +$fcc = gcd(gcd($a,$b),$c); +$mns = min($n1,$n2,$n3); +$mms = min($m1,$m2,$m3); + +$mcd_term = Formula("$fcc$var1**($mns)$var2**($mms)")->reduce; + +$t1 = Compute("$a/$fcc$var1**($n1-$mns) $var2**($m1-$mms)")->reduce; +$t2 = Compute("$b/$fcc$var1**($n2-$mns) $var2**($m2-$mms)")->reduce; +$t3 = Compute("$c/$fcc$var1**($n3-$mns) $var2**($m3-$mms)")->reduce; + +$temp_exp = Compute("$mcd_term*$t1+$mcd_term*$t2+$mcd_term*$t3")->reduce; + +#Opciones a mostrar junto con la respuesta +$r = Compute("$mcd_term($t1+$t2+$t3)")->reduce->TeX; +$r1 = Compute("$fcc($a/$fcc$var1**($n1)$var2**($m1)+$b/$fcc$var1**($n2)$var2**($m2)+$c/$fcc$var1**($n3)$var2**($m3))")->reduce->TeX; +$r2 = Compute("$var1$var2($a$var1**($n1-1)$var2**($m1-1)+$b$var1**($n2-1)$var2**($m2-1)+$c$var1**($n3-1)$var2**($m3-1))")->reduce->TeX; +$r3 = Compute("$fcc$var1$var2( $a/$fcc$var1**($n1-1)$var2**($m1-1)+$b/$fcc$var1**($n2-1)$var2**($m2-1)+$c/$fcc$var1**($n3-1)$var2**($m3-1))")->reduce->TeX; + +$radio = RadioButtons( [ + "\($r\)", + "\($r1\)", + "\($r2\)", + "\($r3\)", + "Ninguna de las otras"] , + "\($r\)", + last =>["Ninguna de las otras"], + labels => "ABC", + separator => "$BR$BR" +); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorice la siguiente expresión +\[ +$exp +\] +$PAR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Calcular el máximo común divisor (MCD) de los términos, en este caso es: +\[ + $mcd_term +\] +$PAR +$BBOLD Paso 2:$EBOLD Aislar el MCD en cada expresión +\[ +$exp = $temp_exp +\] +$PAR +$BBOLD Paso 2:$EBOLD Usar la ley distributiva para factorizar el MCD asegurándose poner entre paréntesis la expresión restante +\[ +$temp_exp = $r +\] +$PAR +Por lo tanto la respuesta es: \($r\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factorizacion/factorizar_cuadratica_A.pg b/Contrib/UPRM/Prebasica/factorizacion/factorizar_cuadratica_A.pg new file mode 100644 index 0000000000..e3b04d1878 --- /dev/null +++ b/Contrib/UPRM/Prebasica/factorizacion/factorizar_cuadratica_A.pg @@ -0,0 +1,108 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizar diferencia de cuadrados + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factorizacion/factorizar_cuadratica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Diferencia de cuadrados) +## Level(1) +## KEYWORDS('factorizacion','diferencia de cuadrados') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#la expresión a factorizar: (ax)^2 - b^2 = (ax+b)(ax-b) +$a = random(1,20); +$b = (1,20); + +$aa = $a*$a; +$bb = $b*$b; + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$exp = Formula("$aa x^2 - $bb")->reduce(); + +Context("LimitedFactor"); + +$answer = Compute("($a x + $b)($a x - $b)")->reduce(); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorizar completamente +\[ +$exp +\] +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar que se puede aplicar el método de diferencia de cuadrados para factorizar: +$PAR +\(\phantom{aaa}\) i. \(\sqrt{$aa x^2} = $a x\) +$BR +\(\phantom{aaa}\) ii. \(\sqrt{$bb} = $b\) +$PAR +entonces \($exp = ($a x)^2 - ($b)^2\) +$PAR +$BBOLD Paso 2:$EBOLD Factorizar +\[ + ($a x)^2 - ($b)^2 = $answer, +\] +$BR +por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factorizacion/factorizar_cuadratica_B.pg b/Contrib/UPRM/Prebasica/factorizacion/factorizar_cuadratica_B.pg new file mode 100644 index 0000000000..ab42e5d332 --- /dev/null +++ b/Contrib/UPRM/Prebasica/factorizacion/factorizar_cuadratica_B.pg @@ -0,0 +1,108 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizar trinomios tipo x^2 + (p+q)x + pq + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factorizacion/factorizar_cuadratica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Trinomios cuadrados perfectos) +## Level(1) +## KEYWORDS('factorizacion','trinomios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#la expresión a factorizar: x^2 + (p+q)x + pq = (x+p)(x+q) +#eligiendo p y q diferentes +$p = non_zero_random(-20,20); +do{ + $q = non_zero_random(-20,20); +}until($q!=$p); + +$p_mas_q = $p+$q; +$pq = $p*$q; + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$exp = Formula("x^2 + ($p+$q) x + $p*$q")->reduce(); + +Context("LimitedFactor"); +$answer = Compute("(x + $p)(x + $q)")->reduce(); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorizar completamente +\[ +$exp +\] +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar que se puede aplicar el método \(x^2+(p+q)x+pq = (x+p)(x+q)\): +$PAR +\(\phantom{aaa}\) i. \((p+q)x =($p_mas_q) x = ($p+$q)x \) +$BR +\(\phantom{aaa}\) ii. \(pq = $pq = ($p)\cdot ($q)\) +$PAR +$BBOLD Paso 2:$EBOLD Factorizar +\[ + x^2+(p+q)x+pq = $answer, +\] +$BR +por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factorizacion/factorizar_cuadratica_C.pg b/Contrib/UPRM/Prebasica/factorizacion/factorizar_cuadratica_C.pg new file mode 100644 index 0000000000..3ee9db569a --- /dev/null +++ b/Contrib/UPRM/Prebasica/factorizacion/factorizar_cuadratica_C.pg @@ -0,0 +1,116 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizar Cuadrados perfectos x^2 + 2ax + a^2 + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factorizacion/factorizar_cuadratica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Cuadrados perfectos) +## Level(1) +## KEYWORDS('factorizacion','cuadrados perfectos') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#la expresión a factorizar: x^2+2ax + a^2 +$a = non_zero_random(-20,20); + +$aa = $a*$a; +$dos_a = 2*$a; +$abs_a = abs($a); + +if ($a> 0){ + $tipo = "suma"; + $simbolo = "+"; +}else{ + $tipo = "resta"; + $simbolo = "-"; +} + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$exp = Formula("x^2+2*$a x + $a*$a")->reduce(); + +$answer = Compute("(x + $a)^2")->reduce(); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorizar completamente +\[ +$exp +\] +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar que se puede aplicar el método de Cuadrados perfectos de una $tipo para factorizar: +$PAR +\(\phantom{aaa}\) i. \(\sqrt{x^2} = x\) +$BR +\(\phantom{aaa}\) ii. \(\sqrt{$aa} = $a\) +$PAR +\(\phantom{aaa}\) iii. \(2\cdot ($a) x = $dos_a x\) +$PAR +entonces \($exp = (x)^2 $simbolo (2\cdot $abs_a) x + ($abs_a)^2\) +$PAR +$BBOLD Paso 2:$EBOLD Factorizar +\[ + (x)^2 $simbolo (2\cdot $abs_a) x + ($abs_a)^2 = $answer, +\] +$BR +por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factorizacion_agrupacionn/factorizacion_agrupacion_A.pg b/Contrib/UPRM/Prebasica/factorizacion_agrupacionn/factorizacion_agrupacion_A.pg new file mode 100644 index 0000000000..1ac447ac30 --- /dev/null +++ b/Contrib/UPRM/Prebasica/factorizacion_agrupacionn/factorizacion_agrupacion_A.pg @@ -0,0 +1,137 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizacion por agrupación de términos tipo: x^2 + (p+q)x + pq + xy + py = (x+p)(x+q+y) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factorizacion_agrupacion/factorizacion_agrupacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Por agrupacion) +## Level(1) +## KEYWORDS('factorizacion','agrupacion','factor comun') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +#eliminando la variable por defecto x del contexto, +# para que luego pueda salir elegida y no nuestre una advertencia +Context()->variables->remove("x"); + +#la expresión a factorizar: x^2 + (p+q)x + pq + xy + py +$p = non_zero_random(-20,20); +$q = non_zero_random(-20,20); + +#eligiendo las variables +@vars = ("a","b","c","d","e","g","p","q","w","x"); +$index1 = random(0,9); +do { + $index2 = random(0,9); +} until ($index1 != $index2); + +Context()->variables->add($vars[$index1] => 'Real'); +Context()->variables->add($vars[$index2] => 'Real'); + +$exp1 = Formula("$vars[$index1]^2 + ($p+$q)$vars[$index1] + $p*$q")->reduce(); +$exp2 = Formula("$vars[$index1] $vars[$index2] + $p $vars[$index2]")->reduce(); + +$factor1 = Formula("$vars[$index1] + $p")->reduce(); +$factor2 = Formula("$vars[$index1] + $q")->reduce(); +$factor3 = Formula("$vars[$index2]( $vars[$index1] + $p)")->reduce(); +$factor4 = Formula("($factor1) + $vars[$index2] "); + +$exp = Formula("$vars[$index1]^2 + ($p+$q)$vars[$index1] + $p*$q + $vars[$index1] $vars[$index2] + $p $vars[$index2]")->reduce(); + + +Context("LimitedFactor"); +Context()->variables->remove("x"); +Context()->variables->add($vars[$index1] => 'Real'); +Context()->variables->add($vars[$index2] => 'Real'); +$answer = Compute("$factor1*$factor4")->reduce(); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorizar +\[ +$exp +\] +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Agrupar términos que se pueden factorizar +\[ +$exp = ($exp1) + ($exp2) +\] +$PAR +$BBOLD Paso 2:$EBOLD Factorizar cada grupo +\[ +\begin{align*} + $exp1 &= ($factor1)($factor2) \\[0.2cm] + $exp2 &= $factor3 +\end{align*} +\] +$PAR +$BBOLD Paso 3:$EBOLD Factorizar utilizando factor común +\[ +\begin{align*} + $exp &= ($factor1)($factor2) + $factor3 \\[0.2cm] + &= ($factor1)( ( $vars[$index1] + $q )+$vars[$index2]) \\[0.2cm] + &= $answer +\end{align*} +\] +$PAR +Por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factorizacion_agrupacionn/factorizacion_agrupacion_B.pg b/Contrib/UPRM/Prebasica/factorizacion_agrupacionn/factorizacion_agrupacion_B.pg new file mode 100644 index 0000000000..d6f0b628f0 --- /dev/null +++ b/Contrib/UPRM/Prebasica/factorizacion_agrupacionn/factorizacion_agrupacion_B.pg @@ -0,0 +1,131 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizacion por agrupación de términos tipo: qp^3+aqp^2+bp+ba = (p+a)(qp^2+b) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factorizacion_agrupacion/factorizacion_agrupacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Por agrupacion) +## Level(1) +## KEYWORDS('factorizacion','agrupacion','factor comun') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#eliminando la variable por defecto x del contexto, +# para que luego pueda salir elegida y no nuestre una advertencia +# si se escoje +Context()->variables->remove("x"); + +#la expresión a factorizar: qp^3+aqp^2+bp+ba +$a = non_zero_random(-20,20); +$b = non_zero_random(-20,20); + +#eligiendo las variables +@vars = ("a","b","c","d","e","g","p","q","w","x"); +$index1 = random(0,9); +do { + $index2 = random(0,9); +} until ($index1 != $index2); + +Context()->variables->add($vars[$index1] => 'Real'); +Context()->variables->add($vars[$index2] => 'Real'); +$exp1 = Formula(" $vars[$index1] $vars[$index2]^3 + $a $vars[$index1] $vars[$index2]^2 ") ->reduce(); +$exp2 = Formula("$b $vars[$index2] + $b*$a")->reduce(); + +$factor1 = Formula("$vars[$index2] + $a")->reduce(); +$factor2 = Formula("$vars[$index1] $vars[$index2] + $b")->reduce(); + +$exp = Formula("$exp1 + $exp2")->reduce(); + +Context("LimitedFactor"); +Context()->variables->remove("x"); +Context()->variables->add($vars[$index1] => 'Real'); +Context()->variables->add($vars[$index2] => 'Real'); +$answer = Compute("($vars[$index2] +$a)($vars[$index1] $vars[$index2]^2+$b)")->reduce(); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorizar +\[ +$exp +\] +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Agrupar términos que se pueden factorizar +\[ +$exp = ($exp1) + ($exp2) +\] +$PAR +$BBOLD Paso 2:$EBOLD Factorizar cada grupo +\[ +\begin{align*} + $exp1 &= $vars[$index1] $vars[$index2]^2($factor1) \\[0.2cm] + $exp2 &= $b($factor1) +\end{align*} +\] +$PAR +$BBOLD Paso 3:$EBOLD Factorizar utilizando factor común +\[ +\begin{align*} + $exp &= $vars[$index1] $vars[$index2]^2($factor1) + $b($factor1) \\[0.2cm] + &= $answer +\end{align*} +\] +$PAR +Por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factorizacion_agrupacionn/factorizacion_agrupacion_C.pg b/Contrib/UPRM/Prebasica/factorizacion_agrupacionn/factorizacion_agrupacion_C.pg new file mode 100644 index 0000000000..40eecf0611 --- /dev/null +++ b/Contrib/UPRM/Prebasica/factorizacion_agrupacionn/factorizacion_agrupacion_C.pg @@ -0,0 +1,122 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizacion por agrupación de términos tipo: p^3+ap^2+bp+ab = (p+a)(p^2+b) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factorizacion_agrupacion/factorizacion_agrupacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Por agrupacion) +## Level(1) +## KEYWORDS('factorizacion','agrupacion','factor comun') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#la expresión a factorizar: p^3+ap^2+bp+ab +$a = non_zero_random(-20,20); +$b = non_zero_random(-20,20); +$ab = $a*$b; + +#eligiendo las variables +@vars = ("b","c","d","e","g","p","q","w","y"); +$index = random(0,8); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +#Context()->noreduce('(-x)-y','(-x)+y'); + +Context()->variables->add($vars[$index] => 'Real'); +$exp = Formula(" $vars[$index]^3 + $a $vars[$index]^2 + $b $vars[$index] + $b*$a")->reduce(); + +$factor1 = Formula("$vars[$index] + $a")->reduce(); +$factor2 = Formula("$vars[$index]^2 + $b")->reduce(); + +Context("LimitedFactor"); +Context()->variables->add($vars[$index] => 'Real'); +$answer = Compute("($vars[$index] +$a)($vars[$index]^2+$b)")->reduce(); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorizar +\[ +$exp +\] +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Agrupar términos que se pueden factorizar +\[ +$exp = ($vars[$index]^3 + $a $vars[$index]^2) + ($b $vars[$index] + $ab) +\] +$PAR +$BBOLD Paso 2:$EBOLD Factorizar cada grupo +\[ +\begin{align*} + $exp1 &= $vars[$index]^2($factor1) \\[0.2cm] + $exp2 &= $b($factor1) +\end{align*} +\] +$PAR +$BBOLD Paso 3:$EBOLD Factorizar utilizando factor común +\[ +\begin{align*} + $exp &= $vars[$index]^2($factor1) + $b($factor1) \\[0.2cm] + &= $answer +\end{align*} +\] +$PAR +Por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factorizacion_de_trinomios/factorizar_trinomio_coeficiente_principal_diferente_de_uno.pg b/Contrib/UPRM/Prebasica/factorizacion_de_trinomios/factorizar_trinomio_coeficiente_principal_diferente_de_uno.pg new file mode 100644 index 0000000000..20177f8f90 --- /dev/null +++ b/Contrib/UPRM/Prebasica/factorizacion_de_trinomios/factorizar_trinomio_coeficiente_principal_diferente_de_uno.pg @@ -0,0 +1,121 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizar trinomios tipo ax^2 + bx + c +# + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factorizacion_de_trinomios/factorizar_trinomio_coeficiente_principal_diferente_de_uno.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Trinomios cuadrados perfectos) +## Level(1) +## KEYWORDS('factorizacion','trinomios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Creando las constantes para ax^2+bx+c + +do { + $B = non_zero_random(-9,9); + $D = non_zero_random(-9,9); + do { + $A = non_zero_random(-5,5); + $C = non_zero_random(-5,5); + }until ( abs($A*$C) > 1 ); +}until ( $A*$D + $B*$C != 0); + +#Construimos ax^2+bx+c +$a = $A*$C; +$b = $A*$D + $B*$C; +$c = $B*$D; + +Context("LimitedFactor"); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$exp = Formula("$a x^2 + $b x + $c")->reduce(); + + +$answer = Compute(" ($A x + $B)($C x + $D) ")->reduce(); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorice completamente el siguiente trinomio +\[ +$exp +\] +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El trinomio es de la forma +\[ + $exp = (ax + b)(cx + d). +\] +$PAR +$BBOLD Paso 1:$EBOLD Buscar el cuarteto \( (a,b,c,d) \) tal que \( a\times c = $a \), \( b \times d = $c \) y \( ad + bc = $b \). Para este ejercicio: +\[ + (a,b,c,d) = ($A,$B,$C,$D) +\] +$PAR +$BBOLD Paso 2:$EBOLD Factorizando se obtiene +\[ + $exp = $answer, +\] +$BR +por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factorizacion_de_trinomios/factorizar_trinomio_coeficiente_principal_uno.pg b/Contrib/UPRM/Prebasica/factorizacion_de_trinomios/factorizar_trinomio_coeficiente_principal_uno.pg new file mode 100644 index 0000000000..dd12d479c1 --- /dev/null +++ b/Contrib/UPRM/Prebasica/factorizacion_de_trinomios/factorizar_trinomio_coeficiente_principal_uno.pg @@ -0,0 +1,109 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizar trinomios tipo x^2 + (p+q)x + pq + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factorizacion_de_trinomios/factorizar_trinomio_coeficiente_principal_uno.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Trinomios cuadrados perfectos) +## Level(1) +## KEYWORDS('factorizacion','trinomios') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#la expresión a factorizar: x^2 + (p+q)x + pq = (x+p)(x+q) +#eligiendo p y q diferentes +$p = non_zero_random(-20,20); +do{ + $q = non_zero_random(-20,20); +}until( $q != $p ); + +$p_mas_q = $p+$q; +$pq = $p*$q; + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$exp = Formula("x^2 + ($p+$q) x + $p*$q")->reduce(); + +Context("LimitedFactor"); +$answer = Compute("(x + $p)(x + $q)")->reduce(); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorice completamente el siguiente trinomio +\[ +$exp +\] +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El objetivo es expresar \( $exp = (x+a)(x+b) \). +$PAR +$BBOLD Paso 1:$EBOLD Buscar el par \( (a,b) \) tal que \( a\times b = $pq \) y \( a + b = $p_mas_q \). Para este ejercicio: +\[ + (a,b) = ($p,$q)\quad \text{o} \quad (a,b) = ($q,$p). +\] +$PAR +$BBOLD Paso 2:$EBOLD Factorizando se obtiene +\[ + $exp = $answer, +\] +$BR +por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/factorizacion_suma_diferencia_de_cubos/diferencia_suma_de_cubos.pg b/Contrib/UPRM/Prebasica/factorizacion_suma_diferencia_de_cubos/diferencia_suma_de_cubos.pg new file mode 100644 index 0000000000..fbb2ae4f77 --- /dev/null +++ b/Contrib/UPRM/Prebasica/factorizacion_suma_diferencia_de_cubos/diferencia_suma_de_cubos.pg @@ -0,0 +1,129 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Factorizar diferencia de cubos + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/factorizacion_suma_diferencia_de_cubos/diferencia_suma_de_cubos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Factorizacion) +## DBsection(Diferencia o suma de cubos) +## Level(1) +## KEYWORDS('factorizacion','diferencia de cubos','suma de cubos') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#la expresión a factorizar: (ax^n)^3 \pm b^3 = (ax^n+b)(a^2x^2n \pm abx^n + b^2) +$a = random(1,9); +do{ + $b = random(1,9); +}until ($a != $b); +$n = random(2,5); + +$aaa = $a**3; +$bbb = $b**3; +$n3 = 3*$n; + +$ab = $a*$b; + +Context("LimitedFactor"); + +Context()->noreduce('(-x)-y','(-x)+y'); +if (random(0,1) == 0){ + $signo = "+"; + $o_signo = "-"; + $tipo = "suma"; + $answer = Compute("($a x**$n + $b)($a**2 x**(2*$n) - $ab x**$n + $b**2)")->reduce(); +}else{ + $signo = "-"; + $o_signo = "+"; + $tipo = "diferencia"; + $answer = Compute("($a x**$n - $b)($a**2 x**(2*$n) + $ab x**$n + $b**2)")->reduce(); +} + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); + +$exp = Compute("$aaa x^{$n3} $signo $bbb")->reduce; +$ax = Compute("($a x**$n)")->reduce; +$aaax = Compute("($aaa x**$n3)")->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Factorice completamente +\[ +$exp +\] +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Verificar que cada término es un cubo perfecto: +$PAR +\(\phantom{aaa}\) i. \(\sqrt[3]{$aaax} = $ax\) +$BR +\(\phantom{aaa}\) ii. \(\sqrt[3]{$bbb} = $b\) +$PAR +entonces \( $exp = ($ax)^3 $signo $b^3 \) +$PAR +$BBOLD Paso 2:$EBOLD Aplicar fórmula de $tipo de cubos: +\[ +\begin{align*} + ($ax)^3 $signo $b^3 &= \left( ($ax) $signo $b\right)\left( ($ax)^2 $o_signo ($ax)($b) + ($b)^2 \right) \\[0.2cm] + & = $answer +\end{align*} +\] +$BR +por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/fracciones/fracciones_equivalentes.pg b/Contrib/UPRM/Prebasica/fracciones/fracciones_equivalentes.pg new file mode 100644 index 0000000000..87589c3b2a --- /dev/null +++ b/Contrib/UPRM/Prebasica/fracciones/fracciones_equivalentes.pg @@ -0,0 +1,111 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Fracciones equivalentes + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/fracciones/fracciones_equivalentes.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Fracciones) +## DBsection(Equivalentes) +## Level(1) +## KEYWORDS('fracciones','equivalencia','equivalentes') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@vars = ("a","b","c","d","e","f", "g","h","i","k","l","m","n","o","p","q","r","s", "t","u","v","w","x","y","z"); +$index = random(0,24); + +Context("Fraction"); +$a = random(6,50); +$b = random(5,60); + +#Aleatorizando la constante de proporcionalidad +$k = random(2,8); + +$c = $a*$k; +$d = $b*$k; + +$fraccion1 = Fraction($a,$b); +$fraccion2 = Fraction($c,$d); + +$prob = random(0,1); +if ($prob == 0){ + $answer = Compute($c); + $cadena = "\frac{ $vars[$index] }{ $d }"; + $sol_exp1 = "$a \cdot $d = $vars[$index] \cdot $b"; + $sol_exp2 = "$vars[$index] = \frac{$a \cdot $d }{$b}"; +}else{ + $answer = Compute($d); + $cadena = "\frac{ $c }{ $vars[$index] }"; + $sol_exp1 = "$a \cdot $d = $c \cdot $vars[$index]"; + $sol_exp2 = "$vars[$index] = \frac{$c \cdot $b }{$a}"; +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +¿Cuál debe ser el valor de la variable \( $vars[$index] \) para que las siguientes fracciones sean equivalentes? +\[ +\frac{$a}{$b} = $cadena +\] +$PAR +\( $vars[$index] = \) \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Podemos encontrar el valor \( $vars[$index] \) multiplicamos en cruz \( \frac{$a}{$b} = $cadena \) +\[ + $sol_exp1 \quad \Rightarrow \quad $sol_exp2, +\] +simplificamos y/o reducimos la fracción, por lo tanto \($vars[$index] = $answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/fracciones/fracciones_mixtas_A.pg b/Contrib/UPRM/Prebasica/fracciones/fracciones_mixtas_A.pg new file mode 100644 index 0000000000..ca32fc717b --- /dev/null +++ b/Contrib/UPRM/Prebasica/fracciones/fracciones_mixtas_A.pg @@ -0,0 +1,92 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Fracciones mixtas: de mixta a impropia + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/fracciones/fracciones_mixtas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Fracciones) +## DBsection(Mixtas) +## Level(1) +## KEYWORDS('fracciones','mixtas') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$a = random(6,50); +$b = random(1,5); +$c = random(6,9); +$ac = $a*$c; + +$nume = $a*$c+$b; +$deno = $c; + +Context("Fraction"); +$answer = Fraction($nume,$deno); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La siguiente es la fracción impropia asociado con el mixto \($a \frac{$b}{$c} \). La respuesta debe ser una fracción \( \frac{a}{b} \) en su mínima expresión. +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD \($a \frac{$b}{$c} \) indica que tenemos \($a\) partes enteras y \( \frac{$b}{$c} \) partes de una unidad. +$PAR +$BBOLD Paso 2:$EBOLD Una parte entera se puede expresar como \( \frac{$c}{$c} \), luego \($a\) partes enteras en la forma \( \frac{$ac}{$c} \). Por consiguiente, +\[ + $a \frac{$b}{$c} = \frac{$ac}{$c} + \frac{$b}{$c} = \frac{$nume}{$deno}. +\] +Por lo tanto la solución es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/fracciones/fracciones_mixtas_B.pg b/Contrib/UPRM/Prebasica/fracciones/fracciones_mixtas_B.pg new file mode 100644 index 0000000000..210301449c --- /dev/null +++ b/Contrib/UPRM/Prebasica/fracciones/fracciones_mixtas_B.pg @@ -0,0 +1,108 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Fracciones mixtas, convertir de impropia a mixta + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/fracciones/fracciones_mixtas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Fracciones) +## DBsection(Mixtas) +## Level(1) +## KEYWORDS('fracciones','mixtas') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$a = random(6,50); +$b = random(1,5); +$c = random(6,9); +$ac = $a*$c; + +$nume = $a*$c+$b; +$deno = $c; + +Context("Fraction"); +$f = Fraction($nume,$deno); + +Context("LimitedFraction"); +$answer = Compute("$a $b/$c"); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La fracción impropia \( $f \) escrita como fracción mixta es: +$PAR +$BBOLD Nota:$EBOLD +Escribir la fracción mixta de la forma \( a\frac{b}{c} \) y con la parte fraccionaria simplificada al máximo. +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} + +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Re-escribir numerador de la fracción usando al mayor entero múltiplo de \( $deno\) menor que \( $nume \): +\[ + \frac{$nume}{$deno} = \frac{$ac+$b}{$c} +\] +$PAR +$BBOLD Paso 2:$EBOLD Distribuir denominador con cada término del numerador y simplificar: +\[ +\frac{$ac+$b}{$c} = \frac{$ac}{$c} + \frac{$b}{$c} = $a + \frac{$b}{$c} +\] +$PAR +$BBOLD Paso 3:$EBOLD Escribir como fracción mixta: +\[ +$a + \frac{$b}{$c} = $a\frac{$b}{$c}. +\] +$PAR +Por tanto, al simplificar la parte propia de ser necesario, la solución es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/fracciones/fracciones_mixtas_C.pg b/Contrib/UPRM/Prebasica/fracciones/fracciones_mixtas_C.pg new file mode 100644 index 0000000000..c4611996ed --- /dev/null +++ b/Contrib/UPRM/Prebasica/fracciones/fracciones_mixtas_C.pg @@ -0,0 +1,99 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Fracciones mixtas, convertir de mixta a impropia + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/fracciones/fracciones_mixtas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Fracciones) +## DBsection(Mixtas) +## Level(1) +## KEYWORDS('fracciones','mixtas') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$a = random(6,50); +$b = random(1,5); +$c = random(6,9); +$ac = $a*$c; + +$nume = $a*$c+$b; +$deno = $c; + +Context("Fraction"); +$answer = Fraction($nume,$deno); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La fracción mixta \( $a\frac{$b}{$c} \) escrita como fracción impropia es: +$PAR +$BBOLD Nota:$EBOLD +Escribir la fracción simplificada al máximo. +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} + +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1, requirePureFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Re-escribir la fracción mixta como la suma de la parte entera y la parte fraccionaria: +\[ +$a \frac{$b}{$c} = $a + \frac{$b}{$c} +\] +$PAR +$BBOLD Paso 2:$EBOLD Sumar la parte entera y la parte fraccionaria: +\[ + $a + \frac{$b}{$c} = \frac{$nume}{$deno}. +\] +Por lo tanto la solución es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/fracciones/multiplicacion_division_fracciones.pg b/Contrib/UPRM/Prebasica/fracciones/multiplicacion_division_fracciones.pg new file mode 100644 index 0000000000..7b4a413f27 --- /dev/null +++ b/Contrib/UPRM/Prebasica/fracciones/multiplicacion_division_fracciones.pg @@ -0,0 +1,158 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Multiplicar o dividir dos fracciones + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/fracciones/multiplicacion_division_fracciones.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Fracciones) +## DBsection(Multiplicacion y division) +## Level(1) +## KEYWORDS('fracciones','mixtas','multiplicacion','division') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#eligiendo los numeradores y denominadores +$a = random(2,20); +do { + $b = random(2,20); +}until ($b != $a); + +$c = random(2,20); +do { + $d = random(2,20); +}until ($d != $c); + + +Context("Fraction"); +$f1 = Fraction($a,$b); +$f2 = Fraction($c,$d); + +@primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199); + +#Usado para retornar la factorización prima de un número +sub factor { + my $n = shift; + my $i = 0; + my $pfactors = ""; + + while ($n > 1){ + while ( ($n % $primes[$i] ) == 0 ){ + $pfactors = $pfactors."$primes[$i]\cdot"; + $n = $n/$primes[$i]; + } + $i++; + } + $pfactors = substr $pfactors, 0, -5; + return $pfactors; +} + +$fa = factor($a); +$fb = factor($b); +$fc = factor($c); +$fd = factor($d); + +$prob = random(0,1); +if ($prob == 0){ + + $opera = "*"; + $exp_text1 ="La multiplicación de fracciones es directa, numerador con numerador y denominador con denominador, + \[ + \frac{$a}{$b} \cdot \frac{$c}{$d} = \frac{$a\cdot $c}{$b\cdot $d} + \] + pero antes si se puede hacemos,"; + + $exp_text2 ="\frac{$fa}{$fb} \cdot \frac{$fc}{$fd}"; + $simbolo = "\cdot"; + +}else{ + + $opera = "/"; + $exp_text1 ="Convertir en multiplicación pues esta se realiza, numerador con numerador y denominador con denominador, + \[ + \frac{$a}{$b} \div \frac{$c}{$d} = \frac{$a}{$b}\cdot \frac{$d}{$c} = \frac{$a\cdot $d}{$b \cdot $c} + \] + pero antes si se puede hacemos,"; + + $exp_text2 ="\frac{$fa}{$fb} \cdot \frac{$fd}{$fc}"; + + $simbolo = "\div"; + +} + + +$answer = Compute("$f1 $opera $f2")->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Realice la siguiente operación +\[ +\frac{$a}{$b} $simbolo \frac{$c}{$d} +\] +y simplifique su resultado completamente. +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1, requirePureFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD $exp_text1 +$PAR +$BBOLD Paso 2:$EBOLD escribir numeradores y denominadores como producto de primos y simplificar antes de multiplicar. +$BR +Luego +\[ +\frac{$a}{$b} $simbolo \frac{$c}{$d} = $exp_text2 = $answer. +\] +Por lo tanto la solución es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/fracciones/proporciones_graficas.pg b/Contrib/UPRM/Prebasica/fracciones/proporciones_graficas.pg new file mode 100644 index 0000000000..ea108c75c6 --- /dev/null +++ b/Contrib/UPRM/Prebasica/fracciones/proporciones_graficas.pg @@ -0,0 +1,157 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada una gráfica con alguna parte de ella sombreada, +# encontrar la fracción que la representa. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/fracciones/proporciones_graficas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Fracciones) +## DBsection(Representación gráfica) +## Level(1) +## KEYWORDS('fracciones','gráfica','sombreada','porcentaje') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Numero de regiones +$n = random(2,20); + +########################################################### +#Subrutina que devuelve un arreglo bidimensional con los valores de x y y +#de los puntos a dividir la circunferencia. +sub getPoints{ + + my $x0 = shift; + my $y0 = shift; + my $r = shift; + my $noOfDividingPoints = shift; + + my @points; + + my $angle = 0; + + for (my $i=0; $i < $noOfDividingPoints; $i++) { + $angle = $i*(6.283/$noOfDividingPoints); + $points[0][$i] = $x0 + $r*cos($angle); + $points[1][$i] = $y0 + $r*sin($angle); + } + return @points; +} +################# termina subrutina ########################## + +Context("Numeric"); +Context()->flags->set(tolerance=>0.00001,tolType=>"absolute"); +$r=10; + +$graph = init_graph(-$r-1,-$r-1, $r+1,$r+1, size=>[400,400 ]); + +$func = Compute("sqrt{$r**2 - x**2}"); +$fund = Compute("-sqrt{$r**2 - x**2}"); + +plot_functions( $graph, "$func for x in <-$r,$r> using color:black and weight:2"); +plot_functions( $graph, "$fund for x in <-$r,$r> using color:black and weight:2"); + +#Usando la subrutina +@puntos = getPoints(0,0,$r,$n); + +#La siguiente línea sirve capturar el tamaño de una fila de un arreglo +#aqui no es necesaria pues sabemos de antemano n +#$numero_puntos = @{ $puntos[1] }; + +#Dibujando las secciones +foreach my $i (0..$n -1){ + $graph->moveTo(0,0); + $graph->lineTo($puntos[0][$i], $puntos[1][$i], 'black'); +} + +#variable donde estará el número de partes sombreadas +$m = 0; + +#Sombreando regiones en forma aleatoria +#y capturando la cantidad (m) para crear la respuesta +foreach my $i (0..$n-2){ + $prob = random(0,1); + if ($prob == 1){ + $x = ( $puntos[0][$i] + $puntos[0][$i+1] )/4; + $y = ( $puntos[1][$i] + $puntos[1][$i+1] )/4; + $graph->fillRegion( [$x, $y,'blue'] ); + $graph->lb( new Label($x, $y, ".",'black','center','middle')); + $m = $m + 1; + } +} + +#Comentario: los dos bucles anteriores se pueden unir, están así +#pues empecé haciendo lo de dividir, luego sombrear. + +Context("Fraction"); +$answer = Fraction($m,$n); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +¿Qué fracción del círculo está coloreada de azul? +$PAR +$BCENTER +\{ image( insertGraph($graph), tex_size=>100, height=>300, width=>300) \} +$ECENTER +$PAR +Exprese la respuesta como una fracción en su mínima expresión. +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1, requirePureFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +La figura se ha dividido en \($n\) partes iguales, luego el denominador es igual a \($n\). De estas partes, \($m\) está(n) coloreada(s) de azul, luego el numerador es igual a \($m\). +$PAR +Por lo tanto la solución es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/fracciones/simplificar.pg b/Contrib/UPRM/Prebasica/fracciones/simplificar.pg new file mode 100644 index 0000000000..5a915f5cd6 --- /dev/null +++ b/Contrib/UPRM/Prebasica/fracciones/simplificar.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Simplificar fracciones + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/fracciones/simplificar.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Fracciones) +## DBsection(Simplificar) +## Level(1) +## KEYWORDS('fracciones','simplificar') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Fraction"); +#lista de algunos primos +$p1 = list_random(2, 3, 5, 7,11,13); +$p2 = list_random(2, 3, 5, 7,11,13); +$p3 = list_random(2, 3, 5, 7,11,13); +$p4 = list_random(2, 3, 5, 7,11,13); +@p = ($p1, $p2, $p3, $p4); + +#eligiendo número de factores aleatoriamente para numerador y denominador +$n_nume = random(2,4); +$n_deno = random(2,4); + +$a = 1; +$exp_num = ""; +foreach my $i (1..$n_nume){ + $a = $a*$p[$i-1]; + $exp_nume = $exp_nume."$p[$i-1]\cdot"; +} +$k1 = random(1,6); +$a = $a*$k1; +$exp_nume = $exp_nume."$k1"; + +$b = 1; +foreach my $i (1..$n_deno){ + $b = $b*$p[$i-1]; + $exp_deno = $exp_deno."$p[$i-1]\cdot"; +} +$k2 = random(1,6); +$b = $b*$k2; +$exp_deno = $exp_deno."$k2"; + +$answer = Fraction($a,$b); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Simplifique al máximo la fracción +\[ +\frac{$a}{$b} +\] +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Simplificar la fracción$EBOLD: El numerador se puede expresar como \( $a = $exp_nume\) y el denominador \( $b = $exp_deno\), entonces: +\[ +\frac{$a}{$b} = \frac{$exp_nume}{$exp_deno} = $answer, +\] +por lo tanto la solución es: \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_A.pg b/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_A.pg new file mode 100644 index 0000000000..482a6e50b7 --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_A.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Encontrar el área sombreada de figuras geométricas combinadas. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Areas_Combinadas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Áreas combinadas) +## Level(1) +## KEYWORDS('area','sombreada','') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$r = random(2,20); +$dr = 2*$r; +$a_cuadrado = (2*$r)**2; +$a_circulo = pi*$r**2; +$rc = $r**2; + +$answer = Compute($a_cuadrado - $a_circulo); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "ac1.png", width=>300 ) \} +$ECENTER +$PAR +Si \(r = $r\) cm, calcule el área sombreada de la figura de arriba. (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar área sombreada como combinación de figuras de áreas conocidas. Sea \(A_s\) el área sombreada, entonces +\[ +A_s = \text{área cuadrado} - \text{área círculo} +\] +$PAR +$BBOLD Paso 2:$EBOLD Calcular el área de cada figura conocida: +$PAR +\( \phantom{algo} \) $BBOLD Cuadrado:$EBOLD El cuadrado tiene lado igual a \(2r = 2\times $r = $dr\), entonces +\[ +\text{área cuadrado} = $dr^2 = $a_cuadrado +\] +$PAR +\( \phantom{algo} \) $BBOLD Círculo:$EBOLD El círculo tiene radio \(r = $r\), entonces: +\[ +\text{área círculo} = \pi($r)^2 = $rc\pi +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir valores del paso 2 en el paso 1 +\[ +\begin{align*} + A_s &= \text{área cuadrado} - \text{área círculo} \\[0.2cm] + &= $a_cuadrado - $rc\pi. +\end{align*} +\] +$PAR +Por lo tanto el área sombreada es \( $a_cuadrado - $rc\pi \) cm\(^2 \approx $answer\) cm\(^2\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_B.pg b/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_B.pg new file mode 100644 index 0000000000..975360075e --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_B.pg @@ -0,0 +1,126 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Encontrar el área sombreada de figuras geométricas combinadas. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Areas_Combinadas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Áreas combinadas) +## Level(1) +## KEYWORDS('area','sombreada','') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$b = random(3,10); +$a = $b + random(2,9); + +$ad2 = $a/2; +$ad2c = $ad2**2; + +$a_triangulo = $b*$a/2; +$a_cuadrado = $a**2; +$a_semi = (pi*($a/2)**2)/2; + +$a1a2 = $a_triangulo + $a_cuadrado; + +$answer = Compute($a_triangulo + $a_cuadrado + $a_semi); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "ac4.png", width=>300 ) \} +$ECENTER +$PAR +Si \(a = $a\) cm, \(b = $b\) cm, calcule el área de la figura de arriba. (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar área sombreada como combinación de figuras de áreas conocidas. Sea \(A_f\) el área de la figura, entonces +\[ +A_f = \text{área triángulo} + \text{área cuadrado} + \frac{\text{ área círculo} }{2} +\] +$PAR +$BBOLD Paso 2:$EBOLD Calcular el área de cada figura conocida: +$PAR +\( \phantom{algo} \) $BBOLD Triángulo:$EBOLD El triángulo tiene base \(b = $b\) y altura \(a = $a\), entonces: +\[ +\text{área triángulo} = \frac{ $b\times$a }{2} = $a_triangulo +\] +$PAR +\( \phantom{algo} \) $BBOLD Cuadrado:$EBOLD El cuadrado tiene lado igual a \(a = $a\), entonces: +\[ +\text{área cuadrado} = ($a)^2 = $a_cuadrado +\] +$PAR +\( \phantom{algo} \) $BBOLD Círculo:$EBOLD El círculo tiene radio \(r = \frac{a}{2} = \frac{$a}{2} = $ad2\), entonces: +\[ +\text{ área círculo} = \pi($ad2)^2 = $ad2c\pi +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir valores del paso 2 en el paso 1 +\[ +\begin{align*} + A_s &= \text{área triángulo} + \text{área cuadrado} + \frac{\text{ área círculo} }{2} \\[0.2cm] + &= $a_triangulo + $a_cuadrado + \frac{$ad2c\pi}{2} = $a1a2 + \frac{$ad2c\pi}{2} \approx $answer +\end{align*} +\] +$PAR +Por lo tanto el área de la figura es \( $answer \) cm\(^2\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_C.pg b/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_C.pg new file mode 100644 index 0000000000..99c8bb3f1d --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_C.pg @@ -0,0 +1,116 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Encontrar el área sombreada de figuras geométricas combinadas. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Areas_Combinadas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Áreas combinadas) +## Level(1) +## KEYWORDS('area','sombreada','') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$c = random(3,20); +$b = $c + random(2,9); +$a = random(2,10); + +$a_trapecio = ($b+$c)*$a/2; +$a_triangulo = $b*$a/2; + +$answer = Compute($a_trapecio - $a_triangulo); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "ac6.png", width=>300 ) \} +$ECENTER +$PAR +Si \(a = $a\) cm, \(b = $b\) cm y \(c = $c\) cm, calcule el área sombreada de la figura de arriba. (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar área sombreada como combinación de figuras de áreas conocidas. Sea \(A_s\) el área sombreada, entonces +\[ +A_s = \text{área trapecio} - \text{área triángulo} +\] +$PAR +$BBOLD Paso 2:$EBOLD Calcular el área de cada figura conocida: +$PAR +\( \phantom{algo} \) $BBOLD Trapecio:$EBOLD El trapecio tiene base mayor \(b = $b\), base menor \(c = $c\) cm, y altura \(a = $a\) cm, entonces: +\[ +\text{área trapecio} = \frac{($b+$c)$a}{2} = $a_trapecio +\] +$PAR +\( \phantom{algo} \) $BBOLD Triángulo:$EBOLD El triángulo tiene base \(b = $b\), y altura \(a = $a\), entonces: +\[ +\text{área triángulo} = \frac{$b\times $a}{2} = $a_triangulo +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir valores del paso 2 en el paso 1 +\[ +\begin{align*} + A_s &= \text{área trapecio} - \text{área triángulo} \\[0.2cm] + &= $a_trapecio - $a_triangulo. +\end{align*} +\] +$PAR +Por lo tanto el área sombreada es \( $answer \) cm\(^2\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_D.pg b/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_D.pg new file mode 100644 index 0000000000..cfcd8f6f59 --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_D.pg @@ -0,0 +1,125 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Encontrar el área sombreada de figuras geométricas combinadas. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Areas_Combinadas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Áreas combinadas) +## Level(1) +## KEYWORDS('area','sombreada','') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$a = random(2,30); + +$da = 2*$a; +$asd = $a/2; + +$a_rectangulo = $da*$a; +$a_circulo = pi*($asd)**2; + +$asdc = $asd**2; +$dasdc = 2*$asdc; + + +$answer = Compute($a_rectangulo - 2*$a_circulo); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "ac2.png", width=>300 ) \} +$ECENTER +$PAR +Si \(a = $a\) cm, calcule el área sombreada de la figura de arriba. (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar área sombreada como combinación de figuras de áreas conocidas. Sea \(A_s\) el área sombreada, entonces +\[ +\begin{align*} + A_s &= \text{área rectángulo} - \text{área círculo} - \text{área círculo} \\[0.2cm] + &= \text{área rectángulo} - 2(\text{área círculo}) +\end{align*} +\] +$PAR +$BBOLD Paso 2:$EBOLD Calcular el área de cada figura conocida: +$PAR +\( \phantom{algo} \) $BBOLD Rectángulo:$EBOLD El rectángulo tiene base \(b = 2a = 2\times$a = $da\), y altura \(a = $a\), entonces: +\[ +\text{área rectángulo} = $da\times$a = $a_rectangulo +\] +$PAR +\( \phantom{algo} \) $BBOLD Círculo:$EBOLD Cada uno de los círculos tiene radio \(r = \frac{a}{2} = \frac{$a}{2} = $asd\), entonces: +\[ +\text{área círculo} = \pi($asd)^2 = $asdc\pi +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir valores del paso 2 en el paso 1 +\[ +\begin{align*} + A_s &= \text{área rectángulo} - 2(\text{área círculo}) \\[0.2cm] + &= $a_rectangulo - 2\times $asdc\pi \\[0.2cm] + &= $a_rectangulo - $dasdc\pi \approx $answer +\end{align*} +\] +$PAR +Por lo tanto el área sombreada es \($answer\) cm\(^2\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_E.pg b/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_E.pg new file mode 100644 index 0000000000..4c1839d33d --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Areas_Combinadas_E.pg @@ -0,0 +1,120 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Encontrar el área sombreada de figuras geométricas combinadas. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Areas_Combinadas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Áreas combinadas) +## Level(1) +## KEYWORDS('area','sombreada','') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$r = random(2,20); + +$dr = 2*$r; +$rc = $r**2; + +$l = $dr/sqrt(2); + +$a_circulo = pi*$r**2; +$a_cuadrado = $l**2; + +$answer = Compute($a_circulo - $a_cuadrado); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "ac3.png", width=>300 ) \} +$ECENTER +$PAR +Si \(r = $r\) cm, calcule el área sombreada de la figura de arriba. (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar área sombreada como combinación de figuras de áreas conocidas. Sea \(A_s\) el área sombreada, entonces +\[ +A_s = \text{área círculo} - \text{área cuadrado} +\] +$PAR +$BBOLD Paso 2:$EBOLD Calcular el área de cada figura conocida: +$PAR +\( \phantom{algo} \) $BBOLD Círculo:$EBOLD El círculo tiene radio \(r = $r\), entonces: +\[ +\text{área círculo} = \pi($r)^2 = $rc\pi +\] +\( \phantom{algo} \) $BBOLD Cuadrado:$EBOLD Sea \(d\) = diagonal del cuadrado con \(d=2r = 2\times $r = $dr\) y \(l\) = lado. Utilizando Pitágoras se obtiene: +\[ +$dr^2 = l^2 + l^2 \quad \Rightarrow \quad l = \frac{ $dr }{ \sqrt{2} }, +\] +\( \phantom{algo} \) entonces el área del cuadrado es: \(\displaystyle A = \left( \frac{$dr}{\sqrt{2}} \right)^2 = $a_cuadrado \) + +$PAR +$BBOLD Paso 3:$EBOLD Sustituir valores del paso 2 en el paso 1 +\[ +\begin{align*} + A_s &= \text{área círculo} - \text{área cuadrado}\\[0.2cm] + &= $rc\pi - $a_cuadrado. +\end{align*} +\] +$PAR +Por lo tanto el área sombreada es \( $rc\pi - $a_cuadrado \) cm\(^2 \approx $answer\) cm\(^2\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_A.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_A.pg new file mode 100644 index 0000000000..c463aeef32 --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_A.pg @@ -0,0 +1,134 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dado el perímetro de un cuadrado encontrar el valor del lado. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','cuadrados') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$lado = random(2,99); +$perimetro = 4*$lado; + +if ( random(0,1) == 0 ){ + $condicion = "perímetro"; + $pregunta = "lado"; + $answer = Compute("$lado"); + $valor = $perimetro; + $var = "l"; + $eq1 = "4\cdot \text{lado} = $perimetro"; + $eq2 = "4\cdot l = $perimetro"; + $eq3 = "4l = $perimetro"; +}else{ + $condicion = "lado"; + $pregunta = "perímetro"; + $answer = Compute("$perimetro"); + $valor = $lado; + $var = "p"; + $eq1 = "4\cdot $lado=\text{perimetro}"; + $eq2 = "4\cdot $lado = p"; + $eq3 = $eq2; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Si el $condicion de un cuadrado es $valor cm. Determine el valor del $pregunta del cuadrado. (Escribir sólo el número, SIN incluir cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "El perímetro del cuadrado igual a cuatro veces el lado", "\(\text{perimetro} = 4\cdot \text{lado}\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \($var\) la medida del $pregunta del cuadrado. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( $eq1 \)", "\($eq2\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( $eq3 \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \($var\): +\[ +$eq3 \quad \text{entonces}\quad $var = $answer +\] +por lo tanto el $pregunta del cuadrado es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_B.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_B.pg new file mode 100644 index 0000000000..2ef419d2dd --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_B.pg @@ -0,0 +1,107 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un cuadrado encontrar el lado, o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','cuadrados') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$lado = random(2,99); +$area = $lado**2; + +if ( random(0,1) == 0 ){ + $condicion = "área"; + $pregunta = "lado"; + $valor = $area; + $answer = Compute("$lado"); + $eq = "l^2 = $area"; + $unidades1 = "cm\(^2\)"; + $unidades2 = "cm"; +}else{ + $condicion = "lado"; + $pregunta = "área"; + $valor = $lado; + $answer = Compute("$area"); + $eq = "A = $lado^2"; + $unidades1 = "cm"; + $unidades2 = "cm\(^2\)"; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "cuadrado.png", width=>250 ) \} +$ECENTER +Considere el cuadrado que se muestra arriba. Si el $condicion del cuadrado es $valor $unidades1. Determine el valor del $pregunta del cuadrado. (Escribir sólo el número, SIN incluir cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Utilizar la fórmula del áre de un cuadrado: \(A = l^2\), entonces +\[ +$eq, +\] +por lo tanto la solución es $answer $unidades2. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_C.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_C.pg new file mode 100644 index 0000000000..05a34c854f --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_C.pg @@ -0,0 +1,138 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un cuadrado encontrar el perímetro, el lado, o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','cuadrados') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$lado = random(2,99); +$perimetro = 4*$lado; + +if ( random(0,1) == 0 ){ + $condicion = "perímetro"; + $pregunta = "lado"; + $answer = Compute("$lado"); + $valor = $perimetro; + $var = "l"; + $eq1 = "4\times \text{lado} = $perimetro"; + $eq2 = "4\cdot l = $perimetro"; + $eq3 = "4l = $perimetro"; + $unidades2 = "cm\(^2\)"; +}else{ + $condicion = "lado"; + $pregunta = "perímetro"; + $answer = Compute("$perimetro"); + $valor = $lado; + $var = "p"; + $eq1 = "4\cdot $lado=\text{perimetro}"; + $eq2 = "4\cdot $lado=\text{p}"; + $eq3 = $eq2; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "cuadrado.png", width=>250 ) \} +$ECENTER +Considere el cuadrado que se muestra arriba. Si el $condicion de un cuadrado es $valor cm. Determine el valor del $pregunta del cuadrado. (Escribir sólo el número, SIN incluir cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "El $condicion de un cuadrado es $valor", "\($eq1\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \($var\) la medida del $pregunta del cuadrado. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( $eq1 \) = $p", "\($eq2\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( $eq3 \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \($var\): +\[ +$eq3 \quad \text{entonces}\quad $var = $answer +\] +por lo tanto el $pregunta del cuadrado es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_D.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_D.pg new file mode 100644 index 0000000000..7ae3cb441e --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_D.pg @@ -0,0 +1,130 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un rectángulo cuyos lados están en función de x +# si se dá el perímetro, encontrar el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','cuadrados') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$a = random(1,5); +$b = random(5,10); +$c = random(1,5); +$d = random(1,7); + +@largos = ("x + $a", "$a x - $b", "$a x"); +@altos = ("x - $a", "$b x - $d", "$b x"); +$index = random(0,2); + +$x = random(2,20); + +$fa = Formula($largos[$index])->reduce; +$fb = Formula($altos[$index])->reduce; + +$largo = $fa->eval(x=>$x); +$alto = $fb->eval(x=>$x); + +$p = 2*($largo + $alto); +$A = $largo*$alto; + +#Objeto que tendrá el rectángulo +$gr = init_graph(-10,-5,10,5, size=>[250,150]); + +$gr->lb(new Label(0,-4.2,$fa,'blue','center','middle')); +$gr->lb(new Label(7.7,0,$fb,'blue','center','middle')); + +$answer = Compute($A); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image(insertGraph($gr), width=>250, tex_size=>320); \} +$ECENTER +$PAR +Considere el rectángulo que se muestra arriba. Si el perímetro es $p cm, calcule el área del rectángulo. (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1$EBOLD Encontrar el valor de \(x\). Utilizar la fórmula del perímetro de un rectángulo: \(P = 2a+2b\), donde \(a\) es la base y \(b\) es la altura. +$PAR +Entonces +\[ +$p = 2($largos[$index])+2($altos[$index]) \quad \Rightarrow\quad x = $x +\] +$PAR +$BBOLD Paso 2$EBOLD Calcular el valor de los lados del rectángulo: +\[ +\begin{align*} + a &= $largos[$index] = $largo \\[0.2cm] + b &= $altos[$index] = $alto +\end{align*} +\] +$PAR +$BBOLD Paso 3$EBOLD Utilizar la fórmula del área del rectángulo: \( A = ab \). Entonces +\[ +A = $largo\times $alto = $A +\] +por lo tanto la solución es \( $A\text{ cm}^2 \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_E.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_E.pg new file mode 100644 index 0000000000..9e1e8d0505 --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_E.pg @@ -0,0 +1,119 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un rectángulo cuyos lados están en función de x +# si se dá el perímetro, encontrar x. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','rectnagulos') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$a = random(1,5); +$b = random(5,10); + +$c = random(1,5); +$d = random(1,7); + +@largos = ("x + $a", "$a x - $b", "$a x"); +@altos = ("x - $a", "$b x - $d", "$b x"); +$index = random(0,2); + +$x = random(2,20); + +$fa = Formula($largos[$index])->reduce; +$fb = Formula($altos[$index])->reduce; + +$largo = $fa->eval(x=>$x); +$alto = $fb->eval(x=>$x); + +$p = 2*($largo + $alto); +$A = $largo*$alto; + +#Objeto que tendrá el rectángulo +$gr = init_graph(-10,-5,10,5, size=>[250,150]); + +#adicionando al rectángulo los lados en función de x. +$gr->lb(new Label(0,-4.2,$fa,'blue','center','middle')); +$gr->lb(new Label(7.7,0,$fb,'blue','center','middle')); + +$answer = Compute($x); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image(insertGraph($gr), width=>250, tex_size=>320); \} +$ECENTER +$PAR +Considere el rectángulo que se muestra arriba. Si el perímetro es $p cm, calcule el valor de \(x\). (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Utilizar la fórmula del perímetro de un rectángulo: \(P = 2a+2b\), donde \(a\) es la base y \(b\) es la altura. +$PAR +Entonces +\[ +$p = 2($largos[$index])+2($altos[$index]) \quad \Rightarrow\quad x = $x. +\] +Por lo tanto el valor de \( x \) es $answer. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_I.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_I.pg new file mode 100644 index 0000000000..0e3f9da5e4 --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_I.pg @@ -0,0 +1,93 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un rectángulo encontrar el perímetro, el lado, o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','cuadrados') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$largo = random(15,30); +$alto = random(2,9); + +$perimetro = 2*($largo + $alto); +$area = $largo*$alto; + +$answer = Compute($perimetro); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "rectangulo.png", width=>300 ) \} +$ECENTER +Considere el rectángulo que se muestra arriba. Si \(a = $alto\) cm y \(b = $largo\) cm, calcule el perímetro del rectángulo. (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Utilizar la fórmula del perímetro: \(P = 2a + 2b \). Sustituyendo, +\[ +P = 2\times $alto + 2\times $largo = $perimetro +\] +por lo tanto la solución es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_J.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_J.pg new file mode 100644 index 0000000000..99364bb149 --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_J.pg @@ -0,0 +1,93 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un rectángulo encontrar el perímetro, el lado, o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','cuadrados') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$largo = random(15,30); +$alto = random(2,9); + +$perimetro = 2*($largo + $alto); +$area = $largo*$alto; + +$answer = Compute($largo); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "rectangulo.png", width=>300 ) \} +$ECENTER +Considere el rectángulo que se muestra arriba. Si \(a = $alto\) cm y el área de dicho rectángulo es $area cm\(^2\), calcule el valor de \(b\). (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Utilizar la fórmula del área de un rectángulo: \(A = ab \). Sustituyendo, +\[ +$area =$alto \times b \quad \Rightarrow\quad b = $largo +\] +por lo tanto la solución es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_K.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_K.pg new file mode 100644 index 0000000000..8c19228ef9 --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_K.pg @@ -0,0 +1,93 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un rectángulo encontrar el perímetro, el lado, o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','cuadrados') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$largo = random(15,30); +$alto = random(2,9); + +$perimetro = 2*($largo + $alto); +$area = $largo*$alto; + +$answer = Compute($area); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "rectangulo.png", width=>300 ) \} +$ECENTER +Considere el rectángulo que se muestra arriba. Si \(a = $alto\) cm y \(b = $largo\) cm, calcule el área del rectángulo. (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Utilizar la fórmula del área: \(A = ab \). Sustituyendo, +\[ +A = $alto\times $largo = $area +\] +por lo tanto la solución es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_L.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_L.pg new file mode 100644 index 0000000000..6ef3cd3bda --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_L.pg @@ -0,0 +1,93 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un rectángulo encontrar el perímetro, el lado, o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','cuadrados') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$largo = random(15,30); +$alto = random(2,9); + +$perimetro = 2*($largo + $alto); +$area = $largo*$alto; + +$answer = Compute($largo); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "rectangulo.png", width=>300 ) \} +$ECENTER +Considere el rectángulo que se muestra arriba. Si \(a = $alto\) cm y el perímetro de dicho rectángulo es $perimetro cm, calcule el valor de \(b\). (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El perímetro es la suma de las longitudes de los lados, por lo tanto la fórmula de perímetro de un rectángulo es: \(P = 2a + 2b \). Sustituyendo, +\[ +$perimetro =2\times $alto + 2\times b \quad \Rightarrow\quad b = $largo +\] +por lo tanto la solución es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_M.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_M.pg new file mode 100644 index 0000000000..2c80f4e470 --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_M.pg @@ -0,0 +1,92 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un rombo encontrar el perímetro, el lado, o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','rombo') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$largo = random(15,30); +$alto = random(2,9); + +$perimetro = 2*($largo + $alto); + +$answer = Compute($perimetro); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "rom1.png", width=>300 ) \} +$ECENTER +Considere el paralelogramo que se muestra arriba. Si \(a = $alto\) cm y \(b = $largo\) cm, calcule el perímetro del paralelogramo. (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +En un paralelogramo, los lados paralelos son congruentes, por tanto la fórmula del perímetro es: \(P = 2a + 2b \). Sustituyendo, +\[ +P = 2\times $alto + 2\times $largo \quad \Rightarrow\quad P = $perimetro +\] +por lo tanto la solución es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_N.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_N.pg new file mode 100644 index 0000000000..bb56442feb --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_N.pg @@ -0,0 +1,93 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un rombo encontrar el perímetro, el lado, o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','rombo') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$largo = random(15,30); +$altura = random(2,9); + +$perimetro = 2*($largo + $alto); +$area = $largo*$altura; + +$answer = Compute($area); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "rom2.png", width=>300 ) \} +$ECENTER +Considere el paralelogramo que se muestra arriba. Si \(h = $altura\) cm y \(b = $largo\) cm, calcule el área del paralelogramo. (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Utilizar la fórmula del área de un paralelogramo: \(A=bh \). En este caso, +\[ +A = $largo\times $altura = $area +\] +por lo tanto la solución es \( $answer \) cm\(^2\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_O.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_O.pg new file mode 100644 index 0000000000..f56d509d78 --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_O.pg @@ -0,0 +1,92 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un rombo encontrar el perímetro, el lado, o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','rombo') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$largo = random(15,30); +$alto = random(2,9); + +$perimetro = 2*($largo + $alto); + +$answer = Compute($largo); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "rom1.png", width=>300 ) \} +$ECENTER +Considere el paralelogramo que se muestra arriba. Si \(a = $alto\) cm y su perímetro es \(P = $perimetro\) cm, calcule el valor de \(b\). (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +En un paralelogramo, los lados paralelos son congruentes, por tanto la fórmula del perímetro es: \(P = 2a + 2b \). Sustituyendo, +\[ +$perimetro = 2\times $alto + 2b \quad \Rightarrow\quad b = $largo +\] +por lo tanto la solución es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_P.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_P.pg new file mode 100644 index 0000000000..e74841a2a8 --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_P.pg @@ -0,0 +1,94 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un trapecio encontrar algún lado, la altura o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','trapecio') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$B = random(15,30); +$h = random(4,9); +$b = random(5,20); + +$A = ($B+$b)*$h/2; +#$P = + +$answer = Compute($A); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "trap.png", width=>300 ) \} +$ECENTER +Considere el trapecio que se muestra arriba. Si \(B = $B\) cm, \(b = $b\) cm y \(h = $h\) cm, calcule el área del trapecio. (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Utilizar la fórmula del área de un trapecio: \(\displaystyle A = \frac{(B+b)h}{2} \). Sustituyendo, +\[ +A = \frac{($B+$b)$h}{2} \quad \Rightarrow\quad A = $A +\] +por lo tanto la solución es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_Q.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_Q.pg new file mode 100644 index 0000000000..08b232ff9e --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_Q.pg @@ -0,0 +1,94 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un trapecio encontrar algún lado, la altura o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','trapecio') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$B = random(15,30); +$h = random(4,9); +$b = random(5,20); + +$A = ($B+$b)*$h/2; +#$P = + +$answer = Compute($h); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "trap.png", width=>300 ) \} +$ECENTER +Considere el trapecio que se muestra arriba. Si \(B = $B\) cm, \(b = $b\) cm y el área es \($A\) cm\(^2\), calcule el valor de \(h\). (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Utilizar la fórmula del área de un trapecio: \(\displaystyle A = \frac{(B+b)h}{2} \). Sustituyendo, +\[ +$A = \frac{($B+$b)h}{2} \quad \Rightarrow\quad h = $h +\] +por lo tanto la solución es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_R.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_R.pg new file mode 100644 index 0000000000..d7a6dbad8e --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_R.pg @@ -0,0 +1,94 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un trapecio encontrar algún lado, la altura o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','trapecio') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$B = random(15,30); +$h = random(4,9); +$b = random(5,20); + +$A = ($B+$b)*$h/2; +#$P = + +$answer = Compute($b); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "trap.png", width=>300 ) \} +$ECENTER +Considere el trapecio que se muestra arriba. Si \(B = $B\) cm, \(h = $h\) cm y el área es \($A\) cm\(^2\), calcule el valor de \(b\). (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Utilizar la fórmula del área de un trapecio: \(\displaystyle A = \frac{(B+b)h}{2} \). Sustituyendo, +\[ +$A = \frac{($B+b)$h}{2} \quad \Rightarrow\quad b = $b +\] +por lo tanto la solución es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_S.pg b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_S.pg new file mode 100644 index 0000000000..fbf81cc7ee --- /dev/null +++ b/Contrib/UPRM/Prebasica/geometria/Cuadrilateros_S.pg @@ -0,0 +1,94 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la gráfica de un trapecio encontrar algún lado, la altura o el área. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/geometria/Cuadrilateros.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Geometría) +## DBsection(Cuadrilateros) +## Level(1) +## KEYWORDS('cuadrilateros','trapecio') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedFactor.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$B = random(15,30); +$h = random(4,9); +$b = random(5,20); + +$A = ($B+$b)*$h/2; +#$P = + +$answer = Compute($B); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image( "trap.png", width=>300 ) \} +$ECENTER +Considere el trapecio que se muestra arriba. Si \(b = $b\) cm, \(h = $h\) cm y el área es \($A\) cm\(^2\), calcule el valor de \(B\). (NO escriba el símbolo cm) +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Utilizar la fórmula del área de un trapecio: \(\displaystyle A = \frac{(B+b)h}{2} \). Sustituyendo, +\[ +$A = \frac{(B+$b)$h}{2} \quad \Rightarrow\quad B = $B +\] +por lo tanto la solución es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/geometria/ac1.png b/Contrib/UPRM/Prebasica/geometria/ac1.png new file mode 100644 index 0000000000..10f3b3441e Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/ac1.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/ac2.png b/Contrib/UPRM/Prebasica/geometria/ac2.png new file mode 100644 index 0000000000..c9b0bbdc46 Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/ac2.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/ac3.png b/Contrib/UPRM/Prebasica/geometria/ac3.png new file mode 100644 index 0000000000..cc4ac04e4a Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/ac3.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/ac4.png b/Contrib/UPRM/Prebasica/geometria/ac4.png new file mode 100644 index 0000000000..760c4d719b Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/ac4.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/ac5.png b/Contrib/UPRM/Prebasica/geometria/ac5.png new file mode 100644 index 0000000000..2025ba7924 Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/ac5.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/ac6.png b/Contrib/UPRM/Prebasica/geometria/ac6.png new file mode 100644 index 0000000000..9987af8fdc Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/ac6.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/cuadrado.png b/Contrib/UPRM/Prebasica/geometria/cuadrado.png new file mode 100644 index 0000000000..caa8d02629 Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/cuadrado.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/rec1.png b/Contrib/UPRM/Prebasica/geometria/rec1.png new file mode 100644 index 0000000000..fc1897b528 Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/rec1.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/rec2.png b/Contrib/UPRM/Prebasica/geometria/rec2.png new file mode 100644 index 0000000000..54fb462a42 Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/rec2.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/rec3.png b/Contrib/UPRM/Prebasica/geometria/rec3.png new file mode 100644 index 0000000000..67fb873a9f Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/rec3.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/rectangulo.png b/Contrib/UPRM/Prebasica/geometria/rectangulo.png new file mode 100644 index 0000000000..5800050d10 Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/rectangulo.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/rom1.png b/Contrib/UPRM/Prebasica/geometria/rom1.png new file mode 100644 index 0000000000..d4bb8684b2 Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/rom1.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/rom2.png b/Contrib/UPRM/Prebasica/geometria/rom2.png new file mode 100644 index 0000000000..d338a31f92 Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/rom2.png differ diff --git a/Contrib/UPRM/Prebasica/geometria/trap.png b/Contrib/UPRM/Prebasica/geometria/trap.png new file mode 100644 index 0000000000..48e19a4724 Binary files /dev/null and b/Contrib/UPRM/Prebasica/geometria/trap.png differ diff --git a/Contrib/UPRM/Prebasica/inec_cuad-sol/inec_cuad_tut1_sp.pg b/Contrib/UPRM/Prebasica/inec_cuad-sol/inec_cuad_tut1_sp.pg new file mode 100644 index 0000000000..a64600546c --- /dev/null +++ b/Contrib/UPRM/Prebasica/inec_cuad-sol/inec_cuad_tut1_sp.pg @@ -0,0 +1,180 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Inecuaciones polinomicas: tipo ax^2 + bx + c [>,<,>=,<=] 0 +# encontrar solución en forma de intervalo. +# Respuestas enteras, usando C(x-A)(x-B) +# para formar ax^2 + bx + c = 0, donde a=C, b=-C(A+B) y c = ABC + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inec_cuad-sol/inec_cuad_tut1_sp.db +# +# Última actualización: Edwin F. 07/31/2014 +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Polinomicas) +## Level(1) +## KEYWORDS('factorizacion','inecuaciones', 'polinomios') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"parserRadioButtons.pl", +"UPRMgraphMacros.pl", +"contextInequalities.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +#Creando las constantes para ax^2+bx+c + +#Partiendo de C(x-A)(x-B) +$A = non_zero_random(-9,9); +$B = non_zero_random(-9,9); +$C = non_zero_random(-1,1); + +#Construimos ax^2+bx+c +$a = $C; +$b = -$C*($A+$B); +$c = $A*$B*$C; + +@list_desig_tex = (">","<","\geq","\leq"); +@list_desig = (">","<",">=","<="); +$index = random(0,3); + +@val_cero = PGsort( sub {$_[0] < $_[1]} , ($A,$B) ); + +$punto_prueba1 = $val_cero[0] - 1; +$punto_prueba2 = ($val_cero[0] + $val_cero[1])/2; +$punto_prueba3 = $val_cero[1] + 1; + +Context()->noreduce('(-x)+y', '(-x)-y'); +$f = Formula("$a x^2 + $b x + $c")->reduce; +$fa = Formula("$C(x-$A)(x-$B)")->reduce; + +$fpp1 = $f->eval(x=>$punto_prueba1); +$fpp2 = $f->eval(x=>$punto_prueba2); +$fpp3 = $f->eval(x=>$punto_prueba3); + +#Subrutina que retorna un "+" o "-" si el número ingresado +#es positivo o negativo +sub signo { + local $a = $_[0]; + if ( $a > 0 ) { return "\(+\)";} + if ( $a < 0 ) { return "\(-\)";} + if ( $a == 0 ) { return "\(0\)";} +} + +Context("Inequalities"); + +#creando el intervalo solución +if ( $index == 0 ){ + $answer = Union( Compute( "(-Inf,$val_cero[0])" ) , Compute( "($val_cero[1],Inf)" ) ); + $paso_extra = ""; +}elsif ($index == 1){ + $answer = Compute( "($val_cero[0],$val_cero[1])" ); + $paso_extra = ""; +}elsif ($index == 2){ + $answer = Union( Compute( "(-Inf,$val_cero[0]]" ) , Compute( "[$val_cero[1],Inf)" ) ); + $paso_extra = "$PAR Note que hemos añadido todos los extremos que son números, pues al sustituirlos en el polinomio obtenemos cero."; +}else{ + $answer = Compute( "[$val_cero[0],$val_cero[1]]" ); + $paso_extra = "$PAR Note que hemos añadido todos los extremos que son números, pues al sustituirlos en el polinomio obtenemos cero."; +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Resolver la siguiente inecuación +\[ + $f $list_desig_tex[$index] 0 +\] +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("intervals") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Factorizar el polinomio: +\[ +$f = $fa +\] +$PAR +$BBOLD Paso 2:$EBOLD Hallar los intervalos de prueba, igualando cada factor a cero: +\[ + \begin{align*} + x - $A &= 0 \quad \Rightarrow \quad x = $A \\ + x - $B &= 0 \quad \Rightarrow \quad x = $B, + \end{align*} +\] +entonces los intervalos de prueba serán \( (-\infty,$val_cero[0]), ($val_cero[0],$val_cero[1]) \) y \( ($val_cero[1],\infty) \). +$PAR +$BBOLD Paso 3:$EBOLD Seleccionar un punto de prueba dentro de cada intervalo anterior para determinar el signo que tiene la expresión \( $f \). +$PAR +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Intervalo$EBOLD", "$BBOLD Punto de Prueba$EBOLD", "$BBOLD Evaluar$EBOLD", "$BBOLD Signo$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( (-\infty,$val_cero[0]) \)", "\( $punto_prueba1 \)", "\( $a ($punto_prueba1)^2 + $b ($punto_prueba1) + $c = $fpp1 \)", signo($fpp1) ], align=>CENTER, separation=>0). + AlignedRow( [ "\( ($val_cero[0],$val_cero[1]) \)", "\( $punto_prueba2 \)", "\( $a ($punto_prueba2)^2 + $b ($punto_prueba2) + $c = $fpp2 \)", signo($fpp2) ], align=>CENTER, separation=>0). + AlignedRow( [ "\( ($val_cero[1],\infty) \)", "\( $punto_prueba3 \)", "\( $a ($punto_prueba3)^2 + $b ($punto_prueba3) + $c = $fpp3 \)", signo($fpp3) ], align=>CENTER, separation=>0). +EndTable() +\} +$PAR +Buscamos los valores de \(x\) que hagan el polinomio \($list_desig_tex[$index] 0\). Basándonos en la tabla anterior, el conjunto solución es: \($answer\). +$paso_extra +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inec_cuad-sol/inec_cuad_tut2_sp.pg b/Contrib/UPRM/Prebasica/inec_cuad-sol/inec_cuad_tut2_sp.pg new file mode 100644 index 0000000000..acfc8cc53a --- /dev/null +++ b/Contrib/UPRM/Prebasica/inec_cuad-sol/inec_cuad_tut2_sp.pg @@ -0,0 +1,228 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Inecuaciones lineales con valor absoluto: tipo |ax+b| [>,<,>=,<=] c +# encontrar solución en forma de intervalo. +# a = 1, -1 y b y c son enteros no cero + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inec_cuad-sol/inec_cuad_tut2_sp.db +# +# Última actualización: Edwin F. 07/31/2014 +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Valor absoluto) +## Level(1) +## KEYWORDS('valor absoluto','inecuaciones') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"parserRadioButtons.pl", +"UPRMgraphMacros.pl", +"contextInequalities.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +#Creando las constantes para |ax+b| [>,<,>=,<=] c + +$a = non_zero_random(-1,1); +$b = non_zero_random(-20,20); +do{ + $c = non_zero_random(-20,20); +}until ($c != $b); + +@list_desig_tex = (">","<","\geq","\leq"); +@list_desig = (">","<",">=","<="); +$index = random(0,3); + +$pt1 = ($c - $b)/$a; +$pt2 = (-$c - $b)/$a; + +@val_cero = PGsort( sub {$_[0] < $_[1]} , ($pt1,$pt2) ); + +$punto_prueba1 = $val_cero[0] - 1; +$punto_prueba2 = ($val_cero[0] + $val_cero[1])/2; +$punto_prueba3 = $val_cero[1] + 1; + +Context()->noreduce('(-x)+y', '(-x)-y'); +$f = Formula("|$a x + $b|")->reduce; +$fa = Formula("$a x + $b")->reduce; +$fa2 = Formula("$a x")->reduce; + +$fpp1 = $f->eval(x=>$punto_prueba1); +$fpp2 = $f->eval(x=>$punto_prueba2); +$fpp3 = $f->eval(x=>$punto_prueba3); + +$fa2pp1 = $fa2->eval(x=>$punto_prueba1); +$fa2pp2 = $fa2->eval(x=>$punto_prueba2); +$fa2pp3 = $fa2->eval(x=>$punto_prueba3); + +#Subrutina que retorna un "+" o "-" si el número ingresado +#es positivo o negativo +sub vverdad { + local ($x, $y, $idx) = ($_[0], $_[1],$_[2]); + if ( $idx == 0 ) { return $x > $y ? "Cierto" : "Falso";} + if ( $idx == 1 ) { return $x < $y ? "Cierto" : "Falso";} + if ( $idx == 2 ) { return $x >= $y ? "Cierto" : "Falso";} + if ( $idx == 3 ) { return $x <= $y ? "Cierto" : "Falso";} +} + +Context("Inequalities"); + +#creando el intervalo solución +if ( $index == 0 ){ # Aqui se usa para > + if ( $c > 0){ + $answer = Union( Compute( "(-Inf,$val_cero[0])" ) , Compute( "($val_cero[1],Inf)" ) ); + $paso_extra = ""; + }else{ + $answer = Compute( "(-Inf,Inf)" ); + $paso_extra = "$PAR Note que se satisfacen todos los intervalos de prueba, por lo tanto la solución son todos los reales. + +$PAR En este tipo de ejercicio se puede llegar a la solución rápidamente si nos damos cuenta que el valor absoluto siempre da como resultado un número no negativo."; + } +}elsif ($index == 1){ # Aqui se usa para < + if ( $c > 0){ + $answer = Compute( "($val_cero[0],$val_cero[1])" ); + $paso_extra = ""; + }else{ + $answer = Compute( "{ }" ); + $paso_extra = "$PAR Como ninguno de los intervalos de prueba se satisface, no hay solución real. + +$PAR En este tipo de ejercicio se puede llegar a la solución rápidamente si nos damos cuenta que el valor absoluto siempre da como resultado un número no negativo."; + } +}elsif ($index == 2){ # Aqui se usa para >= + if ( $c > 0){ + $answer = Union( Compute( "(-Inf,$val_cero[0]]" ) , Compute( "[$val_cero[1],Inf)" ) ); + $paso_extra = ""; + }else{ + $answer = Compute( "(-Inf,Inf)" ); + $paso_extra = "$PAR Note que se satisfacen todos los intervalos de prueba, por lo tanto la solución son todos los reales. + +$PAR En este tipo de ejercicio se puede llegar a la solución rápidamente si nos damos cuenta que el valor absoluto siempre da como resultado un número no negativo."; + } +}else{ # Aqui se usa para <= + if ( $c > 0){ + $answer = Compute( "[$val_cero[0],$val_cero[1]]" ); + $paso_extra = ""; + }else{ + $answer = Compute( "{ }" ); + $paso_extra = "$PAR Como ninguno de los intervalos de prueba se satisface, no hay solución real. + +$PAR En este tipo de ejercicio se puede llegar a la solución rápidamente si nos damos cuenta que el valor absoluto siempre da como resultado un número no negativo."; + } +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Resolver la siguiente inecuación +\[ + $f $list_desig_tex[$index] $c +\] +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("intervals") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Hallar los intervalos de prueba, resolviendo la ecuación \($f = $c\): +\[ + \begin{align*} + $fa &= $c \quad \Rightarrow \quad x = $pt1 \\ + $fa &= -$c \quad \Rightarrow \quad x = $pt2, + \end{align*} +\] +entonces los intervalos de prueba serán \( (-\infty,$val_cero[0]), ($val_cero[0],$val_cero[1]) \) y \( ($val_cero[1],\infty) \). +$PAR +$BBOLD Paso 2:$EBOLD Seleccionar un punto de prueba dentro de cada intervalo anterior para determinar el valor de verdad de la expresión \( $f $list_desig_tex[$index] $c \). +$PAR +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Intervalo$EBOLD", "$BBOLD Punto de Prueba$EBOLD", "$BBOLD Evaluar$EBOLD", "$BBOLD Valor de verdad$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( (-\infty,$val_cero[0]) \)", "\( $punto_prueba1 \)", +"\[ +\begin{align*} + \left| $fa2pp1 + $b \right| & $list_desig_tex[$index] $c \\ + $fpp1 & $list_desig_tex[$index] $c +\end{align*} +\]", +vverdad($fpp1,$c,$index) ], align=>CENTER, separation=>0). + AlignedRow( [ "\( ($val_cero[0],$val_cero[1]) \)", "\( $punto_prueba2 \)", +"\[ +\begin{align*} + \left| $fa2pp2 + $b \right| & $list_desig_tex[$index] $c \\ + $fpp2 & $list_desig_tex[$index] $c +\end{align*} +\]", +vverdad($fpp2,$c,$index) ], align=>CENTER, separation=>0). + AlignedRow( [ "\( ($val_cero[1],\infty) \)", "\( $punto_prueba3 \)", +"\[ +\begin{align*} + \left| $fa2pp3 + $b \right| & $list_desig_tex[$index] $c \\ + $fpp3 & $list_desig_tex[$index] $c +\end{align*} +\]", +vverdad($fpp3,$c,$index) ], align=>CENTER, separation=>0). +EndTable() +\} +$PAR +Buscamos los valores de \(x\) que hagan el valor absoluto de la expresión \($list_desig_tex[$index] $c\). Basándonos en la tabla anterior, el conjunto solución es: \($answer\). +$paso_extra +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_A.pg b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_A.pg new file mode 100644 index 0000000000..644e14f913 --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_A.pg @@ -0,0 +1,228 @@ +# DESCRIPTION +# +# Tipo: Opción múltiple única respuesta +# Dada una inecuación tipo y>=Mx, elegir su representación gráfica. +# M es un entero positivo o negativo +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones.db +# Programación por Carl Yao de Portland Community College del archivo +# PCCBasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality10.pg +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Inecuaciones lineales dos variables) +## Level(1) +## KEYWORDS('inecuaciones','lineales', 'dos variables', 'graficas') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "pccTables.pl", + "UPRMgraphMacros.pl", + "PGcourse.pl", + "problemRandomize.pl" +); + +############################################## +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +$symbol = '\geq'; + +Context("Numeric"); +$refreshCachedImages=1; + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + +$m=non_zero_random(-5,5,1); +$b=0; +@ar_mb = ([$m,$b,''],[-$m,$b,''],[$m,$b,dashed],[-$m,$b,dashed],[$m,$b,'']); + +#This subroutine is used later to see which side to shade. +sub testPoint { + local ($x, $y, $grNum) = ($_[0], $_[1], $_[2]); + if (($grNum==0) || ($grNum==4)) {return ($y >= $m * $x);} + if ($grNum==1) {return ($y <= -$m * $x);} + if ($grNum==2) {return ($y > $m * $x);} + if ($grNum==3) {return ($y < -$m * $x);} +} + +$x1 = 0; +$y1 = $m*$x1+$b; +$x2 = 1; +$y2 = $m*$x2+$b; + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$pt1=Compute("($x1,$y1)"); +$pt2=Compute("($x2,$y2)"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([0,$x2, 5],[$b,-$b,$y2,5],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); + +for my $i (0..4) { + + $f = Formula("$ar_mb[$i][0] *x + $ar_mb[$i][1]")->reduce; + + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'blue',2,$ar_mb[$i][2]); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'white',1); + + $gr[$i]->new_color("lightred", 245,234,229); + + $xfillcoord = 0; + $yfillcoord = ($f->eval(x=>$xfillcoord))+$marksep[1]; + $yfillcoord = ($f->eval(x=>$xfillcoord))-$marksep[1] if !(&testPoint($xfillcoord, $yfillcoord, $i)); + + $gr[$i]->fillRegion([$xfillcoord, $yfillcoord,"lightred"]); + + $x3 = 1; + $y3 = $f->eval(x=>$x3); + $dashOrSolid = ($ar_mb[$i][2] eq 'dashed') ? 'punteada' : 'solida'; + push(@ALTtags,"Gráfica $ALPHABET[$inverse{$i}]: Esta es la gráfica de la línea que pasa por (0,$ar_mb[$i][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); +} + +pop(@ALTtags); +push(@ALTtags,"Esta es la gráfica de la línea que pasa por (0,$ar_mb[4][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +############################################## + +BEGIN_PGML + +Elija la gráfica que muestra la solución de [`y [$symbol] [$f]`]. En su propio papel de gráficar, primero dibuje la línea (sea punteada o sólida), y luego seleccione un punto de prueba para decidir cual lado de la línea sombrear. *Advertencia:* si salta los pasos que se deben hacer en papel, entonces no se está practicando lo que el ejercicio intenta que usted practique. + +La gráfica correcta es + [@$radio->buttons()@]* + +[@EnlargeImageStatementPGML@]** +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +$gr[4]->lb( new Label($x1,$y1-$marksep[1]/5,' '."$pt1".' ','red','right','middle')); +$gr[4]->lb( new Label($x2,$y2,' '."$pt2",'red','left','middle')); +$gr[4]->lb( new Label(0,1,"punto de prueba (0,1)".' ','red','right','middle')); + +$gr[4]->stamps( closed_circle($x1,$y1,'red') ); +$gr[4]->stamps( closed_circle($x2,$y2,'red') ); +$gr[4]->stamps( closed_circle(0,1,'red') ); + +$mOutput = $m==1 ? "" : "$m \cdot"; +$mOutput = $m==-1 ? "-" : "$m \cdot"; + +Context()->texStrings; +BEGIN_SOLUTION + +Para graficar la inecuación \( y $symbol $f \), primero graficamos la línea \( y=$f \). Lo puede hacer usando el método de tabulación o el de triángulo-pendiente para localizar los dos puntos de la línea. +$PAR +Note que la línea es $dashOrSolid, porque la inecuación usa el símbolo \( $symbol \). +$PAR +Luego, necesitamos decidir cual lado sombrear. Usualmente sustituimos \(x=0\) y \(y=0\) en la inecuación. Sin embargo, para este problema, \( (0,0) \) está en la línea \( y = $f \), luego debemos elegir otro punto. +$PAR +Usemos el punto \( (0, 1) \). Sustituimos \(x=0\) y \(y=1\) en \( y $symbol $f \), y tenemos: +$PAR +\[ +\begin{aligned}{2} + y &$symbol $f \\ + 1 &$symbol $mOutput 0 \\ + 1 &$symbol 0 +\end{aligned} +\] + $PAR +Que es cierto, luego sombreamos el lado con el punto \( (0, 1) \). +$PAR +Por consiguiente la respuesta correcta es \{ $radio->correct_ans() \}. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>400, height=>400, tex_size=>400, + extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ) \} + +$ECENTER + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_B.pg b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_B.pg new file mode 100644 index 0000000000..401acbad53 --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_B.pg @@ -0,0 +1,228 @@ +# DESCRIPTION +# +# Tipo: Opción múltiple única respuesta +# Dada una inecuación tipo y +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones.db +# Programación por Carl Yao de Portland Community College del archivo +# PCCBasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality20.pg +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Inecuaciones lineales dos variables) +## Level(1) +## KEYWORDS('inecuaciones','lineales', 'dos variables', 'graficas') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "pccTables.pl", + "UPRMgraphMacros.pl", + "PGcourse.pl", + "problemRandomize.pl" +); + +############################################## +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +$symbol = '<'; + +Context("Numeric"); +$refreshCachedImages=1; + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + +$m=non_zero_random(-5,5,1); +$b=0; +@ar_mb = ([$m,$b,'dashed'],[-$m,$b,'dashed'],[$m,$b,''],[-$m,$b,''],[$m,$b,'dashed']); + +#This subroutine is used later to see which side to shade. +sub testPoint { + local ($x, $y, $grNum) = ($_[0], $_[1], $_[2]); + if (($grNum==0) || ($grNum==4)) {return ($y < $m * $x);} + if ($grNum==1) {return ($y > -$m * $x);} + if ($grNum==2) {return ($y >= $m * $x);} + if ($grNum==3) {return ($y <= -$m * $x);} +} + +$x1 = 0; +$y1 = $m*$x1+$b; +$x2 = 1; +$y2 = $m*$x2+$b; + +Context("Point"); +Context()->parens->set("[" => {type => "Interval", close => "]"}); +Context()->parens->set("{" => {type => "Set", close => "}"}); +Context()->parens->set("<" => {type => "Vector", close => ">"}); +$pt1=Compute("($x1,$y1)"); +$pt2=Compute("($x2,$y2)"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([0,$x2, 5],[$b,-$b,$y2,5],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); + +for my $i (0..4) { + + $f = Formula("$ar_mb[$i][0] *x + $ar_mb[$i][1]")->reduce; + + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'blue',2,$ar_mb[$i][2]); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'white',1); + + $gr[$i]->new_color("lightred", 245,234,229); + + $xfillcoord = 0; + $yfillcoord = ($f->eval(x=>$xfillcoord))+$marksep[1]; + $yfillcoord = ($f->eval(x=>$xfillcoord))-$marksep[1] if !(&testPoint($xfillcoord, $yfillcoord, $i)); + + $gr[$i]->fillRegion([$xfillcoord, $yfillcoord,"lightred"]); + + $x3 = 1; + $y3 = $f->eval(x=>$x3); + $dashOrSolid = ($ar_mb[$i][2] eq 'dashed') ? 'punteada' : 'solida'; + push(@ALTtags,"Gráfica $ALPHABET[$inverse{$i}]: Esta es la gráfica de la línea que pasa por (0,$ar_mb[$i][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); +} + +pop(@ALTtags); +push(@ALTtags,"Esta es la gráfica de la línea que pasa por (0,$ar_mb[4][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +############################################## + +BEGIN_PGML + +Elija la gráfica que muestra la solución de [`y [$symbol] [$f]`]. En su propio papel de gráficar, primero dibuje la línea (sea punteada o sólida), y luego seleccione un punto de prueba para decidir cual lado de la línea sombrear. *Advertencia:* si salta los pasos que se deben hacer en papel, entonces no se está practicando lo que el ejercicio intenta que usted practique. + +La gráfica correcta es + [@$radio->buttons()@]* + +[@EnlargeImageStatementPGML@]** +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +$gr[4]->lb( new Label($x1,$y1-$marksep[1]/5,' '."$pt1".' ','red','right','middle')); +$gr[4]->lb( new Label($x2,$y2,' '."$pt2",'red','left','middle')); +$gr[4]->lb( new Label(0,1,"punto de prueba (0,1)".' ','red','right','middle')); + +$gr[4]->stamps( closed_circle($x1,$y1,'red') ); +$gr[4]->stamps( closed_circle($x2,$y2,'red') ); +$gr[4]->stamps( closed_circle(0,1,'red') ); + +$mOutput = $m==1 ? "" : "$m \cdot"; +$mOutput = $m==-1 ? "-" : "$m \cdot"; + +Context()->texStrings; +BEGIN_SOLUTION + +Para graficar la inecuación \( y $symbol $f \), primero graficamos la línea \( y=$f \). Lo puede hacer usando el método de tabulación o el de triángulo-pendiente para localizar los dos puntos de la línea. +$PAR +Note que la línea es $dashOrSolid, porque la inecuación usa el símbolo \( $symbol \). +$PAR +Luego, necesitamos decidir cual lado sombrear. Usualmente sustituimos \(x=0\) y \(y=0\) en la inecuación. Sin embargo, para este problema, \( (0,0) \) está en la línea \( y = $f \), luego debemos elegir otro punto. +$PAR +Usemos el punto \( (0, 1) \). Sustituimos \(x=0\) y \(y=1\) en \( y $symbol $f \), y tenemos: +$PAR +\[ +\begin{align*} + y &$symbol $f \\ + 1 &$symbol $mOutput 0 \\ + 1 &$symbol 0 +\end{align*} +\] + $PAR +Que es falso, luego sombreamos el lado sin el punto \( (0, 1) \). +$PAR +Por consiguiente la respuesta correcta es \{ $radio->correct_ans() \}. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>400, height=>400, tex_size=>400, + extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ) \} + +$ECENTER + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_C.pg b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_C.pg new file mode 100644 index 0000000000..ec3ec29d15 --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_C.pg @@ -0,0 +1,232 @@ +# DESCRIPTION +# +# Tipo: Opción múltiple única respuesta +# Dada una inecuación tipo y > Mx + B, elegir su representación gráfica. +# M y B son enteros no cero positivos o negativos +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones.db +# Programación por Carl Yao de Portland Community College del archivo +# PCCBasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality30.pg +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Inecuaciones lineales dos variables) +## Level(1) +## KEYWORDS('inecuaciones','lineales', 'dos variables', 'graficas') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "pccTables.pl", + "UPRMgraphMacros.pl", + "PGcourse.pl", + "problemRandomize.pl" +); + +############################################## +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +$symbol = '>'; + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + +$m=non_zero_random(-5,5,1); +$b=non_zero_random(-5,5,1); +@ar_mb = ([$m,$b,'dashed'],[$m,-$b,'dashed'],[$m,$b,''],[-$m,$b,''],[$m,$b,'dashed']); + +#This subroutine is used later to see which side to shade. +sub testPoint { + local ($x, $y, $grNum) = ($_[0], $_[1], $_[2]); + if (($grNum==0) || ($grNum==4)) {return ($y > $m * $x + $b);} + if ($grNum==1) {return ($y > $m * $x - $b);} + if ($grNum==2) {return ($y >= $m * $x + $b);} + if ($grNum==3) {return ($y <= -$m * $x + $b);} +} + +if (0 > $m * 0 +$b) { + $trueOrFalse = "cierto"; + $withOrWithout = "con"; +} +else { + $trueOrFalse = "falso"; + $withOrWithout = "sin"; +} + +$x1 = 0; +$y1 = $m*$x1+$b; +$x2 = 1; +$y2 = $m*$x2+$b; + +$pt1=Compute("($x1,$y1)"); +$pt2=Compute("($x2,$y2)"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([0,$x2, 5],[$b,-$b,$y2,5],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); + +for my $i (0..4) { + + $f = Formula("$ar_mb[$i][0] *x + $ar_mb[$i][1]")->reduce; + + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'blue',2,$ar_mb[$i][2]); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'white',1); + + $gr[$i]->new_color("lightred", 245,234,229); + + $xfillcoord = 0; + $yfillcoord = ($f->eval(x=>$xfillcoord))+$marksep[1]; + $yfillcoord = ($f->eval(x=>$xfillcoord))-$marksep[1] if !(&testPoint($xfillcoord, $yfillcoord, $i)); + + $gr[$i]->fillRegion([$xfillcoord, $yfillcoord,"lightred"]); + + $x3 = 1; + $y3 = $f->eval(x=>$x3); + $dashOrSolid = ($ar_mb[$i][2] eq 'dashed') ? 'punteada' : 'solida'; + push(@ALTtags,"Gráfica $ALPHABET[$inverse{$i}]: Esta es la gráfica de la línea que pasa por (0,$ar_mb[$i][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); +} + +pop(@ALTtags); +push(@ALTtags,"Esta es la gráfica de la línea que pasa por (0,$ar_mb[4][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +############################################## + +BEGIN_PGML + +Elija la gráfica que muestra la solución de [`y [$symbol] [$f]`]. En su propio papel de gráficar, primero dibuje la línea (sea punteada o sólida), y luego seleccione un punto de prueba para decidir cual lado de la línea sombrear. *Advertencia:* si salta los pasos que se deben hacer en papel, entonces no se está practicando lo que el ejercicio intenta que usted practique. + +La gráfica correcta es + [@$radio->buttons()@]* + +[@EnlargeImageStatementPGML@]** +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +$gr[4]->lb( new Label($x1,$y1,' '."$pt1".' ','red','right','middle')); +$gr[4]->lb( new Label($x2,$y2,' '."$pt2",'red','left','middle')); +$gr[4]->lb( new Label(0,$marksep[1]/5,"punto de prueba (0,0)",'red','right','middle')); + +$gr[4]->stamps( closed_circle($x1,$y1,'red') ); +$gr[4]->stamps( closed_circle($x2,$y2,'red') ); +$gr[4]->stamps( closed_circle(0,0,'red') ); + +$mOutput = $m==1 ? "" : "$m \cdot"; +$mOutput = $m==-1 ? "-" : "$m \cdot"; + +Context()->texStrings; +BEGIN_SOLUTION + +Para graficar la inecuación \( y $symbol $f \), primero graficamos la línea \( y=$f \). Lo puede hacer usando el método de tabulación o el de triángulo-pendiente para localizar los dos puntos de la línea. +$PAR +Note que la línea es $dashOrSolid, porque la inecuación usa el símbolo \( $symbol \). +$PAR +Luego, necesitamos decidir cual lado sombrear. Elegimos \( (0,0) \) como el punto de prueba. Al sustituir \(x=0\) y \(y=0\) en la inecuación \( y $symbol $f \), tenemos: +$PAR +\[ +\begin{align*} + y &$symbol $f \\ + 0 &$symbol $mOutput 0 + $b \\ + 0 &$symbol $b +\end{align*} +\] + $PAR +Que es $trueOrFalse, luego sombreamos el lado $withOrWithout el punto \( (0, 0) \). +$PAR +Por consiguiente la respuesta correcta es \{ $radio->correct_ans() \}. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>400, height=>400, tex_size=>400, + extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ) \} + +$ECENTER + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_D.pg b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_D.pg new file mode 100644 index 0000000000..af1a9696fe --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_D.pg @@ -0,0 +1,234 @@ +# DESCRIPTION +# +# Tipo: Opción múltiple única respuesta +# Dada una inecuación tipo y <= Mx + B, elegir su representación gráfica. +# M y B son enteros no cero positivos o negativos. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones.db +# +# Programación por Carl Yao de Portland Community College del archivo +# PCCBasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality40.pg +# +# Última actualización: Edwin F. 07/29/2014 +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Inecuaciones lineales dos variables) +## Level(1) +## KEYWORDS('inecuaciones','lineales', 'dos variables', 'graficas') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "pccTables.pl", + "UPRMgraphMacros.pl", + "PGcourse.pl", + "problemRandomize.pl" +); + +############################################## +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +$symbol = '\le'; + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + +$m=non_zero_random(-5,5,1); +$b=non_zero_random(-5,5,1); +@ar_mb = ([$m,$b,''],[$m,-$b,''],[$m,$b,'dashed'],[$m,-$b,'dashed'],[$m,$b,'']); + +#This subroutine is used later to see which side to shade. +sub testPoint { + local ($x, $y, $grNum) = ($_[0], $_[1], $_[2]); + if (($grNum==0) || ($grNum==4)) {return ($y <= $m * $x + $b);} + if ($grNum==1) {return ($y <= $m * $x - $b);} + if ($grNum==2) {return ($y > $m * $x + $b);} + if ($grNum==3) {return ($y < -$m * $x - $b);} +} + +if (0 <= $m * 0 +$b) { + $trueOrFalse = "cierto"; + $withOrWithout = "con"; +} +else { + $trueOrFalse = "falso"; + $withOrWithout = "sin"; +} + +$x1 = 0; +$y1 = $m*$x1+$b; +$x2 = 1; +$y2 = $m*$x2+$b; + +$pt1=Compute("($x1,$y1)"); +$pt2=Compute("($x2,$y2)"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([0,$x2, 5],[$b,-$b,$y2,5],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); + +for my $i (0..4) { + + $f = Formula("$ar_mb[$i][0] *x + $ar_mb[$i][1]")->reduce; + + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'blue',2,$ar_mb[$i][2]); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'white',1); + + $gr[$i]->new_color("lightred", 245,234,229); + + $xfillcoord = 0; + $yfillcoord = ($f->eval(x=>$xfillcoord))+$marksep[1]; + $yfillcoord = ($f->eval(x=>$xfillcoord))-$marksep[1] if !(&testPoint($xfillcoord, $yfillcoord, $i)); + + $gr[$i]->fillRegion([$xfillcoord, $yfillcoord,"lightred"]); + + $x3 = 1; + $y3 = $f->eval(x=>$x3); + $dashOrSolid = ($ar_mb[$i][2] eq 'dashed') ? 'punteada' : 'solida'; + push(@ALTtags,"Gráfica $ALPHABET[$inverse{$i}]: Esta es la gráfica de la línea que pasa por (0,$ar_mb[$i][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); +} + +pop(@ALTtags); +push(@ALTtags,"Esta es la gráfica de la línea que pasa por (0,$ar_mb[4][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +############################################## + +BEGIN_PGML + +Elija la gráfica que muestra la solución de [`y [$symbol] [$f]`]. En su propio papel de gráficar, primero dibuje la línea (sea punteada o sólida), y luego seleccione un punto de prueba para decidir cual lado de la línea sombrear. *Advertencia:* si salta los pasos que se deben hacer en papel, entonces no se está practicando lo que el ejercicio intenta que usted practique. + +La gráfica correcta es + [@$radio->buttons()@]* + +[@EnlargeImageStatementPGML@]** +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +$gr[4]->lb( new Label($x1,$y1,' '."$pt1".' ','red','right','middle')); +$gr[4]->lb( new Label($x2,$y2,' '."$pt2",'red','left','middle')); +$gr[4]->lb( new Label(0,$marksep[1]/5,"punto de prueba (0,0)",'red','right','middle')); + +$gr[4]->stamps( closed_circle($x1,$y1,'red') ); +$gr[4]->stamps( closed_circle($x2,$y2,'red') ); +$gr[4]->stamps( closed_circle(0,0,'red') ); + +$mOutput = $m==1 ? "" : "$m \cdot"; +$mOutput = $m==-1 ? "-" : "$m \cdot"; + +Context()->texStrings; +BEGIN_SOLUTION + +Para graficar la inecuación \( y $symbol $f \), primero graficamos la línea \( y=$f \). Lo puede hacer usando el método de tabulación o el de triángulo-pendiente para localizar los dos puntos de la línea. +$PAR +Note que la línea es $dashOrSolid, porque la inecuación usa el símbolo \( $symbol \). +$PAR +Luego, necesitamos decidir cual lado sombrear. Elegimos \( (0,0) \) como el punto de prueba. Al sustituir \(x=0\) y \(y=0\) en la inecuación \( y $symbol $f \), tenemos: +$PAR +\[ +\begin{align*} + y &$symbol $f \\ + 0 &$symbol $mOutput 0 + $b \\ + 0 &$symbol $b +\end{align*} +\] + $PAR +Que es $trueOrFalse, luego sombreamos el lado $withOrWithout el punto \( (0, 0) \). +$PAR +Por consiguiente la respuesta correcta es \{ $radio->correct_ans() \}. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>400, height=>400, tex_size=>400, + extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ) \} + +$ECENTER + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_E.pg b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_E.pg new file mode 100644 index 0000000000..0ab7c6bfbe --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_E.pg @@ -0,0 +1,284 @@ +# DESCRIPTION +# +# Tipo: Opción múltiple única respuesta +# Dada una inecuación tipo y >= B, elegir su representación gráfica. +# B es entero positivo o negativo. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones.db +# +# Programación por Carl Yao de Portland Community College del archivo +# PCCBasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality50.pg +# +# Última actualización: Edwin F. 07/29/2014 +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Inecuaciones lineales dos variables) +## Level(1) +## KEYWORDS('inecuaciones','lineales', 'dos variables', 'graficas') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "pccTables.pl", + "UPRMgraphMacros.pl", + "PGcourse.pl", + "problemRandomize.pl" +); + +############################################## +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +$symbol = '\ge'; + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + +$m=0; +$b=non_zero_random(-5,5,1); +@ar_mb = ([$m,$b,''],[$m,$b,''],[DNE,DNE,''],[DNE,DNE,'dashed'],[$m,$b,'']); + +#This subroutine is used later to see which side to shade. +sub testPoint { + local ($x, $y, $grNum) = ($_[0], $_[1], $_[2]); + if (($grNum==0) || ($grNum==4)) {return ($y >= $m * $x + $b);} + if ($grNum==1) {return ($y <= $m * $x + $b);} + if ($grNum==2) {return ($x >= $m * $x + $b);} + if ($grNum==3) {return ($x < $m * $x + $b);} +} + +if (0 > $m * 0 +$b) { + $trueOrFalse = "cierto"; + $withOrWithout = "con"; +} +else { + $trueOrFalse = "falso"; + $withOrWithout = "sin"; +} + +$x1 = 0; +$y1 = $m*$x1+$b; +$x2 = 1; +$y2 = $m*$x2+$b; + +$pt1=Compute("($x1,$y1)"); +$pt2=Compute("($x2,$y2)"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([0,$x2, 5],[$b,-$b,$y2,5],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); +@ALTtags=(); + +for ($i=2;$i<=3;$i++) { + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + $gr[$i]->moveTo($b,$min[1]); + $gr[$i]->lineTo($b,$max[1],'blue',2,$ar_mb[$i][2]); + + $gr[$i]->moveTo($b,$min[1]); + $gr[$i]->lineTo($b,$max[1],'white',1); + + $gr[$i]->new_color("lightred", 245,234,229); + + $yfillcoord = 0; + $xfillcoord = $b+$marksep[0]/8; + $xfillcoord = $b-$marksep[0]/8 if !(&testPoint($xfillcoord, $yfillcoord, $i)); + + $gr[$i]->fillRegion([$xfillcoord, $yfillcoord,"lightred"]); + + $x3 = $b; + $y3 = 1; + $dashOrSolid = ($ar_mb[$i][2] eq 'dashed') ? 'punteada' : 'solida'; + @ALTtags[$i] = "Graph $ALPHABET[$inverse{$i}]: Esta es la gráfica de la línea que pasa por ($b,0) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."; + +} + +for my $i (0..4) { + if (($i==2)||($i==3)) {next;} + + $f = Formula("$ar_mb[$i][0] *x + $ar_mb[$i][1]")->reduce; + + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'blue',2,$ar_mb[$i][2]); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'white',1); + + $gr[$i]->new_color("lightred", 245,234,229); + + $xfillcoord = 0; + $yfillcoord = ($f->eval(x=>$xfillcoord))+$marksep[1]; + $yfillcoord = ($f->eval(x=>$xfillcoord))-$marksep[1] if !(&testPoint($xfillcoord, $yfillcoord, $i)); + + $gr[$i]->fillRegion([$xfillcoord, $yfillcoord,"lightred"]); + + $x3 = 1; + $y3 = $f->eval(x=>$x3); + $dashOrSolid = ($ar_mb[$i][2] eq 'dashed') ? 'punteada' : 'solida'; + $ALTtags[$i]="Graph $ALPHABET[$inverse{$i}]: Esta es la gráfica de la línea que pasa por (0,$ar_mb[$i][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."; +} + +pop(@ALTtags); +push(@ALTtags,"Esta es la gráfica de la línea que pasa por (0,$ar_mb[4][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +############################################## + +BEGIN_PGML + +Elija la gráfica que muestra la solución de [`y [$symbol] [$f]`]. En su propio papel de gráficar, primero dibuje la línea (sea punteada o sólida), y luego seleccione un punto de prueba para decidir cual lado de la línea sombrear. *Advertencia:* si salta los pasos que se deben hacer en papel, entonces no se está practicando lo que el ejercicio intenta que usted practique. + +La gráfica correcta es + [@$radio->buttons()@]* + +[@EnlargeImageStatementPGML@]** +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +$gr[4]->lb( new Label($x1,$y1+$marksep[1]/5,"$pt1".' ','red','right','middle')); +$gr[4]->lb( new Label($x2,$y2+$marksep[1]/5,' '."$pt2",'red','left','middle')); +$gr[4]->lb( new Label(0,$marksep[1]/5,"punto de prueba (0,0)".' ','red','right','middle')); + +$gr[4]->stamps( closed_circle($x1,$y1,'red') ); +$gr[4]->stamps( closed_circle($x2,$y2,'red') ); +$gr[4]->stamps( closed_circle(0,0,'red') ); + +$mOutput = $m==1 ? "" : "$m \cdot"; +$mOutput = $m==-1 ? "-" : "$m \cdot"; + +Context()->texStrings; +BEGIN_SOLUTION + +Para graficar la inecuación \( y $symbol $f \), primero graficamos la línea \( y=$f \). Esta es una línea horizontal que pasa por el punto \( (0,$b) \). +$PAR +Note que la línea es $dashOrSolid, porque la inecuación usa el símbolo \( $symbol \). +$PAR +Luego, necesitamos decidir cual lado sombrear. Elegimos \( (0,0) \) como el punto de prueba. Al sustituir \(x=0\) y \(y=0\) en la inecuación \( y $symbol $f \), tenemos: +$PAR +\[ +\begin{align*} + y &$symbol $f \\ + 0 &$symbol $b +\end{align*} +\] + $PAR +Que es $trueOrFalse, luego sombreamos el lado $withOrWithout el punto \( (0, 0) \). +$PAR +Por consiguiente la respuesta correcta es \{ $radio->correct_ans() \}. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>400, height=>400, tex_size=>400, + extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ) \} + +$ECENTER + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_F.pg b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_F.pg new file mode 100644 index 0000000000..56c935fb9b --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_F.pg @@ -0,0 +1,285 @@ +# DESCRIPTION +# +# Tipo: Opción múltiple única respuesta +# Dada una inecuación tipo x < b, elegir su representación gráfica. +# b es entero positivo o negativo. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones.db +# +# Programación y redacción por Carl Yao de Portland Community College del archivo +# PCCBasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality60.pg +# +# Última actualización: Edwin F. 07/29/2014 +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Inecuaciones lineales dos variables) +## Level(1) +## KEYWORDS('inecuaciones','lineales', 'dos variables', 'graficas') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "pccTables.pl", + "UPRMgraphMacros.pl", + "PGcourse.pl", + "problemRandomize.pl" +); + +############################################## +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +$symbol = '<'; + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; + +$scramble{4} = 4; +$inverse{4} = 4; + +$m=0; +$b=non_zero_random(-5,5,1); +@ar_mb = ([DNE,DNE,'dashed'],[DNE,DNE,'dashed'],[$m,$b,'dashed'],[$m,$b,''],[DNE,DNE,'dashed']); + +#This subroutine is used later to see which side to shade. +sub testPoint { + local ($x, $y, $grNum) = ($_[0], $_[1], $_[2]); + if (($grNum==0) || ($grNum==4)) {return ($x < $b);} + if ($grNum==1) {return ($x > $b);} + if ($grNum==2) {return ($y >= $m * $x + $b);} + if ($grNum==3) {return ($y < $m * $x + $b);} +} + +if (0 < $m * 0 +$b) { + $trueOrFalse = "cierto"; + $withOrWithout = "con"; +} +else { + $trueOrFalse = "falso"; + $withOrWithout = "sin"; +} + +$x1 = $b; +$y1 = 0; +$x2 = $b; +$y2 = 1; + +$pt1=Compute("($x1,$y1)"); +$pt2=Compute("($x2,$y2)"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([0,$x2, 5],[$b,-$b,$y2,5],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); +@ALTtags=(); + +for ($i=2;$i<=3;$i++) { + + $f = Formula("$ar_mb[$i][0] *x + $ar_mb[$i][1]")->reduce; + + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'blue',2,$ar_mb[$i][2]); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'white',1); + + $gr[$i]->new_color("lightred", 245,234,229); + + $xfillcoord = 0; + $yfillcoord = ($f->eval(x=>$xfillcoord))+$marksep[1]; + $yfillcoord = ($f->eval(x=>$xfillcoord))-$marksep[1] if !(&testPoint($xfillcoord, $yfillcoord, $i)); + + $gr[$i]->fillRegion([$xfillcoord, $yfillcoord,"lightred"]); + + $x3 = 1; + $y3 = $f->eval(x=>$x3); + $dashOrSolid = ($ar_mb[$i][2] eq 'dashed') ? 'punteada' : 'solida'; + @ALTtags[$i] = "Gráfica $ALPHABET[$inverse{$i}]: Esta es la gráfica de la línea que pasa por (0,$ar_mb[$i][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."; + +} + +for my $i (0..4) { + if (($i==2)||($i==3)) {next;} + + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + $gr[$i]->moveTo($b,$min[1]); + $gr[$i]->lineTo($b,$max[1],'blue',2,$ar_mb[$i][2]); + + $gr[$i]->moveTo($b,$min[1]); + $gr[$i]->lineTo($b,$max[1],'white',1); + + $gr[$i]->new_color("lightred", 245,234,229); + + $yfillcoord = 0; + $xfillcoord = $b+$marksep[0]/8; + $xfillcoord = $b-$marksep[0]/8 if !(&testPoint($xfillcoord, $yfillcoord, $i)); + + $gr[$i]->fillRegion([$xfillcoord, $yfillcoord,"lightred"]); + + $x3 = $b; + $y3 = 1; + $dashOrSolid = ($ar_mb[$i][2] eq 'dashed') ? 'punteada' : 'solida'; + $ALTtags[$i]="Gráfica $ALPHABET[$inverse{$i}]: Esta es la gráfica de la línea que pasa por ($b,0) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."; +} + +pop(@ALTtags); +push(@ALTtags,"Esta es la gráfica de la línea que pasa por (0,$ar_mb[4][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +############################################## + +BEGIN_PGML + +Elija la gráfica que muestra la solución de [`x [$symbol] [$f]`]. En su propio papel de gráficar, primero dibuje la línea (sea punteada o sólida), y luego seleccione un punto de prueba para decidir cual lado de la línea sombrear. *Advertencia:* si salta los pasos que se deben hacer en papel, entonces no se está practicando lo que el ejercicio intenta que usted practique. + +La gráfica correcta es + [@$radio->buttons()@]* + +[@EnlargeImageStatementPGML@]** +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +$gr[4]->lb( new Label($x1,$y1+$marksep[1]/5,"$pt1",'red','right','middle')); +$gr[4]->lb( new Label($x2,$y2+$marksep[1]/5,"$pt2",'red','left','middle')); +$gr[4]->lb( new Label(0,-$marksep[1]/5,"punto de prueba (0,0)".' ','red','right','middle')); + +$gr[4]->stamps( closed_circle($x1,$y1,'red') ); +$gr[4]->stamps( closed_circle($x2,$y2,'red') ); +$gr[4]->stamps( closed_circle(0,0,'red') ); + +$mOutput = $m==1 ? "" : "$m \cdot"; +$mOutput = $m==-1 ? "-" : "$m \cdot"; + +Context()->texStrings; +BEGIN_SOLUTION + +Para graficar la inecuación \( x $symbol $f \), primero graficamos la línea \( x=$b \). Esta es una línea vertical que pasa por el punto \( ($b,0) \). +$PAR +Note que la línea es $dashOrSolid, porque la inecuación usa el símbolo \( $symbol \). +$PAR +Luego, necesitamos decidir cual lado sombrear. Elegimos \( (0,0) \) como el punto de prueba. Al sustituir \(x=0\) y \(y=0\) en la inecuación \( x $symbol $f \), tenemos: +$PAR +\[ +\begin{align*} + x &$symbol $b \\ + 0 &$symbol $b +\end{align*} +\] + $PAR +Que es $trueOrFalse, luego sombreamos el lado $withOrWithout el punto \( (0, 0) \). +$PAR +Por consiguiente la respuesta correcta es \{ $radio->correct_ans() \}. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>400, height=>400, tex_size=>400, + extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ) \} + +$ECENTER + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_G.pg b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_G.pg new file mode 100644 index 0000000000..e97f2820bb --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_G.pg @@ -0,0 +1,250 @@ +# DESCRIPTION +# +# Tipo: Opción múltiple única respuesta +# Dada una inecuación tipo Ax+Dy>C, elegir su representación gráfica. +# A, D, C son entero no cero positivos o negativos. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones.db +# +# Programación y redacción por Carl Yao de Portland Community College del archivo +# PCCBasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality70.pg +# +# Última actualización: Edwin F. 07/29/2014 +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Inecuaciones lineales dos variables) +## Level(1) +## KEYWORDS('inecuaciones','lineales', 'dos variables', 'graficas') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "pccTables.pl", + "UPRMgraphMacros.pl", + "PGcourse.pl", + "problemRandomize.pl" +); + +############################################## +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +$symbol = '>'; + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; +$scramble{4} = 4; +$inverse{4} = 4; + +$a=non_zero_random(-5,5,1); +do {$d=non_zero_random(-5,5,1);} until (abs($d)!=abs($a)); +$c=lcm(abs($a),abs($d))*non_zero_random(-3,3,1); + +$m=-$a/$d; +$b=$c/$d; +@ar_mb = ([$m,$b,'dashed'],[$m,$b,''],[-$d/$a,$b,'dashed'],[-$d/$a,$b,''],[$m,$b,'dashed']); + +#This subroutine is used later to see which side to shade +sub testPoint { + local ($x, $y, $grNum) = ($_[0], $_[1], $_[2]); + if (($grNum==0) || ($grNum==4)) {return ($a*$x + $d*$y > $c);} + if ($grNum==1) {return ($a*$x + $d*$y >= $c);} + if ($grNum==2) {return ($y > -$d/$a * $x +$b);} + if ($grNum==3) {return ($y < -$d/$a * $x +$b);} +} + +if (0 > $c) { + $trueOrFalse = "cierto"; + $withOrWithout = "con"; +} +else { + $trueOrFalse = "falso"; + $withOrWithout = "sin"; +} + +$x1 = 0; +$y1 = $c/$d; +$x2 = $c/$a; +$y2 = 0; + +$pt1=Compute("($x1,$y1)"); +$pt2=Compute("($x2,$y2)"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([0,$x2, 5],[$b,-$b,$y2,5],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); + +for my $i (0..4) { + + $f = Formula("$ar_mb[$i][0] *x + $ar_mb[$i][1]")->reduce; + + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'blue',2,$ar_mb[$i][2]); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'white',1); + + $gr[$i]->new_color("lightred", 245,234,229); + + $xfillcoord = 0; + $yfillcoord = ($f->eval(x=>$xfillcoord))+$marksep[1]; + $yfillcoord = ($f->eval(x=>$xfillcoord))-$marksep[1] if !(&testPoint($xfillcoord, $yfillcoord, $i)); + + $gr[$i]->fillRegion([$xfillcoord, $yfillcoord,"lightred"]); + + $x3 = 1; + $y3 = $f->eval(x=>$x3); + $dashOrSolid = ($ar_mb[$i][2] eq 'dashed') ? 'punteada' : 'solida'; + push(@ALTtags , "Gráfica $ALPHABET[$inverse{$i}]: Esta es la gráfica de la línea que pasa por (0,$ar_mb[$i][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); +} + +pop(@ALTtags); +push(@ALTtags,"Esta es la gráfica de la línea que pasa por (0,$ar_mb[4][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +Context()->variables->add(y=>"Real"); +$f = Formula("$a*x+$d*y")->reduce; + +############################################## + +BEGIN_PGML + +Elija la gráfica que muestra la solución de [`[$f] [$symbol] [$c]`]. En su propio papel de gráficar, primero dibuje la línea (sea punteada o sólida), y luego seleccione un punto de prueba para decidir cual lado de la línea sombrear. *Advertencia:* si salta los pasos que se deben hacer en papel, entonces no se está practicando lo que el ejercicio intenta que usted practique. + +La gráfica correcta es + [@$radio->buttons()@]* + +[@EnlargeImageStatementPGML@]** +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +$gr[4]->lb( new Label($x1,$y1-$marksep[1]/4,' '."$pt1".' ','red','right','middle')); +$gr[4]->lb( new Label($x2,$y2-$marksep[1]/4,' '."$pt2".' ','red','right','middle')); +$gr[4]->lb( new Label(0,$marksep[1]/3,"punto de prueba (0,0)",'red','center','middle')); + +$gr[4]->stamps( closed_circle($x1,$y1,'red') ); +$gr[4]->stamps( closed_circle($x2,$y2,'red') ); +$gr[4]->stamps( closed_circle(0,0,'red') ); + +$aOutput = $a==1 ? "" : "$a \cdot"; +$aOutput = $a==-1 ? "-" : "$a \cdot"; +$dOutput = $d==1 ? "" : "$d \cdot"; +$dOutput = $d==-1 ? "-" : "$d \cdot"; + +Context()->texStrings; +BEGIN_SOLUTION + +Para graficar la inecuación \( $f $symbol $c \), primero graficamos la línea \( $f=$c \). Lo puede hacer usando el método de tabulación o el de triángulo-pendiente para localizar los dos puntos de la línea. +$PAR +Note que la línea es $dashOrSolid, porque la inecuación usa el símbolo \( $symbol \). +$PAR +Luego, necesitamos decidir cual lado sombrear. Elegimos \( (0,0) \) como el punto de prueba. Al sustituir \(x=0\) y \(y=0\) en la inecuación \( $f $symbol $c \), tenemos: +$PAR +\[ +\begin{align*} + $f &$symbol $c \\ + $aOutput 0 + $dOutput 0 &$symbol $c \\ + 0 &$symbol $c +\end{align*} +\] + $PAR +Que es $trueOrFalse, luego sombreamos el lado $withOrWithout el punto \( (0, 0) \). +$PAR +Por consiguiente la respuesta correcta es \{ $radio->correct_ans() \}. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>400, height=>400, tex_size=>400, + extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ) \} + +$ECENTER + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_H.pg b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_H.pg new file mode 100644 index 0000000000..4e86378049 --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_H.pg @@ -0,0 +1,250 @@ +# DESCRIPTION +# +# Tipo: Opción múltiple única respuesta +# Dada una inecuación tipo Ax+Dy<=C, elegir su representación gráfica. +# A, D, C son entero no cero positivos o negativos. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones.db +# +# Programación y redacción por Carl Yao de Portland Community College del archivo +# PCCBasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality80.pg +# +# Última actualización: Edwin F. 07/29/2014 +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Inecuaciones lineales dos variables) +## Level(1) +## KEYWORDS('inecuaciones','lineales', 'dos variables', 'graficas') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "pccTables.pl", + "UPRMgraphMacros.pl", + "PGcourse.pl", + "problemRandomize.pl" +); + +############################################## +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +$symbol = '\leq'; + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; +$scramble{4} = 4; +$inverse{4} = 4; + +$a=non_zero_random(-4,4,1); +do {$d=non_zero_random(-4,4,1);} until ((abs($d)!=abs($a))&&(abs($d)!=1)); +$c=lcm(abs($a),abs($d))*non_zero_random(-2,2,1); + +$m=-$a/$d; +$b=$c/$d; +@ar_mb = ([$m,$b,''],[$m,$b,'dashed'],[$m,-$b,'dashed'],[1/$m,$b,''],[$m,$b,'']); + +#This subroutine is used later to see which side to shade +sub testPoint { + local ($x, $y, $grNum) = ($_[0], $_[1], $_[2]); + if (($grNum==0) || ($grNum==4)) {return ($a*$x + $d*$y <= $c);} + if ($grNum==1) {return ($a*$x + $d*$y > $c);} + if ($grNum==2) {return ($y > -$d/$a * $x +$b);} + if ($grNum==3) {return ($y < -$d/$a * $x +$b);} +} + +if (0 <= $c) { + $trueOrFalse = "true"; + $withOrWithout = "with"; +} +else { + $trueOrFalse = "false"; + $withOrWithout = "without"; +} + +$x1 = 0; +$y1 = $c/$d; +$x2 = $c/$a; +$y2 = 0; + +$pt1=Compute("($x1,$y1)"); +$pt2=Compute("($x2,$y2)"); + +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([0,$x2, 5],[$b,-$b,$y2,5],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); + +for my $i (0..4) { + + $f = Formula("$ar_mb[$i][0] *x + $ar_mb[$i][1]")->reduce; + + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'blue',2,$ar_mb[$i][2]); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'white',1); + + $gr[$i]->new_color("lightred", 245,234,229); + + $xfillcoord = 0; + $yfillcoord = ($f->eval(x=>$xfillcoord))+$marksep[1]; + $yfillcoord = ($f->eval(x=>$xfillcoord))-$marksep[1] if !(&testPoint($xfillcoord, $yfillcoord, $i)); + + $gr[$i]->fillRegion([$xfillcoord, $yfillcoord,"lightred"]); + + $x3 = 1; + $y3 = $f->eval(x=>$x3); + $dashOrSolid = ($ar_mb[$i][2] eq 'dashed') ? 'punteada' : 'solida'; + push(@ALTtags , "Gráfica $ALPHABET[$inverse{$i}]: Esta es la gráfica de la línea que pasa por (0,$ar_mb[$i][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); +} + +pop(@ALTtags); +push(@ALTtags,"Esta es la gráfica de la línea que pasa por (0,$ar_mb[4][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +Context()->variables->add(y=>"Real"); +$f = Formula("$a*x+$d*y")->reduce; + +############################################## + +BEGIN_PGML + +Elija la gráfica que muestra la solución de [`[$f] [$symbol] [$c]`]. En su propio papel de gráficar, primero dibuje la línea (sea punteada o sólida), y luego seleccione un punto de prueba para decidir cual lado de la línea sombrear. *Advertencia:* si salta los pasos que se deben hacer en papel, entonces no se está practicando lo que el ejercicio intenta que usted practique. + +La gráfica correcta es + [@$radio->buttons()@]* + +[@EnlargeImageStatementPGML@]** +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +$gr[4]->lb( new Label($x1,$y1-$marksep[1]/4,' '."$pt1".' ','red','right','middle')); +$gr[4]->lb( new Label($x2,$y2-$marksep[1]/4,' '."$pt2".' ','red','right','middle')); +$gr[4]->lb( new Label(0,$marksep[1]/3,"punto de prueba (0,0)",'red','center','middle')); + +$gr[4]->stamps( closed_circle($x1,$y1,'red') ); +$gr[4]->stamps( closed_circle($x2,$y2,'red') ); +$gr[4]->stamps( closed_circle(0,0,'red') ); + +$aOutput = $a==1 ? "" : "$a \cdot"; +$aOutput = $a==-1 ? "-" : "$a \cdot"; +$dOutput = $d==1 ? "" : "$d \cdot"; +$dOutput = $d==-1 ? "-" : "$d \cdot"; + +Context()->texStrings; +BEGIN_SOLUTION + +Para graficar la inecuación \( $f $symbol $c \), primero graficamos la línea \( $f=$c \). Lo puede hacer usando el método de tabulación o el de triángulo-pendiente para localizar los dos puntos de la línea. +$PAR +Note que la línea es $dashOrSolid, porque la inecuación usa el símbolo \( $symbol \). +$PAR +Luego, necesitamos decidir cual lado sombrear. Elegimos \( (0,0) \) como el punto de prueba. Al sustituir \(x=0\) y \(y=0\) en la inecuación \( $f $symbol $c \), tenemos: +$PAR +\[ +\begin{align*} + $f &$symbol $c \\ + $aOutput 0 + $dOutput 0 &$symbol $c \\ + 0 &$symbol $c +\end{align*} +\] + $PAR +Que es $trueOrFalse, luego sombreamos el lado $withOrWithout el punto \( (0, 0) \). +$PAR +Por consiguiente la respuesta correcta es \{ $radio->correct_ans() \}. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>400, height=>400, tex_size=>400, + extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ) \} + +$ECENTER + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_I.pg b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_I.pg new file mode 100644 index 0000000000..b69ffd0ea3 --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuaciones_lineales_de_dos_variables/inecuacion_grafica_dada_I.pg @@ -0,0 +1,255 @@ +# DESCRIPTION +# +# Tipo: Opción múltiple única respuesta +# Dada una inecuación tipo Ax+Dy<0, elegir su representación gráfica. +# A, D son enteros no cero positivos o negativos. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones.db +# +# Programación y redacción por Carl Yao de Portland Community College del archivo +# PCCBasicAlgebra/EquationsAndInequalitiesInTwoVariables/GraphTwoVariableInequality90.pg +# +# Última actualización: Edwin F. 07/29/2014 +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Inecuaciones lineales dos variables) +## Level(1) +## KEYWORDS('inecuaciones','lineales', 'dos variables', 'graficas') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( + "PGgraphmacros.pl", + "PGstandard.pl", + "MathObjects.pl", + "PGML.pl", + "parserRadioButtons.pl", + "pccTables.pl", + "UPRMgraphMacros.pl", + "PGcourse.pl", + "problemRandomize.pl" +); + +############################################## +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +$symbol = '<'; + +Context("Numeric"); +Context()->noreduce('(-x)-y','(-x)+y'); +$refreshCachedImages=1; + +#Create a hash and its inverse that randomizes the order of the four graphs. +%scramble = (); +%inverse = (); +for my $i (0..3) { + do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) ); + $scramble{$i} = $temp; + $inverse{$temp} = $i; +}; +$scramble{4} = 4; +$inverse{4} = 4; + +$a=non_zero_random(-5,5,1); +do {$d=non_zero_random(-5,5,1);} until (gcd(abs($d),abs($a))==1); +$c=0; + +$m=-$a/$d; +$b=$c/$d; +@ar_mb = ([$m,$b,'dashed'],[$m,$b,''],[$d/$a,$b,'dashed'],[-$d/$a,$b,'dashed'],[$m,$b,'dashed']); + +#This subroutine is used later to see which side to shade +sub testPoint { + local ($x, $y, $grNum) = ($_[0], $_[1], $_[2]); + if (($grNum==0) || ($grNum==4)) {return ($a*$x + $d*$y < $c);} + if ($grNum==1) {return ($a*$x + $d*$y > $c);} + if ($grNum==2) {return ($y > $d/$a * $x +$b);} + if ($grNum==3) {return ($y < -$d/$a * $x +$b);} +} + +if ($a < $c) { + $trueOrFalse = "cierto"; + $withOrWithout = "con"; +} +else { + $trueOrFalse = "falso"; + $withOrWithout = "sin"; +} + +$x1 = 0; +$y1 = $c/$d; +$x2 = abs($d); +$y2 = -$a*abs($d)/$d; + +$pt1=Compute("($x1,$y1)"); +$pt2=Compute("($x2,$y2)"); +($min[0], $max[0], $min[1], $max[1], $ticknum[0], $ticknum[1], $xticks_ref, $yticks_ref, $marksep[0], $marksep[1]) = NiceGraphParameters([0,$x2, 5],[$b,-$b,$y2,5],centerOrigin=>1); + +@xticks = @$xticks_ref; +@yticks = @$yticks_ref; + +@gr=(); + +for my $i (0..4) { + + $f = Formula("$ar_mb[$i][0] *x + $ar_mb[$i][1]")->reduce; + + $gr[$i] = init_graph($min[0],$min[1],$max[0],$max[1], + axes=>[0,0], + grid=>[$ticknum[0],$ticknum[1]], + size=>[xPixels(),yPixels()] + ); + $gr[$i]->lb('reset'); + + for my $j (@xticks) { + if (abs($j)<10**(-10)) {next;} + $gr[$i]->lb( new Label($j, -$marksep[1]/8, $j,'black','center','top')); + } + + for my $j (@yticks) { + if (Real($j) == 0) {next;} + $gr[$i]->lb( new Label($marksep[0]/8, $j, $j,'black','left','middle')); + } + + $gr[$i]->lb( new Label($min[0]+$marksep[0]/8, $max[1]-$marksep[1]/8, $ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'blue',2,$ar_mb[$i][2]); + + $gr[$i]->moveTo($min[0],$f->eval(x=>$min[0])); + $gr[$i]->lineTo($max[0],$f->eval(x=>$max[0]),'white',1); + + $gr[$i]->new_color("lightred", 245,234,229); + + $xfillcoord = 0; + $yfillcoord = ($f->eval(x=>$xfillcoord))+$marksep[1]; + $yfillcoord = ($f->eval(x=>$xfillcoord))-$marksep[1] if !(&testPoint($xfillcoord, $yfillcoord, $i)); + + $gr[$i]->fillRegion([$xfillcoord, $yfillcoord,"lightred"]); + + $x3 = 1; + $y3 = $f->eval(x=>$x3); + $dashOrSolid = ($ar_mb[$i][2] eq 'dashed') ? 'punteada' : 'solida'; + push(@ALTtags , "Gráfica $ALPHABET[$inverse{$i}]: Esta es la gráfica de la línea que pasa por (0,$ar_mb[$i][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); +} + +pop(@ALTtags); +push(@ALTtags,"Esta es la gráfica de la línea que pasa por (0,$ar_mb[4][1]) y ($x3,$y3). La línea es $dashOrSolid. El lado que incluye el punto ($xfillcoord,$yfillcoord) está sombreado."); + +$radio = RadioButtons( + ["A","B","C","D"], + $ALPHABET[$inverse{0}], # correct answer + order => ["A","B","C","D"], +); + +Context()->variables->add(y=>"Real"); +$f = Formula("$a*x+$d*y")->reduce; + +############################################## + +BEGIN_PGML + +Elija la gráfica que muestra la solución de [`[$f] [$symbol] [$c]`]. En su propio papel de gráficar, primero dibuje la línea (sea punteada o sólida), y luego seleccione un punto de prueba para decidir cual lado de la línea sombrear. *Advertencia:* si salta los pasos que se deben hacer en papel, entonces no se está practicando lo que el ejercicio intenta que usted practique. + +La gráfica correcta es + [@$radio->buttons()@]* + +[@EnlargeImageStatementPGML@]** +END_PGML + +Context()->texStrings; + +BEGIN_TEXT +$BCENTER +\{ +LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"' ), +image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"' ), +], +[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"' ), +image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"' ) +]], allcellcss => "padding:20pt;") + +\} +$ECENTER +$PAR + +END_TEXT + +Context()->normalStrings; + +############################################## + +ANS( $radio->cmp() ); + +$gr[4]->lb( new Label($x1,$y1-$marksep[1]/4,' '."$pt1".' ','red','right','middle')); +$gr[4]->lb( new Label($x2,$y2-$marksep[1]/4,' '."$pt2".' ','red','right','middle')); +$gr[4]->lb( new Label(1,$marksep[1]/3,"punto de prueba (0,0)",'red','center','middle')); + +$gr[4]->stamps( closed_circle($x1,$y1,'red') ); +$gr[4]->stamps( closed_circle($x2,$y2,'red') ); +$gr[4]->stamps( closed_circle(1,0,'red') ); + +$aOutput = $a==1 ? "" : "$a \cdot"; +$aOutput = $a==-1 ? "-" : "$a \cdot"; +$dOutput = $d==1 ? "" : "$d \cdot"; +$dOutput = $d==-1 ? "-" : "$d \cdot"; + +$absA = abs($a); +$absD = abs($d); + +if (abs($d)==1) {$mOutput = "$m";} +else {$mOutput = $m>0 ? " \frac {$absA}{$absD}" : "- \frac {$absA}{$absD}";} + +Context()->texStrings; +BEGIN_SOLUTION + +Para graficar la inecuación \( $f $symbol $c \), primero graficamos la línea \( $f=$c \). Para este problema, no podemos simplemente encontrar los interceptos \(x\) y \(y\), porque ellos son el mismo punto: \( (0,0) \). Tenemos que cambiar la ecuación a la forma pendiente-intercepto \( y = $mOutput x \), y por consiguiente usar el y-intercepto, \( (0,0) \), y triángulo-pendiente. +$PAR +Note que la línea es $dashOrSolid, porque la inecuación usa el símbolo \( $symbol \). +$PAR +Luego, necesitamos decidir cual lado sombrear. No podemos elegir el punto \( (0,0) \), porque está en la línea. En su lugar, elegimos \( (1,0) \). Al sustituir \(x=1\) y \(y=0\) en la inecuación \( $f $symbol $c \), tenemos: +$PAR +\[ +\begin{align*} + $f &$symbol $c \\ + $aOutput 1 + $dOutput 0 &$symbol $c \\ + $a &$symbol $c +\end{align*} +\] + $PAR +Que es $trueOrFalse, luego sombreamos el lado $withOrWithout el punto \( (1, 0) \). +$PAR +Por consiguiente la respuesta correcta es \{ $radio->correct_ans() \}. +$PAR +$BCENTER +\{ image( insertGraph($gr[4]), width=>400, height=>400, tex_size=>400, + extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"' ) \} + +$ECENTER + +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuaciones_polinomicas_y_racionales/inecuaciones_polinomicas.pg b/Contrib/UPRM/Prebasica/inecuaciones_polinomicas_y_racionales/inecuaciones_polinomicas.pg new file mode 100644 index 0000000000..943e00784b --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuaciones_polinomicas_y_racionales/inecuaciones_polinomicas.pg @@ -0,0 +1,184 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Inecuaciones polinomicas: tipo x^3 + ax^2 + bx [>,<,>=,<=] 0 +# encontrar solución en forma de intervalo. +# a = p + q y b = pq, con p y q enteros no cero. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuaciones_polinomicas_y_racionales/inecuaciones_polinomicas.db +# +# Última actualización: Edwin F. 07/30/2014 +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Polinomicas) +## Level(1) +## KEYWORDS('factorizacion','inecuaciones', 'polinomios') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"parserRadioButtons.pl", +"UPRMgraphMacros.pl", +"contextInequalities.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +#creando aleatoriamente la inecuacion x^3 + ax^2 + bx [>,<,>=,<=] 0 +$p = non_zero_random(-9,9); +do{ + $q = non_zero_random(-9,9); +}until( $q != $p ); + +$a = $p + $q; +$b = $p*$q; + +#usado para simplificar en caso que a y b sean negativos. +$mp = -$p; +$mq = -$q; + +@list_desig_tex = (">","<","\geq","\leq"); +@list_desig = (">","<",">=","<="); +$index = random(0,3); + +@val_cero = PGsort( sub {$_[0] < $_[1]} , (-$p,-$q,0) ); + +$punto_prueba1 = $val_cero[0] - 1; +$punto_prueba2 = $val_cero[1] - 0.5; +$punto_prueba3 = $val_cero[1] + 0.5; +$punto_prueba4 = $val_cero[2] + 1; + +Context()->noreduce('(-x)+y', '(-x)-y'); +$f = Formula("x^3 + $a x^2 + $b x")->reduce; + +Context("Fraction"); + +$fpp1 = Fraction( $f->eval(x=>$punto_prueba1) )->reduce; +$fpp2 = Fraction( $f->eval(x=>$punto_prueba2) )->reduce; +$fpp3 = Fraction( $f->eval(x=>$punto_prueba3) )->reduce; +$fpp4 = Fraction( $f->eval(x=>$punto_prueba4) )->reduce; + +Context("Inequalities"); + +#Subrutina que retorna un "+" o "-" si el número ingresado +#es positivo o negativo +sub signo { + local $a = $_[0]; + if ( $a > 0 ) { return "\(+\)";} + if ( $a < 0 ) { return "\(-\)";} + if ( $a == 0 ) { return "\(0\)";} +} + +#creando el intervalo solución +if ( $index == 0 ){ + $answer = Union( Compute( "($val_cero[0],$val_cero[1])" ) , Compute( "($val_cero[2],Inf)" ) ); + $paso_extra = ""; +}elsif ($index == 1){ + $answer = Union( Compute( "(-Inf,$val_cero[0])" ) , Compute( "($val_cero[1],$val_cero[2])" ) ); + $paso_extra = ""; +}elsif ($index == 2){ + $answer = Union( Compute( "[$val_cero[0],$val_cero[1]]" ) , Compute( "[$val_cero[2],Inf)" ) ); + $paso_extra = "$PAR Note que hemos añadido todos los extremos que son números, pues al sustituirlos en el polinomio obtenemos cero."; +}else{ + $answer = Union( Compute( "(-Inf,$val_cero[0]]" ) , Compute( "[$val_cero[1],$val_cero[2]]" ) ); + $paso_extra = "$PAR Note que hemos añadido todos los extremos que son números, pues al sustituirlos en el polinomio obtenemos cero."; +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Hallar el conjunto solución de la siguiente inecuación +\[ + $f $list_desig_tex[$index] 0 +\] +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("intervals") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Factorizar el polinomio: +\[ +$f = x(x^2 + $a x + $b) = x(x+$p)(x+$q) +\] +$PAR +$BBOLD Paso 2:$EBOLD Hallar los valores que hacen cero a cada factor del polinomio: +\[ + \begin{align*} + x = 0 \\ + x + $p &= 0 \quad \Rightarrow \quad x = $mp \\ + x + $q &= 0 \quad \Rightarrow \quad x = $mq, + \end{align*} +\] +entonces los intervalos de prueba serán \( (-\infty,$val_cero[0]), ($val_cero[0],$val_cero[1]), ($val_cero[1],$val_cero[2]) \) y \( ($val_cero[2],\infty) \). +$PAR +$BBOLD Paso 2:$EBOLD Seleccionar un punto de prueba dentro de cada intervalo anterior para determinar el signo que tiene la expresión \( \displaystyle $f. \) +$PAR +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Intervalo$EBOLD", "$BBOLD Punto de Prueba$EBOLD", "$BBOLD Evaluar$EBOLD", "$BBOLD Signo$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( (-\infty,$val_cero[0]) \)", "\( $punto_prueba1 \)", "\( ($punto_prueba1)^3 + $a($punto_prueba1)^2 + $b($punto_prueba1) = $fpp1 \)", signo($fpp1) ], align=>CENTER, separation=>0). + AlignedRow( [ "\( ($val_cero[0],$val_cero[1]) \)", "\( $punto_prueba2 \)", "\( ($punto_prueba2)^3 + $a($punto_prueba2)^2 + $b($punto_prueba2) = $fpp2 \)", signo($fpp2) ], align=>CENTER, separation=>0). + AlignedRow( [ "\( ($val_cero[1],$val_cero[2]) \)", "\( $punto_prueba3 \)", "\( ($punto_prueba3)^3 + $a($punto_prueba3)^2 + $b($punto_prueba3) = $fpp3 \)", signo($fpp3) ], align=>CENTER, separation=>0). + AlignedRow( [ "\( ($val_cero[2],\infty) \)", "\( $punto_prueba4 \)", "\( ($punto_prueba4)^3 + $a($punto_prueba4)^2 + $b($punto_prueba4) = $fpp4 \)", signo($fpp4) ], align=>CENTER, separation=>0). +EndTable() +\} +$PAR +Buscamos los valores de \(x\) que hagan el polinomio \($list_desig_tex[$index] 0\). Basándonos en la tabla anterior, el conjunto solución es: \($answer\). +$paso_extra +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuaciones_polinomicas_y_racionales/inecuaciones_racionales.pg b/Contrib/UPRM/Prebasica/inecuaciones_polinomicas_y_racionales/inecuaciones_racionales.pg new file mode 100644 index 0000000000..47556bf511 --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuaciones_polinomicas_y_racionales/inecuaciones_racionales.pg @@ -0,0 +1,185 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Inecuaciones racionales: tipo (x+a)/(x+b) [>,<,>=,<=] 0 +# encontrar solución en forma de intervalo. +# a y b enteros no cero + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuaciones_polinomicas_y_racionales/inecuaciones_racionales.db +# +# Última actualización: Edwin F. 07/30/2014 +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Racionales) +## Level(1) +## KEYWORDS('factorizacion','inecuaciones','racional') +## +## DBCCSS('') +## TitleText1('') +## EditionText1('') +## AuthorText1('') +## Section1('') +## Problem1('') +## +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +############################################## + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"parserRadioButtons.pl", +"UPRMgraphMacros.pl", +"contextInequalities.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +#creando aleatoriamente la inecuacion (x+a)/(x+b) [>,<,>=,<=] 0 +$a = non_zero_random(-9,9); +do{ + $b = non_zero_random(-9,9); +}until( $b != $a ); + +#usado para simplificar en caso que a y b sean negativos. +$ma = -$a; +$mb = -$b; + +@list_desig_tex = (">","<","\geq","\leq"); +@list_desig = (">","<",">=","<="); +$index = random(0,3); + +$min_mamb = min(-$a,-$b); +$max_mamb = max(-$a,-$b); + +$punto_prueba1 = $min_mamb - 1; +$punto_prueba3 = $max_mamb + 1; +$punto_prueba2 = ($max_mamb + $min_mamb)/2; + +Context()->noreduce('(-x)+y', '(-x)-y'); +$f = Formula("(x+$a)/(x+$b)")->reduce; + +Context("Fraction"); + +$fpp1 = Fraction( $f->eval(x=>$punto_prueba1) )->reduce; +$fpp2 = Fraction( $f->eval(x=>$punto_prueba2) )->reduce; +$fpp3 = Fraction( $f->eval(x=>$punto_prueba3) )->reduce; + +Context("Inequalities"); + +#Subrutina que retorna un "+" o "-" si el número ingresado +#es positivo o negativo +sub signo { + local $a = $_[0]; + if ( $a > 0 ) { return "\(+\)";} + if ( $a < 0 ) { return "\(-\)";} + if ( $a == 0 ) { return "\(0\)";} +} + +#creando el intervalo solución +if ( $index == 0 ){ + $answer = Union( Compute( "(-Inf,$min_mamb)" ) , Compute( "($max_mamb,Inf)" ) ); + $paso_extra = ""; +}elsif ($index == 1){ + $answer = Compute( "($min_mamb,$max_mamb)" ); + $paso_extra = ""; +}elsif ($index == 2){ + if ( $mb == $min_mamb ){ + $answer = Union( Compute( "(-Inf,$min_mamb)" ) , Compute( "[$max_mamb,Inf)" ) ); + $extremo = $max_mamb; + }else{ + $answer = Union( Compute( "(-Inf,$min_mamb]" ) , Compute( "[$max_mamb,Inf)" ) ); + $extremo = $min_mamb; + } +$paso_extra = "$PAR Note que hemos añadido el extremo \( $extremo \), pues al sustituirlo en la fracción obtenemos cero."; +}else{ + if ( $mb == $min_mamb ){ + $answer = Compute( "($min_mamb,$max_mamb]" ); + $extremo = $max_mamb; + }else{ + $answer = Compute( "[$min_mamb,$max_mamb)" ); + $extremo = $min_mamb; + } +$paso_extra = "$PAR Note que hemos añadido el extremo \( $extremo \), pues al sustituirlo en la fracción obtenemos cero."; +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Hallar el conjunto solución de la siguiente inecuación +\[ + $f $list_desig_tex[$index] 0 +\] +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("intervals") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Hallar los valores que hacen cero a cada factor de la fracción: +\[ + \begin{align*} + x + $a &= 0 \quad \Rightarrow \quad x = $ma \\ + x + $b &= 0 \quad \Rightarrow \quad x = $mb, + \end{align*} +\] +entonces los intervalos de prueba serán \( (-\infty,$min_mamb), ($min_mamb,$max_mamb) \) y \( ($max_mamb,\infty) \). +$PAR +$BBOLD Paso 2:$EBOLD Seleccionar un punto de prueba dentro de cada intervalo anterior para determinar el signo que tiene la expresión \( \displaystyle $f. \) +$PAR +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Intervalo$EBOLD", "$BBOLD Punto de Prueba$EBOLD", "$BBOLD Evaluar$EBOLD", "$BBOLD Signo$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( (-\infty,$min_mamb) \)", "\( $punto_prueba1 \)", "\( \displaystyle\frac{($punto_prueba1)+$a}{($punto_prueba1)+$b} = $fpp1 \)", signo($fpp1) ], align=>CENTER, separation=>0). + AlignedRow( [ "\( ($min_mamb,$max_mamb) \)", "\( $punto_prueba2 \)", "\( \displaystyle\frac{($punto_prueba2)+$a}{($punto_prueba2)+$b} = $fpp2 \)", signo($fpp2) ], align=>CENTER, separation=>0). + AlignedRow( [ "\( ($max_mamb,\infty) \)", "\( $punto_prueba3 \)", "\( \displaystyle\frac{($punto_prueba3)+$a}{($punto_prueba3)+$b} = $fpp3 \)", signo($fpp3) ], align=>CENTER, separation=>0). +EndTable() +\} +$PAR +Buscamos los valores de \(x\) que hagan la fracción \($list_desig_tex[$index] 0\). Basándonos en la tabla anterior, el conjunto solución es: \($answer\). +$paso_extra +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones.pg b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones.pg new file mode 100644 index 0000000000..4475e7527a --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones.pg @@ -0,0 +1,135 @@ +# DESCRIPTION +# +# Tipo: falso/cierto +# Comparar dos reales +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Comparacion) +## Level(1) +## KEYWORDS('inecuaciones','comparar') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +$a = random(-30,30,0.01); +$b = random(-30,30,0.01); + +@arrayRelacion = (">", "<","=","\geq", "\leq"); +$index = random(0,4); + +if ($index == 0){ #se elige que a > b + if ($a > $b){ #calculando el valor de verdad + $answer = "C"; + $answer2 = "a la derecha de"; + }elsif( $a < $b ){ + $answer = "F"; + $answer2 = "a la izquierda de"; + }else{ + $answer = "F"; + $answer2 = "en la misma posición que"; + } +}elsif( $index == 1){ #se elige que a < b + if ($a < $b){ #calculando el valor de verdad + $answer = "C"; + $answer2 = "a la izquierda de"; + }elsif( $a > $b ){ + $answer = "F"; + $answer2 = "a la derecha de"; + }else{ + $answer = "F"; + $answer2 = "en la misma posición que"; + } +}elsif( $index == 2 ){ #se elige que a = b + if ($a == $b){ #calculando el valor de verdad + $answer = "C"; + $answer2 = "en la misma posición que"; + }elsif( $a > $b ){ + $answer = "F"; + $answer2 = "a la derecha de"; + }else{ + $answer = "F"; + $answer2 = "a la izquierda de"; + } +}elsif( $index == 3 ){ #se elige que a >= b + if ($a == $b){ #calculando el valor de verdad + $answer = "C"; + $answer2 = "en la misma posición que"; + }elsif( $a > $b ){ + $answer = "C"; + $answer2 = "a la derecha de"; + }else{ + $answer = "F"; + $answer2 = "a la izquierda de"; + } +}else{ #se elige que a <= b + if ($a == $b){ #calculando el valor de verdad + $answer = "C"; + $answer2 = "en la misma posición que"; + }elsif( $a < $b ){ + $answer = "C"; + $answer2 = "a la izquierda de"; + }else{ + $answer = "F"; + $answer2 = "a la derecha de"; + } +} + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("Sea \(a=$a\) y \(b=$b\), entonces \( a $arrayRelacion[$index] b \).", $answer); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + + +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT + +## Provide the answer string +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +SOLUTION(EV3(<<'END_SOLUTION')); +Se tiene que $a se encuentra $answer2 $b en la recta numérica, entonces la respuesta es $BBOLD $answer$EBOLD. +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_lineales_A.pg b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_lineales_A.pg new file mode 100644 index 0000000000..2d749539a1 --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_lineales_A.pg @@ -0,0 +1,204 @@ +# DESCRIPTION +# +# Tipo: Seleccionar la correcta +# Simplificar una inecuación lineal: tipo ax + b [>,<=,>=] c. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones_lineales.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Simplificar) +## Level(1) +## KEYWORDS('inecuaciones') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl", +"parserRadioButtons.pl", +"contextInequalities.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +#construyendo la exp. tipo ax + b [>,<,>=,<=] c +$a = non_zero_random(-9,9); +$b = $a*non_zero_random(-20,20); +do{ + $c = $a*non_zero_random(-20,20); +}until ($c != $b); + +#eligiendo el tipo de desigualdad +@sim = (">","<","\geq","\leq"); +$index = random(0,3); + +#desigualdad contraria para la solucion +@sim_cont = ("<",">","\leq","\geq"); + +#Signo no TeX para Compute +if ($index == 0){ + $simbolo = ">"; + $simbolo_contrario = "<"; +}elsif ( $index == 1 ){ + $simbolo = "<"; + $simbolo_contrario = ">"; +}elsif ( $index == 2 ){ + $simbolo = ">="; + $simbolo_contrario = "<="; +}else{ + $simbolo = "<="; + $simbolo_contrario = ">="; +} + +#Los valores absolutos de a y b +#en caso de ser necesarios +$abs_a = abs($a); +$abs_b = abs($b); + +#valores temporales para la solución +$c_menos_b = $c - $b; +$b_menos_c = $b - $c; +$c_mas_b = $b + $c; + +#Operación a realizarse en el primer paso de la solución +if ($b > 0){ + $ope = "Restamos"; + $sig = "-"; +}else{ + $ope = "Sumamos"; + $sig = "+"; +} + + +#la inecuación a preguntar +if ( $a == 1){ + $ineq = "x + $b $sim[$index] $c"; +}elsif ($a == -1){ + $ineq = "-x + $b $sim[$index] $c"; +}else{ + $ineq = "$a x + $b $sim[$index] $c"; +} + +#En caso que "a" sea negativo se necesita un paso extra +#en la solución +if ( $a< 0 ){ + + Context("Inequalities-Only"); + $r = Compute("x $simbolo_contrario $c_menos_b/$a")->TeX; + $r1 = Compute("x $simbolo $c_menos_b/$a")->TeX; + $r2 = Compute("x $simbolo_contrario $b_menos_c/$a")->TeX; + $r3 = Compute("x $simbolo $b_menos_c/$a")->TeX; + $r4 = Compute("x $simbolo $c_mas_b/$a")->TeX; + + #Diferenciando de a = -1 y a < -1 + if ($a == -1){ + + $extra =" + $BBOLD Paso 2:$EBOLD Eliminar el signo \(-\). Dividimos a ambos lados de la desigualdad + por \(-1\) y cambiar dirección de la desigualdad. + \[ + \frac{-x}{-1} $sim_cont[$index] \frac{$c_menos_b}{-1} \quad \Rightarrow \quad $r + \] + $PAR"; + + }else{ + + $extra =" + $BBOLD Paso 2:$EBOLD Eliminar al $a de \(x\). Dividimos a ambos lados de la desigualdad + por \($a\) y cambiar dirección de la desigualdad. + \[ + \frac{$a x}{$a} $sim_cont[$index] \frac{$c_menos_b}{$a} \quad \Rightarrow \quad $r + \] + $PAR"; + + } + +}else{ + +Context("Inequalities-Only"); + $r = Compute("x $simbolo $c_menos_b/$a")->TeX; + $r1 = Compute("x $simbolo_contrario $c_menos_b/$a")->TeX; + $r2 = Compute("x $simbolo $b_menos_c/$a")->TeX; + $r3 = Compute("x $simbolo_contrario $b_menos_c/$a")->TeX; + $r4 = Compute("x $simbolo $c_mas_b/$a")->TeX; + + if ($a > 1){ + + $extra =" + $BBOLD Paso 2:$EBOLD Eliminar al $a de \(x\). Dividimos a ambos lados de la desigualdad + por \($a\). + \[ + \frac{$a x}{$a} $sim[$index] \frac{$c_menos_b}{$a} \quad \Rightarrow \quad $r + \] + $PAR"; + + } + +} + +$radio = RadioButtons(["\($r\)","\($r1\)","\($r2\)","\($r3\)","\($r4\)","Ninguna de las otras"], "\($r\)", + last => ["Ninguna de las otras"], + labels => "ABC" + ); + +Context()->noreduce('y-x', '-(x+y)', '-(n)', '-(x*y)', 'y-x'); +$ax = Formula("$a x")->reduce; + +Context()->texStrings; +BEGIN_TEXT +El resultado de simplificar +\[ +$ineq +\] +es: +$PAR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Eliminar $b. $ope $abs_b a ambos lados de la desigualdad: +\[ +\begin{align*} + $ax + $b $sig $abs_b & $sim[$index] $c $sig $abs_b \\[0.2cm] + $ax & $sim[$index] $c_menos_b +\end{align*} +\] +$PAR +$extra La solución es: \( $r \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_lineales_B.pg b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_lineales_B.pg new file mode 100644 index 0000000000..484071cfbc --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_lineales_B.pg @@ -0,0 +1,177 @@ +# DESCRIPTION +# +# Tipo: Seleccionar la correcta +# Simplificar una inecuación lineal: tipo x/a + b [>,<=,>=] c. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones_lineales.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Simplificar) +## Level(1) +## KEYWORDS('inecuaciones') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl", +"parserRadioButtons.pl", +"contextInequalities.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +#construyendo la exp. tipo x/a + b [>,<,>=,<=] c +$a = list_random(-9,-8,-7,-6,-5,-4,-3,-2,2,3,4,5,6,7,8,9); +$b = non_zero_random(-50,50); +do{ + $c = non_zero_random(-50,50); +}until ($c != $b); + +#eligiendo el tipo de desigualdad +@sim = (">","<","\geq","\leq"); +$index = random(0,3); + +#desigualdad contraria para la solucion +@sim_cont = ("<",">","\leq","\geq"); + +#Signo no TeX para Compute +if ($index == 0){ + $simbolo = ">"; + $simbolo_contrario = "<"; +}elsif ( $index == 1 ){ + $simbolo = "<"; + $simbolo_contrario = ">"; +}elsif ( $index == 2 ){ + $simbolo = ">="; + $simbolo_contrario = "<="; +}else{ + $simbolo = "<="; + $simbolo_contrario = ">="; +} + +#Los valores absolutos de a y b +#en caso de ser necesarios +$abs_a = abs($a); +$abs_b = abs($b); + +#valores temporales para la solución +$c_menos_b = $c - $b; +$b_menos_c = $b - $c; +$c_mas_b = $b + $c; + +#Operación a realizarse en el primer paso de la solución +if ($b > 0){ + $ope = "Restamos"; + $sig = "-"; +}else{ + $ope = "Sumamos"; + $sig = "+"; +} + + +#la inecuación a preguntar +$ineq = "\frac{x}{$a} + $b $sim[$index] $c"; + +#En caso que "a" sea negativo se necesita un paso extra +#en la solución +if ( $a< 0 ){ + + Context("Inequalities-Only"); + $r = Compute("x $simbolo_contrario $c_menos_b*$a")->TeX; + $r1 = Compute("x $simbolo $c_menos_b*$a")->TeX; + $r2 = Compute("x $simbolo_contrario $b_menos_c*$a")->TeX; + $r3 = Compute("x $simbolo $b_menos_c*$a")->TeX; + $r4 = Compute("x $simbolo $c_mas_b*$a")->TeX; + + $extra =" + $BBOLD Paso 2:$EBOLD Eliminar al $a de \(x\). Multiplicamos a ambos lados de la desigualdad por \($a\) y cambiar dirección de la desigualdad. + \[ + $a \cdot \frac{x}{$a} $sim_cont[$index] $a\cdot $c_menos_b \quad \Rightarrow \quad $r + \] + $PAR"; + +}else{ + +Context("Inequalities-Only"); + $r = Compute("x $simbolo $c_menos_b*$a")->TeX; + $r1 = Compute("x $simbolo_contrario $c_menos_b*$a")->TeX; + $r2 = Compute("x $simbolo $b_menos_c*$a")->TeX; + $r3 = Compute("x $simbolo_contrario $b_menos_c*$a")->TeX; + $r4 = Compute("x $simbolo $c_mas_b*$a")->TeX; + + $extra =" + $BBOLD Paso 2:$EBOLD Eliminar al $a de \(x\). Multiplicamos a ambos lados de la desigualdad por \($a\). + \[ + $a \cdot \frac{x}{$a} $sim[$index] $a\cdot $c_menos_b \quad \Rightarrow \quad $r + \] + $PAR"; + +} + +$radio = RadioButtons(["\($r\)","\($r1\)","\($r2\)","\($r3\)","\($r4\)","Ninguna de las otras"], "\($r\)", + last => ["Ninguna de las otras"], + labels => "ABC" + ); + +Context()->noreduce('y-x', '-(x+y)', '-(n)', '-(x*y)', 'y-x'); +$xsa = Formula("x/$a")->reduce; + +Context()->texStrings; +BEGIN_TEXT +El resultado de simplificar +\[ +$ineq +\] +es: +$PAR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Eliminar $b. $ope $abs_b a ambos lados de la desigualdad: +\[ +\begin{align*} + \frac{x}{$a} + $b $sig $abs_b & $sim[$index] $c $sig $abs_b \\[0.2cm] + \frac{x}{$a} & $sim[$index] $c_menos_b +\end{align*} +\] +$PAR +$extra La solución es: \( $r \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_A.pg b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_A.pg new file mode 100644 index 0000000000..cb0372176f --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_A.pg @@ -0,0 +1,128 @@ +# DESCRIPTION +# +# Tipo: Falso/Cierto +# propiedades de inecuaciones + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones_propiedades.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Propiedades) +## Level(1) +## KEYWORDS('inecuacions','propiedades') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl", +"parserImplicitEquation.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$a = non_zero_random(-20,20); +do { + $b = non_zero_random(-20,20); +} until ($b != $a); + +#variable a usar +$var = list_random("a","b","c","p","q","r","s","v","y","g","h","i","d","e","f","t","w","z"); + +@list_sim = (">","<",">=","<="); +@list_sim_tex = (">","<","\geq","\leq"); +@list_sim_tex_contra = ("<",">","\leq","\geq"); +@list_vv = ( $a > $b, $a < $b, $a >= $b, $a <= $b); +$index = random(0,3); + +if ( $list_vv[$index] ){ + $answer = "C"; + $simbolo = $list_sim_tex[$index]; + $texto = "CIERTO"; +}else{ + $answer = "F"; + $simbolo = $list_sim_tex_contra[$index]; + $texto = "FALSO"; +} + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("Sean \($a\), \($b\), y \($var\) un número real positivo, entonces +\[ +\frac{$a}{$var} $list_sim_tex[$index] \frac{$b}{$var} +\]", $answer +); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Relacionar los números $a y $b: +\[ +$a $simbolo $b +\] +$PAR +$BBOLD Paso 2:$EBOLD Identificar propiedad. +$PAR +$BBOLD Propiedad de división:$EBOLD Si \(j $list_sim_tex[$index] k \) y \(m\) un n úmero real positivo, entonces +\[ + \frac{j}{m} $list_sim_tex[$index] \frac{k}{m} +\] +$PAR +Luego el enunciado es $texto. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_B.pg b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_B.pg new file mode 100644 index 0000000000..663b714edf --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_B.pg @@ -0,0 +1,128 @@ +# DESCRIPTION +# +# Tipo: Falso/Cierto +# propiedades de inecuaciones + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones_propiedades.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Propiedades) +## Level(1) +## KEYWORDS('inecuacions','propiedades') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl", +"parserImplicitEquation.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$a = non_zero_random(-20,20); +do { + $b = non_zero_random(-20,20); +} until ($b != $a); + +#variable a usar +$var = list_random("a","b","c","p","q","r","s","v","y","g","h","i","d","e","f","t","w","z"); + +@list_sim = (">","<",">=","<="); +@list_sim_tex = (">","<","\geq","\leq"); +@list_sim_tex_contra = ("<",">","\leq","\geq"); +@list_vv = ( $a > $b, $a < $b, $a >= $b, $a <= $b); +$index = random(0,3); + +if ( $list_vv[$index] ){ + $answer = "C"; + $simbolo = $list_sim_tex[$index]; + $texto = "CIERTO"; +}else{ + $answer = "F"; + $simbolo = $list_sim_tex_contra[$index]; + $texto = "FALSO"; +} + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("Sean \($a\), \($b\), y \($var\) un número real positivo, entonces +\[ +$a $var $list_sim_tex[$index] $b $var +\]", $answer +); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Relacionar los números $a y $b: +\[ +$a $simbolo $b +\] +$PAR +$BBOLD Paso 2:$EBOLD Identificar propiedad. +$PAR +$BBOLD Propiedad de multiplicación:$EBOLD Si \(j $list_sim_tex[$index] k \) y \(m\) un n úmero real positivo, entonces +\[ + jm $list_sim_tex[$index] km +\] +$PAR +Luego el enunciado es $texto. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_C.pg b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_C.pg new file mode 100644 index 0000000000..53b6f1e652 --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_C.pg @@ -0,0 +1,98 @@ +# DESCRIPTION +# +# Tipo: Seleccionar la correcta +# propiedades de inecuaciones +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones_propiedades.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Propiedades) +## Level(1) +## KEYWORDS('inecuaciones','propiedades') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl", +"parserRadioButtons.pl", +"contextInequalities.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +$var1 = list_random("a","b","c","p","q","r","s","v","y","g","h","i","d","e","f","t","w","z"); +do { + $var2 = list_random("a","b","c","p","q","r","s","v","y","g","h","i","d","e","f","t","w","z"); +} until ($var2 ne $var1); +do { + $var3 = list_random("a","b","c","p","q","r","s","v","y","g","h","i","d","e","f","t","w","z"); +} until ( $var3 ne $var2 && $var3 ne $var1); + +$k = non_zero_random(-9,9); + +@list_sim = (">","<",">=","<="); +@list_sim_contra = ("<",">","<=",">="); +@list_sim_tex = (">","<","\geq","\leq"); +$index = random(0,3); + +$radio = RadioButtons([ + "$var1 $list_sim[$index] $var3", + "$var3 $list_sim[$index] $var1", + "$var1 $list_sim_contra[$index] $var3", + "$var3 $list_sim_contra[$index] $var1", + "Ninguna de las otras"], + "$var1 $list_sim[$index] $var3", + last => ["Ninguna de las otras"], + ); + +Context()->texStrings; +BEGIN_TEXT +Sean \($var1\), \($var2\) números reales cualesquiera y \($var3=$k\). Si \($var1 $list_sim_tex[$index] $var2\) y \($var2 $list_sim_tex[$index] $var3\) entonces ¿cuál de los siguientes enunciados es cierto? +$PAR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Identificar la propiedad: +$PAR +$BBOLD Propiedad transitiva:$EBOLD Si \($var1 $list_sim_tex[$index] $var2\) y \($var2 $list_sim_tex[$index] $var3\) entonces \($var1 $list_sim_tex[$index] $var3\). +$PAR +Por lo tanto la solución es \($var1 $list_sim_tex[$index] $var3\). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_D.pg b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_D.pg new file mode 100644 index 0000000000..01a7bea596 --- /dev/null +++ b/Contrib/UPRM/Prebasica/inecuacioness/inecuaciones_propiedades_D.pg @@ -0,0 +1,114 @@ +# DESCRIPTION +# +# Tipo: Seleccionar la correcta +# propiedades de inecuaciones +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/inecuacioness/inecuaciones_propiedades.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Inecuaciones) +## DBsection(Propiedades) +## Level(1) +## KEYWORDS('inecuaciones','propiedades') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl", +"parserRadioButtons.pl", +"contextInequalities.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +$a = non_zero_random(-20,20); +do{ + $b = non_zero_random(-20,20); +}until($b != $a); + +@list_sim = (">","<",">=","<="); +@list_sim_contra = ("<",">","<=",">="); +@list_sim_tex = (">","<","\geq","\leq"); +@list_sim_tex_contra = ("<",">","\leq","\geq"); +@list_vv = ($a > $b, $a < $b, $a >= $b, $a <= $b); +$index = random(0,3); + +if ($list_vv[$index] == 1){ + $ineq = "$list_sim[$index]"; + $ineq_tex = "$list_sim_tex[$index]"; +}else{ + $ineq = "$list_sim_contra[$index]"; + $ineq_tex = "$list_sim_tex_contra[$index]"; +} + +$var = list_random("a","b","c","p","q","r","s","v","y","g","h","i","d","e","f","t","w","z"); + +$radio = RadioButtons([ + "$a + $var $ineq $b + $var", + "$a + $var $ineq $a - $var", + "$a - $var $ineq $b + $var", + "$a - $var $ineq $b - $var", + "Ninguna de las otras"], + "$a + $var $ineq $b + $var", + last => ["Ninguna de las otras"], + ); + +Context()->texStrings; +BEGIN_TEXT +Considere los números \($a\) y \($b\). Y sea \($var\) un número real cualesquiera, entonces ¿cuál de los siguientes enunciados es cierto? +$PAR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Relacionar $a y $b: +\[ +$a $ineq_tex $b +\] +$PAR +$BBOLD Paso 2:$EBOLD Identificar la propiedad: +$PAR +$BBOLD Propiedad de suma:$EBOLD Si \($a $ineq_tex $b\) y \($var\) un número real, entonces +\[ +$a + $var $ineq_tex $b + $var +\] +es cierto. +$PAR +Por lo tanto la solución es \($a + $var $ineq_tex $b + $var\). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes_A.pg b/Contrib/UPRM/Prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes_A.pg new file mode 100644 index 0000000000..64820a78cb --- /dev/null +++ b/Contrib/UPRM/Prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes_A.pg @@ -0,0 +1,97 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada una gráfica, encontrar el intercepto en x o en y. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Funciones) +## DBsection(Interceptos) +## Level(1) +## KEYWORDS('grafica', 'funciones','interceptos') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$m = non_zero_random(-4,4,1); +$b = random(-9,9,1); +$y = Formula("$m x + $b"); + +if ( random(0,1) == 0 ){ + $answer = Compute($b); + $eje = "\( Y \) (ordenada)"; + $var = "y"; + $punto = "(0,$b)"; +}else{ + $int_x = -$b/$m; + $answer = Compute($int_x); + $eje = "\( X \) (abscisa)"; + $var = "x"; + $punto = "($int_x,0)"; +} + +$gr = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[20,20],size=>[450,450]); + +add_functions($gr, "$y for x in <-10,10> using color:blue and weight:2"); + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image(insertGraph($gr),width=>200,height=>200,tex_size=>450 ) \} +$BR +$BR +(Click en la gráfica para agrandar) +$ECENTER +$PAR$BR +Escriba el intercepto con el eje $eje de la gráfica anterior. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp()); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El intercepto en el eje $eje es la coordenada en \( $var \) del punto que lo interseca. En este caso es \($punto\). +$PAR +Por lo tanto, el valor \( $var \) del punto es \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes_B.pg b/Contrib/UPRM/Prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes_B.pg new file mode 100644 index 0000000000..7ea9aab188 --- /dev/null +++ b/Contrib/UPRM/Prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes_B.pg @@ -0,0 +1,88 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada una ecuación, encontrar el intercepto en x o en y. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Funciones) +## DBsection(Interceptos) +## Level(1) +## KEYWORDS('grafica', 'funciones','interceptos') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$m = non_zero_random(-4,4,1); +$b = random(-9,9,1); +$y = Formula("$m x + $b")->reduce; + +if ( random(0,1) == 0 ){ + $answer = Compute($b); + $eje = "\( Y \) (ordenada)"; + $var = "y"; + $punto = "(0,$b)"; + $p_int = "(0,b)"; +}else{ + $int_x = -$b/$m; + $answer = Compute($int_x); + $eje = "\( X \) (abscisa)"; + $var = "x"; + $punto = "($int_x,0)"; + $p_int = "(-\frac{b}{m},0)"; +} + +Context()->texStrings; +BEGIN_TEXT +Escriba el intercepto con el eje $eje de \( y = $y \). +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp()); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El intercepto en el eje $eje de una recta \(y = mx+b \) es la coordenada en \( $var \) del punto que lo interseca y es exactamente en \( $p_int \). En este caso es \($punto\). +$PAR +Por lo tanto, el valor \( $var \) del punto es \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes_C.pg b/Contrib/UPRM/Prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes_C.pg new file mode 100644 index 0000000000..d38387708a --- /dev/null +++ b/Contrib/UPRM/Prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes_C.pg @@ -0,0 +1,113 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada una gráfica, encontrar el intercepto en x o en y. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/intercepto_con_los_ejes/interceptos_con_los_ejes.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Funciones) +## DBsection(Interceptos) +## Level(1) +## KEYWORDS('grafica', 'funciones','interceptos') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +#Creando los ceros diferentes de un polinomio cúbico +$r1 = random(-8,8,0.5); + +do{ + $r2 = random(-8,8,0.5); +}until ($r2 > $r1); + +do{ + $r3 = random(-8,8,0.5); +}until ($r3 > $r2); + +$y = Formula(" (x - $r1)*(x - $r2)*(x - $r3) "); + +$prob = random(0,2); +if ( $prob == 0 ){ + $answer = Compute($r1); + $preg = "menor"; + $punto = "($r1,0)"; + $posicion = "primer"; +}elsif ( $prob == 1 ){ + $answer = Compute($r2); + $preg = "del medio"; + $punto = "($r2,0)"; + $posicion = "segundo"; +}else{ + $answer = Compute($r3); + $preg = "mayor"; + $punto = "($r3,0)"; + $posicion = "tercer"; +} + +$gr = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[20,20],size=>[450,450]); + +add_functions($gr, "$y for x in <-10,10> using color:blue and weight:2"); + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image(insertGraph($gr),width=>200,height=>200,tex_size=>450 ) \} +$BR +$BR +(Click en la gráfica para agrandar) +$ECENTER +$PAR$BR +Escriba el intercepto $preg con el eje \( X \) (abscisa) de la gráfica anterior. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp()); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El intercepto $preg en el eje \( X \) es la coordenada en \( x \) del $posicion punto (de izquierda a derecha) que interseca con el eje \( X \). +$PAR +En este caso, es \($punto\). +$PAR +Por lo tanto la solución es \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_A.pg b/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_A.pg new file mode 100644 index 0000000000..519781fe5f --- /dev/null +++ b/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_A.pg @@ -0,0 +1,164 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la representación gráfica de una parte de la línea recta, +# escribirla en forma de intervalo. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/intervalos/identificar_intervalo_de_grafica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Intervalo) +## DBsection(Grafica) +## Level(1) +## KEYWORDS('desigualdades','intervalo','grafica') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Inequalities"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +#Haciendo la gráfica +$gr = init_graph(-10,-1,10,1, size=>[800,100]); + +# el eje x +$gr -> moveTo(-10,0); +$gr -> lineTo(10,0,'black','1'); + +# las marcas del eje x, entrada como: valor en y, color y lista de valores +$gr -> h_ticks(0,"black",-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9); + +# creando las etiquetas de las marcas en la forma: x,y,label,color,posición horiz y posicion vert +foreach my $j (-9..9) { + $gr->lb( new Label($j,-0.5,$j, 'black','center','middle')); +} + +#la desigualdad +$a = non_zero_random(-5,5,.5); + +#Eligiendo (a,inf) o [a,inf) o (-inf,a) o (-inf,a] +$prob = random(0,3); +if ($prob == 0){ + $answer = Compute("($a,inf)"); + #Dibujando el intervalo (a,inf) + $gr -> moveTo($a,0.0); + $gr -> arrowTo(10,0.0,'blue',3); + $gr -> stamps( open_circle($a,0.0,'blue') ); + $xlabel = $a + 2; + $tipo = "abierto"; + $accion = "excluimos"; + $direccion = "infinito positivo"; + $sol_text = "($a,\infty)"; +}elsif($prob == 1){ + $answer = Compute("[$a,inf)"); + #Dibujando el intervalo [a,inf) + $gr -> moveTo($a,0.0); + $gr -> arrowTo(10,0.0,'blue',3); + $gr -> stamps( closed_circle($a,0.0,'blue') ); + $xlabel = $a + 2; + $tipo = "cerrado"; + $accion = "incluimos"; + $direccion = "infinito positivo"; + $sol_text = "[$a,\infty)"; +}elsif($prob == 2){ + $answer = Compute("(-inf,$a)"); + #Dibujando el intervalo (-inf,a) + $gr -> moveTo($a,0.0); + $gr -> arrowTo(-10,0.0,'blue',3); + $gr -> stamps( open_circle($a,0.0,'blue') ); + $xlabel = $a - 2; + $tipo = "abierto"; + $accion = "excluimos"; + $direccion = "negativo infinito"; + $sol_text = "(-\infty,$a)"; +}else{ + $answer = Compute("(-inf,$a]"); + #Dibujando el intervalo (-inf,a] + $gr -> moveTo($a,0.0); + $gr -> arrowTo(-10,0.0,'blue',3); + $gr -> stamps( closed_circle($a,0.0,'blue') ); + $xlabel = $a - 2; + $tipo = "cerrado"; + $accion = "incluimos"; + $direccion = "negativo infinito"; + $sol_text = "(-\infty,$a]"; +} + +$gr->lb(new Label($xlabel,0.5,'x','blue','center','middle')); + +############################################################## +# +# Text +# +## + +BEGIN_TEXT +Escriba en notación de $BBOLD intervalo$EBOLD el conjunto azul que se representa en la siguiente figura. +$PAR +$BCENTER +\{ image(insertGraph($gr), width=>640, height=>100, tex_size=>320); \} +$ECENTER +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("inequalities") \} +END_TEXT + +Context("Numeric"); +Context()->normalStrings; +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +#$showHint = 3; +#BEGIN_HINT +#From the picture find the fixed endpoint. If the arrow goes to the right then x +#can be larger. If the arrow goes to the left, then x can be smaller. +#END_HINT + +#$showHint = 5; +#BEGIN_HINT +#Look at the endpoint. If it is a solid point, then the endpoint should be +#included and you will need either \( \le \) or \( \ge \). If it is an open point, then +#the endpoint should not be included and you will need either \( < \) or \( > \). +#END_HINT + +SOLUTION(EV3(<<'END_SOLUTION')); +Identificar el tipo de intervalo. El punto azul en la recta se encuentra $BBOLD $tipo$EBOLD, significa que $BBOLD$accion$EBOLD el punto. También el conjunto azul se extiende hasta $BBOLD $direccion$EBOLD, por lo tanto el intervalo es: +\[ +$sol_text +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_B.pg b/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_B.pg new file mode 100644 index 0000000000..064eda8b60 --- /dev/null +++ b/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_B.pg @@ -0,0 +1,164 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la representación gráfica de una parte de la línea recta, +# escribirla en forma de desigualdad. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/intervalos/identificar_intervalo_de_grafica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Intervalo) +## DBsection(Grafica) +## Level(1) +## KEYWORDS('desigualdades','intervalo','grafica') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Inequalities-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +#Haciendo la gráfica +$gr = init_graph(-10,-1,10,1, size=>[800,100]); + +# el eje x +$gr -> moveTo(-10,0); +$gr -> lineTo(10,0,'black','1'); + +# las marcas del eje x, entrada como: valor en y, color y lista de valores +$gr -> h_ticks(0,"black",-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9); + +# creando las etiquetas de las marcas en la forma: x,y,label,color,posición horiz y posicion vert +foreach my $j (-9..9) { + $gr->lb( new Label($j,-0.5,$j, 'black','center','middle')); +} + +#la desigualdad +$a = non_zero_random(-5,5,.5); + +#Eligiendo (a,inf) o [a,inf) o (-inf,a) o (-inf,a] +$prob = random(0,3); +if ($prob == 0){ + $answer = Compute(" x > $a " || "$a < x"); + #Dibujando el intervalo (a,inf) + $gr -> moveTo($a,0.0); + $gr -> arrowTo(10,0.0,'blue',3); + $gr -> stamps( open_circle($a,0.0,'blue') ); + $xlabel = $a + 2; + $tipo = "abierto"; + $accion = "excluimos"; + $direccion = "infinito positivo"; + $sol_text = "($a,\infty)"; +}elsif($prob == 1){ + $answer = Compute(" x >= $a " || "$a <= x"); + #Dibujando el intervalo [a,inf) + $gr -> moveTo($a,0.0); + $gr -> arrowTo(10,0.0,'blue',3); + $gr -> stamps( closed_circle($a,0.0,'blue') ); + $xlabel = $a + 2; + $tipo = "cerrado"; + $accion = "incluimos"; + $direccion = "infinito positivo"; + $sol_text = "[$a,\infty)"; +}elsif($prob == 2){ + $answer = Compute(" x < $a " || "$a > x"); + #Dibujando el intervalo (-inf,a) + $gr -> moveTo($a,0.0); + $gr -> arrowTo(-10,0.0,'blue',3); + $gr -> stamps( open_circle($a,0.0,'blue') ); + $xlabel = $a - 2; + $tipo = "abierto"; + $accion = "excluimos"; + $direccion = "negativo infinito"; + $sol_text = "(-\infty,$a)"; +}else{ + $answer = Compute(" x <= $a " || "$a >= x"); + #Dibujando el intervalo (-inf,a] + $gr -> moveTo($a,0.0); + $gr -> arrowTo(-10,0.0,'blue',3); + $gr -> stamps( closed_circle($a,0.0,'blue') ); + $xlabel = $a - 2; + $tipo = "cerrado"; + $accion = "incluimos"; + $direccion = "negativo infinito"; + $sol_text = "(-\infty,$a]"; +} + +$gr->lb(new Label($xlabel,0.5,'x','blue','center','middle')); + +############################################################## +# +# Text +# +## + +BEGIN_TEXT +Escriba en notación de $BBOLD desigualdad$EBOLD el conjunto azul que se representa en la siguiente figura. +$PAR +$BCENTER +\{ image(insertGraph($gr), width=>640, height=>100, tex_size=>320); \} +$ECENTER +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("inequalities") \} +END_TEXT + +Context("Numeric"); +Context()->normalStrings; +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +#$showHint = 3; +#BEGIN_HINT +#From the picture find the fixed endpoint. If the arrow goes to the right then x +#can be larger. If the arrow goes to the left, then x can be smaller. +#END_HINT + +#$showHint = 5; +#BEGIN_HINT +#Look at the endpoint. If it is a solid point, then the endpoint should be +#included and you will need either \( \le \) or \( \ge \). If it is an open point, then +#the endpoint should not be included and you will need either \( < \) or \( > \). +#END_HINT + +SOLUTION(EV3(<<'END_SOLUTION')); +Identificar el tipo de intervalo. El punto azul en la recta se encuentra $BBOLD $tipo$EBOLD, significa que $BBOLD$accion$EBOLD el punto. También el conjunto azul se extiende hasta $BBOLD $direccion$EBOLD, por lo tanto el intervalo es: +\[ +$answer +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_C.pg b/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_C.pg new file mode 100644 index 0000000000..b51a4bce10 --- /dev/null +++ b/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_C.pg @@ -0,0 +1,186 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la representación gráfica de una parte de la línea recta, +# escribirla en forma intervalo (a,b) o (a,b] o [a,b) [a,b]. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# parece de este: pedro_prebasica/intervalos/identificar_intervalo_de_grafica.db +# pero en realidad está en este: pedro_prebasica/intervalos//identificar_numeros_en_intervalos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Intervalo) +## DBsection(Grafica) +## Level(1) +## KEYWORDS('desigualdades','intervalo','grafica') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Inequalities"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +#Haciendo la gráfica +$gr = init_graph(-10,-1,10,1, size=>[800,100]); + +# el eje x +$gr -> moveTo(-10,0); +$gr -> lineTo(10,0,'black','1'); + +# las marcas del eje x, entrada como: valor en y, color y lista de valores +$gr -> h_ticks(0,"black",-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9); + +# creando las etiquetas de las marcas en la forma: x,y,label,color,posición horiz y posicion vert +foreach my $j (-9..9) { + $gr->lb( new Label($j,-0.5,$j, 'black','center','middle')); +} + +#la desigualdad +$a = random(-8,-2,.5); +$b = random(2,8,.5); + +#Eligiendo (a,b) o (a,b] o [a,b) o [a,b] +$prob = random(0,3); + +if ($prob == 0){ + + $answer = Compute("($a,$b)"); + + #Dibujando el intervalo (a,b) + $gr -> moveTo($a,0.0); + $gr -> lineTo($b,0.0,'blue',3); + $gr -> stamps( open_circle($a,0.0,'blue') ); + $gr -> stamps( open_circle($b,0.0,'blue') ); + $tipo1 = "abierto"; + $tipo2 = "abierto"; + $accion1 = "excluimos"; + $accion2 = "excluimos"; + $sol_text = "($a,$b)"; + +}elsif($prob == 1){ + + $answer = Compute("($a,$b]"); + + #Dibujando el intervalo (a,b] + $gr -> moveTo($a,0.0); + $gr -> lineTo($b,0.0,'blue',3); + $gr -> stamps( open_circle($a,0.0,'blue') ); + $gr -> stamps( closed_circle($b,0.0,'blue') ); + $tipo1 = "abierto"; + $tipo2 = "cerrado"; + $accion1 = "excluimos"; + $accion2 = "incluimos"; + $sol_text = "($a,$b]"; + +}elsif($prob == 2){ + + $answer = Compute("[$a,$b)"); + + #Dibujando el intervalo [a,b) + $gr -> moveTo($a,0.0); + $gr -> lineTo($b,0.0,'blue',3); + $gr -> stamps( closed_circle($a,0.0,'blue') ); + $gr -> stamps( open_circle($b,0.0,'blue') ); + $tipo1 = "cerrado"; + $tipo2 = "abierto"; + $accion1 = "incluimos"; + $accion2 = "excluimos"; + $sol_text = "[$a,$b)"; + +}else{ + + + $answer = Compute("[$a,$b]"); + + #Dibujando el intervalo [a,b] + $gr -> moveTo($a,0.0); + $gr -> lineTo($b,0.0,'blue',3); + $gr -> stamps( closed_circle($a,0.0,'blue') ); + $gr -> stamps( closed_circle($b,0.0,'blue') ); + $tipo1 = "cerrado"; + $tipo2 = "cerrado"; + $accion1 = "incluimos"; + $accion2 = "incluimos"; + $sol_text = "[$a,$b]"; +} + + $xlabel = ($a + $b)/2; +$gr->lb(new Label($xlabel,0.5,'x','blue','center','middle')); + +############################################################## +# +# Text +# +## + +BEGIN_TEXT +Escriba en notación de $BBOLD intervalo$EBOLD el conjunto azul que se representa en la siguiente figura. +$PAR +$BCENTER +\{ image(insertGraph($gr), width=>640, height=>100, tex_size=>320); \} +$ECENTER +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("inequalities") \} +END_TEXT + +Context("Numeric"); +Context()->normalStrings; +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +#$showHint = 3; +#BEGIN_HINT +#From the picture find the fixed endpoint. If the arrow goes to the right then x +#can be larger. If the arrow goes to the left, then x can be smaller. +#END_HINT + +#$showHint = 5; +#BEGIN_HINT +#Look at the endpoint. If it is a solid point, then the endpoint should be +#included and you will need either \( \le \) or \( \ge \). If it is an open point, then +#the endpoint should not be included and you will need either \( < \) or \( > \). +#END_HINT + +SOLUTION(EV3(<<'END_SOLUTION')); +Identificar el tipo de intervalo. El punto azul de la izquierda en la recta se encuentra $BBOLD $tipo1$EBOLD, significa que $BBOLD$accion1$EBOLD el valor \(x=$a\). El de la derecha está $BBOLD$tipo2$EBOLD, significa que $BBOLD$accion2$EBOLD el punto \(x=$b\). + +Por lo tanto el intervalo es: +\[ +$answer +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_D.pg b/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_D.pg new file mode 100644 index 0000000000..5237460cdb --- /dev/null +++ b/Contrib/UPRM/Prebasica/intervalos/identificar_intervalo_de_grafica_D.pg @@ -0,0 +1,186 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada la representación gráfica de una parte de la línea recta, +# escribirla en forma de desigualdad. + +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# parece de este: pedro_prebasica/intervalos/identificar_intervalo_de_grafica.db +# pero en realidad está en este: pedro_prebasica/intervalos//identificar_numeros_en_intervalos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Intervalo) +## DBsection(Grafica) +## Level(1) +## KEYWORDS('desigualdades','intervalo','grafica','desigualdad') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Inequalities-Only"); +Context()->flags->set(formatStudentAnswer=>'parsed'); + +#Haciendo la gráfica +$gr = init_graph(-10,-1,10,1, size=>[800,100]); + +# el eje x +$gr -> moveTo(-10,0); +$gr -> lineTo(10,0,'black','1'); + +# las marcas del eje x, entrada como: valor en y, color y lista de valores +$gr -> h_ticks(0,"black",-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9); + +# creando las etiquetas de las marcas en la forma: x,y,label,color,posición horiz y posicion vert +foreach my $j (-9..9) { + $gr->lb( new Label($j,-0.5,$j, 'black','center','middle')); +} + +#la desigualdad +$a = random(-8,-2,.5); +$b = random(2,8,.5); + +#Eligiendo (a,b) o (a,b] o [a,b) o [a,b] +$prob = random(0,3); + +if ($prob == 0){ + + $answer = Compute("$a < x < $b"); + + #Dibujando el intervalo (a,b) + $gr -> moveTo($a,0.0); + $gr -> lineTo($b,0.0,'blue',3); + $gr -> stamps( open_circle($a,0.0,'blue') ); + $gr -> stamps( open_circle($b,0.0,'blue') ); + $tipo1 = "abierto"; + $tipo2 = "abierto"; + $accion1 = "excluimos"; + $accion2 = "excluimos"; + $sol_text = "($a,$b)"; + +}elsif($prob == 1){ + + $answer = Compute("$a < x <= $b"); + + #Dibujando el intervalo (a,b] + $gr -> moveTo($a,0.0); + $gr -> lineTo($b,0.0,'blue',3); + $gr -> stamps( open_circle($a,0.0,'blue') ); + $gr -> stamps( closed_circle($b,0.0,'blue') ); + $tipo1 = "abierto"; + $tipo2 = "cerrado"; + $accion1 = "excluimos"; + $accion2 = "incluimos"; + $sol_text = "($a,$b]"; + +}elsif($prob == 2){ + + $answer = Compute("$a <= x < $b"); + + #Dibujando el intervalo [a,b) + $gr -> moveTo($a,0.0); + $gr -> lineTo($b,0.0,'blue',3); + $gr -> stamps( closed_circle($a,0.0,'blue') ); + $gr -> stamps( open_circle($b,0.0,'blue') ); + $tipo1 = "cerrado"; + $tipo2 = "abierto"; + $accion1 = "incluimos"; + $accion2 = "excluimos"; + $sol_text = "[$a,$b)"; + +}else{ + + + $answer = Compute("$a <= x <= $b"); + + #Dibujando el intervalo [a,b] + $gr -> moveTo($a,0.0); + $gr -> lineTo($b,0.0,'blue',3); + $gr -> stamps( closed_circle($a,0.0,'blue') ); + $gr -> stamps( closed_circle($b,0.0,'blue') ); + $tipo1 = "cerrado"; + $tipo2 = "cerrado"; + $accion1 = "incluimos"; + $accion2 = "incluimos"; + $sol_text = "[$a,$b]"; +} + + $xlabel = ($a + $b)/2; +$gr->lb(new Label($xlabel,0.5,'x','blue','center','middle')); + +############################################################## +# +# Text +# +## + +BEGIN_TEXT +Escriba en notación de $BBOLD desigualdad$EBOLD el conjunto azul que se representa en la siguiente figura. +$PAR +$BCENTER +\{ image(insertGraph($gr), width=>640, height=>100, tex_size=>320); \} +$ECENTER +$PAR +\{ans_rule(20)\} \{ AnswerFormatHelp("inequalities") \} +END_TEXT + +Context("Numeric"); +Context()->normalStrings; +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +#$showHint = 3; +#BEGIN_HINT +#From the picture find the fixed endpoint. If the arrow goes to the right then x +#can be larger. If the arrow goes to the left, then x can be smaller. +#END_HINT + +#$showHint = 5; +#BEGIN_HINT +#Look at the endpoint. If it is a solid point, then the endpoint should be +#included and you will need either \( \le \) or \( \ge \). If it is an open point, then +#the endpoint should not be included and you will need either \( < \) or \( > \). +#END_HINT + +SOLUTION(EV3(<<'END_SOLUTION')); +Identificar el tipo de intervalo. El punto azul de la izquierda en la recta se encuentra $BBOLD$tipo1$EBOLD, significa que $BBOLD$accion1$EBOLD el valor \(x=$a\). El de la derecha está $BBOLD$tipo2$EBOLD, significa que $BBOLD$accion2$EBOLD el punto \(x=$b\). + +Por lo tanto el intervalo es: +\[ +$answer +\] +END_SOLUTION + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/intervalos/numeros_en_intervalo.pg b/Contrib/UPRM/Prebasica/intervalos/numeros_en_intervalo.pg new file mode 100644 index 0000000000..bd536264f1 --- /dev/null +++ b/Contrib/UPRM/Prebasica/intervalos/numeros_en_intervalo.pg @@ -0,0 +1,176 @@ +# DESCRIPTION +# +# Tipo: seleccionar varias respuestas correctas +# Identificar números en un intervalo dado + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/intervalos/numeros_en_intervalo.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Intervalos) +## DBsection(Identificar valores) +## Level(1) +## KEYWORDS('intervalos','identificar') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); +$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Extremos del intervalo +$a = random(-25,0,0.01); +$b = random(0.01,25,0.01); + +##################################################### +#Esta parte es para mejorar a futuro +##################################################### + +#tipo de intervalo aleatoriamente (a,b), (a,b], [a,b), [a,b] +#$tipo = random(0,3); +# +#eligiendo aleatoriamente cantidad de números dentro del intervalo +#$num_dentro = random(0,5); + +###################################################### +## hasta aqui +###################################################### + +#Puntos dentro del intervalo +$r1 = random($a, $b, 0.01); +$r2 = random($a, $b, 0.01); +$r3 = random($a, $b, 0.01); + +#Puntos fuera del intervalo +$prob = random(0,2); +if ($prob == 0){ + $r4 = random(-50, $a+0.01, 0.01); + $r5 = random($b+0.01, 50, 0.01); +}elsif($prob == 1){ + $izq_o_der = random(0,1); + if ($izq_o_der == 0){ + $r4 = $a; + $r5 = random($b+0.01, 50, 0.01); + }else{ + $r4 = random($b+0.01, 50, 0.01); + $r5 = $b; + } +}else{ + $r4 = $a; + $r5 = $b; +} + +$mc = new_checkbox_multiple_choice(); +$mc -> qa ( +"¿Cuál de los siguientes números se encuentran en el intervalo \( ($a,$b) \)?. Podrían ser mas de uno.", +"\( $r1 \)$BR", +"\( $r2 \)$BR", +"\( $r3 \)$BR" +); +$mc -> extra( +"\( $r4 \)$BR", +"\( $r5 \)$BR", +); +$mc -> makeLast("Ninguna de las anteriores"); + +#haciendo la representación para la solución +$gr = init_graph($a-5,-1,$b+5,1, size=>[800,100]); + +$gr -> moveTo($a-5,0); +$gr -> lineTo($b+5,0,'black','1'); + +#Esto no funciona por ahora +#my @arr_ticks; +#$index = 0; +#foreach my $i (ceil($a)..floor($b)){ +# $arr_ticks[$index] = $i; +# $index = $index + 1; +#} +# las marcas del eje x, entrada como: valor en y, color y lista de valores +#$gr -> h_ticks(0,"black",$arr_ticks); +# creando las etiquetas de las marcas en la forma: x,y,label,color, posición horiz y posición vert +#foreach my $j (ceil($a)..floor($b)) { +# $gr->lb( new Label($j,-0.5,$j, 'black','center','middle')); +#} + +$gr -> moveTo($a,0.0); +$gr -> lineTo($b,0.0,'blue',3); +$gr -> stamps( open_circle($a,0.0,'blue') ); +$gr->lb(new Label($a,0.5,$a,'blue','center','middle')); +$gr -> stamps( open_circle($b,0.0,'blue') ); +$gr->lb(new Label($b,0.5,$b,'blue','center','middle')); + +#dibujando los puntos dentros del intervalo +$gr -> stamps( closed_circle($r1,0.0,'red') ); +$gr->lb(new Label($r1,-0.5,$r1,'red','center','middle')); +$gr -> stamps( closed_circle($r2,0.0,'red') ); +$gr->lb(new Label($r2,-0.5,$r2,'red','center','middle')); +$gr -> stamps( closed_circle($r3,0.0,'red') ); +$gr->lb(new Label($r3,-0.5,$r3,'red','center','middle')); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +\{ $mc -> print_q() \} +$BR +\{ $mc -> print_a() \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( checkbox_cmp( $mc->correct_ans() ) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +La representación gráfica +$PAR +$BCENTER +\{ image(insertGraph($gr), width=>640, height=>100, tex_size=>320); \} +$ECENTER +$PAR +muestra que los valores \($r1, $r2\) y \($r3\) están dentro del intervalo \( ($a,$b) \), por lo tanto las soluciones son: \{ $mc->correct_ans() \} +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/notacion_cientificaa/notacion_cientifica.pg b/Contrib/UPRM/Prebasica/notacion_cientificaa/notacion_cientifica.pg new file mode 100644 index 0000000000..8c74baa657 --- /dev/null +++ b/Contrib/UPRM/Prebasica/notacion_cientificaa/notacion_cientifica.pg @@ -0,0 +1,119 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Pasar de notación científica a normal +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/notacion_cientifica/notacion_cientifica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Notación científica) +## Level(1) +## KEYWORDS('notacion', 'cientifica') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +################# +### Setup + +#construyendo el número en notación científica: a.b x 10^n +$a = random(1,9); +$b = random(1,99); +$n = non_zero_random(-4,4); +$abs_n = abs($n); + +#Necesario para la explicación en la solución + +#Creando un string de ceros de tamaño n. +$zeros = '0'x($abs_n); + +if ( $n > 0 ){ + $simbolo = ">"; + $direccion = "derecha"; + $cadena_tmp = "$a.$b".$zeros; +}else{ + $simbolo = "<"; + $direccion = "izquierda"; + $cadena_tmp = $zeros."$a.$b"; +} + + +#Cadena que representará el número +$numero_nota_cient = "$a."."$b\times 10^{$n}"; + +#Construyendo el número de la respuesta +if ($b > 9){ + $rp = 100*$a + $b; + $r = $rp*(10**($n-2)); +}else{ + $rp = 10*$a + $b; + $r = $rp*(10**($n-1)); +} + +Context("Numeric"); +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +Eliminar los productos y potencias del número +\[ + $numero_nota_cient +\] +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Escribir el número +\[ +$a.$b +\] +$PAR +$BBOLD Paso 2:$EBOLD Como \( n $simbolo 0 \) se añade $abs_n cero(s) a la $direccion +\[ +$cadena_tmp +\] +y luego se mueve el punto decimal $abs_n unidad(es) a la $direccion y se obtiene: +\[ + $numero_nota_cient = $answer, +\] +por lo tanto, la solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_A.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_A.pg new file mode 100644 index 0000000000..8577d9eb80 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_A.pg @@ -0,0 +1,105 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a+b*c^n, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/exprexp_sp.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +#construyendo la exp. tipo a + b x c^n +$a = random(1,20); +$b = non_zero_random(-9,9); +$c = random(1,9); +$n = random(2,4); + +$r = $a + $b*$c**$n; + +#usado al presentar la solución +$potencia = $c**$n; +$multiplicacion = $b*$potencia; +$suma_resta = $a + $multiplicacion; + +if ( $b > 0){ + $operacion = "suma"; +}else{ + $operacion = "resta"; +} +Context("Numeric"); +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ +$a + $b \cdot $c^{$n} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Realizar la potencia: +\[ +$a + $b \cdot $c^{$n} = $a+$b\cdot $potencia +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar la multiplicación: +\[ +$a+$b\cdot $potencia = $a+$multiplicacion +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la $operacion: +\[ +$a+$multiplicacion = $suma_resta +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_B.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_B.pg new file mode 100644 index 0000000000..601ef74507 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_B.pg @@ -0,0 +1,109 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a+b/c^n, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/exprexp_sp.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +#construyendo la exp. tipo a + b / c^n +$a = random(1,20); +$c =list_random(2,3,5); +$n = random(2,4); + +$b = ($c**$n)*list_random(2,3,5)*list_random(2,3,5); +if ( random(0,1) == 1 ){ + $b = -$b; +} + +$r = $a + $b/($c**$n); + +#usado al presentar la solución +$potencia = $c**$n; +$division = $b/$potencia; +$suma_resta = $a + $division; + +if ( $b > 0){ + $operacion = "suma"; +}else{ + $operacion = "resta"; +} +Context("Numeric"); +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ +$a + $b \div $c^{$n} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Realizar la potencia: +\[ +$a + $b \div $c^{$n} = $a+$b\div $potencia +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar la división: +\[ +$a+$b\div $potencia = $a+$division +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la $operacion: +\[ +$a+$division = $suma_resta +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_C.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_C.pg new file mode 100644 index 0000000000..8401bcf409 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_C.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# +# Tipo: Seleccionar la correcta +# Orden de operaciones: dada una exp tipo a^n+b*c, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/exprexp_sp.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +#construyendo la exp. tipo a^n + b * c +$a = random(1,5); +$n = random(2,4); +$b = non_zero_random(-9,9); +$c = random(2,9); + +$r = $a**$n + $b*$c; +$r1 = ($a + $b*$c)**$n; +$r2 = ($a**$n + $b)*$c; +$r3 = (($a + $b)**$n)*$c; +$r4 = $a*$n + $b*$c; + +#usado al presentar la solución +$potencia = $a**$n; +$multiplicacion = $b*$c; +$suma_resta = $potencia + $multiplicacion; + +if ( $b > 0){ + $operacion = "suma"; +}else{ + $operacion = "resta"; +} +Context("Numeric"); +Context("LimitedNumeric"); + +$radio = RadioButtons(["$r","$r1","$r2","$r3","$r4","Ninguna de las otras"], "$r", + last => ["Ninguna de las otras"], + ); + +Context()->texStrings; +BEGIN_TEXT +\[ +$a^{$n} + $b \cdot $c +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Realizar la potencia: +\[ +$a^{$n} + $b \cdot $c = $potencia + $b\cdot $c +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar la multiplicación: +\[ +$potencia + $b\cdot $c= $potencia + $multiplicacion +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la $operacion: +\[ +$potencia+$multiplicacion = $suma_resta +\] +$PAR +La solución es: \( $suma_resta \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_D.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_D.pg new file mode 100644 index 0000000000..556944f44a --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_D.pg @@ -0,0 +1,110 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a+b/c^n + d*e^m, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/exprexp_sp.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +#construyendo la exp. tipo a+b/c^n + d*e^m +$a = random(-20,20); +$n = random(2,4); +$c =list_random(2,3,5,7); + +$b = ($c**$n)*list_random(2,3,5)*list_random(2,3,5); +if ( random(0,1) == 1 ){ + $b = -$b; +} + +$d = non_zero_random(-15,15); +$e = random(2,5); +$m = random(2,4); + +$r = $a + $b/($c**$n) + $d*($e**$m); + +#usado al presentar la solución +$potencia1 = $c**$n; +$potencia2 = $e**$m; +$division = $b/$potencia1; +$multiplicacion = $d*$potencia2; +$suma_resta = $a + $division + $multiplicacion; + +Context("Numeric"); +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ +$a + $b \div $c^{$n} + $d\cdot $e^{$m} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Realizar las potencias: +\[ +$a + $b \div $c^{$n} + $d\cdot $e^{$m} = $a + $b \div $potencia1 + $d\cdot $potencia2 +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar la división y multiplicación: +\[ +$a + $b \div $potencia1 + $d\cdot $potencia2 = $a + $division + $multiplicacion +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar las sumas y/o restas: +\[ +$a + $division + $multiplicacion = $suma_resta +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_E.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_E.pg new file mode 100644 index 0000000000..62741e4752 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/exprexp_sp_E.pg @@ -0,0 +1,109 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a^n+b/c, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/exprexp_sp.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +#construyendo la exp. tipo a^n + b / c +$a = random(1,5); +$n = random(2,4); +$c =list_random(2,3,5,7); + +$b =$c*list_random(2,3,5)*list_random(2,3,5); +if ( random(0,1) == 1 ){ + $b = -$b; +} + +$r = $a**$n + $b/$c; + +#usado al presentar la solución +$potencia = $a**$n; +$division = $b/$c; +$suma_resta = $potencia + $division; + +if ( $b > 0){ + $operacion = "suma"; +}else{ + $operacion = "resta"; +} +Context("Numeric"); +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ +$a^{$n} + $b \div $c +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Realizar la potencia: +\[ +$a^{$n} + $b \div $c = $potencia + $b\div $c +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar la división: +\[ +$potencia + $b\div $c= $potencia+$division +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la $operacion: +\[ +$potencia+$division = $suma_resta +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_combinadas_A.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_combinadas_A.pg new file mode 100644 index 0000000000..5f106bfd13 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_combinadas_A.pg @@ -0,0 +1,134 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a+b[ c+(d+e/f)^n ], encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_combinadas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +#construyendo la exp. tipo a+b[ c+(d+e/f)^n ] +$a = non_zero_random(-20,20); +$b = non_zero_random(-9,9); +$c = non_zero_random(-20,20); +$d = random(-5,5); + +$f = list_random(2,3,5,7); +$e = $f*random(2,5); +if ( random(0,1) == 1){ + $e = -$e; +} + +$n = random(2,4); + +$r = $a + $b*( $c + ( $d + $e/$f)**$n ); + +#usado al presentar la solución +$division= $e/$f; +$suma_resta1 = $d + $division; +$potencia = $suma_resta1**$n; +$suma_resta2 = $c + $potencia; +$multiplicacion = $b*$suma_resta2; +$suma_resta3 = $a + $multiplicacion; + +if ( $b > 0){ + $operacion = "suma"; +}else{ + $operacion = "resta"; +} + +Context("Numeric"); +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ + $a + $b\left[ $c + \left( $d + $e\div $f \right)^{$n} \right] +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver los paréntesis circulares: +$PAR +la división +\[ + $a + $b\left[ $c + \left( $d + $e\div $f \right)^{$n} \right] = $a + $b\left[ $c + \left( $d + $division \right)^{$n} \right] +\] +la suma y/o resta +\[ + $a + $b\left[ $c + \left( $d + $division \right)^{$n} \right] = $a + $b\left[ $c + ($suma_resta1)^{$n} \right] +\] +$PAR +$BBOLD Paso 2:$EBOLD Resolver paréntesis cuadrados: +$PAR +la potencia +\[ + $a + $b\left[ $c + ($suma_resta1)^{$n} \right] = $a + $b\left[ $c + $potencia \right] +\] +la suma y/o resta +\[ + $a + $b\left[ $c + $potencia \right] = $a + $b\cdot $suma_resta2 +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la multiplicación: +\[ +$a + $b\cdot $suma_resta2 = $a + $multiplicacion +\] +$PAR +$BBOLD Paso 4:$EBOLD Realizar la suma o resta: +\[ +$a + $multiplicacion = $suma_resta3 +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_combinadas_B.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_combinadas_B.pg new file mode 100644 index 0000000000..41d2b86382 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_combinadas_B.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a+b[ c+(d+e*f)^n ] + [g^m - (h+i)], encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_combinadas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +#construyendo la exp. tipo a+b[ c-(d+e*f)^n ] + [g^m - (h+i)] +$a = non_zero_random(-20,20); +$b = non_zero_random(-9,9); +$c = non_zero_random(-1000,1000); +$d = non_zero_random(-9,9); +$e = non_zero_random(-5,5); +$f = random(2,5); +$n = random(2,4); +$g = random(2,5); +$m = random(2,4); +$h = non_zero_random(-9,9); +$i = non_zero_random(-9,9); + +$r = $a + $b*( $c - ( $d + $e*$f)**$n ) + ($g**$m - ($h+$i)); + +#usado al presentar la solución +$multiplicacion1= $e*$f; +$suma_resta1 = $h + $i; +$suma_resta2 = $d + $multiplicacion1; + +#$r = $a + $b*[ $c - ( $sr2)**$n ] + [$g**$m - $sr1]; + +$potencia1 = $suma_resta2**$n; +$potencia2 = $g**$m; +$suma_resta3 = $c - $potencia1; +$suma_resta4 = $potencia2 - $suma_resta1; + +#$r = $a + $b*$sr3 + $sr4; + +$multiplicacion2 = $b*$suma_resta3; +$suma_resta5 = $a + $multiplicacion2 + $suma_resta4; + +Context("Numeric"); +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ + $a + $b\left[ $c - \left( $d + $e\times $f \right)^{$n} \right] + \left[ $g^{$m} + \left( $h + $i \right) \right] +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver los paréntesis circulares: +$PAR +la multiplicación y la suma/resta +\[ + $a + $b\left[ $c - \left( $d + $e\times $f \right)^{$n} \right] + \left[ $g^{$m} + \left( $h + $i \right) \right] = + $a + $b\left[ $c - \left( $d + $multiplicacion1 \right)^{$n} \right] + \left[ $g^{$m} + $suma_resta1 \right] +\] +la suma y/o resta +\[ + $a + $b\left[ $c - \left( $d + $multiplicacion1 \right)^{$n} \right] + \left[ $g^{$m} + $suma_resta1 \right] = + $a + $b\left[ $c - \left( $suma_resta2 \right)^{$n} \right] + \left[ $g^{$m} + $suma_resta1 \right] +\] +$PAR +$BBOLD Paso 2:$EBOLD Resolver paréntesis cuadrados: +$PAR +las potencias +\[ + $a + $b\left[ $c - \left( $suma_resta2 \right)^{$n} \right] + \left[ $g^{$m} + $suma_resta1 \right] = \ + $a + $b\left[ $c - $potencia1 \right] + \left[ $potencia2 + $suma_resta1 \right] = +\] +las sumas y/o restas +\[ + $a + $b\left[ $c - $potencia1 \right] + \left[ $potencia2 + $suma_resta1 \right] = + $a + $b\times$suma_resta3 + $suma_resta4 +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la multiplicación: +\[ + $a + $b\times $suma_resta3 + $suma_resta4 = + $a + $multiplicacion2 + $suma_resta4 +\] +$PAR +$BBOLD Paso 4:$EBOLD Realizar la sumas y/o restas: +\[ +$a + $multiplicacion2 + $suma_resta4 = $suma_resta5 +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_A.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_A.pg new file mode 100644 index 0000000000..11b7220979 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_A.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a \pm (b + c*d)^n + (e \pm f \pm g)^m, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +#construyendo la exp. tipo a \pm (b + c*d)^n + (e \pm f \pm g)^m +$a = non_zero_random(-20,20); +$b = non_zero_random(-20,20); +$c = non_zero_random(-5,5); +$d = random(2,5); + +if ( abs($b + $c*$d) > 10 ){ + $n = 2; +}else{ + $n = random(2,4); +} + +if ( random(0,1) == 0 ){ + $sig1 = "+"; +}else{ + $sig1 = "-"; +} + +if ( random(0,1) == 0 ){ + $sig2 = "+"; +}else{ + $sig2 = "-"; +} + +$e = random(1,20); +$f = random(-20,20); +$g = random(-20,20); + +if ( abs($e + $f + $g) > 10 ){ + $m = 2; +}else{ + $m = random(2,4); +} + +$r = Compute("$a $sig1 ($b + $c*$d)**$n $sig2 ($e + $f + $g)**$m"); + +#usado al presentar la solución +$multiplicacion = $c*$d; +$suma_resta1 = $b + $multiplicacion; + +$suma_resta2 = $e + $f + $g; + +$potencia1 = $suma_resta1**$n; +$potencia2 = $suma_resta2**$m; + +$suma_resta3 = Compute("$a $sig1 $potencia1 $sig2 $potencia2"); + +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ + $a $sig1 ($b + $c\times $d)^{$n} $sig2 ($e + $f + $g)^{$m} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver los paréntesis: +$PAR +la multiplicación +\[ + $a $sig1 ($b + $c\times $d)^{$n} $sig2 ($e + $f + $g)^{$m} = $a $sig1 ($b + $multiplicacion)^{$n} + $sig2 ($e + $f + $g)^{$m} +\] +las sumas y/o restas +\[ +$a $sig1 ($b + $multiplicacion)^{$n} + $sig2 ($e + $f + $g)^{$m} = $a $sig1 ($suma_resta1)^{$n} $sig2 ($suma_resta2)^{$m} +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar las potencias: +\[ + $a $sig1 ($suma_resta1)^{$n} $sig2 ($suma_resta2)^{$m} = $a $sig1 $potencia1 $sig2 $potencia2 +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar las sumas y/o restas: +\[ +$a $sig1 $potencia1 $sig2 $potencia2 = $suma_resta3 +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_B.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_B.pg new file mode 100644 index 0000000000..e956b45e15 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_B.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a \pm (b + c/d)^n + (e \pm f \pm g)^m, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +#construyendo la exp. tipo a \pm (b + c/d)^n + (e \pm f \pm g)^m +$a = non_zero_random(-20,20); +$b = non_zero_random(-20,20); +$d = list_random(2,3,5,7); +$c = $d*random(-9,9); + +if ( abs($b + $c/$d) > 10 ){ + $n = 2; +}else{ + $n = random(2,4); +} + +if ( random(0,1) == 0 ){ + $sig1 = "+"; +}else{ + $sig1 = "-"; +} + +if ( random(0,1) == 0 ){ + $sig2 = "+"; +}else{ + $sig2 = "-"; +} + +$e = random(1,20); +$f = random(-20,20); +$g = random(-20,20); + +if ( abs($e + $f + $g) > 10 ){ + $m = 2; +}else{ + $m = random(2,4); +} + +$r = Compute("$a $sig1 ($b + $c/$d)**$n $sig2 ($e + $f + $g)**$m"); + +#usado al presentar la solución +$division= $c/$d; +$suma_resta1 = $b + $division; + +$suma_resta2 = $e + $f + $g; + +$potencia1 = $suma_resta1**$n; +$potencia2 = $suma_resta2**$m; + +$suma_resta3 = Compute("$a $sig1 $potencia1 $sig2 $potencia2"); + +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ + $a $sig1 ($b + $c\div$d)^{$n} $sig2 ($e + $f + $g)^{$m} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver los paréntesis: +$PAR +la división +\[ + $a $sig1 ($b + $c\div$d)^{$n} $sig2 ($e + $f + $g)^{$m} = $a $sig1 ($b + $division)^{$n} + $sig2 ($e + $f + $g)^{$m} +\] +las sumas y/o restas +\[ +$a $sig1 ($b + $division)^{$n} + $sig2 ($e + $f + $g)^{$m} = $a $sig1 ($suma_resta1)^{$n} $sig2 ($suma_resta2)^{$m} +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar las potencias: +\[ + $a $sig1 ($suma_resta1)^{$n} $sig2 ($suma_resta2)^{$m} = $a $sig1 $potencia1 $sig2 $potencia2 +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar las sumas y/o restas: +\[ +$a $sig1 $potencia1 $sig2 $potencia2 = $suma_resta3 +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_C.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_C.pg new file mode 100644 index 0000000000..e9b1992381 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_C.pg @@ -0,0 +1,145 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a^m \pm (e + f + g) + h(b + c*d)^n, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +#construyendo la exp. tipo a^m \pm (e + f + g) + h(b + c*d)^n +$a = random(2,20); + +if ( $a > 10 ){ + $m = 2; +}else{ + $m = random(2,4); +} + +if ( random(0,1) == 0 ){ + $sig = "+"; +}else{ + $sig = "-"; +} + +$e = random(-20,20); +$f = random(-20,20); +$g = random(-20,20); + +$h = random(-20,20); + +$b = non_zero_random(-20,20); +$c = random(-9,9); +$d = random(2,9); + +if ( abs($b + $c*$d) > 10 ){ + $n = 2; +}else{ + $n = random(2,4); +} + +$r = Compute("$a**$m $sig ($e + $f + $g) + $h*($b + $c*$d)**$n "); + +#usado al presentar la solución +$multiplicacion1 = $c*$d; + +$suma_resta1 = $e + $f + $g; +$suma_resta2 = $b + $multiplicacion1; + +$potencia1 = $a**$m; +$potencia2 = $suma_resta2**$n; + +$multiplicacion2 = $h*$potencia2; + +$suma_resta3 = $potencia1 + $suma_resta1 + $multiplicacion2; + +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ + $a^{$m} $sig ($e + $f + $g) + $h\times ($b + $c\times $d)^{$n} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver los paréntesis: +$PAR +la multiplicación +\[ + $a^{$m} $sig ($e + $f + $g) + $h\times ($b + $c\times$d)^{$n} = $a^{$m} $sig ($e + $f + $g) + $h\times ($b + $multiplicacion1)^{$n} +\] +las sumas y/o restas +\[ + $a^{$m} $sig ($e + $f + $g) + $h\times ($b + $multiplicacion1)^{$n} = $a^{$m} $sig ($suma_resta1) + $h\times ($suma_resta2)^{$n} +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar las potencias: +\[ + $a^{$m} $sig ($suma_resta1) + $h\times ($suma_resta2)^{$n} = $potencia1 $sig $suma_resta1 + $h\times ($potencia2) +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la multiplicación: +\[ + $potencia1 $sig $suma_resta1 + $h\times ($potencia2) = $potencia1 + $suma_resta1 + $multiplicacion2 +\] +$PAR +$BBOLD Paso 4:$EBOLD Realizar las sumas y/o restas: +\[ + $potencia1 + $suma_resta1 + $multiplicacion2 = $suma_resta3 +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_D.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_D.pg new file mode 100644 index 0000000000..948b45acf0 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias_D.pg @@ -0,0 +1,145 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a^m \pm (e + f + g) + h(b + c/d)^n, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_con_dos_potencias.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +#construyendo la exp. tipo a^m \pm (e + f + g) + h(b + c/d)^n +$a = random(2,20); + +if ( $a > 10 ){ + $m = 2; +}else{ + $m = random(2,4); +} + +if ( random(0,1) == 0 ){ + $sig = "+"; +}else{ + $sig = "-"; +} + +$e = random(-20,20); +$f = random(-20,20); +$g = random(-20,20); + +$h = random(-20,20); + +$b = non_zero_random(-20,20); +$d = list_random(2,3,5,7); +$c = $d*random(-9,9); + +if ( abs($b + $c/$d) > 10 ){ + $n = 2; +}else{ + $n = random(2,4); +} + +$r = Compute("$a**$m $sig ($e + $f + $g) + $h*($b + $c/$d)**$n "); + +#usado al presentar la solución +$division= $c/$d; + +$suma_resta1 = $e + $f + $g; +$suma_resta2 = $b + $division; + +$potencia1 = $a**$m; +$potencia2 = $suma_resta2**$n; + +$multiplicacion = $h*$potencia2; + +$suma_resta3 = $potencia1 + $suma_resta1 + $multiplicacion; + +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ + $a^{$m} $sig ($e + $f + $g) + $h\times ($b + $c\div$d)^{$n} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver los paréntesis: +$PAR +la división +\[ + $a^{$m} $sig ($e + $f + $g) + $h\times ($b + $c\div$d)^{$n} = $a^{$m} $sig ($e + $f + $g) + $h\times ($b + $division)^{$n} +\] +las sumas y/o restas +\[ + $a^{$m} $sig ($e + $f + $g) + $h\times ($b + $division)^{$n} = $a^{$m} $sig ($suma_resta1) + $h\times ($suma_resta2)^{$n} +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar las potencias: +\[ + $a^{$m} $sig ($suma_resta1) + $h\times ($suma_resta2)^{$n} = $potencia1 $sig $suma_resta1 + $h\times ($potencia2) +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la multiplicación: +\[ + $potencia1 $sig ($suma_resta1) + $h\times ($potencia2) = $potencia1 + $suma_resta1 + $multiplicacion +\] +$PAR +$BBOLD Paso 4:$EBOLD Realizar las sumas y/o restas: +\[ + $potencia1 + $suma_resta1 + $multiplicacion = $suma_resta3 +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_A.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_A.pg new file mode 100644 index 0000000000..f78f9f221c --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_A.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a \pm (b + c*d)^n, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +#construyendo la exp. tipo a \pm (b + c*d)^n +$a = non_zero_random(-20,20); +$b = non_zero_random(-20,20); +$c = non_zero_random(-5,5); +$d = random(2,5); +$n = random(2,4); + +if ( random(0,1) == 0 ){ + $sig = "+"; +}else{ + $sig = "-"; +} +$r = Compute("$a $sig ($b + $c*$d)**$n"); + +#usado al presentar la solución +$multiplicacion = $c*$d; +$suma_resta1 = $b + $multiplicacion; + +$potencia = $suma_resta1**$n; +$suma_resta2 = Compute("$a $sig $potencia"); + +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ +$a $sig ($b + $c\times $d)^{$n} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver los paréntesis: +$PAR +la multiplicación +\[ + $a $sig ($b + $c\times $d)^{$n} = $a $sig ($b + $multiplicacion)^{$n} +\] +la suma o resta +\[ + $a $sig ($b + $multiplicacion)^{$n} = $a $sig ($suma_resta1)^{$n} +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar la potencia: +\[ +$a $sig ($suma_resta1)^{$n} = $a $sig $potencia +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la suma o resta: +\[ +$a $sig $potencia = $suma_resta2 +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_B.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_B.pg new file mode 100644 index 0000000000..e1959bea09 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_B.pg @@ -0,0 +1,117 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a \pm (b + c/d)^n, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +#construyendo la exp. tipo a \pm (b + c/d)^n +$a = non_zero_random(-20,20); +$b = non_zero_random(-20,20); + +$d = list_random(-2,3,5,7,11,13); +$c = $d*random(2,20); + +$n = random(2,4); + +if ( random(0,1) == 0 ){ + $sig = "+"; +}else{ + $sig = "-"; +} +$r = Compute("$a $sig ($b + $c/$d)**$n"); + +#usado al presentar la solución +$division = $c/$d; +$suma_resta1 = $b + $division; + +$potencia = $suma_resta1**$n; +$suma_resta2 = Compute("$a $sig $potencia"); + +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ +$a $sig ($b + $c\div $d)^{$n} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver los paréntesis: +$PAR +la division +\[ + $a $sig ($b + $c\div $d)^{$n} = $a $sig ($b + $division)^{$n} +\] +la suma o resta +\[ + $a $sig ($b + $division)^{$n} = $a $sig ($suma_resta1)^{$n} +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar la potencia: +\[ +$a $sig ($suma_resta1)^{$n} = $a $sig $potencia +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la suma o resta: +\[ +$a $sig $potencia = $suma_resta2 +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_C.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_C.pg new file mode 100644 index 0000000000..657c8d41f6 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_C.pg @@ -0,0 +1,127 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a \pm (b \pm c)^n, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +#construyendo la exp. tipo a \pm (b \pm c)^n + +if ( random(0,1) == 0 ){ + $sig1 = "+"; +}else{ + $sig1 = "-"; +} + +if ( random(0,1) == 0 ){ + $sig2 = "+"; +}else{ + $sig2 = "-"; +} + + +$a = non_zero_random(-20,20); +do{ + $b = non_zero_random(-100,100); + $c = non_zero_random(-100,100); + $cond = Compute("$b $sig2 $c"); +}until ( abs( $cond ) < 11 ); + + +if ( abs($cond) < 3 ){ + $n = random(4,12); +}elsif( abs($cond) > 5) { + $n = 2; +}else{ + $n = random(2,4); +} + +$r = Compute("$a $sig1 ($b $sig2 $c)**$n"); + +#usado al presentar la solución +$suma_resta1 = Compute("$b $sig2 $c"); + +$potencia = $suma_resta1**$n; +$suma_resta2 = Compute("$a $sig1 $potencia"); + +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ +$a $sig1 ($b $sig2 $c)^{$n} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver los paréntesis haciendo la suma o resta: +\[ + $a $sig1 ($b $sig2 $c)^{$n} = $a $sig1 ($suma_resta1)^{$n} +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar la potencia: +\[ +$a $sig1 ($suma_resta1)^{$n} = $a $sig1 $potencia +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la suma o resta: +\[ +$a $sig1 $potencia = $suma_resta2 +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_D.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_D.pg new file mode 100644 index 0000000000..d6dbacf423 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_D.pg @@ -0,0 +1,112 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a \pm (b*c)^n, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +#construyendo la exp. tipo a \pm (b * c)^n + +if ( random(0,1) == 0 ){ + $sig = "+"; +}else{ + $sig = "-"; +} + +$a = non_zero_random(-50,50); +$b = non_zero_random(-5,5); +$c = non_zero_random(2,9); +if ( abs($b* $c) > 10){ + $ n = 2; +}else{ + $n = random(2,4); +} + +$r = Compute("$a $sig ($b*$c)**$n"); + +#usado al presentar la solución +$producto = $b*$c; +$potencia = $producto**$n; +$suma_resta = Compute("$a $sig $potencia"); + +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ +$a $sig ($b\times $c)^{$n} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver los paréntesis haciendo la multiplicación: +\[ + $a $sig ($b\times $c)^{$n} = $a $sig ($producto)^{$n} +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar la potencia: +\[ +$a $sig ($producto)^{$n} = $a $sig $potencia +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la suma o resta: +\[ +$a $sig $potencia = $suma_resta +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_E.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_E.pg new file mode 100644 index 0000000000..d99d3c5994 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia_E.pg @@ -0,0 +1,112 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Orden de operaciones: dada una exp tipo a \pm ( b/c )^n, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_con_una_potencia.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +#construyendo la exp. tipo a \pm ( b/c )^n + +if ( random(0,1) == 0 ){ + $sig = "+"; +}else{ + $sig = "-"; +} + +$a = non_zero_random(-50,50); +$c = list_random(2,3,5,7); +$b = $c*random(2,9); +$n = random(2,4); + +if ( random(0,1) == 1){ + $b = -$b; +} + +$r = Compute("$a $sig ($b/$c)**$n"); + +#usado al presentar la solución +$division = $b/$c; +$potencia = $division**$n; +$suma_resta = Compute("$a $sig $potencia"); + +Context("LimitedNumeric"); + +$answer = Compute($r); + +Context()->texStrings; +BEGIN_TEXT +\[ +$a $sig ($b\div $c)^{$n} +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +Contestación: \{ans_rule(10)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Resolver los paréntesis haciendo la división: +\[ + $a $sig ($b\div$c)^{$n} = $a $sig ($division)^{$n} +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar la potencia: +\[ +$a $sig ($division)^{$n} = $a $sig $potencia +\] +$PAR +$BBOLD Paso 3:$EBOLD Realizar la suma o resta: +\[ +$a $sig $potencia = $suma_resta +\] +$PAR +La solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_sin_potencias.pg b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_sin_potencias.pg new file mode 100644 index 0000000000..7e4e9809c8 --- /dev/null +++ b/Contrib/UPRM/Prebasica/order_de_operaciones_numericas/operaciones_sin_potencias.pg @@ -0,0 +1,121 @@ +# DESCRIPTION +# +# Tipo: Seleccionar la correcta +# Orden de operaciones: dada una exp tipo a*b+c+d/e+f, encontrar el resultado. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/order_de_operaciones_numericas/operaciones_sin_potencias.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas numéricos) +## DBsection(Orden de operaciones) +## Level(1) +## KEYWORDS('operaciones', 'numeros', 'orden') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"contextLimitedNumeric.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +################# +### Setup + +Context("Numeric"); + +#construyendo la exp. tipo a*b+c+d/e+f +$a = random(-20,20); +$b = random(2,30); +$c = random(-30,30); +$e = list_random(2,3,5,7); +$d = $e*random(-100,100); +$f = random(-50,50); + +$r = $a*$b+$c+$d/$e+$f; +$r1 = $a*($b+$c)+$d/$e+$f; +$r2 = $a*$b+$c+$d/($e+$f); +$r3 = ($a*$b+$c+$d)/$e+$f; +$r4 = $a*($b+$c+$d/$e)+$f; + +#usado al presentar la solución +$multiplicacion = $a*$b; +$division = $d/$e; + +$suma_resta1 = $multiplicacion + $c; +$suma_resta2 = $suma_resta1 + $division; +$suma_resta3 = $suma_resta2 + $f; + +Context("LimitedNumeric"); + +$radio = RadioButtons(["$r","$r1","$r2","$r3","$r4","Ninguna de las otras"], "$r", + last => ["Ninguna de las otras"], + ); + +Context()->texStrings; +BEGIN_TEXT +\[ +$a\times $b + $c + $d\div $e + $f +\] +Efectúe las operaciones indicadas y obtenga el resultado para la expresión que se muestra arriba. +$PAR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Realizar la multiplicación y la división de izquierda a derecha: +$PAR +la multiplicación +\[ +$a\times $b + $c + $d\div $e + $f = $multiplicacion + $c + $d\div $e + $f +\] +la division +\[ +$multiplicacion + $c + $d\div $e + $f = $multiplicacion + $c + $division + $f +\] +$PAR +$BBOLD Paso 2:$EBOLD Realizar sumas y/o restas de izquierda a derecha: +\[ +\begin{align*} + $multiplicacion + $c + $division + $f &= $suma_resta1 + $division + $f \\[0.2cm] + &= $suma_resta2 + $f \\[0.2cm] + &= $suma_resta3 +\end{align*} +\] +$PAR +La solución es: \( $r \). +END_SOLUTION +Context()->normalStrings; + + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/polinomios_division_sintetica/division_sintetica_A.pg b/Contrib/UPRM/Prebasica/polinomios_division_sintetica/division_sintetica_A.pg new file mode 100644 index 0000000000..3d5e2d8f0a --- /dev/null +++ b/Contrib/UPRM/Prebasica/polinomios_division_sintetica/division_sintetica_A.pg @@ -0,0 +1,201 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# División sintética: polinomio grado 3, factor (x-r), r en Z. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de los archivos +# pedro_prebasica/polinomios_division_sintetica/division_sintetica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Polinomios) +## DBsection(División sintética) +## Level(1) +## KEYWORDS('polinomios','operaciones','division','sintetica') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl", +"macro_template.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +Context("Numeric"); +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +#Creando el polinomio y sus componentes A = Q*(x-r) + R + +#el divisor +$b1 = 1; +$b0 = non_zero_random(-9,9); +@B = ($b1, $b0); + +if ($b0 > 0){ + $rb0 = -$b0; +}else{ + $rb0 = abs($b0); +} + +#el cociente +$q2 = non_zero_random(-9,9); +$q1 = random(-9,9); +$q0 = random(-9,9); +@Q = ($q2, $q1, $q0); + +#el residuo +$r0 = random(-9,9); +@R = ($r0); + +#el dividendo A usando el macro PGpolynomialmacros.pl, multiplicando BQ y sumándole R +@BQ = PolyMult(~~@B, ~~@Q); +@A = PolyAdd(~~@BQ, ~~@R); + +#adicionando la variable x a cada parte usando el macro PGpolynomialmacros.pl +$polyB = PolyString(~~@B,x); +$polyQ = PolyString(~~@Q,x); +$polyR = PolyString(~~@R,x); +$polyBQ = PolyString(~~@BQ,t); +$polyA = PolyString(~~@A,x); + +$polyB = Formula($polyB)->reduce; +$polyQ = Formula($polyQ)->reduce; +$polyR = Formula($polyR)->reduce; +$polyBQ = Formula($polyBQ)->reduce; +$polyA = Formula($polyA)->reduce; + +@pregunta = ("cociente", "residuo"); +$index = random(0,1); + +if ($index == 0){ + $answer = $polyQ; + $label = "Cociente"; +}else{ + $answer = $polyR; + $label = "Residuo"; +} + +$a = Compute($A[0]); + +$mul_tmp1 = $rb0*$A[0]; +$b = Compute($mul_tmp1); + +$sum_tmp1 = $A[1] + $mul_tmp1; +$c = Compute($sum_tmp1); + +$mul_tmp2 = $rb0*$sum_tmp1; +$d = Compute($mul_tmp2); + +$sum_tmp2 = $A[2] + $mul_tmp2; +$e = Compute($sum_tmp2); + +$mul_tmp3 = $rb0*$sum_tmp2; +$f = Compute($mul_tmp3); + +$sum_tmp3 = $A[3] + $mul_tmp3; +$g = Compute($sum_tmp3); + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Sea \( P(x) = $polyA \), el $pregunta[$index] cuando \( P(x) \) es dividido por \( ($polyB) \) puede ser encontrado usando división sintética al calcular los valores de las letras en el siguiente arreglo +\[ +\begin{array}{ccccccc} +$rb0 & \mid & $A[0] & $A[1] & $A[2] & $A[3] \\ + & & & b & d & f \\ \hline + & & a & c & e & g \\ +\end{array} +\] +$PAR +\(a =\)\{ans_rule(5)\} +$BR +\(b =\)\{ans_rule(5)\} +$BR +\(c =\)\{ans_rule(5)\} +$BR +\(d =\)\{ans_rule(5)\} +$BR +\(e =\)\{ans_rule(5)\} +$BR +\(f =\)\{ans_rule(5)\} +$BR +\(g =\)\{ans_rule(5)\} \{ AnswerFormatHelp("number") \} +$BR +$BR +$BCENTER +$label = \{ans_rule(20)\} \{ AnswerFormatHelp("formula") \} +$ECENTER +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $a->cmp() ) ; +ANS( $b->cmp() ) ; +ANS( $c->cmp() ) ; +ANS( $d->cmp() ) ; +ANS( $e->cmp() ) ; +ANS( $f->cmp() ) ; +ANS( $g->cmp() ) ; +ANS( $answer->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD División sintética:$EBOLD +$PAR +\[ +\begin{array}{ccccccc} +$rb0 & | & $A[0] & $A[1] & $A[2] & $A[3] \\ + & & & $b & $d & $f \\ \hline + & & $a & $c & $e & $g +\end{array} +\] +$PAR +$BBOLD Algoritmo de la división:$EBOLD \(P(x) = D(x)Q(x) + R(x)\) +\[ +\underbrace{$polyA}_{P(x)} = ( \underbrace{$polyB}_{D(x)} )( \underbrace{$polyQ}_{Q(x)} ) + ( \underbrace{$polyR}_{R(x)} ) +\] +Por lo tanto: +$BCENTER + $label = \($answer\) +$ECENTER +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/polinomios_division_sintetica/division_sintetica_B.pg b/Contrib/UPRM/Prebasica/polinomios_division_sintetica/division_sintetica_B.pg new file mode 100644 index 0000000000..058535da9c --- /dev/null +++ b/Contrib/UPRM/Prebasica/polinomios_division_sintetica/division_sintetica_B.pg @@ -0,0 +1,214 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# División sintética: polinomio grado 4, factor (x-r), r en Z. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de los archivos +# pedro_prebasica/polinomios_division_sintetica/division_sintetica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Polinomios) +## DBsection(División sintética) +## Level(1) +## KEYWORDS('polinomios','operaciones','division','sintetica') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl", +"macro_template.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 1; + +############################################################## +# Setup + +Context("Numeric"); +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + + +#Creando el polinomio y sus componentes A = Q*(x-r) + R + +#el divisor +$b1 = 1; +$b0 = non_zero_random(-9,9); +@B = ($b1, $b0); + +if ($b0 > 0){ + $rb0 = -$b0; +}else{ + $rb0 = abs($b0); +} + +#el cociente +$q3 = non_zero_random(-9,9); +$q2 = random(-9,9); +$q1 = random(-9,9); +$q0 = random(-9,9); +@Q = ($q3, $q2, $q1, $q0); + +#el residuo +$r0 = random(-9,9); +@R = ($r0); + +#el dividendo A usando el macro PGpolynomialmacros.pl, multiplicando BQ y sumándole R +@BQ = PolyMult(~~@B, ~~@Q); +@A = PolyAdd(~~@BQ, ~~@R); + +#adicionando la variable x a cada parte usando el macro PGpolynomialmacros.pl +$polyB = PolyString(~~@B,x); +$polyQ = PolyString(~~@Q,x); +$polyR = PolyString(~~@R,x); +$polyBQ = PolyString(~~@BQ,t); +$polyA = PolyString(~~@A,x); + +$polyB = Formula($polyB)->reduce; +$polyQ = Formula($polyQ)->reduce; +$polyR = Formula($polyR)->reduce; +$polyBQ = Formula($polyBQ)->reduce; +$polyA = Formula($polyA)->reduce; + +@pregunta = ("cociente", "residuo"); +$index = random(0,1); + +if ($index == 0){ + $answer = $polyQ; + $label = "Cociente"; +}else{ + $answer = $polyR; + $label = "Residuo"; +} + +$a = Compute($A[0]); + +$mul_tmp1 = $rb0*$A[0]; +$b = Compute($mul_tmp1); + +$sum_tmp1 = $A[1] + $mul_tmp1; +$c = Compute($sum_tmp1); + +$mul_tmp2 = $rb0*$sum_tmp1; +$d = Compute($mul_tmp2); + +$sum_tmp2 = $A[2] + $mul_tmp2; +$e = Compute($sum_tmp2); + +$mul_tmp3 = $rb0*$sum_tmp2; +$f = Compute($mul_tmp3); + +$sum_tmp3 = $A[3] + $mul_tmp3; +$g = Compute($sum_tmp3); + +$mul_tmp4 = $rb0*$sum_tmp3; +$h = Compute($mul_tmp4); + +$sum_tmp4 = $A[4] + $mul_tmp4; +$i = Compute($sum_tmp4); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Sea \( P(x) = $polyA \), el $pregunta[$index] cuando \( P(x) \) es dividido por \( ($polyB) \) puede ser encontrado usando división sintética al calcular los valores de las letras en el siguiente arreglo +\[ +\begin{array}{ccccccc} +$rb0 & \mid & $A[0] & $A[1] & $A[2] & $A[3] & $A[4] \\ + & & & b & d & f & h \\ \hline + & & a & c & e & g & i \\ +\end{array} +\] +$PAR +\(a =\)\{ans_rule(5)\} +$BR +\(b =\)\{ans_rule(5)\} +$BR +\(c =\)\{ans_rule(5)\} +$BR +\(d =\)\{ans_rule(5)\} +$BR +\(e =\)\{ans_rule(5)\} +$BR +\(f =\)\{ans_rule(5)\} +$BR +\(g =\)\{ans_rule(5)\} +$BR +\(h =\)\{ans_rule(5)\} +$BR +\(i =\)\{ans_rule(5)\} \{ AnswerFormatHelp("number") \} +$BR +$BR +$BCENTER +$label = \{ans_rule(20)\} \{ AnswerFormatHelp("formula") \} +$ECENTER +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $a->cmp() ) ; +ANS( $b->cmp() ) ; +ANS( $c->cmp() ) ; +ANS( $d->cmp() ) ; +ANS( $e->cmp() ) ; +ANS( $f->cmp() ) ; +ANS( $g->cmp() ) ; +ANS( $h->cmp() ) ; +ANS( $i->cmp() ) ; +ANS( $answer->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD División sintética:$EBOLD +$PAR +\[ +\begin{array}{ccccccc} +$rb0 & | & $A[0] & $A[1] & $A[2] & $A[3] & $A[4] \\ + & & & $b & $d & $f & $h \\ \hline + & & $a & $c & $e & $g & $i +\end{array} +\] +$PAR +$BBOLD Algoritmo de la división:$EBOLD \(P(x) = D(x)Q(x) + R(x)\) +\[ +\underbrace{$polyA}_{P(x)} = ( \underbrace{$polyB}_{D(x)} )( \underbrace{$polyQ}_{Q(x)} ) + ( \underbrace{$polyR}_{R(x)} ) +\] +Por lo tanto: +$BCENTER + $label = \($answer\) +$ECENTER +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_aumento.pg b/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_aumento.pg new file mode 100644 index 0000000000..8222a63cdb --- /dev/null +++ b/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_aumento.pg @@ -0,0 +1,124 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que aumenta un valor por un porciento. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/porcentaje_aumento_decremento/porcentaje_aumento.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Porcientos) +## DBsection(Problemas) +## Level(1) +## KEYWORDS('porcientos','porcentajes') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$valor_inicial = random(20,1000,5); +$porcentaje = random(1,300); +$valor_final = $valor_inicial + $valor_inicial*$porcentaje/100; + +@preguntas = ( + "Si \( $valor_inicial \) se aumenta en un \($porcentaje\)%, ¿cuál es el valor final resultante?", + "Si \( $valor_inicial \) se aumenta en un \(n\)%, el valor resultante es \($valor_final\). ¿Cuál era el valor \(n\)? $BR$BR (NO escribir el símbolo %) ", + "Si el valor inicial se aumenta en un \($porcentaje\)%, el resultado es \($valor_final\). ¿Cuál es el valor inicial?" +); + +#Eligiendo la pregunta +$index = random(0,2); + +if ($index == 0){ + $answer = Compute($valor_final); + $valor_conocido1 = "\text{valor}_{inicial} = $valor_inicial"; + $valor_conocido2 = "n = $porcentaje"; + $valor_desconocido = "\text{valor}_{final} = $valor_final"; + $cadena = "\text{valor}_{final} = "; + $resp_text2 ="\text{valor}_{final} = $valor_inicial + \frac{$porcentaje}{100}\cdot $valor_inicial"; +}elsif($index == 1){ + $answer = Compute($porcentaje); + $valor_conocido1 = "\text{valor}_{final} = $valor_final"; + $valor_conocido2 = "\text{valor}_{inicial} = $valor_inicial"; + $valor_desconocido = "n = $porcentaje"; + $cadena = "n = "; + $resp_text2 = "$valor_final = $valor_inicial + \frac{n}{100}\cdot $valor_inicial"; +}else{ + $answer = Compute($valor_inicial); + $valor_conocido1 = "\text{valor}_{final} = $valor_final"; + $valor_conocido2 = "n = $porcentaje"; + $valor_desconocido = "\text{valor}_{inicial} = $valor_inicial"; + $cadena = "\text{valor}_{inicial} = "; + $resp_text2 = "$valor_final = \text{valor}_{inicial} + \frac{$porcentaje}{100}\cdot \text{valor}_{inicial}"; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$preguntas[$index] +$PAR +\($cadena\) \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} + +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Escribir la fórmula asociada con aumento porcentual: +\[ +\text{valor}_{final} = \text{valor}_{inicial} + \frac{n}{100}\cdot \text{valor}_{inicial} +\] +$PAR +$BBOLD Paso 2:$EBOLD Sustituir los valores conocidos \($valor_conocido1\), \($valor_conocido2\) y resolver la ecuación: +\[ +$resp_text2 +\] +Por lo tanto, \( $valor_desconocido\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_cambios_porcentual_A.pg b/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_cambios_porcentual_A.pg new file mode 100644 index 0000000000..2b4e61f729 --- /dev/null +++ b/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_cambios_porcentual_A.pg @@ -0,0 +1,138 @@ +# DESCRIPTION +# +# Tipo: seleccionar la correcta +# Identificar el cambio porcentual + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/porcentaje_aumento_decremento/porcentaje_cambios_porcentual.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Porcientos) +## DBsection(Cambio porcentual) +## Level(1) +## KEYWORDS('porcientos','porcentaje','cambio') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Eligiendo 6 valores diferentes de porcentajes +$p1 = non_zero_random(-100,100); + +do{ + $p2 = non_zero_random(-100,100); +}until ($p2 != $p1); + +do{ + $p3 = non_zero_random(-100,100); +}until ( $p3 != $p2 && $p3 != $p1); + +#Eligiendo el porcentaje a usar, reducción (signo -) o aumento (signo +) +@porciento = ($p1, $p2, $p3, -$p1, -$p2, -$p3); +$index = random(0,5); + +#Eligiendo el valor inicial y calculando el final con el respectivo porciento +$valor_inicial = random(20,1000,5); +$valor_final = $valor_inicial + $valor_inicial*$porciento[$index]/100; + +#Arreglo que tendrá las opciones +@opciones = ( ); + +#creando las cadenas de las opciones dependiendo si es + o - +foreach my $i (0..5){ + if ( $porciento[$i] > 0 ){ + $opciones[$i] = "un aumento de $porciento[$i]%"; + if ($i == $index){ + $valor = "positivo"; + } + }else{ + $tmp = abs($porciento[$i]); + $opciones[$i] = "una disminucion de $tmp%"; + if ($i == $index){ + $valor = "negativo"; + } + } +} + +$radio = RadioButtons( + [ $opciones[0],$opciones[1],$opciones[2],$opciones[3],$opciones[4],$opciones[5],"Ninguna de estas" ], + $opciones[$index], # correct answer + last => ["Ninguna de estas"], # can be a list +); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Calcular el cambio porcentual si el valor inicial es de \($valor_inicial\) y el valor final es de \($valor_final\). Indique si fue una disminución o aumento porcentual. +$BR +$BR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +############################################################## +# Answers +# + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Si llamamos \(v_i\) al valor inicial y \(v_f\) al valor final, y \(C\) al cambio porcentual, entonces: +\[ +C = \frac{v_f - v_i}{v_i}\cdot 100 +\] +$PAR +$BBOLD Paso 2:$EBOLD Ahora, sustituyendo los datos de nuestro problema tenemos que: +\[ +\begin{align*} + C&= \frac{v_f - v_i}{v_i}\cdot 100 \\[0.2cm] + &= \frac{$valor_final - $valor_inicial}{$valor_inicial}\cdot 100 \\[0.2cm] + &= $porciento[$index] +\end{align*} +\] +por ser un valor $valor, el cambio fue $BBOLD$opciones[$index]$EBOLD. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_cambios_porcentual_B.pg b/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_cambios_porcentual_B.pg new file mode 100644 index 0000000000..1e42c157f7 --- /dev/null +++ b/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_cambios_porcentual_B.pg @@ -0,0 +1,110 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Identificar el cambio porcentual + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/porcentaje_aumento_decremento/porcentaje_cambios_porcentual.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Porcientos) +## DBsection(Cambio porcentual) +## Level(1) +## KEYWORDS('porcientos','porcentaje','cambio') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); + +Context("Numeric"); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Eligiendo el porcentaje +$p = non_zero_random(-200,200); + +#Eligiendo el valor inicial y calculando el final con el respectivo porciento +$valor_inicial = random(20,1000,5); +$valor_final = $valor_inicial + $valor_inicial*$p/100; + +if ( $p > 0 ){ + $texto = "un aumento de $p%"; + $valor = "positivo"; +}else{ + $tmp = abs($p); + $texto = "una disminución de $tmp%"; + $valor = "negativo"; +} + +$answer = Compute("$p"); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Calcular el cambio porcentual si el valor inicial es de \($valor_inicial\) y el valor final es de \($valor_final\). +$PAR +$BBOLD Nota:$EBOLD Escriba solo el valor positivo para indicar un aumento o el valor negativo para indicar una disminución, no escriba el símbolo de porcentaje. +$PAR +Contestación: \{ans_rule(10)\} +END_TEXT +Context()->normalStrings; + +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Si llamamos \(v_i\) al valor inicial y \(v_f\) al valor final, y \(C\) al cambio porcentual, entonces: +\[ +C = \frac{v_f - v_i}{v_i}\cdot 100 +\] +$PAR +$BBOLD Paso 2:$EBOLD Ahora, sustituyendo los datos de nuestro problema tenemos que: +\[ +\begin{align*} + C&= \frac{v_f - v_i}{v_i}\cdot 100 \\[0.2cm] + &= \frac{$valor_final - $valor_inicial}{$valor_inicial}\cdot 100 \\[0.2cm] + &= $p +\end{align*} +\] +por ser un valor $valor, el cambio fue $BBOLD$texto$EBOLD. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_decremento.pg b/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_decremento.pg new file mode 100644 index 0000000000..156d89cb85 --- /dev/null +++ b/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_decremento.pg @@ -0,0 +1,124 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que disminuye un valor por un porciento. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/porcentaje_aumento_decremento/porcentaje_decremento.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Porcientos) +## DBsection(Problemas) +## Level(1) +## KEYWORDS('porcientos','porcentajes') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$valor_inicial = random(20,1000,5); +$porcentaje = random(1,150); +$valor_final = $valor_inicial - $valor_inicial*$porcentaje/100; + +@preguntas = ( + "Si \( $valor_inicial \) se disminuyó en un \($porcentaje\)%, ¿cuál es el valor final resultante?", + "Si \( $valor_inicial \) se disminuye en un \(n\)%, el resultado es \($valor_final\). ¿Cuál era el valor \(n\)? $BR$BR (NO escribir el símbolo %) ", + "Si el valor inicial se disminuye en un \($porcentaje\)%, el resultado es \($valor_final\). ¿Cuál es el valor inicial?" +); + +#Eligiendo la pregunta +$index = random(0,2); + +if ($index == 0){ + $answer = Compute($valor_final); + $valor_conocido1 = "\text{valor}_{inicial} = $valor_inicial"; + $valor_conocido2 = "n = $porcentaje"; + $valor_desconocido = "\text{valor}_{final} = $valor_final"; + $cadena = "\text{valor}_{final} = "; + $resp_text2 ="\text{valor}_{final} = $valor_inicial - \frac{$porcentaje}{100}\cdot $valor_inicial"; +}elsif($index == 1){ + $answer = Compute($porcentaje); + $valor_conocido1 = "\text{valor}_{final} = $valor_final"; + $valor_conocido2 = "\text{valor}_{inicial} = $valor_inicial"; + $valor_desconocido = "n = $porcentaje"; + $cadena = "n = "; + $resp_text2 = "$valor_final = $valor_inicial - \frac{n}{100}\cdot $valor_inicial"; +}else{ + $answer = Compute($valor_inicial); + $valor_conocido1 = "\text{valor}_{final} = $valor_final"; + $valor_conocido2 = "n = $porcentaje"; + $valor_desconocido = "\text{valor}_{inicial} = $valor_inicial"; + $cadena = "\text{valor}_{inicial} = "; + $resp_text2 = "$valor_final = \text{valor}_{inicial} - \frac{$porcentaje}{100}\cdot \text{valor}_{inicial}"; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$preguntas[$index] +$PAR +\($cadena\) \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} + +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Escribir la fórmula asociada con disminución porcentual: +\[ +\text{valor}_{final} = \text{valor}_{inicial} - \frac{n}{100}\cdot \text{valor}_{inicial} +\] +$PAR +$BBOLD Paso 2:$EBOLD Sustituir los valores conocidos \($valor_conocido1\), \($valor_conocido2\) y resolver la ecuación: +\[ +$resp_text2 +\] +Por lo tanto, \( $valor_desconocido\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_problemas.pg b/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_problemas.pg new file mode 100644 index 0000000000..5d0743f1ef --- /dev/null +++ b/Contrib/UPRM/Prebasica/porcentaje_aumento_decremento/porcentaje_problemas.pg @@ -0,0 +1,128 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Identificar el cambio porcentual en un problema real. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de archivo +# pedro_prebasica/porcentaje_aumento_decremento/porcentaje_problemas.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Porcientos) +## DBsection(Problemas verbales) +## Level(1) +## KEYWORDS('porcientos','porcentaje','aplicaciones') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"contextFraction.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Eligiendo el porcentaje +$p = non_zero_random(-100,100); +$abs_p = abs($p); + +#Eligiendo el valor inicial y calculando el final con el respectivo porciento +$valor_inicial = random(20,1000,5); +$valor_final = $valor_inicial + $valor_inicial*$p/100; + +if ( $p > 0 ){ + $tipo = "aumento"; + $eq1 = "v_f = v_i + \frac{n}{100}v_i"; +}else{ + $tipo = "disminución"; + $eq1 = "v_f = v_i - \frac{n}{100}v_i"; +} + +@articulo = ("carro", "televisor"); +$index = random(0,1); + +Context("Numeric"); + +$prob = random(0,2); +if ( $prob == 0 ){ + $var1 = "$valor_inicial"; + $var2 = "$abs_p"; + $var3 = "v_f"; + $pregunta = "nuevo precio del $articulo[$index]"; + $answer = Compute("$valor_final"); +}elsif( $prob == 1 ){ + $var1 = "$valor_inicial"; + $var2 = "n"; + $var3 = "$valor_final"; + $pregunta = "porciento de $tipo que tuvo el precio"; + $answer = Compute("$p"); +}else{ + $var1 = "v_i"; + $var2 = "$abs_p"; + $var3 = "$valor_final"; + $pregunta = "precio inicial del $articulo[$index]"; + $answer = Compute("$valor_inicial"); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +El costo de un $articulo[$index] es $\($var1\), pero la empresa le realiza un(a) $tipo del \($var2\)% quedando con un nuevo precio de $\($var3\) ¿Cuál fue el $pregunta? +$PAR +$BBOLD Nota:$EBOLD NO escribir el símbolo $ o %. +$PAR +$pregunta = \{ans_rule(10)\} +END_TEXT +Context()->normalStrings; + +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Escribir la fórmula asociada con $tipo por un porciento: +\[ +$eq1 +\] +$PAR +$BBOLD Paso 2:$EBOLD Sustituir los valores conocidos, \(v_i = $var1\), o, \(n = $var2\), o, \(v_f = $var3\), y resolver la ecuación: +\[ + $var3 = $var1 + \frac{$var2}{100}$var1 +\] +luego el $pregunta es \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/porcientos/aplicaciones_porciento.pg b/Contrib/UPRM/Prebasica/porcientos/aplicaciones_porciento.pg new file mode 100644 index 0000000000..803c478363 --- /dev/null +++ b/Contrib/UPRM/Prebasica/porcientos/aplicaciones_porciento.pg @@ -0,0 +1,157 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas de aplicación + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/porcientos/aplicaciones_porciento.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Porcientos) +## DBsection(Aplicación) +## Level(1) +## KEYWORDS('porcientos','porcentajes','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@nombre = ("Luis","Andrea","Mario","Cydmary","Domingo","Karen","Eliseo"); +$index = random(0,6); + +$prob = random(0,4); + +if ( $prob == 0 ){ + + $n = random(2,40); #porciento + $a = $n*random(30,250); #porcentaje + $b = $a*100/$n; #valor inicial + $enunciado = "$n% de los empleados de un almacén se reportaron enfermos durante el primer cuatrimestre del año. Si $a empleados se reportaron enfermos, ¿cuántos empleados hay en el almacén?"; + $variables_conocidas = "a = $a \quad \text{y} \quad n = $n"; + $var_preg = "b"; + $answer = Compute($b); + $sustituyendo = " + \begin{align*} + $a &= \frac{$n}{100}\cdot b \\[0.2cm] + b &= \frac{100 \times $a}{$n} + \end{align*}"; + +}elsif( $prob == 1 ){ + + $n = random(2,40); + $a = $n*random(2,25); + $b = $a*100/$n; + $enunciado = "$nombre[$index] fue a cenar al restaurante Sancho Panza y dejó una propina de $a dólares para la cena que costó $b dólares. ¿Qué porcentaje del total de la factura dejó $nombre[$index] de propina? (No escriba el símbolo %) "; + $variables_conocidas = "a = $a \quad \text{y} \quad b = $b"; + $var_preg = "n"; + $answer = Compute($n); + $sustituyendo = " + \begin{align*} + $a &= \frac{n}{100}\cdot $b \\[0.2cm] + n &= \frac{100 \times $a}{$b} + \end{align*}"; + +}elsif( $prob == 2 ){ + + $n = list_random(2, 4, 5, 10, 20, 25, 50); + $a = random(5,15); + $b = $a*100/$n; + $enunciado = "$n% de los estudiantes en una clase son mujeres. Si el total de los estudiantes en la clase es $b, ¿cuántas mujeres hay en la clase?"; + $variables_conocidas = "b = $b \quad \text{y} \quad n = $n"; + $var_preg = "a"; + $answer = Compute($a); + $sustituyendo = "a = \frac{$n}{100}\cdot $b"; + +}elsif( $prob == 3 ){ + + $n = random(2,40); + $a = $n*random(200,1000); + $b = $a*100/$n; + $enunciado = "$nombre[$index] gana $b en la lotería y le quiere regalar a su padre el $n% del premio. ¿Cuánto dinero le regaló $nombre[$index] a su padre? (No escriba el símbolo de dolar)"; + $variables_conocidas = "b = $b \quad \text{y} \quad n = $n"; + $var_preg = "a"; + $answer = Compute($a); + $sustituyendo = "a = \frac{$n}{100}\cdot $b"; + +}else{ + + $n = list_random(2, 4, 5, 10, 20, 25, 50); + $a = random(5,15); + $b = $a*100/$n; + $enunciado = "$n% de los estudiantes en una clase son hombres. Si el total de los estudiantes en la clase es $b, ¿cuántos hombres hay en la clase?"; + $variables_conocidas = "b = $b \quad \text{y} \quad n = $n"; + $var_preg = "a"; + $answer = Compute($a); + $sustituyendo = "a = \frac{$n}{100}\cdot $b"; + +} +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$enunciado +$PAR +\($var_preg = \) \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Escriba la fórmula e identificar variables: +\[ +\begin{align*} + \text{Fórmula: } & a = \frac{n}{100}\cdot b \\[0.3cm] + \text{Variables: } & $variables_conocidas +\end{align*} +\] +$PAR +$BBOLD Paso 2:$EBOLD Sustituir valores en la fórmula y determinar valor desconocido: +$PAR +\[ + $sustituyendo +\] +por lo tanto la solución es \( $answer \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/porcientos/convertir_porciento_a_fraccion.pg b/Contrib/UPRM/Prebasica/porcientos/convertir_porciento_a_fraccion.pg new file mode 100644 index 0000000000..0b4fe93ffb --- /dev/null +++ b/Contrib/UPRM/Prebasica/porcientos/convertir_porciento_a_fraccion.pg @@ -0,0 +1,84 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Convertir un porciento en fracción + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/porcientos/convertir_porciento_a_fraccion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Porcientos) +## DBsection(Conversión) +## Level(1) +## KEYWORDS('porcientos','porcentajes','conversion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Fraction"); + +$a = random(1,99); +$answer = Fraction($a,100); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Represente \($a\)% en su fracción equivalente y simplifique el resultado. +$PAR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Representar \($a\)% en notación fraccionaria: +\[ +$a% = $a \text{ sobre } 100 = \frac{$a}{100} +\] +la fracción simplificada al máximo es \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/porcientos/hallar_numero_dado_porciento.pg b/Contrib/UPRM/Prebasica/porcientos/hallar_numero_dado_porciento.pg new file mode 100644 index 0000000000..b8ebf13c2c --- /dev/null +++ b/Contrib/UPRM/Prebasica/porcientos/hallar_numero_dado_porciento.pg @@ -0,0 +1,128 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porciento: calcular una de las variables vf = p*vi, dadas las otras dos. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/porcientos/hallar_numero_dado_porciento.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Porcientos) +## DBsection(Problemas) +## Level(1) +## KEYWORDS('porcientos','porcentajes') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$valor_inicial = random(20,1000,5); +$porcentaje = random(1,150); +$valor_final = $valor_inicial*$porcentaje/100; + +@preguntas = ( + "Determine el \($porcentaje\)% de \( $valor_inicial \).", + "Si \( $valor_final \) es el \($porcentaje\)% de \(b\), calcule el valor de \(b\).", + "Si \($valor_final\) es el \(n\)% de \( $valor_inicial \), calcule el valor de \(n\)." +); + +#Eligiendo pregunta, preparando respuesta. +$index = random(0,2); + +if ($index == 0){ + $answer = Compute($valor_final); + $var_preg = "a"; + $variables_conocidas = "b = $valor_inicial\quad\text{y}\quad n = $porcentaje"; + $sustituyendo = "a = \frac{$porcentaje}{100}\cdot $valor_inicial"; +}elsif($index == 1){ + $answer = Compute($valor_inicial); + $var_preg = "b"; + $variables_conocidas = "a = $valor_final\quad\text{y}\quad n = $porcentaje"; + $sustituyendo = " + \begin{align*} + $valor_final &= \frac{$porcentaje}{100}\cdot b \\[0.2cm] + b &= \frac{$valor_final \times 100}{$porcentaje} + \end{align*}"; +}else{ + $answer = Compute($porcentaje); + $var_preg = "n"; + $variables_conocidas = "a = $valor_final\quad\text{y}\quad b = $valor_inicial"; + $sustituyendo = " + \begin{align*} + $valor_final &= \frac{n}{100} \cdot $valor_inicial \\[0.2cm] + n &= \frac{$valor_final \times 100}{ $valor_inicial} + \end{align*}"; +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$preguntas[$index] +$PAR +\($var_preg =\) \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Escriba la fórmula e identificar variables: +\[ +\begin{align*} + \text{Fórmula: } &a = \frac{n}{100}\cdot b \\[0.3cm] + \text{Variables: } & $variables_conocidas +\end{align*} +\] +$PAR +$BBOLD Paso 2:$EBOLD Sustituir valores en la fórmula y determinar valor desconocido: +$PAR +\[ + $sustituyendo +\] +por lo tanto la solución es \( $answer \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_A.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_A.pg new file mode 100644 index 0000000000..71898497b5 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_A.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (economía) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion','economia') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$precio_carne = random(1,2,0.01); +$n_carne = random(40,99); + +$precio_pollo = random(1,2,0.01); +$n_pollo = random(40,99); + +$total_vendidos = $n_carne + $n_pollo; + +$total_dinero = $n_carne*$precio_carne + $n_pollo*$precio_pollo; + +@pregunta = ("pollo", "carne"); +$index = random(0,1); + +if ( $index == 0 ){ + $text_preg = "pollo"; + $answer = Compute($n_pollo); +}else{ + $text_preg = "carne"; + $answer = Compute($n_carne); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La panadería Ricomini vende pastelillos de carne a $$precio_carne la unidad y pastelillos de pollo a $$precio_pollo la unidad. Si al final del día se obtuvo $$total_dinero por vender $total_vendidos pastelillos, determinar la cantidad de pastelillos de $pregunta[$index] que se vendió en el día. +$PAR +$BBOLD Nota:$EBOLD Los precios ya incluyen el Impuesto de Ventas +$PAR +Cantidad de pastelillos de $pregunta[$index] = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\($precio_carne \cdot \text{carne} + $precio_pollo \cdot \text{pollo} = $total_dinero\)", " "], align=>LEFT, separation=>0). +AlignedRow( [ "Se vendieron $total_vendidos pastelillos en total", "\( \text{pollo} = $total_vendidos - \text{carne} \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(c\) la cantidad de pastelillos de carne que se venden al día. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{pollo} = $total_vendidos - \text{carne} \)", "\( \text{pollo} = $total_vendidos - c\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( $precio_carne\cdot\text{carne} + $precio_pollo\cdot\text{pollo}=$total_dinero \)", "\( $precio_carne c + $precio_pollo($total_vendidos - c)=$total_dinero \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(c\): +\[ +$precio_carne c + $precio_pollo($total_vendidos - c) = $total_dinero \quad \text{entonces}\quad c = $answer +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(c\) para obtener la información que buscamos del problema verbal: +\[ + \begin{align*} + \text{Carne: } & c=$n_carne \\[0.2cm] + \text{Pollo: } & $total_vendidos - c =$n_pollo + \end{align*} +\] +$PAR +por lo tanto se vendieron \( $answer \) pastelillos de $pregunta[$index]. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_B.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_B.pg new file mode 100644 index 0000000000..9a7fce200d --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_B.pg @@ -0,0 +1,145 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (economía) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion','economia') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$precio_manzana = random(2,4,0.01); +$n_manzana = random(10,50); + +$precio_pera = random(1.5,2.5,0.01); +$n_pera = random(10,50); + +$total_comprado = $n_manzana + $n_pera; + +$total_dinero = $n_manzana*$precio_mazana + $n_pera*$precio_pera; + +@pregunta = ("manzana", "pera"); +$index = random(0,1); + +if ( $index == 0 ){ + $text_preg = "manzana"; + $answer = Compute($n_manzana); +}else{ + $text_preg = "pera"; + $answer = Compute($n_pera); +} + +@nombre = ("Jacinto","Isabel","Laura","Diego","Ingrid","Cydmary","Jesús","Glorimar","Alberto","Lisha","Gloriel","Ramón","Aidy","Aldo","Hector","Eloy"); + +$index2 = random(0,15); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$nombre[$index2] va a comprar manzanas y peras a Mr. special. El precio del kilo de manzanas es $$precio_manzana y el precio del kilo de peras es $$precio_pera. Si $nombre[$index2] compró $total_comprado kilos de manzanas y peras en conjunto y pagó un total de $$total_dinero, determinar los kilos de $pregunta[$index] que compró $nombre[$index2] . +$PAR +$BBOLD Nota:$EBOLD Los precios ya incluyen el Impuesto de Ventas +$PAR +Kilos de $pregunta[$index] comprados por $nombre[$index2] = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\($precio_manzana \cdot \text{manzanas} + $precio_pera \cdot \text{peras} = $total_dinero\)", " "], align=>LEFT, separation=>0). +AlignedRow( [ "Se compró $total_comprado manzanas y peras en total", "\( \text{peras} = $total_comprado - \text{manzanas} \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(n\) la cantidad de kilos de manzana que compró $nombre[$index2]. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{peras} = $total_comprado - \text{manzanas} \)", "\( \text{peras} = $total_comprado - n\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( $precio_manzana\cdot\text{manzanas} + $precio_pera\cdot\text{peras}=$total_dinero \)", "\( $precio_manzana n + $precio_pera($total_comprado - n)=$total_dinero \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(n\): +\[ +$precio_manzana n + $precio_pera($total_comprado - n) = $total_dinero \quad \text{entonces}\quad n = $answer +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(n\) para obtener la información que buscamos del problema verbal: +\[ + \begin{align*} + \text{Manzanas: } & n=$n_manzana \\[0.2cm] + \text{Peras: } & $total_comprado - n =$n_pera + \end{align*} +\] +$PAR +por lo tanto $nombre[$index2] compró \( $answer \) kilos de $pregunta[$index]. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_C.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_C.pg new file mode 100644 index 0000000000..c7d287da5b --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_C.pg @@ -0,0 +1,145 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (economía) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion','economia') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$sueldo1 = random(6,14,0.01); +$horas1 = random(5,20); + +$sueldo2 = random(6,14,0.01); +$horas2 = random(5,20); + +$total_trabajado = $horas1 + $horas2; + +$total_dinero = $horas1*$sueldo1 + $horas2*$sueldo2; + +@pregunta = ("1", "2"); +$index = random(0,1); + +if ( $index == 0 ){ + $text_preg = "1"; + $answer = Compute($horas1); +}else{ + $text_preg = "2"; + $answer = Compute($horas2); +} + +@nombre = ("Jacinto","Isabel","Laura","Diego","Ingrid","Cydmary","Jesús","Glorimar","Alberto","Lisha","Gloriel","Ramón","Aidy","Aldo","Hector","Eloy"); + +$index2 = random(0,15); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$nombre[$index2] tiene dos empleos. En empleo 1 gana $$sueldo1 la hora y en el empleo 2 gana $$sueldo2 la hora. Si en una semana determinada trabaja un total de $total_trabajado horas y gana $$total_dinero, determinar la cantidad de horas que labora en el empleo $pregunta[$index]. +$PAR +$BBOLD Nota:$EBOLD No escriba el símbolo $ +$PAR +Horas trabajadas en el empleo $pregunta[$index] = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\($sueldo1 \cdot \text{empleo 1} + $sueldo2 \cdot \text{empleo 2} = $total_dinero\)", " "], align=>LEFT, separation=>0). +AlignedRow( [ "Trabaja $total_trabajado horas en total", "\( \text{empleo 2} = $total_trabajado - \text{empleo 1} \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(n\) la cantidad de horas que $nombre[$index2] trabaja en el empleo 1. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{empleo 2} = $total_trabajado - \text{empleo 1} \)", "\( \text{empleo 2} = $total_trabajado - n\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( $sueldo1\cdot\text{empleo 1} + $sueldo2\cdot\text{empleo 2}=$total_dinero \)", "\( $sueldo1 n + $sueldo2($total_trabajado - n)=$total_dinero \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(n\): +\[ +$sueldo1 n + $sueldo2($total_trabajado - n) = $total_dinero \quad \text{entonces}\quad n = $answer +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(n\) para obtener la información que buscamos del problema verbal: +\[ + \begin{align*} + \text{Empleo 1: } & n=$horas1 \\[0.2cm] + \text{Empleo 2: } & $total_trabajado - n =$horas2 + \end{align*} +\] +$PAR +por lo tanto $nombre[$index2] trabajó \( $answer \) horas en el empleo $pregunta[$index]. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_D.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_D.pg new file mode 100644 index 0000000000..e294cebf3e --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_economia_D.pg @@ -0,0 +1,127 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (economía) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion','economia') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$base = random(1200,3800,5); +$ganancia = random(10000,80000); +$divisor = random(2,5); + +$impuestos = $base + $ganancia/$divisor; + +@nombre = ("Jacinto","Isabel","Laura","Diego","Ingrid","Cydmary","Jesús","Glorimar","Alberto","Lisha","Gloriel","Ramón","Aidy","Aldo","Hector","Eloy"); + +$index = random(0,15); + +$answer = Compute($ganancia); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$nombre[$index] paga $$base más \(\frac{1}{$divisor}\) de sus ganancias en impuestos. Si $nombre[$index] paga $$impuestos de impuestos, determinar la ganancia de $nombre[$index]. +$PAR +$BBOLD Nota:$EBOLD No escriba el símbolo $ +$PAR +Ganancias = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( $base \; \text{mas} \; \frac{1}{$divisor}(\text{de lo ganado}) = $impuestos \)", " \( $base + \frac{1}{$divisor}(\text{de lo ganado}) = $impuestos \) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(g\) la ganancia de $nombre[$index]. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\($base + \frac{1}{$divisor}(\text{de lo ganado}) = $impuestos\)", "\( $base + \frac{g}{$divisor} = $impuestos\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(g\): +\[ +$base + \frac{g}{$divisor} = $impuestos \quad \text{entonces}\quad g = $answer +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(g\) para obtener la información que buscamos del problema verbal: +\[ + \text{Ganancias: } g=$ganancia +\] +$PAR +por lo tanto las ganancias de $nombre[$index] son \($answer\) dólares. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_A.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_A.pg new file mode 100644 index 0000000000..7fca69d66d --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_A.pg @@ -0,0 +1,137 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (geometría) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@mult = ("dos", "tres", "cuatro", "cinco"); +$index1 = random(0,3); + +@pregunta = ("ancho", "largo"); +$index2 = random(0,1); + +$a = random(2,30); +$k = ($index1 + 2); +$dos_k = 2*$k; +$l = $k*$a; +$p = 2*($a + $l); + +if ($index2 == 0){ + $answer = Compute($a); +}else{ + $answer = Compute($l); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Un terreno tiene una forma rectangular. Si el largo del terreno es $mult[$index1] veces más que su ancho y el perímetro del terreno es $p m, calcule el $pregunta[$index2] del terreno. (Escribir sólo el número, SIN incluir las unidades m) +$PAR +El $pregunta[$index2] es = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "El perímetro de un terreno rectangular es $p", "\(2\cdot\text{ancho} + 2\cdot\text{largo} = $p\)"], align=>LEFT, separation=>0). +AlignedRow( ["El largo es $mult[$index1] veces más que su ancho", "\(\text{largo} = $k\cdot\text{ancho}\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(a\) el ancho del terreno. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\(\text{largo} = $k\cdot\text{ancho}\)", "\(\text{largo} = $k a\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\(2\cdot\text{ancho} + 2\cdot\text{largo} = $p\)", "\( 2 a + 2($k a) = $p\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( 2 a + $dos_k a = $p\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(a\): +\[ +2 a + $dos_k a = $p \quad \text{entonces}\quad a = $answer +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(a\) para obtener la información del problema verbal: +\[ +\begin{align*} + \text{Ancho: } & a=$a \\[0.2cm] + \text{Largo: } & l = $k a= $l +\end{align*} +\] +$PAR +por lo tanto el $pregunta[$index2] del terreno es \( $answer \) m. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_B.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_B.pg new file mode 100644 index 0000000000..b54b7a509c --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_B.pg @@ -0,0 +1,119 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (geometría) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$l = random(11,99); +$p = 4*$l; + +$answer = Compute($l); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Si el perímetro de un cuadrado es $p cm, determinar la medida de su lado. (Escribir sólo el número, SIN incluir las unidades cm) +$PAR +Lado = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "El perímetro de un cuadrado es $p", "\(4\cdot\text{lado} = $p\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(l\) la medida del lado del cuadrado. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\(4\cdot\text{lado}\) = $p", "\(4\cdot l = $p\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( 4 l = $p\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(l\): +\[ +4l = $p \quad \text{entonces}\quad l = $answer +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(l\) para obtener la información del problema verbal: +\[ + \text{Lado: } l=$l +\] +$PAR +por lo tanto el lado es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_C.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_C.pg new file mode 100644 index 0000000000..b06f6046cd --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_C.pg @@ -0,0 +1,161 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (geometría) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$k1 = random(2,9); +$k2 = random(2,9); +$k3 = random(2,9); + +$lado = random(5,30); + +$k1l = $k1*$lado; +$k2l = $k2*$lado; +$k3l = $k3*$lado; + +$p = $lado*($k1+$k2+$k3); + +@pregunta = ("mayor", "menor"); +$index = random(0,1); + +if ($index == 0){ + if ($k1 > $k2 && $k1 > $k3){ + $answer = Compute("$k1l"); + }elsif($k2 > $k1 && $k2 > $k3){ + $answer = Compute("$k2l"); + }elsif($k3 > $k1 && $k3 > $k2){ + $answer = Compute("$k3l"); + }else{ + $answer = Compute("$k1l"); + } +}else{ + if ($k1 < $k2 && $k1 < $k3){ + $answer = Compute("$k1l"); + }elsif($k2 < $k1 && $k2 < $k3){ + $answer = Compute("$k2l"); + }elsif($k3 < $k1 && $k3 < $k2){ + $answer = Compute("$k3l"); + }else{ + $answer = Compute("$k1l"); + } +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Las proporciones de los lados de un triángulo son ($k1,$k2,$k3). Si el perímetro del triángulo es $p cm, calcular el lado de $pregunta[$index] medida. (Escribir sólo el número, SIN incluir las unidades cm) +$PAR +Lado de $pregunta[$index] medida = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "El perímetro de un triángulo es $p", "\(\text{lado 1} + \text{lado 2} + \text{lado 3}= $p\)"], align=>LEFT, separation=>0). +AlignedRow( ["\(\text{lado 1} = $k1\cdot\text{cantidad}\)"], align=>LEFT, separation=>0). +AlignedRow( ["\(\text{lado 2} = $k2\cdot\text{cantidad}\)"], align=>LEFT, separation=>0). +AlignedRow( ["\(\text{lado 3} = $k3\cdot\text{cantidad}\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(l\) la cantidad desconocida. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\(\text{lado 1}=$k1\cdot\text{cantidad}\)", "\(\text{lado 1}=$k1 l\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\(\text{lado 2}=$k2\cdot\text{cantidad}\)", "\(\text{lado 2}=$k2 l\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\(\text{lado 3}=$k3\cdot\text{cantidad}\)", "\(\text{lado 3}=$k3 l\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(l\): +\[ +$k1 l + $k2 l + $k3 l = $p \quad \text{entonces}\quad l = $lado +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(l\) para obtener la información del problema verbal: +\[ +\begin{align*} + \text{Lado 1: } & $k1 l = $k1l \\[0.2cm] + \text{Lado 2: } & $k2 l = $k2l \\[0.2cm] + \text{Lado 3: } & $k3 l = $k3l +\end{align*} +\] +$PAR +por lo tanto el lado de $pregunta[$index] medida del triángulo es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_D.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_D.pg new file mode 100644 index 0000000000..ae15eacf66 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_D.pg @@ -0,0 +1,137 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (geometría) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$k = random(4,25); +$l = random(30,100); + +$a = $l-$k; + +$p = 2*$l + 2*($l-$k); + +@pregunta = ("ancho", "largo"); +$index = random(0,1); + +if ($index == 0){ + $answer = Compute($a); +}else{ + $answer = Compute($l); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +El ancho de un rectángulo es $k cm más pequeño que su largo, si su perímetro es $p cm, calcule el $pregunta[$index] del rectángulo. (Escribir sólo el número, SIN incluir las unidades cm) +$PAR +El $pregunta[$index] es = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "El perímetro de un rectángulo es $p", "\(2\cdot\text{ancho} + 2\cdot\text{largo} = $p\)"], align=>LEFT, separation=>0). +AlignedRow( ["El ancho es $k más pequeño que el largo","\(\text{ancho} = \text{largo} - $k\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(l\) el largo del rectángulo. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\(\text{ancho} = \text{largo} - $k\)", "\(\text{ancho} = l - $k\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\(2\cdot \text{ancho} + 2\cdot \text{largo} = 52\)", "\(2\cdot l + 2\cdot (l - $k)=$p\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\(2l + 2(l-$k) = $p\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(l\): +\[ +2 l + 2(l-$k) = $p \quad \text{entonces}\quad l = $l +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(l\) para obtener la información del problema verbal: +\[ +\begin{align*} + \text{Ancho: } & l -$k = $a \\[0.2cm] + \text{Largo: } & l = $l +\end{align*} +\] +$PAR +por lo tanto el $pregunta[$index] del rectángulo es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_E.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_E.pg new file mode 100644 index 0000000000..921a2395d8 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_E.pg @@ -0,0 +1,120 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (geometría) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$r = random(2,30); +$dos_r = 2*$r; +$p = pi*$dos_r; + +$answer = Compute($r); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Si el perímetro de un círculo es \($dos_r\pi\) cm, determinar el radio. (Escribir sólo el número, SIN incluir las unidades cm) +$PAR +Radio = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "El perímetro de un círculo es \($dos_r\pi\)", "\(2\pi \cdot\text{radio} = $dos_r\pi\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(r\) el radio del círculo. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\(2\pi\cdot\text{radio} = $dos_r\pi\)", "\(2\pi \cdot r = $dos_r\pi\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( 2\pi r = $dos_r\pi\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(r\): +\[ +2\pi r = $dos_r\pi \quad \text{entonces}\quad r = $r +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(r\) para obtener la información del problema verbal: +\[ + \text{Radio: } r=$r +\] +$PAR +por lo tanto el radio es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_F.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_F.pg new file mode 100644 index 0000000000..de295c7506 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_F.pg @@ -0,0 +1,138 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (geometría) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@mult = ("dos", "tres", "cuatro", "cinco"); +$index1 = random(0,3); + +@pregunta = ("de los lados congruentes","del lado no congruente"); +$index2 = random(0,1); + +$b = random(2,30); +$k = ($index1+2); +$a = $k*$b; +$p = 2*$a+$b; + +$dos_k = 2*$k; + +if ($index2 == 0){ + $answer = Compute($a); +}else{ + $answer = Compute($b); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La medida del lado congruente de un triángulo isósceles es $mult[$index1] veces la medida del lado no congruente. Si el perímetro del triángulo isósceles es $p cm, determine la medida $pregunta[$index2] del triángulo. (Escribir sólo el número, SIN incluir las unidades cm) +$PAR +Contestación = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "El perímetro de un triángulo isóseceles es $p", "\(2\cdot\text{lado congruente} + \text{lado diferente} = $p\)"], align=>LEFT, separation=>0). +AlignedRow( ["Lado congruente es $mult[$index1] veces la medida del lado no congruente", "\(\text{lado congruente} = $k\cdot\text{lado diferente}\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(l\) la medida del lado diferente. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\(\text{lado congruente} = $k\cdot\text{lado diferente}\)", "\(\text{lado congruente} = $k l\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\(2\cdot\text{lado congruente} + \text{lado diferente} = $p\)", "\( l + 2($k l) = $p\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( l + $dos_k l = $p\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(l\): +\[ +l + $dos_k l = $p \quad \text{entonces}\quad l = $answer +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(l\) para obtener la información del problema verbal: +\[ +\begin{align*} + \text{Lado diferente: } & l=$b \\[0.2cm] + \text{Lado congruente: } & $k l = $a +\end{align*} +\] +$PAR +por lo tanto la medida $pregunta[$index2] del triángulo es \( $answer \) m. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_G.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_G.pg new file mode 100644 index 0000000000..de4661ac7f --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_G.pg @@ -0,0 +1,138 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (geometría) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$k = random(4,25); +$l = random(30,100); + +$a = $l-$k; + +$p = 2*$l + 2*($l-$k); + +@pregunta = ("ancho", "largo"); +$index = random(0,1); + +if ($index2 == 0){ + $answer = Compute($a); +}else{ + $answer = Compute($l); +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Un terreno tiene una forma rectangular y si su ancho es $k m más pequeño que su largo. Si el perímetro del terreno es $p m, calcule el $pregunta[$index] del terreno. (Escribir sólo el número, SIN incluir las unidades m) +$PAR +El $pregunta[$index] es = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "El perímetro del terreno es $p", "\(2\cdot\text{ancho} + 2\cdot\text{largo} = $p\)"], align=>LEFT, separation=>0). +AlignedRow( ["El ancho es $k m más pequeño que el largo","\(\text{ancho} = \text{largo} - $k\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(l\) el largo del terreno. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\(\text{ancho} = \text{largo} - $k\)", "\(\text{ancho} = l - $k\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\(2\cdot \text{ancho} + 2\cdot \text{largo} = 52\)", "\(2\cdot l + 2\cdot (l - $k)=$p\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\(2l + 2(l-$k) = $p\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(l\): +\[ +2 l + 2(l-$k) = $p \quad \text{entonces}\quad l = $l +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(l\) para obtener la información del problema verbal: +\[ +\begin{align*} + \text{Ancho: } & l -$k = $a \\[0.2cm] + \text{Largo: } & l = $l +\end{align*} +\] +$PAR +por lo tanto el $pregunta[$index] del terreno es \( $answer \) m. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_H.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_H.pg new file mode 100644 index 0000000000..99f9babbb2 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_H.pg @@ -0,0 +1,138 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (geometría) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Numeric"); + +$k = random(4,25); +$l = random(30,100); + +$a = $l-$k; + +$p = 2*$l + 2*($l-$k); + +@pregunta = ("ancho", "largo"); +$index = random(0,1); + +if ($index2 == 0){ + $answer = Compute($a); +}else{ + $answer = Compute($l); +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +El ancho de un rectángulo es $k cm más pequeño que su largo. Si su perímetro es $p cm, calcule el $pregunta[$index] del rectángulo. (Escribir sólo el número, SIN incluir las unidades cm) +$PAR +El $pregunta[$index] es = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "El perímetro de un rectángulo es $p", "\(2\cdot\text{ancho} + 2\cdot\text{largo} = $p\)"], align=>LEFT, separation=>0). +AlignedRow( ["El ancho es $k cm más pequeño que el largo","\(\text{ancho} = \text{largo} - $k\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(l\) el largo del terreno. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\(\text{ancho} = \text{largo} - $k\)", "\(\text{ancho} = l - $k\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\(2\cdot \text{ancho} + 2\cdot \text{largo} = 52\)", "\(2\cdot l + 2\cdot (l - $k)=$p\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\(2l + 2(l-$k) = $p\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(l\): +\[ +2 l + 2(l-$k) = $p \quad \text{entonces}\quad l = $l +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(l\) para obtener la información del problema verbal: +\[ +\begin{align*} + \text{Ancho: } & l -$k = $a \\[0.2cm] + \text{Largo: } & l = $l +\end{align*} +\] +$PAR +por lo tanto el $pregunta[$index] del rectángulo es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_I.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_I.pg new file mode 100644 index 0000000000..1a8000c778 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria_I.pg @@ -0,0 +1,120 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (geometría) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_geometria.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$l = random(11,99); +$p = 3 *$l; + +$answer = Compute($l); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Si el perímetro de un triángulo equilátero es $p cm, calcular la dimensión del lado del triángulo. (Escribir sólo el número, SIN incluir las unidades cm) +$PAR +Lado = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "El perímetro de un triángulo equilátero es $p", "\(\text{lado} + \text{lado} + \text{lado} = $p\)"], align=>LEFT, separation=>0). +AlignedRow( [ "\(3\cdot \text{lado}=$p\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(l\) el lado del triángulo equilátero. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\(3\cdot\text{lado}\) = $p", "\(3\cdot l = $p\)"], align=>LEFT, separation=>0). + AlignedRow( [ " ", "\( 3 l = $p\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(l\): +\[ +3l = $p \quad \text{entonces}\quad l = $answer +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(l\) para obtener la información del problema verbal: +\[ + \text{Lado: } l=$l +\] +$PAR +por lo tanto el lado del triángulo es \( $answer \) cm. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos_A.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos_A.pg new file mode 100644 index 0000000000..52e11cccdb --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos_A.pg @@ -0,0 +1,132 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (movimientos) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion','movimiento') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Fraction"); + +@nombre = ("Jacinto","Isabel","Laura","Diego","Ingrid","Cydmary","Jesús","Glorimar","Alberto","Lisha","Gloriel","Ramón","Aidy","Aldo","Hector","Eloy"); + +$index = random(0,15); + +@sitio = ("de Walgreens","del Mall de Mayaguez","de Sam's","del Town Center","del Parque de los Próceres","del correo en Mayagüez","del Hospital Perea","de la UPR de Mayagüez"); + +$index2 = random(0,7); + +$velo = random(3,15); +$dist_inicial = random(2,9); +$dist_final = random(3,20); + +$dist = $dist_final - $dist_inicial; + +$tiempo = Fraction($dist,$velo); + +$answer = Compute($tiempo); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +El carro de $nombre[$index] se encuentra a $dist_inicial millas $sitio[$index2] y comienza a alejarse de dicho lugar a una velocidad de $velo millas por hora. Luego, por medio del GPS, se da cuenta que se encuentra a $dist_final millas del punto de partida. Determinar la cantidad de horas que manejó $nombre[$index] desde el punto de partida hasta ese momento. +$PAR +$BBOLD Nota:$EBOLD (SÓLO ESCRIBIR EL NÚMERO, y considerar la velocidad CONSTANTE) +$PAR +Tiempo manejado = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "Fórmula de distancia", " \( \text{distancia} = \text{velocidad} \cdot \text{tiempo}\) "], align=>LEFT, separation=>0). + AlignedRow( [ "Distancia recorrida", " \( \text{distancia} = $dist_final - $dist_inicial = $dist\) "], align=>LEFT, separation=>0). + AlignedRow( [ "Velocidad de $velo millas por hora", " \( \text{velocidad} = $velo\) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(t\) el tiempo que $nombre[$index]. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{distancia} = \text{velocidad} \cdot \text{tiempo} \)", "\( $dist = $velo\cdot t \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( $dist = $velo t\)", " "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(t\): +\[ +$dist = $velo t \quad \text{entonces}\quad t = $answer. +\] +Por lo tanto $nombre[$index] manejó \($answer\) hora(s). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos_B.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos_B.pg new file mode 100644 index 0000000000..91ca308099 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos_B.pg @@ -0,0 +1,162 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (movimientos) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion','movimiento') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Eligiendo 2 tiempos diferentes aleatorios +$tiempo1 = random(2,15); +do{ + $tiempo2 = random(2,18); +}until ($tiempo2 != $tiempo1); +$diffe = random(2,20); + +Context("Fraction"); +$t1d = $tiempo1*$diffe; + +if ($tiempo2 > $tiempo1){ + $t2_menos_t1 = $tiempo2 - $tiempo1; + $key = "mas"; + $simbolo = "+"; + $velo_carro2 = Fraction($t1d, $t2_menos_t1); + $velo_carro1 = $velo_carro2 + $diffe; +}else{ + $t2_menos_t1 = $tiempo1 - $tiempo2; + $key = "menos"; + $simbolo = "-"; + $velo_carro2 = Fraction($t1d, $t2_menos_t1); + $velo_carro1 = $velo_carro2 - $diffe; +} + + +$dist1 = $velo_carro1*$tiempo1; +$dist2 = $velo_carro2*$tiempo2; + +@pregunta = ("A", "B"); +$index = random(0,1); + +if ($index == 0){ + $answer = Compute($velo_carro1); +}else{ + $answer = Compute($velo_carro2); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Dos carros recorren la misma distancia. Si la velocidad del carro A es $diffe unidades $key que la velocidad del carro B y el carro A tardó $tiempo1 minutos y el carro B duró $tiempo2 minutos, calcular la velocidad del carro $pregunta[$index]. +$PAR +$BBOLD Nota:$EBOLD (SÓLO ESCRIBIR EL NÚMERO, SIN UNIDADES) +$PAR +Velocidad carro $pregunta[$index] = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla recordando que +\[ + \text{distancia} = \text{velocidad}\cdot \text{tiempo} +\] +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "Dos carros recorren la misma distancia", " \( (\text{velocidad carro A})\cdot(\text{tiempo de A}) = (\text{velocidad carro B})\cdot(\text{tiempo de B}) \) "], align=>LEFT, separation=>0). + AlignedRow( [ "Carro A duró $tiempo1 minutos", " \( \text{tiempo de A} = $tiempo1 \) "], align=>LEFT, separation=>0). + AlignedRow( [ "Carro B duró $tiempo2 minutos", " \( \text{tiempo de B} = $tiempo2 \) "], align=>LEFT, separation=>0). + AlignedRow( [ "velocidad carro A es $diffe $key que velocidad carro B", " \( \text{velocidad carro A} = \text{velocidad carro B} $simbolo $diffe \) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(v\) la velocidad del carro $pregunta[$index]. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{velocidad carro A} = \text{velocidad carro B} $simbolo $diffe \)", "\( \text{velocidad carro A} = v $simbolo $diffe \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( (\text{velocidad carro A})\cdot(\text{tiempo de A}) = (\text{velocidad carro B})\cdot(\text{tiempo de B}) \)", " \( (v $simbolo $diffe)\cdot $tiempo1 = v\cdot $tiempo2 \) "], align=>LEFT, separation=>0). +AlignedRow( [ "\( $tiempo1(v $simbolo $diffe) = $tiempo2 v \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(v\): +\[ + $tiempo1(v $simbolo $diffe) = $tiempo2 v\quad \text{entonces}\quad v = $answer. +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(v\) para obtener la información que buscamos en el problema verbal: +\[ +\begin{align*} + \text{Velocidad carro A: } & v $simbolo $diffe = $velo_carro1 \\[0.2cm] + \text{Velocidad carro B: } & v = $velo_carro2 \\[0.2cm] + \text{Distancia recorrida por los dos: } & $velo_carro1\cdot $tiempo1 = $velo_carro2\cdot $tiempo2 = $dist1. +\end{align*} +\] +$PAR +Por lo tanto la velocidad del carro $pregunta[$index] es \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos_C.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos_C.pg new file mode 100644 index 0000000000..93e49b4311 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos_C.pg @@ -0,0 +1,124 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (movimientos) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_movimientos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion','movimiento') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Fraction"); + +$velo = random(10,25); +$dist_inicial = $velo*random(450,600); +$dist_final = $velo*random(15,30); + +$dist = $dist_inicial - $dist_final; + +$tiempo = Fraction($dist,$velo); + +$answer = Compute($tiempo); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Un meteorito, que inicialmente se encuentra a $dist_inicial millas de la Tierra se dirige a ésta a una velocidad de $velo millas por semana. Si después de un tiempo, el meteorito se encuentra a $dist_final millas de la Tierra, determinar la cantidad de semanas que transcurrieron en ese tiempo. +$PAR +$BBOLD Nota:$EBOLD (SÓLO ESCRIBIR EL NÚMERO. Considere la velocidad CONSTANTE) +$PAR +Cantidad de semanas = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "Fórmula de distancia", " \( \text{distancia} = \text{velocidad} \cdot \text{tiempo}\) "], align=>LEFT, separation=>0). + AlignedRow( [ "Distancia recorrida", " \( \text{distancia} = $dist_inicial - $dist_final = $dist\) "], align=>LEFT, separation=>0). + AlignedRow( [ "Velocidad de $velo millas por hora", " \( \text{velocidad} = $velo\) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(t\) el tiempo en semanas que tarda su recorrido. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{distancia} = \text{velocidad} \cdot \text{tiempo} \)", "\( $dist = $velo\cdot t \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( $dist = $velo t\)", " "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(t\): +\[ +$dist = $velo t \quad \text{entonces}\quad t = $answer. +\] +Por lo tanto el meteorito duró \($answer\) semana(s) en hacer ese recorrido. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_A.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_A.pg new file mode 100644 index 0000000000..7a951a258d --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_A.pg @@ -0,0 +1,130 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (numericos) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#construyendo 2 enteros consecutivos +$entero1 = random(3,50); +$entero2 = $entero1+1; + +$suma = $entero1 + $entero2; + +@pregunta = ("menor","mayor"); +$index = random(0,1); +if ( $index == 0 ){ + $answer = Compute($entero1); +}else{ + $answer = Compute($entero2); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Si la suma de dos números enteros consecutivos es $suma, encontrar el número $pregunta[$index]. +$PAR +Entero $pregunta[$index] = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "Suma de dos números enteros es $suma", " \( \text{primer número} + \text{segundo número} = $suma \) "], align=>LEFT, separation=>0). + AlignedRow( [ "Son números enteros consecutivos", " \( \text{segundo número} = \text{primer número}+1 \) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(x\) el primer entero. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{segundo número} = \text{primer número}+1 \)", "\( \text{segundo número} = x+1 \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{primer número} + \text{segundo número} = $suma \)", "\( x + (x+1) = $suma \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(x\): +\[ + x + (x+1) = $suma \quad \text{entonces}\quad x = $entero1. +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(x\) para obtener la información que buscamos en el problema verbal: +\[ +\begin{align*} + \text{Primer entero: } & x = $entero1, \\[0.2cm] + \text{Segundo entero: } & x + 1 = $entero2, +\end{align*} +\] +$PAR +Por lo tanto el entero $pregunta[$index] es \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_B.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_B.pg new file mode 100644 index 0000000000..5d76390a65 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_B.pg @@ -0,0 +1,139 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (numericos) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#construyendo 3 enteros impares consecutivos +$entero = random(3,50); +$impar1 = 2*$entero +1; +$impar2 = 2*$entero +3; +$impar3 = 2*$entero +5; + +$suma = $impar1 + $impar2 + $impar3; + +@pregunta = ("menor", "del medio", "mayor"); +$index = random(0,2); +if ( $index == 0 ){ + $answer = Compute($impar1); +}elsif( $index == 1 ){ + $answer = Compute($impar2); +}else{ + $answer = Compute($impar3); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Si la suma de tres números enteros impares consecutivos es $suma, encontrar el número impar $pregunta[$index]. +$PAR +Impar $pregunta[$index] = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "Suma de tres números enteros es $suma", " \( \text{primer número} + \text{segundo número} + \text{tercer número} = $suma \) "], align=>LEFT, separation=>0). + AlignedRow( [ "Son números enteros impares consecutivos", " \( \text{primer número} = 2\cdot\text{entero}+1 \) "], align=>LEFT, separation=>0). + AlignedRow( [ " ", "\( \text{segundo número} = 2\cdot\text{entero}+3 \) "], align=>LEFT, separation=>0). + AlignedRow( [ " ", "\( \text{tercer número} = 2\cdot\text{entero}+5 \) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(n\) un número entero. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{primer número} = 2\cdot\text{entero}+1 \)", "\( \text{primer número} = 2\cdot n+1 = 2n+1 \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{segundo número} = 2\cdot\text{entero}+3 \)", "\( \text{segundo número} = 2\cdot n+3 =2n+3\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{tercer número} = 2\cdot\text{entero}+5 \)", "\( \text{tercer número} = 2\cdot n+5 =2n+5\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{primer número} + \text{segundo número} + \text{tercer número} = $suma \)", "\( (2n+1) + (2n+3) + (2n+5)= $suma\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(n\): +\[ + (2n+1) + (2n+3) + (2n+5)= $suma \quad \text{entonces}\quad n = $entero. +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(n\) para obtener la información que buscamos en el problema verbal: +\[ +\begin{align*} + \text{Primer entero impar: } & 2n + 1 = $impar1, \\[0.2cm] + \text{Segundo entero impar: } & 2n + 3 = $impar2, \\[0.2cm] + \text{Tercer entero impar: } & 2n + 5 = $impar3 . +\end{align*} +\] +$PAR +Por lo tanto el entero impar $pregunta[$index] es \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_C.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_C.pg new file mode 100644 index 0000000000..584038f926 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_C.pg @@ -0,0 +1,139 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (numericos) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#construyendo 3 enteros pares consecutivos +$entero = random(3,50); +$par1 = 2*$entero; +$par2 = 2*$entero +2; +$par3 = 2*$entero +4; + +$suma = $par1 + $par2 + $par3; + +@pregunta = ("menor", "del medio", "mayor"); +$index = random(0,2); +if ( $index == 0 ){ + $answer = Compute($par1); +}elsif( $index == 1 ){ + $answer = Compute($par2); +}else{ + $answer = Compute($par3); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Si la suma de tres números enteros pares consecutivos es $suma, encontrar el número par $pregunta[$index]. +$PAR +Par $pregunta[$index] = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "Suma de tres números enteros es $suma", " \( \text{primer número} + \text{segundo número} + \text{tercer número} = $suma \) "], align=>LEFT, separation=>0). + AlignedRow( [ "Son números enteros pares consecutivos", " \( \text{primer número} = 2\cdot\text{entero} \) "], align=>LEFT, separation=>0). + AlignedRow( [ " ", "\( \text{segundo número} = 2\cdot\text{entero}+2 \) "], align=>LEFT, separation=>0). + AlignedRow( [ " ", "\( \text{tercer número} = 2\cdot\text{entero}+4 \) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(n\) un número entero. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{primer número} = 2\cdot\text{entero} \)", "\( \text{primer número} = 2\cdot n = 2n \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{segundo número} = 2\cdot\text{entero}+2 \)", "\( \text{segundo número} = 2\cdot n+2 =2n+2\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{tercer número} = 2\cdot\text{entero}+4 \)", "\( \text{tercer número} = 2\cdot n+4 =2n+4\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{primer número} + \text{segundo número} + \text{tercer número} = $suma \)", "\( 2n + (2n+2) + (2n+4)= $suma\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(n\): +\[ + 2n + (2n+2) + (2n+4)= $suma \quad \text{entonces}\quad n = $entero. +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(n\) para obtener la información que buscamos en el problema verbal: +\[ +\begin{align*} + \text{Primer entero par: } & 2n = $par1, \\[0.2cm] + \text{Segundo entero par: } & 2n + 2 = $par2, \\[0.2cm] + \text{Tercer entero par: } & 2n + 4 = $par3 . +\end{align*} +\] +$PAR +Por lo tanto el entero par $pregunta[$index] es \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_D.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_D.pg new file mode 100644 index 0000000000..8b43afa9a6 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_D.pg @@ -0,0 +1,133 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (numericos) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#construyendo 2 enteros pares consecutivos +$entero = random(3,50); +$par1 = 2*$entero; +$par2 = 2*$entero +2; + +$suma = $par1 + $par2; + +@pregunta = ("menor", "mayor"); +$index = random(0,1); +if ( $index == 0 ){ + $answer = Compute($par1); +}else{ + $answer = Compute($par2); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Si la suma de dos números enteros pares consecutivos es $suma, encontrar el número par $pregunta[$index]. +$PAR +Par $pregunta[$index] = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "Suma de dos números enteros es $suma", " \( \text{primer número} + \text{segundo número} = $suma \) "], align=>LEFT, separation=>0). + AlignedRow( [ "Son números enteros pares consecutivos", " \( \text{primer número} = 2\cdot\text{entero} \) "], align=>LEFT, separation=>0). + AlignedRow( [ " ", "\( \text{segundo número} = 2\cdot\text{entero}+2 \) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(n\) un número entero. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{primer número} = 2\cdot\text{entero} \)", "\( \text{primer número} = 2\cdot n = 2n \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{segundo número} = 2\cdot\text{entero}+2 \)", "\( \text{segundo número} = 2\cdot n+2 =2n+2\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{primer número} + \text{segundo número} = $suma \)", "\( 2n + (2n+2) = $suma\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(n\): +\[ + 2n + (2n+2) = $suma \quad \text{entonces}\quad n = $entero. +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(n\) para obtener la información que buscamos en el problema verbal: +\[ +\begin{align*} + \text{Primer entero par: } & 2n = $par1, \\[0.2cm] + \text{Segundo entero par: } & 2n + 2 = $par2, +\end{align*} +\] +$PAR +Por lo tanto el entero par $pregunta[$index] es \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_E.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_E.pg new file mode 100644 index 0000000000..6aaf05b4d7 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_E.pg @@ -0,0 +1,136 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (numericos) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#construyendo 3 enteros consecutivos +$entero1 = random(3,50); +$entero2 = $entero1+1; +$entero3 = $entero1+2; + +$suma = $entero1 + $entero2 + $entero3; + +@pregunta = ("menor","del medio","mayor"); +$index = random(0,2); +if ( $index == 0 ){ + $answer = Compute($entero1); +}elsif( $index == 1 ){ + $answer = Compute($entero2); +}else{ + $answer = Compute($entero3); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Si la suma de tres números enteros consecutivos es $suma, encontrar el número $pregunta[$index]. +$PAR +Entero $pregunta[$index] = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "Suma de tres números enteros es $suma", " \( \text{primer número} + \text{segundo número} + \text{tercer número} = $suma \) "], align=>LEFT, separation=>0). + AlignedRow( [ "Son números enteros consecutivos", " \( \text{segundo número} = \text{primer número}+1 \) "], align=>LEFT, separation=>0). +AlignedRow( [ " ", " \( \text{tercer número} = \text{primer número}+2 \) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(x\) el primer entero. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{segundo número} = \text{primer número}+1 \)", "\( \text{segundo número} = x+1 \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{tercer número} = \text{primer número}+2 \)", "\( \text{tercer número} = x+2 \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{primer número} + \text{segundo número} + \text{tercer número}= $suma \)", "\( x + (x+1) + (x+2)= $suma \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(x\): +\[ + x + (x+1) + (x+2)= $suma \quad \text{entonces}\quad x = $entero1. +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(x\) para obtener la información que buscamos en el problema verbal: +\[ +\begin{align*} + \text{Primer entero: } & x = $entero1, \\[0.2cm] + \text{Segundo entero: } & x + 1 = $entero2, \\[0.2cm] + \text{Tercer entero: } & x + 2 = $entero3, +\end{align*} +\] +$PAR +Por lo tanto el entero $pregunta[$index] es \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_F.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_F.pg new file mode 100644 index 0000000000..10e792bbbf --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_F.pg @@ -0,0 +1,133 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (numericos) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#construyendo 2 enteros impares consecutivos +$entero = random(3,50); +$impar1 = 2*$entero +1; +$impar2 = 2*$entero +3; + +$suma = $impar1 + $impar2; + +@pregunta = ("menor", "mayor"); +$index = random(0,1); +if ( $index == 0 ){ + $answer = Compute($impar1); +}else{ + $answer = Compute($impar2); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Si la suma de dos números enteros impares consecutivos es $suma, encontrar el número impar $pregunta[$index]. +$PAR +Impar $pregunta[$index] = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "Suma de dos números enteros es $suma", " \( \text{primer número} + \text{segundo número} = $suma \) "], align=>LEFT, separation=>0). + AlignedRow( [ "Son números enteros impares consecutivos", " \( \text{primer número} = 2\cdot\text{entero}+1 \) "], align=>LEFT, separation=>0). + AlignedRow( [ " ", "\( \text{segundo número} = 2\cdot\text{entero}+3 \) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(n\) un número entero. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{primer número} = 2\cdot\text{entero}+1 \)", "\( \text{primer número} = 2\cdot n+1 = 2n+1 \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{segundo número} = 2\cdot\text{entero}+3 \)", "\( \text{segundo número} = 2\cdot n+3 =2n+3\)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{primer número} + \text{segundo número} = $suma \)", "\( (2n+1) + (2n+3) = $suma\)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(n\): +\[ + (2n+1) + (2n+3) = $suma \quad \text{entonces}\quad n = $entero. +\] +$BBOLD Paso 5:$EBOLD +Usar el valor de \(n\) para obtener la información que buscamos en el problema verbal: +\[ +\begin{align*} + \text{Primer entero impar: } & 2n + 1 = $impar1, \\[0.2cm] + \text{Segundo entero impar: } & 2n + 3 = $impar2, +\end{align*} +\] +$PAR +Por lo tanto el entero impar $pregunta[$index] es \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_G.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_G.pg new file mode 100644 index 0000000000..bb5073ae97 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_G.pg @@ -0,0 +1,145 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (numericos) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Fraction"); + +$k1 = non_zero_random(-20,20); +$k2 = non_zero_random(-20,20); +$abs_k1 = abs($k1); +$abs_k2 = abs($k2); + +@factor = ("doble", "triple"); +$index = random(0,1); +if ($index == 0){ + $f = 2; +}else{ + $f = 3; +} + +if ($k1 > 0){ + $desplaza1 = "aumentado"; + $simbolo1 = "+"; +}else{ + $desplaza1 = "disminuido"; + $simbolo1 = "-"; +} + +if ($k2 > 0){ + $desplaza2 = "más"; + $simbolo2 = "+"; + $nf = $f; +}else{ + $desplaza2 = "menos"; + $simbolo2 = "-"; + $nf = -$f; +} + +$k1_menos_abs_k2 = $k1-$abs_k2; +$nf_menos_1 = $nf-1; + +$answer = Fraction($k1_menos_abs_k2,$nf_menos_1); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Si un número $desplaza1 en $abs_k1 es igual a $abs_k2 $desplaza2 el $factor[$index] de dicho número, determinar el número. +$PAR +Número = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "Un número $desplaza1 en $abs_k1 es igual a $abs_k2 $desplaza2 el $factor[$index] de dicho número", " \( \text{número} $simbolo1 $abs_k1 = $abs_k2 $simbolo2 $f\cdot \text{número} \) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(n\) un número entero. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{número} $simbolo1 $abs_k1 = $abs_k2 $simbolo2 $f\cdot \text{número} \)", "\( n $simbolo1 $abs_k1 = $abs_k2 $simbolo2 $f \cdot n \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( n $simbolo1 $abs_k1 = $abs_k2 $simbolo2 $f n \)", " "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(n\): +\[ + n $simbolo1 $abs_k1 = $abs_k2 $simbolo2 $f n \quad \text{entonces}\quad n = $answer. +\] +$PAR +Por lo tanto el número es \($answer\), o cualquier resultado equivalente. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_H.pg b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_H.pg new file mode 100644 index 0000000000..7e7c7613c9 --- /dev/null +++ b/Contrib/UPRM/Prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos_H.pg @@ -0,0 +1,152 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Porcientos: problemas lineales de aplicación (numericos) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/problemas_verbales_ecuaciones_lineales/problemas_verbales_numericos.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Ecuaciones lineales) +## DBsection(Aplicaciones) +## Level(1) +## KEYWORDS('ecuaciones','lineal','aplicacion') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Eligiendo el primer entero +$n = random(2,50); + +#los posibles factores del segundo entero +@factor = ("dos", "tres","cuatro","cinco","seis","siete","ocho","nueve"); +$index = random(0,7); + +#el factor del segundo entero +$f = $index+2; + +#el segundo entero +$m = $f*$n; + +$prob1 = random(0,1); +if ( $prob1 == 0 ){ + $ope = "suma"; + $valor = $n + $m; + $simbolo = "+"; +}else{ + $ope = "resta"; + $valor = $n - $m; + $simbolo = "-"; +} + +$prob2 = random(0,1); +if ( $prob2 == 0 ){ + $pregunta = "mayor"; + $answer = Compute($m); +}else{ + $pregunta = "menor"; + $answer = Compute($n); +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La $ope de dos números enteros positivos da como resultado $valor. Si el segundo de los números es $factor[$index] veces más grande que el primero, encontrar el número $pregunta. +$PAR +El número $pregunta es = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Ordenar la información del problema en una tabla +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Data$EBOLD", "$BBOLD Ecuación$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "Dos números tienen una $ope de $valor", " \( \text{primer número} $simbolo \text{segundo número} = $valor \) "], align=>LEFT, separation=>0). +AlignedRow( [ "El segundo es $factor[$index] veces más grande que el primero", " \( \text{segundo número} = $f\cdot \text{primer número} \) "], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$BBOLD Paso 2:$EBOLD Sea \(n\) el primer número. +$PAR +$BBOLD Paso 3:$EBOLD Llevar a cabo la sustitución necesaria con las igualdades en el Paso 1 para obtener una ecuación lineal: +$BR +$BR +$BCENTER +\{ + BeginTable(border=>1, tex_border=>"1pt", spacing=>0, padding=>4). + AlignedRow( [ "$BBOLD Ecuación$EBOLD", "$BBOLD Sustitución$EBOLD"], align=>CENTER, separation=>0). + AlignedRow( [ "\( \text{segundo número} = $f\cdot \text{primer número} \)", "\( \text{segundo número} = $f\cdot n = $f n \)"], align=>LEFT, separation=>0). + AlignedRow( [ "\( \text{primer número} $simbolo \text{segundo número} = $valor\)", "\( n $simbolo $f n = $valor \)"], align=>LEFT, separation=>0). +EndTable() +\} +$ECENTER +$BR +$PAR +$BBOLD Paso 4:$EBOLD Resolver la ecuación lineal para obtener el valor de \(n\): +\[ +n $simbolo $f n = $valor \quad \text{entonces}\quad n = $n. +\] +$PAR +$BBOLD Paso 5:$EBOLD +Usar el valor de \(n\) para obtener la información que buscamos en el problema verbal: +\[ +\begin{align*} + \text{Primer número: } & n = $n, \\[0.2cm] + \text{Segundo número: } & $f n = $m. +\end{align*} +\] +$PAR +Por lo tanto el número $pregunta es \($answer\). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/producto_binario/producto_binario_resta.pg b/Contrib/UPRM/Prebasica/producto_binario/producto_binario_resta.pg new file mode 100644 index 0000000000..1b146bcd47 --- /dev/null +++ b/Contrib/UPRM/Prebasica/producto_binario/producto_binario_resta.pg @@ -0,0 +1,124 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Expandir la multiplicación de dos binomios lineales. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu de los archivos +# pedro_prebasica/producto_binario/producto_binario_resta.db +# pedro_prebasica/producto_binario/producto_binario_suma.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Productos notables) +## DBsection(Expandir) +## Level(1) +## KEYWORDS('polinomios','productos','notables') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedPolynomial.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Creando el binomio 1 +$A = non_zero_random(-15,15); +$B = non_zero_random(-15,15); + +#Creando el binomio 2 +$C = non_zero_random(-15,15); +$D = non_zero_random(-15,15); + +$AC = $A*$C; +$AD = $A*$D; +$BC = $B*$C; +$BD = $B*$D; + +#Los coeficientes de la solución +$a = $A*$C; +$b = $A*$D+ $B*$C; +$c = $B*$D; + +$factor1 = Formula("$A x + $B")->reduce; +$factor2 = Formula("$C x + $D")->reduce; + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +#Se restringe sólo a polinomios, i.e., sumas de múltiplos de potencias de x +#Context("LimitedPolynomial"); + +#Limita también a sólo un monomio de cada grado +#Context("LimitedPolynomial")->flags->set(singlePowers=>1); + +#Adicionalmente, no permite operaciones entre coeficientes +Context("LimitedPolynomial-Strict"); + +$answer = Formula( "$a x^2 + $b x + $c" )->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Encuentre el producto de +\[ +($factor1)($factor2) +\] +Escribir el resultado en forma \( ax^2+bx+c \). +$PAR +Resultado: \{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Aplicar propiedad distributiva, multiplicando cada término del primer factor con cada uno del segundo factor. +\[ +($factor1)($factor2) = ($A x)($C x) + ($A x)($D) + ($B)($C x) + ($B)($D) +\] +$PAR +$BBOLD Paso 2:$EBOLD Agrupar términos semejantes y sumar y/o restar sus coeficientes. +\[ + = ($AC) x^2 + ($AD + $BC) x + ($BD) +\] +Por lo tanto la solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/producto_binario/producto_binarios_caso_especial_A.pg b/Contrib/UPRM/Prebasica/producto_binario/producto_binarios_caso_especial_A.pg new file mode 100644 index 0000000000..b92c30f102 --- /dev/null +++ b/Contrib/UPRM/Prebasica/producto_binario/producto_binarios_caso_especial_A.pg @@ -0,0 +1,125 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Expandir la multiplicación de un trinomio cuadrado perfecto +# escrito en la forma (A+B)^2 o (A+B)(A+B) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/producto_binario/producto_binarios_caso_especial.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Productos notables) +## DBsection(Expandir) +## Level(1) +## KEYWORDS('polinomios','productos','notables','cuadrado perfecto') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedPolynomial.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Creando el binomio +$A = non_zero_random(-15,15); +$B = non_zero_random(-15,15); + +$abs_B = abs($B); + +if ( $B > 0 ){ + $simbolo = "+"; +}else{ + $simbolo = "-"; +} + +$a = $A**2; +$b = 2*$A*$B; +$c = $B**2; + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +#aleatorizando la forma de presentar el ejercicio +if ( random(0,1) == 0 ){ + $forma = "($A x + $B)($A x + $B)"; +}else{ + $forma = "($A x + $B)^2" ; +} + +#Se restringe sólo a polinomios, i.e., sumas de múltiplos de potencias de x +#Context("LimitedPolynomial"); + +#Limita también a sólo un monomio de cada grado +#Context("LimitedPolynomial")->flags->set(singlePowers=>1); + +#Adicionalmente, no permite operaciones entre coeficientes +Context("LimitedPolynomial-Strict"); + +$answer = Formula( "$a x^2 + $b x + $c" )->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Encuentre el producto de +\[ +$forma +\] +Escribir el resultado en forma \(ax^2+bx + c\). +$PAR +Resultado: \{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Al aplicar el producto notable \( (A $simbolo B)^2 = (A $simbolo B)(A $simbolo B) = A^2 $simbolo 2AB + B^2 \), tenemos +\[ +$forma = ($A x)^2 $simbolo 2 ($A x)($abs_B) + $abs_B^2 +\] +$PAR +Simplificando, la solución es: +\[ +$answer +\] +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/producto_binario/producto_binarios_caso_especial_B.pg b/Contrib/UPRM/Prebasica/producto_binario/producto_binarios_caso_especial_B.pg new file mode 100644 index 0000000000..7ac79d38d0 --- /dev/null +++ b/Contrib/UPRM/Prebasica/producto_binario/producto_binarios_caso_especial_B.pg @@ -0,0 +1,115 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Expandir la diferencia de cuadrados + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/producto_binario/producto_binarios_caso_especial.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Productos notables) +## DBsection(Expandir) +## Level(1) +## KEYWORDS('polinomios','productos','notables','diferencia de cuadrados') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Creando los coeficientes del binomio +$a1 = non_zero_random(-15,15); +$a0 = non_zero_random(-15,15); + +@A = ($a1, $a0); +@B = ($a1, -$a0); + +#calculando el producto usando el macro PGpolynomialmacros.pl +@A_por_B = PolyMult(~~@A, ~~@B); + +#@vars = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'y', 'z'); +#$index = random(0,23); + +#Context()->variables->add($vars[$index]=>'Real'); + +#adicionando la variable x a cada parte usando el macro PGpolynomialmacros.pl +$polyA = PolyString(~~@A,x); +$polyB = PolyString(~~@B,x); +$polyA_por_B = PolyString(~~@A_por_B,x); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$out_A = Formula($polyA)->reduce(); +$out_B = Formula($polyB)->reduce(); + +$answer = Formula($polyA_por_B)->reduce(); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Resolver el siguiente producto +\[ +($out_A)($out_B) +\] +Escribir el resultado en forma \(ax^2- b\). +$PAR +Resultado: \{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Al aplicar el producto notable \( (A+B)(A-B) = A^2 - B^2 \), tenemos +\[ +($out_A)($out_B) = ($a1 x)^2 - ($a0)^2 +\] +$PAR +Simplificando, la solución es: +\[ +$answer +\] +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/producto_binario/producto_trinomio_por_binomio.pg b/Contrib/UPRM/Prebasica/producto_binario/producto_trinomio_por_binomio.pg new file mode 100644 index 0000000000..2aa7ab5d4f --- /dev/null +++ b/Contrib/UPRM/Prebasica/producto_binario/producto_trinomio_por_binomio.pg @@ -0,0 +1,134 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Expandir la multiplicación de un binomio por un trinomio. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/producto_binario/producto_trinomio_por_binomio.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Productos notables) +## DBsection(Expandir) +## Level(1) +## KEYWORDS('polinomios','productos','notables') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"contextLimitedPolynomial.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Creando el binomio, D x + E +$D = non_zero_random(-15,15); +$E = non_zero_random(-15,15); + +#Creando el trinomio, A x^2 + B x + C +$A = non_zero_random(-15,15); +$B = non_zero_random(-15,15); +$C = non_zero_random(-15,15); + +#Calculando los coeficientes del producto +$a = $A*$D; +$b = $A*$E + $B*$D; +$c = $B*$E + $C*$D; +$d = $C*$E; + +#productos usados en la solución +$AD = $A*$D; +$AE = $A*$E; +$BD = $B*$D; +$BE = $B*$E; +$CD = $C*$D; +$CE = $C*$E; + +#aleatorizando el orden del producto +if ( random(0,1) == 0 ){ + $factor1 = Formula("$A x^2 + $B x + $C")->reduce; + $factor2 = Formula("$D x + $E")->reduce; +}else{ + $factor2 = Formula("$A x^2 + $B x + $C")->reduce; + $factor1 = Formula("$D x + $E")->reduce; +} + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +#Se restringe sólo a polinomios, i.e., sumas de múltiplos de potencias de x +#Context("LimitedPolynomial"); + +#Limita también a sólo un monomio de cada grado +#Context("LimitedPolynomial")->flags->set(singlePowers=>1); + +#Adicionalmente, no permite operaciones entre coeficientes +Context("LimitedPolynomial-Strict"); + +$answer = Formula("$a x^3 + $b x^2 + $c x + $d")->reduce; + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Encuentre el producto de +\[ +($factor1)($factor2) +\] +Escribir el resultado en forma \( ax^3+bx^2+cx + d \). +$PAR +Resultado: \{ans_rule(20)\} \{ AnswerFormatHelp("formulas") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Aplicar propiedad distributiva, multiplicando cada término del primer factor con cada uno del segundo factor. +\[ + ($factor1)($factor2) = ($A x^2)($D x) + ($A x^2)($E) + ($B x)($D x) + ($B x)($E) + ($C)($D x) + ($C)($E) +\] +$PAR +$BBOLD Paso 2:$EBOLD Agrupar términos semejantes y sumar y/o restar sus coeficientes. +\[ + = ($AD) x^3 + ($AE + $BD) x^2 + ($BE + $CD) x + ($CE) +\] +Por lo tanto la solución es: \( $answer \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/punto_medio/punto_medio_geometria.pg b/Contrib/UPRM/Prebasica/punto_medio/punto_medio_geometria.pg new file mode 100644 index 0000000000..238f25188c --- /dev/null +++ b/Contrib/UPRM/Prebasica/punto_medio/punto_medio_geometria.pg @@ -0,0 +1,136 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Problema que pregunta por el punto medio (xm,ym) +# del segmento representado en el plano cartesiano +# por dos puntos dados +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/punto_medio/punto_medio_geometria.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Plano cartesiano) +## DBsection(Punto medio) +## Level(1) +## KEYWORDS('grafica', 'puntos','plano','coordenadas','segmento', 'punto medio') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"AnswerFormatHelp.pl", +"problemRandomize.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$refreshCachedImages=1; + +@eje = ("\(x\)", "\(y\)"); +$index = random(0,1,1); + +Context("Point"); +$A = Point(random(-9,9,1),random(-9,9,1)); +$B = Point(random(-9,9,1),random(-9,9,1)); + +#Extrayendo coordenadas de A, no se usa en este problema +($aA, $bA) = $A->value; +($aB, $bB) = $B->value; + +$gr = init_graph(-10,-10,10,10,axes=>[0,0],grid=>[10,10],size=>[450,450]); + +# adicionando los dos puntos +$gr->stamps( closed_circle($aA, $bA, 'blue') ); +$gr->stamps( closed_circle($aB, $bB, 'red') ); + +# adicionandole etiquetas a los puntos +$gr->lb(new Label($aA+0.1,$bA+.6,'A','blue','center','middle')); +$gr->lb(new Label($aB+0.1,$bB+.6,'B','red','center','middle')); + +#creando las opciones (puntos) + +$opcion1 = ($A-$B)/2; +$opcion2 = ($B-$A)/2; +$opcion3 = -($A+$B)/2; +$opcion4 = $A; +$opcion5 = $B; +$answer = ($A+$B)/2; + +$radio = RadioButtons( + [ + "$answer", + "$opcion1", + "$opcion2", + "$opcion3", + "$opcion4", + "$opcion5", + "Ninguna de estas" ], + "$answer", # correct answer + last => ["Ninguna de estas"], # can be a list +); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +\{ image(insertGraph($gr),width=>200,height=>200,tex_size=>450 ) \} +$BR +$BR +(Click en la gráfica para agrandar) +$ECENTER +$BR +Dado que \( (a,b) \) es el punto medio de los dos puntos mostrados en la gráfica anterior. Encuentre \( (a,b) \). +$BR +$BR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +############################################################## +# Answers +# + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El punto medio del segmento que une los puntos \( (x_1,y_1) \) y \( (x_2,y_2) \) se define por: +\[ + M = \left( \frac{x_1+x_2}{2}, \frac{y_1+y_2}{2} \right), +\] +luego para los puntos \($A\) y \($B\) se tiene que: +\[ + M = \left( \frac{$aA+$aB}{2}, \frac{$bA+$bB}{2} \right) = $answer +\] +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/punto_medio/punto_medio_variantes.pg b/Contrib/UPRM/Prebasica/punto_medio/punto_medio_variantes.pg new file mode 100644 index 0000000000..ba7b83655a --- /dev/null +++ b/Contrib/UPRM/Prebasica/punto_medio/punto_medio_variantes.pg @@ -0,0 +1,143 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dados dos puntos en una gráfica encontrar su distancia. +# +# Problema WebWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/distancia_dos_puntos/hallar_distancia_dada_grafica.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Plano cartesiano) +## DBsection(Distancia entre puntos) +## Level(1) +## KEYWORDS('grafica', 'puntos','plano','coordenadas','distancia') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"problemRandomize.pl", +"AnswerFormatHelp.pl" +); + +TEXT(beginproblem()); + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +Context("Point"); +$A = Point(random(-9,9,1),random(-9,9,1)); +$B = Point(random(-9,9,1),random(-9,9,1)); + +#Extrayendo coordenadas de A, B +($aA, $bA) = $A->value; +($aB, $bB) = $B->value; + +#Calculando el punto medio +$Pm = Point( ($aA+$aB)/2, ($bA+$bB)/2 ); + +#Extrayendo coordenadas de Pm +($aPm, $bPm) = $Pm->value; + +$opcion = random(0,8); + +if ( $opcion == 0 ){ + $var1 = "(x_1,y_1)"; + $var2 = "$B"; + $var3 = "$Pm"; + $pregunta = "x_1"; + $answer = Compute("$aA"); +}elsif( $opcion == 1 ){ + $var1 = "(x_1,y_1)"; + $var2 = "$B"; + $var3 = "$Pm"; + $pregunta = "y_1"; + $answer = Compute("$bA"); +}elsif( $opcion == 2 ){ + $var1 = "$A"; + $var2 = "(x_2,y_2)"; + $var3 = "$Pm"; + $pregunta = "x_2"; + $answer = Compute("$aB"); +}elsif( $opcion == 3 ){ + $var1 = "$A"; + $var2 = "(x_2,y_2)"; + $var3 = "$Pm"; + $pregunta = "y_2"; + $answer = Compute("$bB"); +}elsif( $opcion == 4 ){ + $var1 = "$A"; + $var2 = "$B"; + $var3 = "(x_m,y__m)"; + $pregunta = "x_m"; + $answer = Compute("$aPm"); +}elsif( $opcion == 5 ){ + $var1 = "$A"; + $var2 = "$B"; + $var3 = "(x_m,y_m)"; + $pregunta = "y_m"; + $answer = Compute($bPm); +}elsif( $opcion == 6 ){ + $var1 = "(x_1,y_1)"; + $var2 = "$B"; + $var3 = "$Pm"; + $pregunta = "(x_1,y_1)"; + $answer = Compute("$A"); +}elsif( $opcion == 7 ){ + $var1 = "$A"; + $var2 = "(x_2,y_2)"; + $var3 = "$Pm"; + $pregunta = "(x_2,y_2)"; + $answer = Compute("$B"); +}else{ + $var1 = "$A"; + $var2 = "$B"; + $var3 = "(x_m,y_m)"; + $pregunta = "(x_m,y_m)"; + $answer = Compute("$Pm"); +} + +BEGIN_TEXT +Dado que \( $var3 \) es el punto medio de \( $var1 \) y \( $var2 \), entonces el siguiente es el valor de \( $pregunta \): +$BR +$BR +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El punto medio del segmento que une los puntos \( A = (x_1,y_1) \) y \( B = (x_2,y_2) \) se define por: +\[ +P_m = (x_m, y_m), \quad \text{donde}\quad x_m = \frac{x_1 + x_2}{2} \quad \text{y}\quad y_m = \frac{y_1 + y_2}{2} +\] +$BBOLD Paso 1: $EBOLD Identificar los valores dados y el valor preguntado. \(A = $var1\) , \(B = $var2 \) y \( Pm = $var3 \). +$PAR +$BBOLD Paso 2: $EBOLD Sustituir en las ecuaciones +\[ +x_m = \frac{x_1 + x_2}{2} \quad \text{o}\quad y_m = \frac{y_1 + y_2}{2} +\] +$PAR +y despejar para el/los valor(es) preguntado(s) +\[ +$pregunta = $answer. +\] +Por lo tanto la respuesta es: \($answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/racionalizacionn/racionalizacion.pg b/Contrib/UPRM/Prebasica/racionalizacionn/racionalizacion.pg new file mode 100644 index 0000000000..237a7c9b17 --- /dev/null +++ b/Contrib/UPRM/Prebasica/racionalizacionn/racionalizacion.pg @@ -0,0 +1,128 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Racionalizar tipo a/sqrt{b} o a/(sqrt{b} + sqrt{c}) + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/Prebasica/racionalizacion/racionalizacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Radicales) +## DBsection(Racionalizacion) +## Level(1) +## KEYWORDS('racionalizacion','radicales', 'simplificar') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"PGauxiliaryFunctions.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +Context("Fraction-NoDecimals"); + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = non_zero_random(-50,50); +$b = random(2,50); +$c = random(2,50); + +$b_menos_c = $b-$c; + +($p1, $q1) = reduce($a,$b); +($p2, $q2) = reduce($a,$b_menos_c); + + +$prob = random(0,1); +if ( $prob == 0){ + $exp = "\frac{$a}{\sqrt{$b}}"; + $answer = Compute("$p1*sqrt($b)/$q1"); + $ans_text = "Como el denominador tiene un radical, si multiplicamos por este tanto en el denominador como en el numerador, o lo que es igual multiplicar por uno la expresión pero expresado como \( \frac{\sqrt{$b}}{\sqrt{$b}} = 1\), lo transformamos en +\[ + $exp = \frac{$a}{\sqrt{$b}} \cdot \frac{\sqrt{$b}}{\sqrt{$b}} = \frac{$a\sqrt{$b}}{$b} +\] +al simplificar de ser necesario, tenemos +\[ +\frac{$p1\sqrt{$b}}{$q1}. +\] +"; +}else{ + $exp = "\frac{$a}{\sqrt{$b} + \sqrt{$c}}"; + $answer = Compute(" ($p2*( sqrt($b)-sqrt($c) ) )/$q2"); + $ans_text = "Recordemos el producto especial \( (a+b)(a-b) = a^2-b^2 \). + $PAR + Como el denominador tiene dos términos, para racionalizar usamos el producto anterior. Luego, + \[ + \frac{$a}{ \sqrt{$b} + \sqrt{$c} } = \frac{$a}{ \sqrt{$b} + \sqrt{$c} }\cdot \frac{ \sqrt{$b} - \sqrt{$c} }{\sqrt{$b} - \sqrt{$c}} = \frac{$a(\sqrt{$b} - \sqrt{$c})}{ $b-$c } + \] +al simplificar de ser necesario, la solución es +\[ +\frac{$p2(\sqrt{$b} - \sqrt{$c})}{ $q2} +\] +"; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$PAR +$BBOLD Restringiendo la respuesta... en proceso$EBOLD +$PAR +$PAR +Racionalizar el denominador y simplificar completamente +\[ +$exp +\] +Contestación: \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$ans_text +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/sist_num-sol/sist_num_tut1.pg b/Contrib/UPRM/Prebasica/sist_num-sol/sist_num_tut1.pg new file mode 100644 index 0000000000..9b1c74e9fd --- /dev/null +++ b/Contrib/UPRM/Prebasica/sist_num-sol/sist_num_tut1.pg @@ -0,0 +1,228 @@ +# DESCRIPTION +# +# Tipo: Falso/Cierto +# Sistemas de numeración: dado un número real, decir si es entero, racional, irracional o no. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/sist_num-sol/sist_num_tut1.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas de numeración) +## DBsection(Conjuntos numéricos ) +## Level(1) +## KEYWORDS('racional','entero','irracional','numeros') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl", +"parserImplicitEquation.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Se elegirá el número entero, racional o irracional usando la variable +#aleatoria $prob + +$prob = random(0,2); +if ( $prob == 0 ){ #tipo 0: entero + + $r = random(-1000,1000); + + $explica = "Los enteros se definen como el conjunto \( \mathbb{Z} = \{ \ldots,-3,-2,-1,0,1,2,3,4,\ldots \} \), y \($r\) pertenece a este conjunto. "; + +}elsif( $prob == 1){ #tipo 1: racional de dos tipos, decimal o fracción + + $explica = "El conjunto de los números racionales se define como \( \mathbb{Q} = \{ x = \frac{p}{q} \mid p, q \in \mathbb{Z}, \text{ y } q\ne 0\} \). O equivalentemente, aquellos números decimales cuya parte decimal es finita o periódica. "; + + #eligiendo numerador "a" y denominador "b" diferentes + $a = random(-50,50); + do{ + #$b = non_zero_random(-50,50); + $b = list_random(2, 3, 5, 7, 11, 13, 37, 41); + }until ( gcd($b,$a) == 1 && $a != $b); + + #eligiendo si este racional será fracción o decimal + $frac = random(0,1); + if ( $frac == 0 ){ + Context("Numeric"); + $r = $a/$b; + $r = $r."..."; + $equi_r = "\frac{$a}{$b}"; + $adic_explica = "En este caso \( $r = $equi_r \) pertenece a este conjunto pues es un decimal finito o infinito periódico y se puede escribir en forma de fracción. "; + }else{ + $r = "\frac{$a}{$b}"; + $equi_r = $a/$b; + $equi_r = $equi_r."..."; + $adic_explica = "En este caso \($r\) pertenece a este conjunto pues claramente es fracción de dos enteros. "; + } + + $explica = $explica.$adic_explica; + +}else{ #tipo 2: irracional de tres tipos, decimal, raiz cuadrada de primo o con ope + + $explica = "El conjunto de los números irracionales se define como \( \mathbb{I} = \{ x \ne \frac{p}{q} \mid p, q \in \mathbb{Z}, \text{ y } q\ne 0\} \), es decir aquellos que no se pueden escribir en forma de fracción. Se debe tener cuidado pues muchas veces verificar que un número es irracional puede ser muy complicado. "; + + $irra = random(0,2); + if ( $irra == 0 ){ + $fix = random(2,9); + $rep = random(0,1); + $p_int = random(-100,100); + + #adicionando la parte entera a la cadena + $cadena = $p_int."."; + foreach my $i (0..5){ + + $cadena = $cadena.$fix; + foreach my $j (0..$i){ + $cadena = $cadena.$rep; + } + + } + $r = $cadena."..."; + $adic_explica = "En este caso \($r\) pertenece a este conjunto pues su parte decimal, aunque tiene un patrón, nunca tendrá periodo. Se puede demostrar que no es escribible en forma de fracción. "; + + }elsif( $irra == 1 ){ + + $a = list_random(2, 3, 5, 7, 11, 13, 17, 19, 23); + $r = "\sqrt{ $a }"; + $adic_explica = "En este caso \($r\) pertenece a este conjunto pues se puede probar que la raíz de un entero que no es un cuadrado perfecto es siempre irracional. "; + + }else{ + + $a = list_random(2, 3, 5, 7, 11, 13, 17, 19, 23); + $b = list_random("\pi", "e", "\sqrt{$a}"); + $c = random(1,9); + if ( random(0,1) == 0){ + $r = "\frac{$c}{\sqrt{$a}}"; + }else{ + $r = "\frac{$b}{$c}"; + } + + $adic_explica = "En este caso \($r\) pertenece a este conjunto pues se puede probar que la división entre irracionales y racionales diferentes de cero son siempre irracionales. "; + } + + $explica = $explica.$adic_explica; +} + +#cambiando el tipo y el valor de verdad para tener más variedad del ejercicio +if ( $prob == 0){ #recibiendo un entero + + $check = random(0,2); + if ( $check == 0 ){ + $tipo = "entero"; + $answer = "C"; + $explica = $explica."Por lo tanto el enunciado es CIERTO."; + }elsif( $check == 1 ){ + $tipo = "racional"; + $answer = "C"; + $explica = $explica."Todo número entero también es racional. Por lo tanto el enunciado es CIERTO."; + }else{ + $tipo = "irracional"; + $answer = "F"; + $explica = $explica."También, todo número entero es racional y el conjunto de los racionales es disjunto con el conjunto de los irracionales. Por lo tanto el enunciado es FALSO."; + } + +}elsif( $prob == 1 ){ #recibiendo un racional + + $check = random(0,2); + if ( $check == 0 ){ + $tipo = "racional"; + $answer = "C"; + $explica = $explica."Por lo tanto el enunciado es CIERTO."; + }elsif( $check == 1 ){ + $tipo = "entero"; + $answer = "F"; + $explica = $explica."Esta fracción no se puede reducir a un entero, por lo tanto el enunciado es FALSO."; + }else{ + $tipo = "irracional"; + $answer = "F"; + $explica = $explica."Los irracionales son un conjunto disjunto con los racionales, por lo tanto el enunciado es FALSO."; + } + +}else{ #recibiendo un irracional + + $check = random(0,2); + if ( $check == 0 ){ + $tipo = "irracional"; + $answer = "C"; + $explica = $explica."Por lo tanto el enunciado es CIERTO."; + }elsif( $check == 1 ){ + $tipo = "racional"; + $answer = "F"; + $explica = $explica." También, los racionales son un conjunto disjunto con los irracionales, por lo tanto el enunciado es FALSO."; + }else{ + $tipo = "entero"; + $answer = "F"; + $explica = $explica." También, los racionales son un conjunto disjunto con los irracionales, y todo entero es racional, por lo tanto el enunciado es FALSO."; + } + +} + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ( +"\( $r \) es un número $tipo.","$answer", +); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$explica +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/sist_num-sol/sist_num_tut2.pg b/Contrib/UPRM/Prebasica/sist_num-sol/sist_num_tut2.pg new file mode 100644 index 0000000000..211f1d158d --- /dev/null +++ b/Contrib/UPRM/Prebasica/sist_num-sol/sist_num_tut2.pg @@ -0,0 +1,176 @@ +# DESCRIPTION +# +# Tipo: Falso/Cierto +# Sistemas de numeración: propiedades de mult., adición e igualdad. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/sist_num-sol/sist_num_tut2.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Sistemas de numeración) +## DBsection(Propiedades) +## Level(1) +## KEYWORDS('racional','entero','irracional','numeros','propiedades') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl", +"parserRadioButtons.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@propiedades = ( +"Sean \(x, y\) números reales, entonces \( x\cdot y \) es un número real.", +"Sean \(x, y\) números reales, entonces \( x\cdot y = y\cdot x \).", +"Sean \(x, y\) y \(z\) números reales, entonces \( (x\cdot y)\cdot z = y\cdot (x\cdot z) \).", +"Sea \( x \) un número real, entonces existe un número real \(1\) tal que \( x\cdot 1 = 1\cdot x = x\).", +"Sean \(x, y\) números reales, entonces \( x + y \) es un número real.", +"Sea \( x \) un número real, entonces existe un número real \(0\) tal que \( x + 0 = 0 + x = x\).", +"Sea \( x \) un número real, entonces existe un número real \(-x\) tal que \( x + (-x) = (-x) + x = 0\).", +"Sean \(x, y\) y \(z\) números reales, entonces \( (x + y) + z = y + (x + z) \).", +"Sean \(x, y\) números reales, entonces \( x + y = y + x \).", +"Sean \(x, y\) y \(z\) números reales, entonces \( x = y \) y \( y = z \Rightarrow x = z \).", +"Sean \(x, y\) números reales, entonces \( x = y \Rightarrow y = x \).", +"Sea \(x\) un número real, entonces \( x = x \).", +); + +@nombre = ( +"Clausura", +"Conmutativa", +"Asociativa", +"Elemento identidad", +"Clausura", +"Elemento neutro", +"Opuesto aditivo", +"Asociativa", +"Conmutativa", +"Transitiva", +"Simétrica", +"Reflexiva" +); + + +$index = random(0,$#propiedades); + +Context("Numeric"); + +if ( $index <4 ){ + + $pregunta = "multiplicación"; + + $radio = RadioButtons([ + "Clausura", + "Conmutativa", + "Asociativa", + "Elemento identidad", + "Ninguna de las otras"], + "$nombre[$index]", + last => ["Ninguna de las otras"], + ); + +}elsif ( 3 < $index && $index < 9 ){ + + $pregunta = "adición"; + + $radio = RadioButtons([ + "Clausura", + "Elemento neutro", + "Opuesto aditivo", + "Asociativa", + "Conmutativa", + "Ninguna de las otras"], + "$nombre[$index]", + last => ["Ninguna de las otras"], + ); + +}else{ + + $pregunta = "igualdad"; + + $radio = RadioButtons([ + "Transitiva", + "Simétrica", + "Reflexiva", + "Ninguna de las otras"], + "$nombre[$index]", + last => ["Ninguna de las otras"], + ); + +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Considere la siguiente expresión: +$BCENTER +$PAR + $propiedades[$index] +$PAR +$ECENTER +¿Cuál propiedad de los $BBOLD Axiomas de $pregunta$EBOLD se muestra en la expresión de arriba? +$PAR +\{ $radio->buttons() \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 0; + +ANS( $radio->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El enunciado: +$BCENTER +$PAR + $propiedades[$index] +$PAR +$ECENTER +es la Propiedad: +$BCENTER +$BBOLD$nombre[$index]$EBOLD de los $BBOLD Axiomas de $pregunta$EBOLD. +$ECENTER +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_calcular_valor.pg b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_calcular_valor.pg new file mode 100644 index 0000000000..18f6730337 --- /dev/null +++ b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_calcular_valor.pg @@ -0,0 +1,140 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Variacion directa: Buscar la relacion a=kl, a y l dados. Y calcular a o l dado uno de ellos. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/variacion_directa/variacion_directa_calcular_valor.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Variacion directa) +## Level(1) +## KEYWORDS('relaciones','variacion','directa') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@frase = ("varía directamente con","es directamente proporcional a","es proporcional a"); +$indice = random(0,2); + +#posibles variables a usar +@vars = ("a","b","c","d","e","f", "g","h","i","l","m","n","o","p","q","r","s", "t","u","v","w","x","y","z"); + +#eligiendo la primera variable +$index1 = random(0,23); + +#la segunda variable diferente a la primera +do{ + $index2 = random(0,23); +}until($index2 != $index1); + +#creando la relación a=kb +$b = random(5,50); +$k = random(2,9); +$a = $k*$b; + +Context(Fraction); + +$prob = random(0,1); +if ( $prob == 0){ + $valor_a_calcular = "$vars[$index1]"; + $var_dada = "$vars[$index2]"; + + do { + $valor = random(2,50); + }until ($valor != $b); + + $answer = Compute("$k*$valor"); + $text1 = "$vars[$index1] = $k\cdot $valor"; +}else{ + $valor_a_calcular = "$vars[$index2]"; + $var_dada = "$vars[$index1]"; + + do { + $valor = random(2,50); + } until ($valor != $a); + + $answer = Fraction($valor,$k); + $text1 = "$valor = $k\cdot $vars[$index2]"; +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Se tiene que \( $vars[$index1] \) $frase[$indice] \( $vars[$index2] \). Si \( $vars[$index1] = $a \) cuando \( $vars[$index2] = $b \), calcule el valor de \( $valor_a_calcular \) cuando \( $var_dada = $valor\). +$PAR +\( $valor_a_calcular \) = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Traducir el enunciado a una fórmula de variación directa +\[ + $vars[$index1] \text{ $frase[$indice] } $vars[$index2] \quad \Rightarrow\quad $vars[$index1] = k\cdot $vars[$index2] +\] +donde \( k \) es la constante de proporcionalidad. +$PAR +$BBOLD Paso 2:$EBOLD Sustituir valores conocidos para encontrar \( k \) +\[ + $a = k\cdot $b \quad \Rightarrow\quad k = \frac{$a}{$b} = $k +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir el valor de \( k \) y escribir la fórmula +\[ + $vars[$index1] = $k $vars[$index2] +\] +$PAR +$BBOLD Paso 4:$EBOLD Queremos saber el valor de \($valor_a_calcular\) cuando \($var_dada\) es \($valor\) +\[ +$text1 \quad \Rightarrow\quad $valor_a_calcular = $answer. +\] +Por lo tanto el valor de \( $valor_a_calcular \) es \( $answer \) cuando \( $var_dada = $valor \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_constante_de_proporcionalidad_y_formula.pg b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_constante_de_proporcionalidad_y_formula.pg new file mode 100644 index 0000000000..e2ded1455b --- /dev/null +++ b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_constante_de_proporcionalidad_y_formula.pg @@ -0,0 +1,133 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Variacion directa: Buscar la relacion a=kl, a y l dados. Y calcular a o l dado uno de ellos. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/variacion_directa/variacion_directa_calcular_valor.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Variacion directa) +## Level(1) +## KEYWORDS('relaciones','variacion','directa') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl", +"parserImplicitEquation.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@frase = ("varía directamente con","es directamente proporcional a","es proporcional a"); +$indice = random(0,2); + +#posibles variables a usar +@vars = ("a","b","c","d","e","f", "g","h","i","l","m","n","o","p","q","r","s", "t","u","v","w","z"); + +#eligiendo la primera variable +$index1 = random(0,21); + +#la segunda variable diferente a la primera +do{ + $index2 = random(0,21); +}until($index2 != $index1); + +#creando la relación a=kb +$b = random(5,50); +$k = random(2,9); +$a = $k*$b; + +Context()->variables->add($vars[$index1] => 'Real', $vars[$index2] => 'Real'); + +$prob = random(0,1); +if ( $prob == 0 ){ + $preg = " escriba la fórmula para la relación entre \($vars[$index1]\) y \( $vars[$index2] \)."; + $answer = ImplicitEquation("$vars[$index1] = $k $vars[$index2]"); + $etiqueta = "Fórmula: "; +}else{ + $preg = "determine el valor de la constante de proporcionalidad."; + $answer = Compute($k); + $etiqueta = "\( k =\)"; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +$BR +\($vars[$index1]\) $frase[$indice] \($vars[$index2]\) +$ECENTER +$BR +Si \( $vars[$index1] = $a\) cuando \( $vars[$index2] = $b \), $preg +$PAR +$etiqueta \{ans_rule(20)\} \{ AnswerFormatHelp("formula") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Traducir el enunciado a una fórmula de variación directa +$BCENTER +$BR +\($vars[$index1]\) $frase[$indice] \($vars[$index2] \) entonces \( $vars[$index1] = k\cdot $vars[$index2] \), +$PAR +$ECENTER +donde \( k \) es la constante de proporcionalidad. +$PAR +$BBOLD Paso 2:$EBOLD Sustituir valores conocidos para encontrar \( k \) +\[ + $a = k\cdot $b \quad \Rightarrow\quad k = \frac{$a}{$b} = $k +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir el valor de \( k \) y escribir la fórmula +\[ + $vars[$index1] = $k $vars[$index2]. +\] +$PAR +Por lo tanto la solución es \( $answer \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_definicion.pg b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_definicion.pg new file mode 100644 index 0000000000..21488a6a9e --- /dev/null +++ b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_definicion.pg @@ -0,0 +1,130 @@ +# DESCRIPTION +# +# Tipo: Falso/Cierto +# Variacion directa: dada una relación decir si es directa o no. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/variacion_directa/variacion_directa_definicion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Definición) +## Level(1) +## KEYWORDS('relaciones','variacion','directa') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl", +"parserImplicitEquation.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@frase = ("varía directamente con","es directamente proporcional a","es proporcional a"); +$indice = random(0,2); + +#posibles variables a usar +@vars = ("a","b","c","d","e","f", "g","h","i","l","m","n","o","p","q","r","s", "t","u","v","w","z"); + +#eligiendo la primera variable +$index1 = random(0,21); + +#la segunda variable diferente a la primera +do{ + $index2 = random(0,21); +}until($index2 != $index1); + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("El enunciado +$BCENTER +\( $vars[$index1] \) $frase[$indice] \( $vars[$index2] \) +$ECENTER +$PAR +se representa algebraicamente como \( $vars[$index1] = k $vars[$index2] \), para algún número real constante \(k\).", "C", +"El enunciado +$BCENTER +\( $vars[$index1] \) $frase[$indice] \( $vars[$index2] \) +$ECENTER +$PAR +se representa algebraicamente como \( $vars[$index1] = \frac{k}{$vars[$index2]} \), para algún número real constante \(k\).","F", +"El enunciado +$BCENTER +\( $vars[$index2] \) $frase[$indice] \( $vars[$index1] \) +$ECENTER +$PAR +se representa algebraicamente como \( $vars[$index1] = k $vars[$index2] \), para algún número real constante \(k\).","C", +"El enunciado +$BCENTER +\( $vars[$index2] \) $frase[$indice] \( $vars[$index1] \) +$ECENTER +$PAR +se representa algebraicamente como \( $vars[$index2] = \frac{k}{$vars[$index1]} \), para algún número real constante \(k\).","F", +); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El enunciado es +\{ $tf_list_ptr -> print_a \} +$BR +pues, \( $vars[$index1] \) $frase[$indice] \( $vars[$index2] \), se representa algebraicamente como \( $vars[$index1] = k $vars[$index2] \), o equivalentemente \( $vars[$index2] = k' $vars[$index1] \) +para algún valor real \( k \) o \( k'\) respectivamente. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion_A.pg b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion_A.pg new file mode 100644 index 0000000000..9aba603ed6 --- /dev/null +++ b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion_A.pg @@ -0,0 +1,128 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Variacion directa: Problemas de aplicación + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Variacion directa) +## Level(1) +## KEYWORDS('relaciones','variacion','directa','aplicaciones') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@frase = ("varía directamente con el","es directamente proporcional al","es proporcional al"); +$index1 = random(0,2); + +@movil = ("un automovil","una motocicleta"); +$index2 = random(0,1); + +#creando la relación a=kb +$k = random(2,15); + +$f = Formula("$k x"); +$b1 = random(1,9); +$fb1 = $f->eval(x=>$b1); + +$b2 = random(5,50); +$fb2 = $f->eval(x=>$b2); + +$prob = random(0,1); +if ( $prob == 0){ + $pregunta = "cuál es la distancia recorrida en $b2 horas"; + $answer = Compute($fb2); + $sustituir = "d = $k t \quad \Rightarrow \quad d = $k\cdot $b2 \quad \Rightarrow \quad d = $fb2."; +}else{ + $pregunta = "cuántas horas duró en recorrer $fb2 kilómetros"; + $answer = Compute($b2); + $sustituir = "d = $k t \quad \Rightarrow \quad $fb2 = $k t \quad \Rightarrow \quad t = $b2."; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +La distancia que recorre $movil[$index2] $frase[$index1] tiempo que realiza el recorrido. Si recorre una distancia de $fb1 kilómetros en $b1 hora(s), entonces $pregunta. +$PAR +(ESCRIBIR sólo el número) +$PAR +Contestación: = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Traducir el enunciado a una fórmula de variación directa +$BCENTER +$PAR +La distancia $frase[$index1] tiempo \(\quad \Rightarrow \quad \text{distancia} = k\cdot \text{tiempo} \) +$PAR +$ECENTER +donde \( k \) es la constante de proporcionalidad. +$PAR +$BBOLD Paso 2:$EBOLD Sustituir valores conocidos para encontrar \( k \). Como la distancia es $fb1 kilómetros y el tiempo son $b1 horas, entonces +\[ + $fb1 = k\cdot $b1 \quad \Rightarrow \quad k = \frac{$fb1}{$b1} = $k +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir el valor de \( k \) y escribir la fórmula +\[ + \text{distancia} = $k\cdot\text{tiempo} \quad \text{o} \quad d = $k t. +\] +$PAR +$BBOLD Paso 4:$EBOLD Queremos saber $pregunta, entonces sustituyendo en la ecuación anterior +\[ +$sustituir +\] +Por lo tanto la solución es $answer. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion_B.pg b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion_B.pg new file mode 100644 index 0000000000..b77015d816 --- /dev/null +++ b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion_B.pg @@ -0,0 +1,129 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Variacion directa: Problemas de aplicación + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Variacion directa) +## Level(1) +## KEYWORDS('relaciones','variacion','directa','aplicaciones') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@frase = ("varía directamente con el","es directamente proporcional al","es proporcional al"); +$index1 = random(0, $#frase); + +@pueblo = ("Mayagüez","Ponce","San Juan", "Cabo Rojo", "Cayey", "Lares"); +$index2 = random(0, $#pueblo); + +#creando la relación a=kb +$k = random(500,2000); + +$f = Formula("$k x"); +$b1 = random(100,200); +$fb1 = $f->eval(x=>$b1); + + +$b2 = random(201,600); +$fb2 = $f->eval(x=>$b2); + +$prob = random(0,1); +if ( $prob == 0){ + $pregunta = "¿cuál es el costo de una casa de $b2 pies cuadrados?"; + $answer = Compute($fb2); + $sustituir = "c = $k t \quad \Rightarrow \quad c = $k\cdot $b2 \quad \Rightarrow \quad c = $fb2."; +}else{ + $pregunta = "¿cuál es el tamaño de la casa que cuesta $fb2?"; + $answer = Compute($b2); + $sustituir = "c = $k t \quad \Rightarrow \quad $fb2 = $k t \quad \Rightarrow \quad t = $b2."; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +El costo de una casa en $pueblo[$index2] $frase[$index1] tamaño de la casa. Una casa de $b1 pies cuadrados cuesta $$fb1, $pregunta +$PAR +(NO escribir el símbolo $) +$PAR +Contestación: = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Traducir el enunciado a una fórmula de variación directa +$BCENTER +$PAR +Costo de una casa $frase[$index1] tamaño de la casa \(\quad \Rightarrow \quad \text{costo} = k\cdot \text{tamaño} \) +$PAR +$ECENTER +donde \( k \) es la constante de proporcionalidad. +$PAR +$BBOLD Paso 2:$EBOLD Sustituir valores conocidos para encontrar \( k \) +\[ + $fb1 = k\cdot $b1 \quad \Rightarrow \quad k = \frac{$fb1}{$b1} = $k +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir el valor de \( k \) y escribir la fórmula +\[ + \text{costo} = $k\cdot\text{tamaño} \quad \text{o} \quad c = $k t. +\] +$PAR +$BBOLD Paso 4:$EBOLD Identificar variables conocidas y sustituir los valores en la fórmula +\[ +$sustituir +\] +Por lo tanto la solución es $answer. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion_C.pg b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion_C.pg new file mode 100644 index 0000000000..4e93f0c4ae --- /dev/null +++ b/Contrib/UPRM/Prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion_C.pg @@ -0,0 +1,126 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Variacion directa: Problemas de aplicación + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/variacion_directa/variacion_directa_problemas_de_aplicacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Variacion directa) +## Level(1) +## KEYWORDS('relaciones','variacion','directa','aplicaciones') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@frase = ("varía directamente con el","es directamente proporcional al","es proporcional al"); +$index = random(0, $#frase); + +#creando la relación a=kb +$k = random(0.1,0.2,0.01); + +$f = Formula("$k x"); +$b1 = random(8000,40000); +$fb1 = $f->eval(x=>$b1); + + +$b2 = random(8000,40000); +$fb2 = $f->eval(x=>$b2); + +$prob = random(0,1); +if ( $prob == 0){ + $pregunta = "¿cuál es el impuesto sobre ventas de un coche nuevo que tiene un precio de venta de $b2?"; + $answer = Compute($fb2); + $sustituir = "i = $k p \quad \Rightarrow \quad i = $k\cdot $b2 \quad \Rightarrow \quad i = $fb2."; +}else{ + $pregunta = "¿cuál es el precio de venta de un coche nuevo que tiene un impuesto sobre ventas de $fb2?"; + $answer = Compute($b2); + $sustituir = "i = $k p \quad \Rightarrow \quad $fb2 = $k p \quad \Rightarrow \quad p = $b2."; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +El importe del impuesto sobre ventas de un auto nuevo $frase[$index] precio de venta del auto. Si un auto de $b1 paga $fb1 de impuesto sobre ventas, $pregunta +$PAR +(NO escribir el símbolo $) +$PAR +Contestación: = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Traducir el enunciado a una fórmula de variación directa +$BCENTER +$PAR +Impuesto sobre ventas $frase[$index1] precio de venta \(\quad \Rightarrow \quad \text{impuesto sobre ventas} = k\cdot \text{precio de venta} \) +$PAR +$ECENTER +donde \( k \) es la constante de proporcionalidad. +$PAR +$BBOLD Paso 2:$EBOLD Sustituir valores conocidos para encontrar \( k \) +\[ + $fb1 = k\cdot $b1 \quad \Rightarrow \quad k = \frac{$fb1}{$b1} = $k +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir el valor de \( k \) y escribir la fórmula +\[ + \text{impuesto sobre ventas} = $k\cdot\text{precio de venta} \quad \text{o} \quad i = $k p. +\] +$PAR +$BBOLD Paso 4:$EBOLD Identificar variables conocidas y sustituir los valores en la fórmula +\[ +$sustituir +\] +Por lo tanto la solución es $answer. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_calcular_valor.pg b/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_calcular_valor.pg new file mode 100644 index 0000000000..2ad455295f --- /dev/null +++ b/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_calcular_valor.pg @@ -0,0 +1,141 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Variacion inversa: Buscar la relacion a=b/k, a y b dados. Y calcular a o b dado uno de ellos. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/variacion_inversa/variacion_inversa_calcular_valor.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Variacion indirecta) +## Level(1) +## KEYWORDS('relaciones','variacion','indirecta') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@frase = ("varía inversamente con","es inversamente proporcional a"); +$indice = random(0,$#frase); + +#posibles variables a usar +@vars = ("a","b","c","d","e","f", "g","h","i","l","m","n","o","p","q","r","s", "t","u","v","w","x","y","z"); + +#eligiendo la primera variable +$index1 = random(0,$#vars); + +#la segunda variable diferente a la primera +do{ + $index2 = random(0,$#vars); +}until($index2 != $index1); + +#creando la relación a=k/b +$b = random(5,50); +$a = random(2,9); +$k = $a*$b; + +Context(Fraction); + +$prob = random(0,1); +if ( $prob == 0){ + $valor_a_calcular = "$vars[$index1]"; + $var_dada = "$vars[$index2]"; + do { + $valor = random(2,50); + }until ($valor != $b); + $answer = Compute("$k/$valor"); + $text1 = "$vars[$index1] = \frac{$k}{$valor}"; +}else{ + $valor_a_calcular = "$vars[$index2]"; + $var_dada = "$vars[$index1]"; + do { + $valor = random(2,9); + }until ($valor != $a); + $answer = Compute("$valor*$k"); + $text1 = "$valor =\frac{$k}{$vars[$index2]}"; +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +$PAR +\( $vars[$index1] \) $frase[$indice] \( $vars[$index2] \). +$PAR +$ECENTER +Si \( $vars[$index1] = $a \) cuando \( $vars[$index2] = $b \), calcule el valor de \( $valor_a_calcular \) cuando \( $var_dada = $valor\). +$PAR +\( $valor_a_calcular \) = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Traducir el enunciado a una fórmula de variación inversa +\[ + $vars[$index1] \text{ $frase[$indice] } $vars[$index2] \quad \Rightarrow\quad $vars[$index1] = \frac{k}{ $vars[$index2]} +\] +donde \( k \) es la constante de proporcionalidad. +$PAR +$BBOLD Paso 2:$EBOLD Sustituir valores conocidos para encontrar \( k \) +\[ + $a = \frac{k}{$b} \quad \Rightarrow\quad k = $a\cdot $b = $k +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir el valor de \( k \) y escribir la fórmula +\[ + $vars[$index1] = \frac{$k} {$vars[$index2] } +\] +$PAR +$BBOLD Paso 4:$EBOLD Identificar variables conocidas y sustituir los valores en la fórmula +\[ +$text1 \quad \Rightarrow\quad $valor_a_calcular = $answer. +\] +Por lo tanto el valor de \( $valor_a_calcular \) es \( $answer \) cuando \( $var_dada = $valor \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_constante_de_proporcionalidad_y_formula.pg b/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_constante_de_proporcionalidad_y_formula.pg new file mode 100644 index 0000000000..4b21bd6817 --- /dev/null +++ b/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_constante_de_proporcionalidad_y_formula.pg @@ -0,0 +1,137 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Variacion inversa: Buscar la relacion a=k/b, a y b dados. Y calcular a o b dado uno de ellos. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/variacion_inversa/variacion_inversa_constante_de_proporcionalidad_y_formula.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Variacion inversa) +## Level(1) +## KEYWORDS('relaciones','variacion','inversa') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl", +"parserAssignment.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@frase = ("varía inversamente con","es inversamente proporcional a"); +$indice = random(0,$#frase); + +#posibles variables a usar +@vars = ("a","b","c","d","e","f", "g","h","i","l","m","n","o","p","q","r","s", "t","u","v","w","z"); + +#eligiendo la primera variable +$index1 = random(0,$#vars); + +#la segunda variable diferente a la primera +do{ + $index2 = random(0,$#vars); +}until($index2 != $index1); + +#creando la relación a=k/b +$a = random(5,50); +$b = random(2,9); +$k = $a*$b; + +Context("Numeric")->variables->add($vars[$index1] => 'Real', $vars[$index2] => 'Real'); +parser::Assignment->Allow; + +$prob = random(0,1); +if ( $prob == 0 ){ + $preg = " escriba la fórmula para la relación entre \($vars[$index1]\) y \( $vars[$index2] \)."; + $answer = Formula("$vars[$index1] = $k/$vars[$index2]"); + $etiqueta = "Fórmula: "; + $pasoAdicional = " + $BBOLD Paso 3:$EBOLD Sustituir el valor de \( k \) y escribir la fórmula + \[ + $vars[$index1] = \frac{ $k }{ $vars[$index2] }. + \] + $PAR"; +}else{ + $preg = "determine el valor de la constante de proporcionalidad."; + $answer = Compute($k); + $etiqueta = "\( k = \)"; + $pasoAdicional =""; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +$BCENTER +$BR +\($vars[$index1]\) $frase[$indice] \($vars[$index2]\) +$ECENTER +$BR +Si \( $vars[$index1] = $a\) cuando \( $vars[$index2] = $b \), $preg +$PAR +$etiqueta \{ans_rule(20)\} \{ AnswerFormatHelp("formula") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Traducir el enunciado a una fórmula de variación inversa +$BCENTER +$BR +\($vars[$index1]\) $frase[$indice] \($vars[$index2] \) entonces \( $vars[$index1] = \frac{ k }{ $vars[$index2] }\), +$PAR +$ECENTER +donde \( k \) es la constante de proporcionalidad. +$PAR +$BBOLD Paso 2:$EBOLD Sustituir valores conocidos para encontrar \( k \) +\[ + $a = \frac{k}{$b} \quad \Rightarrow\quad k = $a\cdot $b = $k +\] +$PAR +$pasoAdicional +Por lo tanto la solución es \( $answer \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_definicion.pg b/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_definicion.pg new file mode 100644 index 0000000000..9f608d15ed --- /dev/null +++ b/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_definicion.pg @@ -0,0 +1,129 @@ +# DESCRIPTION +# +# Tipo: Falso/Cierto +# Variacion inversa: dada una relación decir si es inversa o no. + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/variacion_inversa/variacion_inversa_definicion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Definición) +## Level(1) +## KEYWORDS('relaciones','variacion','inversa') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl", +"parserImplicitEquation.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +@frase = ("varía inversamente con","es inversamente proporcional a"); +$indice = random(0,$#frase); + +#posibles variables a usar +@vars = ("a","b","c","d","e","f", "g","h","i","l","m","n","o","p","q","r","s", "t","u","v","w","z"); + +#eligiendo la primera variable +$index1 = random(0,$#vars); + +#la segunda variable diferente a la primera +do{ + $index2 = random(0,$#vars); +}until($index2 != $index1); + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("El enunciado: +$BCENTER +\( $vars[$index1] \) $frase[$indice] \( $vars[$index2] \) +$ECENTER +$PAR +se representa algebraicamente como \( $vars[$index1] = \frac{k}{$vars[$index2]} \), para algún número real constante \(k\).", "C", +"El enunciado: +$BCENTER +\( $vars[$index1] \) $frase[$indice] \( $vars[$index2] \) +$ECENTER +$PAR +se representa algebraicamente como \( $vars[$index1] = \frac{$vars[$index2]}{k} \), para algún número real constante \(k\).","F", +"El enunciado: +$BCENTER +\( $vars[$index2] \) $frase[$indice] \( $vars[$index1] \) +$ECENTER +$PAR +se representa algebraicamente como \( $vars[$index1] = k $vars[$index2] \), para algún número real constante \(k\).","F", +"El enunciado: +$BCENTER +\( $vars[$index2] \) $frase[$indice] \( $vars[$index1] \) +$ECENTER +$PAR +se representa algebraicamente como \( $vars[$index1] = \frac{k}{$vars[$index2]} \), para algún número real constante \(k\).","C", +); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +El enunciado es +\{ $tf_list_ptr -> print_a \} +$BR +pues, \( $vars[$index1] \) $frase[$indice] \( $vars[$index2] \), se representa algebraicamente como \( $vars[$index1] = \frac{k}{$vars[$index2]} \) o equivalentemente \( $vars[$index2] = \frac{k}{$vars[$index1]} \) para algún valor real \( k \). +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_problemas_de_aplicacion_A.pg b/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_problemas_de_aplicacion_A.pg new file mode 100644 index 0000000000..42a00f509e --- /dev/null +++ b/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_problemas_de_aplicacion_A.pg @@ -0,0 +1,153 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Variacion inversa: Problemas de aplicación + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/variacion_inversa/variacion_inversa_problemas_de_aplicacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Variacion inversa) +## Level(1) +## KEYWORDS('relaciones','variacion','inversa','aplicaciones') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#creando la relación a=k/b +@primos = (2, 3, 5); + +@factors_k = (); +$k = 1; + +#Eligiendo a k como una multiplicación de 5 primos de la lista de primos. +foreach my $i (0..4){ + $r = random(0,$#primos); + @factors_k[$i] = $primos[$r]; + $k = $k*$primos[$r]; +} + +#Eligiendo de los 5 factores de k (mínimo 3, máximo 4) cuantos serán para a y el resto para b +$num_fact_a = random(1,3); + +$a = 1; +foreach my $i (0..$num_fact_a){ + $a = $a*$factors_k[$i]; +} + +$b = 1; +foreach my $i ($num_fact_a+1 .. $#factors_k){ + $b = $b*$factors_k[$i]; +} + +#Eligiendo otra partición diferente de k y asignandola a a1 y b1. +do { + $num_fact_a1 = random(1,3); +}until( $num_fact_a1 != $num_fact_a ); + +$a1 = 1; +foreach my $i (0..$num_fact_a1){ + $a1 = $a1*$factors_k[$i]; +} + +$b1 = 1; +foreach my $i ($num_fact_a1+1 .. $#factors_k){ + $b1 = $b1*$factors_k[$i]; +} + +$prob = random(0,1); +if ( $prob == 0){ + $pregunta = "¿Cuántos trabajadores se necesitan para terminar el proyecto en $a1 días?"; + $answer = Compute($b1); + $sustituir = "t = \frac{$k}{n} \quad \Rightarrow \quad $a1 = \frac{$k}{n} \quad \Rightarrow \quad n = $b1."; +}else{ + $pregunta = "¿Cuántos días se necesitan para terminar el proyecto utilizando $b1 trabajadores?"; + $answer = Compute($a1); + $sustituir = "t = \frac{$k}{n} \quad \Rightarrow \quad t = \frac{$k}{$b1} \quad \Rightarrow \quad t = $a1."; +} + + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +El tiempo para completar un proyecto es inversamente proporcional al número de personas que está haciendo el proyecto. El proyecto puede ser completado por $b trabajadores en $a días. $pregunta +$PAR +(Escribir SOLO el número) +$PAR +Contestación: = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Traducir el enunciado a una fórmula de variación inversa +$BCENTER +$PAR +Tiempo inversamente proporcional al número de trabajadores \(\quad \Rightarrow \quad \text{tiempo} = \frac{k}{\text{número de trabajadores}}\) +$PAR +$ECENTER +donde \( k \) es la constante de proporcionalidad. +$PAR +$BBOLD Paso 2:$EBOLD Sustituir valores conocidos para encontrar \( k \). +\[ + $a = \frac{k}{$b} \quad \Rightarrow \quad k = $a\cdot$b = $k +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir el valor de \( k \) y escribir la fórmula +\[ +\text{tiempo} = \frac{$k}{\text{número de trabajadores}} \quad \text{o} \quad t = \frac{$k}{n} +\] +$PAR +$BBOLD Paso 4:$EBOLD Identificar variables conocidas y sustituir los valores en la fórmula +\[ +$sustituir +\] +Por lo tanto la solución es $answer. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_problemas_de_aplicacion_B.pg b/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_problemas_de_aplicacion_B.pg new file mode 100644 index 0000000000..4534900f85 --- /dev/null +++ b/Contrib/UPRM/Prebasica/variacion_inversa/variacion_inversa_problemas_de_aplicacion_B.pg @@ -0,0 +1,152 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Variacion inversa: Problemas de aplicación + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/variacion_inversa/variacion_inversa_problemas_de_aplicacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Variacion inversa) +## Level(1) +## KEYWORDS('relaciones','variacion','inversa','aplicaciones') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl", +"unionTables.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#creando la relación a=k/b +@primos = (2, 3, 5); + +@factors_k = (); +$k = 1; + +#Eligiendo a k como una multiplicación de 5 primos de la lista de primos. +foreach my $i (0..3){ + $r = random(0,$#primos); + @factors_k[$i] = $primos[$r]; + $k = $k*$primos[$r]; +} + +#Eligiendo de los 4 factores de k (mínimo 2, máximo 3) cuántos serán para a y el resto para b +$num_fact_a = random(1,2); + +$a = 1; +foreach my $i (0..$num_fact_a){ + $a = $a*$factors_k[$i]; +} + +$b = 1; +foreach my $i ($num_fact_a+1 .. $#factors_k){ + $b = $b*$factors_k[$i]; +} + +#Eligiendo otra partición diferente de k y asignandola a a1 y b1. +do { + $num_fact_a1 = random(1,2); +}until( $num_fact_a1 != $num_fact_a ); + +$a1 = 1; +foreach my $i (0..$num_fact_a1){ + $a1 = $a1*$factors_k[$i]; +} + +$b1 = 1; +foreach my $i ($num_fact_a1+1 .. $#factors_k){ + $b1 = $b1*$factors_k[$i]; +} + +$prob = random(0,1); +if ( $prob == 0){ + $pregunta = "el ancho del rectángulo cuando longitud es $a1 pies"; + $answer = Compute($b1); + $sustituir = "l = \frac{$k}{a} \quad \Rightarrow \quad $a1 = \frac{$k}{a} \quad \Rightarrow \quad a = $b1."; +}else{ + $pregunta = "la longitud del rectángulo cuando el ancho es $b1 pies."; + $answer = Compute($a1); + $sustituir = "l= \frac{$k}{a} \quad \Rightarrow \quad l = \frac{$k}{$b1} \quad \Rightarrow \quad l = $a1."; +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Sea un rectángulo con área constante. La longitud de un rectángulo varía inversamente con su ancho. Si la longitud de un rectángulo es $a pies cuando el ancho es $b pies, encontrar $pregunta +$PAR +(Escribir SOLO el número) +$PAR +Contestación: = \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD Traducir el enunciado a una fórmula de variación inversa +$BCENTER +$PAR +La longitud varía inversamente con la anchura \(\quad \Rightarrow \quad \text{longitud} = \frac{k}{\text{anchura}}\) +$PAR +$ECENTER +donde \( k \) es la constante de proporcionalidad. +$PAR +$BBOLD Paso 2:$EBOLD Sustituir valores conocidos para encontrar \( k \). +\[ + $a = \frac{k}{$b} \quad \Rightarrow \quad k = $a\cdot$b = $k +\] +$PAR +$BBOLD Paso 3:$EBOLD Sustituir el valor de \( k \) y escribir la fórmula +\[ +\text{longitud} = \frac{$k}{\text{anchura}} \quad \text{o} \quad l = \frac{$k}{a} +\] +$PAR +$BBOLD Paso 4:$EBOLD Identificar variables conocidas y sustituir los valores en la fórmula +\[ +$sustituir +\] +Por lo tanto la solución es $answer. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/verificacion_puntos_interceptos_ecuacion_recta/interceptos_ejes_algebraicamente.pg b/Contrib/UPRM/Prebasica/verificacion_puntos_interceptos_ecuacion_recta/interceptos_ejes_algebraicamente.pg new file mode 100644 index 0000000000..0a894b47fe --- /dev/null +++ b/Contrib/UPRM/Prebasica/verificacion_puntos_interceptos_ecuacion_recta/interceptos_ejes_algebraicamente.pg @@ -0,0 +1,106 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Dada una recta en la forma y = mx + b, encontrar el intercepto en x o y + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/verificacion_puntos_interceptos_ecuacion_recta/verificacion_puntos_interceptos_ecuacion_recta.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Rectas) +## DBsection(Interceptos) +## Level(1) +## KEYWORDS('lineas','recta','interceptos') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$m = non_zero_random(-20,20); +$b = random(-20,20); + +$eq = Formula("$m x + $b")->reduce; + +Context("Fraction"); +$prob = random(0,1); +if ($prob == 0){ + $answer = Compute("$b")->reduce(); + $punto = "(0,a)"; + $eje = "y"; + $usar = "y = m(0) +b"; + $accion ="simplificamos"; +}else{ + $answer = Fraction(-$b,$m)->reduce(); + $punto = "(a,0)"; + $eje = "x"; + $usar = "0 = mx +b"; + $accion ="despejamos"; +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Sea \( $punto \) el punto de intercepción con el eje \( $eje \) de la recta +\[ +y = $eq. +\] +Calcule el valor de \( a \). +$PAR +\(a = \) \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp(studentsMustReduceFractions=>1) ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +$BBOLD Paso 1:$EBOLD La recta está escrita en la forma \(y = mx + b\). Para el intercepto en \($eje\) usamos \($usar\) y $accion para \($eje\). +$PAR +Por lo tanto, la respuesta es: \(a = $answer\) +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/verificacion_puntos_interceptos_ecuacion_recta/verificar_puntos_ecuacion_A.pg b/Contrib/UPRM/Prebasica/verificacion_puntos_interceptos_ecuacion_recta/verificar_puntos_ecuacion_A.pg new file mode 100644 index 0000000000..150da3ce35 --- /dev/null +++ b/Contrib/UPRM/Prebasica/verificacion_puntos_interceptos_ecuacion_recta/verificar_puntos_ecuacion_A.pg @@ -0,0 +1,133 @@ +# DESCRIPTION +# +# Tipo: respuesta corta +# Encontrar el valor y o x del punto (a,y) o (x,a) +# de las relaciones tipo: y = a\sqrt{x}, o, ax + by = c, o, y = ax^2+bx+c + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/verificacion_puntos_interceptos_ecuacion_recta/verificar_puntos_ecuacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Puntos) +## Level(1) +## KEYWORDS('relaciones','puntos','verificar') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +$a = non_zero_random(-5,5); +$b = non_zero_random(-20,20); +$c = random(-20,20); + +#Eligiendo un x a evaluar +$x = random(2,16); + +#Eligiendo la relación a mostrar +$prob = random(0,2); +if ($prob == 0){ + $eq = Formula("$a*sqrt(x) + $c")->reduce; + $y = $eq->eval(x=>$x); + $eq_text = "$y = $a\sqrt{x} + $c"; + $tipo = "al radical"; + $sustituye_x = "y = $a\sqrt{$x} + $c"; + $sustituye_y = "$y = $a\sqrt{x} + $c"; +}elsif($prob == 1){ + $eq = Formula("(-$a x + $c)/$b")->reduce; + $y = $eq->eval(x=>$x); + $eq_text = "$a x + $b y = $c"; + $tipo = "a la recta"; + $sustituye_x = "$a($x) + $b y = $c"; + $sustituye_y = "$a x + $b($y) = $c"; +}else{ + $eq = Formula("$a x^2 + $b x + $c")->reduce; + $y = $eq->eval(x=>$x); + $eq_text = "y = $a x^2 + $b x + $c"; + $tipo = "a la parábola"; + $sustituye_x = "y = $a($x)^2 + $b($x) + $c"; + $sustituye_y = "$y = $a x^2 + $b x + $c"; +} + +$prob = random(0,1); +if ($prob == 0){ + $var = "x"; + $var_dada = "y=$y"; + $punto = "(x,$y)"; + $answer = Compute($x); + $sustituye = $sustituye_y; +}else{ + $var = "y"; + $var_dada = "x=$x"; + $punto = "($x,y)"; + $answer = Compute($y); + $sustituye = $sustituye_x; +} + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Encontrar el valor de \($var\) del punto \( $punto \) que pertenece $tipo +\[ +$eq_text. +\] +\($var = \) \{ans_rule(20)\} \{ AnswerFormatHelp("number") \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( $answer->cmp() ); + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Al sustituir \($var_dada\) en la ecuación \($eq_text\) tenemos +\[ +$sustituye, +\] +por lo tanto la solución es $answer. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/UPRM/Prebasica/verificacion_puntos_interceptos_ecuacion_recta/verificar_puntos_ecuacion_B.pg b/Contrib/UPRM/Prebasica/verificacion_puntos_interceptos_ecuacion_recta/verificar_puntos_ecuacion_B.pg new file mode 100644 index 0000000000..a517fbb955 --- /dev/null +++ b/Contrib/UPRM/Prebasica/verificacion_puntos_interceptos_ecuacion_recta/verificar_puntos_ecuacion_B.pg @@ -0,0 +1,125 @@ +# DESCRIPTION +# +# Tipo: falso/cierto +# Determinar si un punto pertenece a la relación. y = a\sqrt{x}, o, ax + by = c, o, y = ax^2+bx+c + +# Problema WeBWork escrito por Edwin Florez, +# +# +# Adaptado desde el sistema quiz.uprm.edu del archivo +# pedro_prebasica/verificacion_puntos_interceptos_ecuacion_recta/verificar_puntos_ecuacion.db +# +# ENDDESCRIPTION + +## DBsubject(Prebasica) +## DBchapter(Relaciones) +## DBsection(Puntos) +## Level(1) +## KEYWORDS('relaciones','verificar') +## Author(Edwin Florez) +## Institution(UPRM) +## Language(es) + +DOCUMENT(); + +loadMacros( +"PGstandard.pl", +"MathObjects.pl", +"PGgraphmacros.pl", +"contextInequalities.pl", +"AnswerFormatHelp.pl", +"PGchoicemacros.pl", +"contextFraction.pl", +"problemRandomize.pl", +"PGpolynomialmacros.pl" +); + +TEXT(beginproblem()); +#$refreshCachedImages = 1; + +# Allow for the user to try another version of the problem once they get it correct. +ProblemRandomize(when=>"Correct",onlyAfterDue=>0); + +# Show which answers are correct and which ones are incorrect +#$showPartialCorrectAnswers = 0; + +############################################################## +# Setup + +$a = non_zero_random(-5,5); +$b = non_zero_random(-20,20); +$c = random(-20,20); + +$p = random(2,16); + +#Eligiendo la relación a mostrar +$prob = random(0,2); +if ($prob == 0){ + $eq = Formula("$a*sqrt(x) + $c")->reduce; + $eq_text = "y = $a\sqrt{x} + $c"; +}elsif($prob == 1){ + $eq = Formula("(-$a x + $c)/$b")->reduce; + $eq_text = "$a x + $b y = $c"; +}else{ + $eq = Formula("$a x^2 + $b x + $c")->reduce; + $eq_text = "y = $a x^2 + $b x + $c"; +} + +#Valor y cuando x = p +$y = $eq->eval(x=>$p); + +#Eligiendo aleatoriamente si (p,q) pertenece o no a la relación anterior. +$bool = random(0,1); +if ($bool == 0){ + $q = $eq->eval(x=>$p); + $valor = "C"; +}else{ + $q = non_zero_random(-5,5); + $valor = "F"; +} + +#Si se aplica el método reduce() al Contexto Formula, no usa estas reglas al +#aplicar las técnicas de reducción a expresiones. +Context()->noreduce('(-x)-y','(-x)+y'); + +## Set up a true-false list by creating a new select list object. +## $tf_list_ptr points to a new select list object. +$tf_list_ptr = new_select_list(); + +## Now assign to the true-false list object an array of +## "question", "answer" pairs from which a subset will be selected. +## +$tf_list_ptr -> qa ("El punto \( ($p,$q) \) pertenece a la ecuación +\[ +$eq_text +\]", $valor); + +## Choose one of the possible question-answer pairs +$tf_list_ptr -> choose(1); + +############################################################## +# +# Text +# + +Context()->texStrings; +BEGIN_TEXT +Determine si la siguiente proposición es cierta o falsa. Entre $BBOLD C $EBOLD para cierta o $BBOLD F $EBOLD para falsa. +\{ $tf_list_ptr -> print_q \} +END_TEXT +Context()->normalStrings; + +#Context("Numeric"); +############################################################## +# Answers +# + +ANS( str_cmp( $tf_list_ptr->ra_correct_ans ) ) ; + +Context()->texStrings; +SOLUTION(EV3(<<'END_SOLUTION')); +Al sustituir \(x = $p\) en \($eq_text\) tenemos que \( y = $y\), por lo tanto la respuesta es $valor. +END_SOLUTION +Context()->normalStrings; + +ENDDOCUMENT(); \ No newline at end of file