// Numbas version: exam_results_page_options {"name": "RAW demo 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "tags": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

A second worked example about combinatorics. 

"}, "variable_groups": [], "variables": {"r": {"templateType": "anything", "name": "r", "definition": "random(4..10)", "group": "Ungrouped variables", "description": ""}, "n": {"templateType": "anything", "name": "n", "definition": "random(r+1..15)", "group": "Ungrouped variables", "description": ""}, "sport": {"templateType": "anything", "name": "sport", "definition": "random(['basketball','football','chess','rugby','athletics','cricket'])", "group": "Ungrouped variables", "description": ""}}, "extensions": [], "parts": [{"vsetRange": [0, 1], "extendBaseMarkingAlgorithm": true, "useCustomName": false, "checkingAccuracy": 0.001, "stepsPenalty": 0, "marks": "4", "type": "jme", "customName": "", "checkingType": "absdiff", "answer": "comb({n},{r}) * perm({r},2)", "showPreview": true, "scripts": {}, "variableReplacements": [], "adaptiveMarkingPenalty": 0, "showFeedbackIcon": true, "steps": [{"extendBaseMarkingAlgorithm": true, "matrix": ["1", 0], "showCellAnswerState": true, "displayType": "radiogroup", "shuffleChoices": true, "maxMarks": 0, "marks": 0, "type": "1_n_2", "customName": "", "useCustomName": false, "distractors": ["", ""], "displayColumns": 0, "scripts": {}, "variableReplacements": [], "adaptiveMarkingPenalty": 0, "minMarks": 0, "choices": ["combination", "permutation"], "showCorrectAnswer": true, "unitTests": [], "prompt": "

To choose {r} students form {n}, which type formula will we use?

", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": ""}, {"vsetRange": [0, 1], "extendBaseMarkingAlgorithm": true, "useCustomName": false, "checkingAccuracy": 0.001, "marks": 1, "type": "jme", "customName": "", "checkingType": "absdiff", "answer": "comb({n},{r})", "showPreview": true, "scripts": {}, "variableReplacements": [], "adaptiveMarkingPenalty": 0, "showFeedbackIcon": true, "valuegenerators": [], "failureRate": 1, "showCorrectAnswer": true, "unitTests": [], "vsetRangePoints": 5, "prompt": "

We use the combination formula when selection order doesn't matter, and the permutation formula when selection order does matter. 

\n

How many ways are there to choose the {r} students for the team from the {n} students? 

", "variableReplacementStrategy": "originalfirst", "checkVariableNames": false, "customMarkingAlgorithm": ""}, {"vsetRange": [0, 1], "extendBaseMarkingAlgorithm": true, "useCustomName": false, "checkingAccuracy": 0.001, "marks": 1, "type": "jme", "customName": "", "checkingType": "absdiff", "answer": "perm({r},2)", "showPreview": true, "scripts": {}, "variableReplacements": [], "adaptiveMarkingPenalty": 0, "showFeedbackIcon": true, "valuegenerators": [], "failureRate": 1, "showCorrectAnswer": true, "unitTests": [], "vsetRangePoints": 5, "prompt": "

How many ways are there to choose the captain and vice-captain from the team of {r} students? 

", "variableReplacementStrategy": "originalfirst", "checkVariableNames": false, "customMarkingAlgorithm": ""}, {"extendBaseMarkingAlgorithm": true, "matrix": [0, "1"], "showCellAnswerState": true, "displayType": "radiogroup", "shuffleChoices": true, "maxMarks": 0, "marks": 0, "type": "1_n_2", "customName": "", "useCustomName": false, "distractors": ["", ""], "displayColumns": 0, "scripts": {}, "variableReplacements": [], "adaptiveMarkingPenalty": 0, "minMarks": 0, "choices": ["Add", "Multiply"], "showCorrectAnswer": true, "unitTests": [], "prompt": "

Results for independent cases should be added together, while results for dependent cases should be multiplied together. What should you do in this case? 

", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": ""}], "valuegenerators": [], "failureRate": 1, "showCorrectAnswer": true, "unitTests": [], "vsetRangePoints": 5, "prompt": "

At the school {sport} tryouts, {n} students turned up but only {r} students made the team. One of the team-members was declared the captain, and another team-member was declared the vice-captain. 

\n

In how many ways could this have been done? 

", "variableReplacementStrategy": "originalfirst", "checkVariableNames": false, "customMarkingAlgorithm": ""}], "advice": "

$^n\\!C_r$ is the number of ways to choose $r$ distinct items from a set of $n$ distinct items, where the order you choose them in does not matter. For example, choosing a subset of students for a sports team. 

\n

$^n\\!P_r$ is the number of ways to choose $r$ distinct items from a set of $n$ distinct items, where the order you choose them in does matter. For example, choosing members of a team to receive specific titles. 

\n

When counting independent cases, the totals should be added together. When counting dependent cases, the totals should be multiplied together. 

\n

Notice that the 2 positions for captain and vice-captain could have been chosen first, and then the remaining $\\var{r}-2=\\var{r-2}$ members of the team chosen from the remaining $\\var{n}-2=\\var{n-2}$ students. So another way to express the answer to this question would be $^\\var{n}\\!P_2 \\times {}^\\var{n-2}\\!C_\\var{r-2}$.

", "name": "RAW demo 2", "statement": "

This question concerns counting combinations and permutations. 

\n

You might want to use the Numbas syntax comb(n,r) and perm(n,r) in your answers. 

\n
\n

", "ungrouped_variables": ["r", "n", "sport"], "functions": {}, "preamble": {"css": "", "js": ""}, "variablesTest": {"maxRuns": 100, "condition": ""}, "contributors": [{"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}]}], "contributors": [{"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}