// Numbas version: exam_results_page_options {"name": "Inequalities que involucra valor absoluto", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Inequalities que involucra valor absoluto", "preamble": {"css": "", "js": ""}, "ungrouped_variables": ["choice", "sym", "a", "c", "d", "b", "leadCoeff", "prod", "one", "rootList", "r1", "r2", "strict", "backChoice", "backsym", "extremeY", "backprod", "dr", "hole", "nonhole"], "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Inequality involving a single absolute value, question solution uses the piecewise nature of the absolute value function.

"}, "variable_groups": [], "tags": [], "advice": "

Short-cut Method

\n

\n

For questions of this type (where the absolute value is 'less than' or 'less than and equal to' something positive) we can set out our working in a shorter way:

\n

\n

\\begin{alignat}{2} &&|\\simplify{{a}x+{b}}| &\\var{latex(sym)} \\var{c}\\\\ \\var{-c} &\\var{latex(sym)}&\\simplify{{a}x+{b}}&\\var{latex(sym)}\\var{c}\\\\ \\var{-c-b} &\\var{latex(sym)} &\\simplify{{a}x}\\quad&\\var{latex(sym)}\\var{c-b}.\\end{alignat}

\n

\n

\n

Cases Method

\n

\n

Recall that the absolute value is defined as the piecewise function \$|x|=\\begin{cases}x, &\\text{ for } x\\ge 0\\\\ -x, &\\text{ for } x<0. \\end{cases}\$

\n

This means that $|\\simplify{{a}x+{b}}|$ is actually $\\simplify{{a}x+{b}}$ when $\\simplify{{a}x+{b}}\\ge 0$ but it is $-(\\simplify{{a}x+{b}})$ when $\\simplify{{a}x+{b}}<0$. We have two cases:

\n

\n

Case 1: $\\simplify{{a}x+{b}}\\ge 0$

\n

Rearranging $\\simplify{{a}x+{b}}\\ge 0$ for $x$ gives $x \\ge \\simplify[fractionNumbers]{{-b/a}}$ $x \\le \\simplify[fractionNumbers]{{-b/a}}$ and so case 1 is only relevant for $x \\ge \\simplify[fractionNumbers]{{-b/a}}$ $x \\le \\simplify[fractionNumbers]{{-b/a}}$.

\n

In case 1, our inequality is simply $\\simplify{{a}x+{b}} \\var{latex(sym)} \\var{c}$, and so rearranging it for $x$ gives $x \\var{latex(sym)} \\simplify[fractionNumbers,simplifyFractions,!unitDenominator]{{(c-b)/a}}$ $x \\var{latex(backsym)} \\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(c-b)/a}}$

\n

So in conclusion for case 1, we require that $x \\ge \\simplify[fractionNumbers]{{-b/a}}$ $x \\le \\simplify[fractionNumbers]{{-b/a}}$   and  $x \\var{latex(sym)} \\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(c-b)/a}}$ $x \\var{latex(backsym)} \\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(c-b)/a}}$ which is the same as $\\simplify[fractionNumbers]{-{b/a}}\\le x\\var{latex(sym)} \\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(c-b)/a}}$ $\\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(c-b)/a}}\\var{latex(sym)} x\\le \\simplify[fractionNumbers]{{-b/a}}$ $x\\var{latex(sym)}\\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(c-b)/a}}$ $x\\var{latex(backsym)}\\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(c-b)/a}}$.

\n

\n

Case 2: $\\simplify{{a}x+{b}}< 0$

\n

Rearranging $\\simplify{{a}x+{b}}< 0$ for $x$ gives $x < \\simplify[fractionNumbers]{{-b/a}}$ $x > \\simplify[fractionNumbers]{{-b/a}}$ and so case 2 is only relevant for $x < \\simplify[fractionNumbers]{{-b/a}}$ $x > \\simplify[fractionNumbers]{{-b/a}}$.

\n

In case 2, our inequality is actually $-(\\simplify{{a}x+{b}}) \\var{latex(sym)} \\var{c}$, and so rearranging it for $x$ gives $x \\var{latex(backsym)} \\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(-c-b)/a}}$ $x \\var{latex(sym)} \\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(-c-b)/a}}$

\n

So in conclusion for case 2, we require that $x < \\simplify[fractionNumbers]{-{b/a}}$ $x > \\simplify[fractionNumbers]{-{b/a}}$  and  $x \\var{latex(backsym)} \\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(-c-b)/a}}$ $x \\var{latex(sym)} \\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(-c-b)/a}}$ which is the same as $\\simplify[fractionNumbers]{{-(b+c)/a}}\\var{latex(sym)} x< \\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{-b}/{a}}$ $\\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{-b/a}}< x \\var{latex(sym)} \\simplify[fractionNumbers,simplifyFractions,unitDenominator]{-{(b+c)/a}}$ $x\\var{latex(backsym)}\\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(-c-b)/a}}$ $x\\var{latex(sym)}\\simplify[fractionNumbers,simplifyFractions,unitDenominator]{{(-c-b)/a}}$.

\n

\n

Therefore the solution to our original inequality $|\\simplify{{a}x+{b}}| \\var{latex(sym)} \\var{c}$ is

\n

\$\\var[fractionNumbers]{r1}<x<\\var[fractionNumbers]{r2}.\$

\n

\$\\var[fractionNumbers]{r1}\\le x \\le\\var[fractionNumbers]{r2}.\$

\n

\$x< \\var[fractionNumbers]{r1}, \\, x> \\var[fractionNumbers]{r2}. \$

\n

\$x\\le \\var[fractionNumbers]{r1}, \\, x\\ge\\var[fractionNumbers]{r2}. \$

\n

\n

\n

", "variables": {"prod": {"group": "Ungrouped variables", "name": "prod", "templateType": "anything", "definition": "leadCoeff*choice", "description": ""}, "r2": {"group": "Ungrouped variables", "name": "r2", "templateType": "anything", "definition": "rootList[1]", "description": "

r2

"}, "backsym": {"group": "Ungrouped variables", "name": "backsym", "templateType": "anything", "definition": "['>','\\\\ge','<','\\\\le'][backChoice-1]", "description": ""}, "hole": {"group": "Ungrouped variables", "name": "hole", "templateType": "anything", "definition": "-b/d", "description": ""}, "backprod": {"group": "Ungrouped variables", "name": "backprod", "templateType": "anything", "definition": "leadCoeff*backchoice", "description": ""}, "b": {"group": "Ungrouped variables", "name": "b", "templateType": "anything", "definition": "random(-12..12 except 0)", "description": ""}, "c": {"group": "Ungrouped variables", "name": "c", "templateType": "anything", "definition": "random(1..12)", "description": ""}, "a": {"group": "Ungrouped variables", "name": "a", "templateType": "anything", "definition": "random(-12..12 except 0)", "description": ""}, "nonhole": {"group": "Ungrouped variables", "name": "nonhole", "templateType": "anything", "definition": "(a-b*c)/(c*d-1)", "description": ""}, "dr": {"group": "Ungrouped variables", "name": "dr", "templateType": "anything", "definition": "r2-r1", "description": ""}, "d": {"group": "Ungrouped variables", "name": "d", "templateType": "anything", "definition": "random(-12..12 except -1..1)", "description": "

d

"}, "extremeY": {"group": "Ungrouped variables", "name": "extremeY", "templateType": "anything", "definition": "(r2-r1)^2/4\n\n//abs((c*b-a)*b-(b*(d*d-1)+d*(c*b-a))^2/(4*d*(c*d-1)))", "description": "

approx of the furthest we need to plot in the y direction

"}, "rootList": {"group": "Ungrouped variables", "name": "rootList", "templateType": "anything", "definition": "sort([(-b-c)/a,(-b+c)/a])", "description": ""}, "strict": {"group": "Ungrouped variables", "name": "strict", "templateType": "anything", "definition": "if(choice=1 or choice=3,true,false)", "description": ""}, "r1": {"group": "Ungrouped variables", "name": "r1", "templateType": "anything", "definition": "rootList[0]", "description": "

r1

"}, "backChoice": {"group": "Ungrouped variables", "name": "backChoice", "templateType": "anything", "definition": "mod(choice+1,4)+1", "description": ""}, "one": {"group": "Ungrouped variables", "name": "one", "templateType": "anything", "definition": "if(choice=3 or choice=4,true,false)", "description": ""}, "leadCoeff": {"group": "Ungrouped variables", "name": "leadCoeff", "templateType": "anything", "definition": "sign(a)", "description": ""}, "sym": {"group": "Ungrouped variables", "name": "sym", "templateType": "anything", "definition": "['>','\\\\ge','<','\\\\le'][choice-1]", "description": ""}, "choice": {"group": "Ungrouped variables", "name": "choice", "templateType": "anything", "definition": "random(1..4)", "description": ""}}, "statement": "

You are given the inequality \$|\\simplify{{a}x+{b}}| \\var{latex(sym)} \\var{c}.\$

\n

", "variablesTest": {"maxRuns": 100, "condition": ""}, "functions": {"graph": {"type": "html", "parameters": [], "language": "javascript", "definition": "a = Numbas.jme.unwrapValue(scope.variables.leadcoeff);\nr1 = Numbas.jme.unwrapValue(scope.variables.r1);\nr2 = Numbas.jme.unwrapValue(scope.variables.r2);\nprod = Numbas.jme.unwrapValue(scope.variables.backprod);\ndr=Numbas.jme.unwrapValue(scope.variables.dr);\nexy=Numbas.jme.unwrapValue(scope.variables.extremey);\nhole = Numbas.jme.unwrapValue(scope.variables.hole);\nnonhole = Numbas.jme.unwrapValue(scope.variables.nonhole);\n\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',{boundingBox:[r1-dr,1.2*exy,r2+dr,-1.2*exy],grid:true,axis:false});\nvar board = div.board;\n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,2],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,10],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0,\n});\n\n\n\nif(prod==2 || prod==4 || prod==-2 || prod==-4){ptColour = 'green';} else {ptColour = 'red';};\n\nboard.create('point',[hole,0],{fixed:true,withLabel:false,strokeColour:'red', fillColor:'red'});\nboard.create('point',[nonhole,0],{fixed:true,withLabel:false,strokeColor:ptColour,fillColor:ptColour});\n\nif(prod==2 || prod==-4 || prod== 1 || prod==-3){ outColour = 'green';} else {outColour = 'red';};\nif(prod==-2 || prod==4 || prod== -1 || prod==3){inColour = 'green';} else {inColour = 'red';};\n\nboard.create('functiongraph',[function(x){return a*(x**2-(r1+r2)*x+r1*r2);},r1,r2],{strokeColor:inColour,strokeWidth:2});\nboard.create('functiongraph',[function(x){return a*(x**2-(r1+r2)*x+r1*r2);},r1-dr,r1],{strokeColor:outColour,strokeWidth:2});\nboard.create('functiongraph',[function(x){return a*(x**2-(r1+r2)*x+r1*r2);},r2,r2+dr],{strokeColor:outColour,strokeWidth:2});\n\nreturn div;"}}, "extensions": ["jsxgraph"], "parts": [{"marks": 0, "gaps": [{"displayType": "dropdownlist", "displayColumns": 0, "scripts": {"mark": {"script": "// apply the normal marking algorithm for this part\nthis.__proto__.mark.apply(this);\n// store whether the student said \"one interval\" in an attribute that's easier to access\nthis.one = this.ticks[0][0];", "order": "instead"}}, "showFeedbackIcon": true, "choices": ["

one interval.

", "

two intervals.

"], "shuffleChoices": false, "marks": 0, "maxMarks": 0, "showCorrectAnswer": true, "matrix": ["if(one=true,1,0)", "if(one=false,1,0)"], "minMarks": 0, "variableReplacementStrategy": "originalfirst", "distractors": ["", ""], "variableReplacements": [], "type": "1_n_2"}, {"maxValue": "r1", "marks": 1, "showFeedbackIcon": true, "allowFractions": true, "type": "numberentry", "correctAnswerFraction": true, "minValue": "r1", "mustBeReduced": false, "showCorrectAnswer": true, "mustBeReducedPC": 0, "scripts": {}, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "correctAnswerStyle": "plain"}, {"displayType": "dropdownlist", "displayColumns": 0, "scripts": {}, "showFeedbackIcon": true, "choices": ["

<

", "

"], "shuffleChoices": false, "marks": 0, "maxMarks": 0, "showCorrectAnswer": true, "matrix": ["if(one=true and strict=true,1,0)", "if(one=true and strict=false,1,0)"], "minMarks": 0, "variableReplacementStrategy": "originalfirst", "distractors": ["", ""], "variableReplacements": [], "type": "1_n_2"}, {"displayType": "dropdownlist", "displayColumns": 0, "scripts": {}, "showFeedbackIcon": true, "choices": ["

<

", "

"], "shuffleChoices": false, "marks": 0, "maxMarks": 0, "showCorrectAnswer": true, "matrix": ["if(one=true and strict=true,1,0)", "if(one=true and strict=false,1,0)"], "minMarks": 0, "variableReplacementStrategy": "originalfirst", "distractors": ["", ""], "variableReplacements": [], "type": "1_n_2"}, {"maxValue": "r2", "marks": 1, "showFeedbackIcon": true, "allowFractions": true, "type": "numberentry", "correctAnswerFraction": true, "minValue": "r2", "mustBeReduced": false, "showCorrectAnswer": true, "mustBeReducedPC": 0, "scripts": {}, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "correctAnswerStyle": "plain"}, {"displayType": "dropdownlist", "displayColumns": 0, "scripts": {}, "showFeedbackIcon": true, "choices": ["

<

", "

"], "shuffleChoices": false, "marks": 0, "maxMarks": 0, "showCorrectAnswer": true, "matrix": ["if(one=false and strict=true,1,0)", "if(one=false and strict=false,1,0)"], "minMarks": 0, "variableReplacementStrategy": "originalfirst", "distractors": ["", ""], "variableReplacements": [], "type": "1_n_2"}, {"maxValue": "r1", "marks": 1, "showFeedbackIcon": true, "allowFractions": true, "type": "numberentry", "correctAnswerFraction": true, "minValue": "r1", "mustBeReduced": false, "showCorrectAnswer": true, "mustBeReducedPC": 0, "scripts": {}, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "correctAnswerStyle": "plain"}, {"displayType": "dropdownlist", "displayColumns": 0, "scripts": {}, "showFeedbackIcon": true, "choices": ["

>

", "

"], "shuffleChoices": false, "marks": 0, "maxMarks": 0, "showCorrectAnswer": true, "matrix": ["if(one=false and strict=true,1,0)", "if(one=false and strict=false,1,0)"], "minMarks": 0, "variableReplacementStrategy": "originalfirst", "distractors": ["", ""], "variableReplacements": [], "type": "1_n_2"}, {"maxValue": "r2", "marks": 1, "showFeedbackIcon": true, "allowFractions": true, "type": "numberentry", "correctAnswerFraction": true, "minValue": "r2", "mustBeReduced": false, "showCorrectAnswer": true, "mustBeReducedPC": 0, "scripts": {}, "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "correctAnswerStyle": "plain"}], "showCorrectAnswer": true, "prompt": "

The solution to the above inequality

\n

\n
\n

Given by the condition [[1]] [[2]] $x$ [[3]] [[4]].

\n
\n
\n

Given by the condition, $x$ [[5]] [[6]] or $x$ [[7]] [[8]].

\n