// Numbas version: finer_feedback_settings {"name": "Mathematical expressions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Mathematical expressions", "tags": [], "metadata": {"description": "
This question gives information on how to answer mathematical expression parts, and some opportunities to try submitting answers.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "\n", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": "#everything table td:nth-child(2) {\n text-align: left;\n padding: 0.5em;\n}\n\n#everything table tr:not(:last-child) td {\n border-bottom: 1px solid lightgray;\n}"}, "parts": [{"type": "information", "useCustomName": true, "customName": "Writing a mathematical expression", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Use your keyboard to write mathematical expressions. As you type, a rendering of your expression as it was interpreted by Numbas will be shown next to the input box.
"}, {"type": "information", "useCustomName": true, "customName": "Syntax reference", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "| To produce | \nYou write | \n
|---|---|
| $a+b$ | \na+b | \n
| $a \\times b$ | \na*b | \n
| $a \\div b$ or $\\frac{a}{b}$ | \na/b | \n
| $\\frac{a+b}{c+d}$ | \n(a+b)/(c+d) | \n
| $e^x$ | \ne^x or exp(x) | \n
| $x^2$ | \nx^2 | \n
| $\\sqrt{x}$ | \nsqrt(x) | \n
| $\\sqrt[3]{x}$ | \nx^(1/3) | \n
| $n!$ | \nn! or fact(n) | \n
| $\\sin(\\theta)$ | \nsin(theta) | \n
| $\\sin^2(\\theta)$ | \nsin(theta)^2 | \n
| $\\sin^{-1}(\\theta)$ | \narcsin(theta) | \n
| $|x|$ | \nabs(x) | \n
The order of operations is:
\nFor multiplication/division and addition/subtraction, the leftmost operation is performed first.
\n"}, {"type": "information", "useCustomName": true, "customName": "Implicit multiplication", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "In handwritten mathematics, the multiplication symbol is often omitted. Numbas allows this when there is no ambiguity about what the expression could represent.
\nYou can always omit the multiplication symbol when a number is followed by a variable name, function, or a set of brackets.
\nYou can always omit the multiplication symbol between two sets of brackets.
\nBe careful when writing the product of two variables - xy might be interpreted as a single variable with a two-letter name, instead of the product of $x$ and $y$. Long variable names are rendered using an upright style, instead of italics.
\nA space character between two variable names will cause Numbas to interpret them as separate items with an implicit multiplication. For example, xy represents a single variable, while x y represents the product of the two variables $x$ and $y$.
Use brackets to group parts of an expression, overriding the normal order of operations.
\nFor example, x/(a+b) represents $\\frac{x}{a+b}$, while x/a+b represents $\\frac{x}{a} + b$.
Only round brackets are used for grouping; square brackets delimit lists, and curly brackets are ignored.
"}, {"type": "information", "useCustomName": true, "customName": "Functions", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "A function application is a name followed by one or more parameters, enclosed in brackets.
\nYou must put brackets around the argument.
\nsin, cos, tan, sec, cosec, cot, arcsin, arccos, arctan
The common notation for powers of trigonometric functions, $\\sin^2(x)$, is not supported: you must write sin(x)^2.
sinh, cosh, tanh, sech, cosech, coth, arcsinh, arccosh, arctanh
ln(x) represents the natural logarithm of $x$.
log(x) represents the logarithm of $x$ with base 10.
log(x,b) represents the logarithm with base $b$ of $x$.
abs(x) represents the absolute value of a number $x$, or the length of a vector $x$.
sqrt(x) represents the square root of $x$.
Numbas understands the following logical connectives:
\n| To produce | \nWrite | \nMeaning | \n
|---|---|---|
| $\\neg P$ | \nnot P | \nnot $P$ | \n
| $P \\wedge Q$ | \nP and Q | \nBoth $P$ and $Q$ | \n
| $P \\vee Q$ | \nP or Q | \nEither $P$ or $Q$ | \n
| $P \\operatorname{XOR} Q$ | \nP xor Q | \n$P$ or $Q$, but not both | \n
| $P \\implies Q$ | \nP implies Q | \n$P$ implies $Q$ | \n
Numbas understands the following relation symbols:
\n| To produce | \nWrite | \nMeaning | \n
|---|---|---|
| $=$ | \n= | \nis equal to | \n
| $\\ne$ | \n<> | \nis not equal to | \n
| $\\lt$ | \n< | \nis less than | \n
| $\\gt$ | \n> | \nis greater than | \n
| $\\leq$ | \n<= | \nis less than or equal to | \n
| $\\geq$ | \n>= | \nis greater than or equal to | \n
You can write a chain of relations: x < y < z is equivalent to (x<y) and (y<z).
Numbas also understands a few other symbols:
\n| To produce | \nYou type | \nMeaning | \n
|---|---|---|
| $\\pi$ | \npi | \nThe ratio of a circle's circumference to its diameter | \n
| $e$ | \ne | \nThe base of the natural logarithm | \n
| $i$ | \ni | \nThe imaginary unit, $\\sqrt{-1}$ | \n
Use the underscore character _ to produce a subscript. For example, to produce $x_1$, write x_1.
| To produce | \nYou write | \n
|---|---|
| $\\alpha$ | \nalpha | \n
| $\\beta$ | \nbeta | \n
| $\\gamma$ | \ngamma | \n
| $\\delta$ | \ndelta | \n
| $\\epsilon$ | \nepsilon | \n
| $\\zeta$ | \nzeta | \n
| $\\eta$ | \neta | \n
| $\\theta$ | \ntheta | \n
| $\\iota$ | \niota | \n
| $\\kappa$ | \nkappa | \n
| $\\lambda$ | \nlambda | \n
| $\\mu$ | \nmu | \n
| $\\nu$ | \nnu | \n
| $\\xi$ | \nxi | \n
| $\\omicron$ | \nomicron | \n
| $\\pi$ | \npi | \n
| $\\rho$ | \nrho | \n
| $\\sigma$ | \nsigma | \n
| $\\tau$ | \ntau | \n
| $\\upsilon$ | \nupsilon | \n
| $\\phi$ | \nphi | \n
| $\\chi$ | \nchi | \n
| $\\psi$ | \npsi | \n
| $\\omega$ | \nomega | \n
| $\\Gamma$ | \nGamma | \n
| $\\Delta$ | \nDelta | \n
| $\\Theta$ | \nTheta | \n
| $\\Lambda$ | \nLambda | \n
| $\\Xi$ | \nXi | \n
| $\\Pi$ | \nPi | \n
| $\\Sigma$ | \nSigma | \n
| $\\Upsilon$ | \nUpsilon | \n
| $\\Phi$ | \nPhi | \n
| $\\Psi$ | \nPsi | \n
| $\\Omega$ | \nOmega | \n
Write a mathematical expression in the box below.
", "answer": "x", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "information", "useCustomName": true, "customName": "Interpreting the preview rendering", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Use the rendering to check that your answer has been interpreted as you intended.
\nVariable names are displayed using italic characters.
\nLong variable names - those made of more than one character, are displayed using a fixed-width font, e.g. $\\texttt{abc}$.
\nFunction names are displayed in an upright font, rather than the italics used for variables. For example, $\\sin(x)$ instead of $sin(x)$.
\nThe rendering only uses brackets when necessary - the relative position of symbols is often enough to convey their meaning. For example, (a+b)/(c+d) is displayed as $\\frac{a+b}{c+d}$.
The multiplication symbol is only used when necessary. Note that the product of $x$ and $y$ is displayed as $xy$, while the product of $2$ and $3$ is displayed as $2 \\times 3$.
"}, {"type": "information", "useCustomName": true, "customName": "Marking", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Numbas marks a mathematical expression by comparing it with an expected answer. If the answer must be in a certain form, the question will say so, but otherwise any expression that produces exactly the same values as the expected answer is marked correct.
"}, {"type": "jme", "useCustomName": true, "customName": "Try it - any form accepted", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "In this part, the expected answer is $2x+4$. Any expression equivalent to that will be marked as correct.
\nTry writing:
\n2*x+42(x+2)(cos(0)+1)*(x+sqrt(4))In this part, the expected answer is again $2x+4$, but only answers in the form $ax+b$, for some numbers $a$ and $b$, will be accepted.