// Numbas version: finer_feedback_settings {"name": "Test Yourself Week 3", "metadata": {"description": "", "licence": "None specified"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": [""], "variable_overrides": [[]], "questions": [{"name": "Curve fitting practice", "extensions": ["linear-algebra", "stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Will Rushworth", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/20560/"}], "tags": [], "metadata": {"description": "

A random dataset given by a linear function with noise (gradient and y-intercept of the linear function are randomised as is distribution of x values).

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Suppose that you have recorded the following experimental data:

\n

{table(display,[\"Current, A,\", \"Voltage, V,\", \"Error, V\"])}

\n

Note that the button 'Try another question like this one' will provide a new dataset.

", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"xs": {"name": "xs", "group": "Ungrouped variables", "definition": "repeat(precround(random(1..100#0),3), n)", "description": "

X values. Chosen uniformly at random within a range.

", "templateType": "anything", "can_override": false}, "ys": {"name": "ys", "group": "Ungrouped variables", "definition": "map(\n precround(gradient*x + intercept + normalsample(0,noise_variance), 3),\n x,\n xs\n)", "description": "

Y values. They have a linear relationship with X, plus some normally-distributed noise. The values are rounded to 3 d.p.

", "templateType": "anything", "can_override": false}, "gradient": {"name": "gradient", "group": "Ungrouped variables", "definition": "random(1..4#0.1)", "description": "

The gradient of Y with respect to X.

", "templateType": "anything", "can_override": false}, "intercept": {"name": "intercept", "group": "Ungrouped variables", "definition": "random(30..50)", "description": "

The $y$-intercept of the line.

", "templateType": "anything", "can_override": false}, "noise_variance": {"name": "noise_variance", "group": "Ungrouped variables", "definition": "5^2", "description": "

The variance of the noise.

", "templateType": "anything", "can_override": false}, "es": {"name": "es", "group": "Ungrouped variables", "definition": "repeat(precround(random(1..10#0),3), n)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "30", "description": "", "templateType": "anything", "can_override": false}, "display": {"name": "display", "group": "Ungrouped variables", "definition": "[xs[i], ys[i], es[i]] for: i of: 0..29", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["xs", "ys", "gradient", "intercept", "noise_variance", "es", "n", "display"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "information", "useCustomName": true, "customName": "1", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find a line of best fit for the dataset of the form $y = mx$, using only the independent and dependent variables (omitting the measurement error).

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

Find a line of best fit for the dataset of the form $y = mx + c$, using the independent and dependent variables and the measurement error.

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

Plot both lines of best fit on the same axes, along with the dataset.

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

Adding the option p0 = [m_0, c_0] to curve_fit(), where m_0 and c_0 are floats, will use these values as initial guesses for $m$ and $c$ in the line of best fit.

\n

How does inputting various initial guesses for the fitting parameters affect the line of best fit in this example?

"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": false, "showresultspage": "oncompletion", "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "startpassword": "", "allowAttemptDownload": false, "downloadEncryptionKey": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "end_message": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": [], "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "inreview"}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "type": "exam", "contributors": [{"name": "Will Rushworth", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/20560/"}], "extensions": ["linear-algebra", "stats"], "custom_part_types": [], "resources": []}