// Numbas version: finer_feedback_settings {"name": "RAW demo 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": [], "ungrouped_variables": ["r", "n", "sport"], "rulesets": {}, "variables": {"n": {"description": "", "definition": "random(r+1..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "n"}, "r": {"description": "", "definition": "random(3..10)", "templateType": "anything", "group": "Ungrouped variables", "name": "r"}, "sport": {"description": "", "definition": "random(['basketball','football','chess','rugby','athletics','cricket'])", "templateType": "anything", "group": "Ungrouped variables", "name": "sport"}}, "advice": "

\n

$C(n,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

$P(n,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. 

", "variable_groups": [], "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. 

", "metadata": {"description": "

A second worked example about combinatorics. 

", "licence": "Creative Commons Attribution 4.0 International"}, "tags": [], "functions": {}, "parts": [{"scripts": {}, "failureRate": 1, "unitTests": [], "vsetRangePoints": 5, "checkingType": "absdiff", "type": "jme", "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? 

", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "checkVariableNames": false, "vsetRange": [0, 1], "steps": [{"vsetRange": [0, 1], "unitTests": [], "variableReplacements": [], "marks": 1, "showCorrectAnswer": true, "showPreview": true, "failureRate": 1, "expectedVariableNames": [], "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? 

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

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

", "checkingType": "absdiff", "type": "jme", "scripts": {}, "checkingAccuracy": 0.001, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "answer": "perm(r,2)"}, {"displayType": "radiogroup", "variableReplacements": [], "marks": 0, "distractors": ["", ""], "unitTests": [], "scripts": {}, "maxMarks": 0, "choices": ["Add", "Multiply"], "matrix": [0, "1"], "type": "1_n_2", "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? 

", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "minMarks": 0, "showCorrectAnswer": true, "shuffleChoices": true, "variableReplacementStrategy": "originalfirst", "displayColumns": 0, "showFeedbackIcon": true}], "variableReplacements": [], "marks": "4", "showPreview": true, "expectedVariableNames": [], "answer": "comb(n,r) * perm(r,2)", "checkingAccuracy": 0.001, "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "showFeedbackIcon": true, "stepsPenalty": 0}], "preamble": {"js": "", "css": ""}, "type": "question", "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/"}]}