// Numbas version: exam_results_page_options {"name": "Number of Solutions Discriminant", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "ungrouped_variables": ["num_roots", "a", "b", "c", "d", "c1", "c2"], "functions": {}, "tags": [], "name": "Number of Solutions Discriminant", "metadata": {"description": "

Some impossible-looking questions about quadratic equations which can be solved with a bit of thinking.

", "licence": "Creative Commons Attribution 4.0 International"}, "variables": {"c": {"templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": "", "definition": "switch(\n num_roots=0,\n random(100*b^2..200*b^2),\n num_roots=1,\n (b/2)^2,\n num_roots=2,\n random(1..round(b^2/400)#100)\n)"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": "", "definition": "if(num_roots=1,random(1..12)*100,2*random(100..200))"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": "", "definition": "1"}, "c2": {"templateType": "anything", "group": "Ungrouped variables", "name": "c2", "description": "", "definition": "random(1,1)*(random(2000..9000)*10+random(1..9#2))"}, "c1": {"templateType": "anything", "group": "Ungrouped variables", "name": "c1", "description": "", "definition": "random(1,1)*(random(2000..9000)*10+random(1..9#2))"}, "num_roots": {"templateType": "anything", "group": "Ungrouped variables", "name": "num_roots", "description": "

Number of roots

", "definition": "random(0,1,2)"}, "d": {"templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": "", "definition": "random(1000..20000)*random(-1,1)"}}, "statement": "

These questions might look impossible, but they're not: you can find the answers without doing any long calculations.

", "variable_groups": [], "parts": [{"marks": 1, "variableReplacements": [], "minValue": "if(d>0,0,2)", "correctAnswerFraction": false, "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "allowFractions": false, "mustBeReduced": false, "maxValue": "if(d>0,0,2)", "type": "numberentry", "prompt": "

How many real solutions does the following equation have?

\n

$\\simplify{x^2+{d}} = 0$

", "scripts": {}, "mustBeReducedPC": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst"}, {"marks": 1, "variableReplacements": [], "minValue": "num_roots", "correctAnswerFraction": false, "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "allowFractions": false, "mustBeReduced": false, "maxValue": "num_roots", "type": "numberentry", "prompt": "

How many real solutions does the following equation have?

\n

$\\simplify{ {a}x^2+{b}x+{c} } = 0$

", "scripts": {}, "mustBeReducedPC": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst"}, {"showFeedbackIcon": true, "matrix": ["1", "1", 0, 0, 0, 0], "marks": 0, "variableReplacements": [], "displayColumns": 0, "minAnswers": 0, "showCorrectAnswer": true, "warningType": "none", "maxAnswers": 0, "prompt": "

Select the numbers below which are solutions to the equation

\n

$\\simplify{ x^2+{-c1-c2}x + {c1*c2}} = 0$

", "shuffleChoices": true, "displayType": "checkbox", "choices": ["

$\\var{c1}$

", "

$\\var{c2}$

", "

$\\var{mod(c1,100)}$

", "

$\\var{c1-mod(c1,10)}$

", "

$\\var{c2+mod(c1,10)}$

", "

$\\var{c1+c2-mod(c1,100)}$

"], "type": "m_n_2", "scripts": {}, "maxMarks": 0, "distractors": ["", "", "", "", "", ""], "minMarks": 0, "variableReplacementStrategy": "originalfirst"}], "preamble": {"js": "", "css": ""}, "advice": "

#### a)

\n

Rearrange the equation:

\n

\$\\simplify{x^2 = {-d}} \$

\n

Any number squared is positive, so this equation has {if(d>0,'no','two')} solutions.

\n

#### b)

\n

The discriminant of a quadratic equation show how many roots the equation has.

\n

\n

\$x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a} \$

\n

The value of $\\sqrt{b^2-4ac}$ is called the discriminant, and the number of solutions to the equation depends on whether it is positive, negative, or zero:

\n
\n
• If the discriminant is positive, there are two solutions to the equation.
• \n
• If the discriminant is zero, the equation only has one solution.
• \n
• If the discriminant is negative, the equation has no real solutions.
• \n
\n

In this case, $a = 1$, $b = \\var{b}$ and $c = \\var{c}$.

\n

Since $a = 1$, the discriminant can be written $\\sqrt{b^2-4c}$.

\n

We can tell that $b^2$ will have $\\var{2*floor(log(b,10))+if(b/10^floor(log(b,10))>=sqrt(10),2,1)}$ digits. $c = \\var{c}$ has $\\var{ceil(log(c,10))}$ digits.

\n

So, $b^2-4c$ is clearly {switch(num_roots=2,'positive',num_roots=0,'negative','zero')}, so the equation has {num_roots} real {pluralise(num_roots,'root','roots')}.

\n

#### c)

\n

In a quadratic equation $x^2+bx+c$, $-b$ is the sum of the two roots of the equation and $c$ is their product.

\n

So, we first need to find a pair of numbers which sum to $\\var{c1+c2}$. In fact, there are three pairs:

\n
\n
• $\\var{mod(c1,100)}$ and $\\var{c1+c2-mod(c1,100)}$;
• \n
• $\\var{c1-mod(c1,10)}$ and $\\var{c2+mod(c1,10)}$;
• \n
• $\\var{c1}$ and $\\var{c2}$.
• \n
\n

The pair whose product is equal to $\\var{c1*c2}$ are the solutions to the equation. We can work out which pair it is without doing the (very long!) multiplication.

\n
\n
• $\\var{mod(c1,100)} \\times \\var{c1+c2-mod(c1,100)}$ will not have as many digits as $\\var{c1*c2}$, so we can reject it.
• \n
• $\\var{c1-mod(c1,10)}$ and $\\var{c2+mod(c1,10)}$ are both even, while $\\var{c1*c2}$ is odd.
• \n
• So $\\var{c1}$ and $\\var{c2}$ must be the solutions.
• \n
", "extensions": [], "variablesTest": {"condition": "", "maxRuns": 100}, "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Johnny Yi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2810/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Johnny Yi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2810/"}]}