// Numbas version: exam_results_page_options {"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": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
To produceYou write
$a+b$a+b
$a \\times b$a*b
$a \\div b$ or $\\frac{a}{b}$a/b
$\\frac{a+b}{c+d}$(a+b)/(c+d)
$e^x$e^x or exp(x)
$x^2$x^2
$\\sqrt{x}$sqrt(x)
$\\sqrt[3]{x}$x^(1/3)
$n!$n! or fact(n)
$\\sin(\\theta)$sin(theta)
$\\sin^2(\\theta)$sin(theta)^2
$\\sin^{-1}(\\theta)$arcsin(theta)
$|x|$abs(x)
"}, {"type": "information", "useCustomName": true, "customName": "Operations", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The order of operations is:

\n\n

For 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.

\n

You can always omit the multiplication symbol when a number is followed by a variable name, function, or a set of brackets.

\n

You can always omit the multiplication symbol between two sets of brackets.

\n

Be 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.

\n

A 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$.

"}, {"type": "information", "useCustomName": true, "customName": "Grouping", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Use brackets to group parts of an expression, overriding the normal order of operations.

\n

For example, x/(a+b) represents $\\frac{x}{a+b}$, while x/a+b represents $\\frac{x}{a} + b$.

\n

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.

\n

You must put brackets around the argument.

\n

Trigonometric functions:

\n

sin, cos, tan, sec, cosec, cot, arcsin, arccos, arctan

\n

The common notation for powers of trigonometric functions, $\\sin^2(x)$, is not supported: you must write sin(x)^2.

\n

Hyperbolic functions:

\n

sinh, cosh, tanh, sech, cosech, coth, arcsinh, arccosh, arctanh

\n

Logarithms:

\n

ln(x) represents the natural logarithm of $x$.

\n

log(x) represents the logarithm of $x$ with base 10.

\n

log(x,b) represents the logarithm with base $b$ of $x$.

\n

Other functions:

\n

abs(x) represents the absolute value of a number $x$, or the length of a vector $x$.

\n

sqrt(x) represents the square root of $x$.

\n

"}, {"type": "information", "useCustomName": true, "customName": "Logical connectives", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Numbas understands the following logical connectives:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
To produceWriteMeaning
$\\neg P$not Pnot $P$
$P \\wedge Q$P and QBoth $P$ and $Q$
$P \\vee Q$P or QEither $P$ or $Q$
$P \\operatorname{XOR} Q$P xor Q$P$ or $Q$, but not both
$P \\implies Q$P implies Q$P$ implies $Q$
"}, {"type": "information", "useCustomName": true, "customName": "Relations", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Numbas understands the following relation symbols:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
To produceWriteMeaning
$=$=is equal to
$\\ne$<>is not equal to
$\\lt$<is less than
$\\gt$>is greater than
$\\leq$<=is less than or equal to
$\\geq$>=is greater than or equal to
\n

You can write a chain of relations: x < y < z is equivalent to (x<y) and (y<z).

"}, {"type": "information", "useCustomName": true, "customName": "Symbols", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Numbas also understands a few other symbols:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
To produceYou typeMeaning
$\\pi$piThe ratio of a circle's circumference to its diameter
$e$eThe base of the natural logarithm
$i$iThe imaginary unit, $\\sqrt{-1}$
\n

Use the underscore character _ to produce a subscript. For example, to produce $x_1$, write x_1.

"}, {"type": "information", "useCustomName": true, "customName": "The Greek alphabet", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
To produceYou write
$\\alpha$alpha
$\\beta$beta
$\\gamma$gamma
$\\delta$delta
$\\epsilon$epsilon
$\\zeta$zeta
$\\eta$eta
$\\theta$theta
$\\iota$iota
$\\kappa$kappa
$\\lambda$lambda
$\\mu$mu
$\\nu$nu
$\\xi$xi
$\\omicron$omicron
$\\pi$pi
$\\rho$rho
$\\sigma$sigma
$\\tau$tau
$\\upsilon$upsilon
$\\phi$phi
$\\chi$chi
$\\psi$psi
$\\omega$omega
$\\Gamma$Gamma
$\\Delta$Delta
$\\Theta$Theta
$\\Lambda$Lambda
$\\Xi$Xi
$\\Pi$Pi
$\\Sigma$Sigma
$\\Upsilon$Upsilon
$\\Phi$Phi
$\\Psi$Psi
$\\Omega$Omega
"}, {"type": "jme", "useCustomName": true, "customName": "Try it", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

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.

\n

Variable names are displayed using italic characters.

\n

Long variable names - those made of more than one character, are displayed using a fixed-width font, e.g. $\\texttt{abc}$.

\n

Function names are displayed in an upright font, rather than the italics used for variables. For example, $\\sin(x)$ instead of $sin(x)$.

\n

The 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}$.

\n

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.

\n

Try writing:

\n", "answer": "2x+4", "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": "jme", "useCustomName": true, "customName": "Try it - restricted form", "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 again $2x+4$, but only answers in the form $ax+b$, for some numbers $a$ and $b$, will be accepted.

", "answer": "2x+4", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "mustmatchpattern": {"pattern": "$n`?*x + $n`?", "partialCredit": 0, "message": "Your answer must be in the form $ax+b$, for some numbers $a$ and $b$.", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}