// Numbas version: finer_feedback_settings {"name": "Question 10 length of vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["a", "c", "d"], "name": "Question 10 length of vectors", "tags": [], "advice": "

a)

\n

x is a vector holding the sequence of numbers between $\\var{a}$ and $\\var{a+c-1}$, inclusive, i.e. {join(list(a..a+c-1),', ')}.

\n

length gives the number of elements in a vector. There are $\\var{c}$ elements in x.

\n

x+{d} adds $\\var{d}$ to each element of x, so the resulting vector has the same length.

\n

b)

\n

y is a single number, so length(y) is $1$.

", "rulesets": {}, "parts": [{"displayColumns": 0, "prompt": "

What is the value of $y$?

", "matrix": ["1", 0, 0, 0], "shuffleChoices": true, "variableReplacements": [], "choices": ["

{c}

", "

{{c}+{a}+{d}}

", "

{{c}+{d}}

", "

{{a}+{d}}

"], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "maxMarks": "1", "scripts": {}, "distractors": ["", "", "", ""], "marks": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": 0}, {"displayColumns": 0, "prompt": "

What is the value of $z$?

", "matrix": [0, 0, "1", 0], "shuffleChoices": false, "variableReplacements": [], "choices": ["

{a}

", "

{c}

", "

1

", "

{{c}+{d}}

"], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "maxMarks": "1", "scripts": {}, "distractors": ["", "", "", ""], "marks": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": 0}], "extensions": [], "statement": "
> x = seq({a},{c+a-1})
> y = length(x+{d})
> z = length(y)
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "random(1..10#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "random(4..10#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "c", "description": ""}, "d": {"definition": "random(1..10#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "d", "description": ""}}, "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}]}