// Numbas version: exam_results_page_options {"name": "Simon's copy of Number of multisets from a given set,", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "variable_groups": [], "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"marks": 0, "showCorrectAnswer": true, "customName": "", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "prompt": "

Number of ways = [[0]]

", "variableReplacements": [], "customMarkingAlgorithm": "", "useCustomName": false, "scripts": {}, "gaps": [{"marks": 2, "showCorrectAnswer": true, "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "customName": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "type": "numberentry", "unitTests": [], "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "mustBeReducedPC": 0, "variableReplacements": [], "allowFractions": false, "customMarkingAlgorithm": "", "useCustomName": false, "scripts": {}, "maxValue": "ans", "showFractionHint": true, "minValue": "ans", "showFeedbackIcon": true}], "showFeedbackIcon": true}], "variablesTest": {"condition": "", "maxRuns": 100}, "name": "Simon's copy of Number of multisets from a given set,", "variables": {"p": {"description": "", "definition": "random(5..10)", "templateType": "anything", "group": "Ungrouped variables", "name": "p"}, "b": {"description": "", "definition": "if(tb<=p,p+1,tb)", "templateType": "anything", "group": "Ungrouped variables", "name": "b"}, "ans": {"description": "", "definition": "comb(p+b-1,b)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans"}, "tb": {"description": "", "definition": "random(7..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "tb"}}, "preamble": {"css": "", "js": ""}, "advice": "

We are not interested in the order in which the cars were sold, but in the number of cars each salesperson sold.

\n

\n

One way to think about this is the 'stars and bars' principle. Suppose we had 4 salesmen and 7 cars. Then we could represent the 7 cars using 7 stars in a row:

\n

$* * * * * **$

\n

We could represent the split in sales between the 4 salesmen using 4-1 = 3 bars.

\n

e.g.

\n

$* |* *| * * *|*$ represents the first salesman selling 1 car, the second selling 2, the third selling 3 and the fourth selling 1

\n

$* ||* * * * **|$ represents the first salesman selling 1 car, the second selling 0, the third selling 6 and the fourth selling 0

\n

\n

Note we have 7+4-1 = 10 stars and bars in total

\n

Then the total number of ways of 4 salesmen selling 7 cars is the same as the number of ways of choosing 7 items to be stars out of the 10 items in total.

\n

i.e. $ {7+4-1 \\choose 7}= {10 \\choose 7} = 120$

\n

\n

\n

Similarly for our example, the number of ways of $\\var{p}$ salesmen selling $\\var{b}$ cars is given by:

\n

\n

\\[\\binom{\\var{b}+\\var{p}-1}{\\var{b}}=\\binom{\\var{p+b-1}}{\\var{b}}=\\var{ans}\\]

", "ungrouped_variables": ["p", "b", "tb", "ans"], "rulesets": {}, "statement": "

A car dealership employs $\\var{p}$ salespeople. A salesperson receives a £100 bonus for each car they sell.

\n

Yesterday, the dealership sold $\\var{b}$ cars.

\n

In how many ways could this happen?

\n

(Consider two scenarios different if they result in different bonus payments).

", "tags": [], "extensions": [], "type": "question", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}