// Numbas version: exam_results_page_options {"name": "Counting by cases", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"statement": "

Suppose you have a hypothetical new alphabet with $\\var{c+v}$ letters: $\\var{c}$ consonants and $\\var{v}$ vowels.

\n

Note that the NUMBAS syntax for $C(n,r)$ is comb(n,r).

", "variables": {"A3": {"definition": "answers[3]", "description": "", "name": "A3", "group": "Ungrouped variables", "templateType": "anything"}, "c": {"definition": "random(10..20)", "description": "", "name": "c", "group": "Ungrouped variables", "templateType": "anything"}, "w": {"definition": "5", "description": "", "name": "w", "group": "Ungrouped variables", "templateType": "anything"}, "ans3": {"definition": "sum(answers[1..w+1])", "description": "", "name": "ans3", "group": "Ungrouped variables", "templateType": "anything"}, "answers": {"definition": "map(comb(w,j)*c^(w-j)*v^(j),j,0..w)", "description": "", "name": "answers", "group": "Ungrouped variables", "templateType": "anything"}, "A2": {"definition": "answers[2]", "description": "", "name": "A2", "group": "Ungrouped variables", "templateType": "anything"}, "total": {"definition": "(c+v)^w", "description": "", "name": "total", "group": "Ungrouped variables", "templateType": "anything"}, "A0": {"definition": "answers[0]", "description": "", "name": "A0", "group": "Ungrouped variables", "templateType": "anything"}, "v": {"definition": "random(3..7)", "description": "", "name": "v", "group": "Ungrouped variables", "templateType": "anything"}, "A1": {"definition": "answers[1]", "description": "", "name": "A1", "group": "Ungrouped variables", "templateType": "anything"}, "A5": {"definition": "answers[5]", "description": "", "name": "A5", "group": "Ungrouped variables", "templateType": "anything"}, "A4": {"definition": "answers[4]", "description": "", "name": "A4", "group": "Ungrouped variables", "templateType": "anything"}}, "preamble": {"js": "", "css": ""}, "ungrouped_variables": ["total", "c", "v", "w", "answers", "ans3", "A0", "A1", "A2", "A3", "A4", "A5"], "tags": [], "variablesTest": {"maxRuns": 100, "condition": "sum(answers) = total"}, "rulesets": {}, "variable_groups": [], "functions": {}, "extensions": [], "metadata": {"description": "

Simple counting exercise. Students are encouraged to look for the smart way of counting.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "parts": [{"vsetRangePoints": 5, "variableReplacements": [], "failureRate": 1, "type": "jme", "valuegenerators": [], "customMarkingAlgorithm": "", "showPreview": true, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "prompt": "

How many different $\\var{w}$-letter words can you make with this alphabet?

", "useCustomName": false, "unitTests": [], "customName": "", "vsetRange": [0, 1], "checkingType": "absdiff", "answer": "{(v+c)^w}", "marks": "0.5", "checkingAccuracy": 0.001, "scripts": {}}, {"prompt": "

Fill out the following table

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$n$Number of $\\var{w}$-letter words with exactly $n$ vowels
$0$[[0]]
$1$[[1]]
$2$[[2]]
$3$[[3]]
$4$[[4]]
$5$[[5]]
TOTAL[[6]]
\n

 

", "variableReplacements": [], "useCustomName": false, "unitTests": [], "type": "gapfill", "customName": "", "gaps": [{"valuegenerators": [], "checkingAccuracy": 0.001, "vsetRangePoints": 5, "variableReplacements": [], "useCustomName": false, "unitTests": [], "type": "jme", "customName": "", "failureRate": 1, "vsetRange": [0, 1], "checkingType": "absdiff", "customMarkingAlgorithm": "", "showPreview": true, "variableReplacementStrategy": "originalfirst", "answer": "{A0}", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": "0.5", "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "scripts": {}}, {"valuegenerators": [], "checkingAccuracy": 0.001, "vsetRangePoints": 5, "variableReplacements": [], "useCustomName": false, "unitTests": [], "type": "jme", "customName": "", "failureRate": 1, "vsetRange": [0, 1], "checkingType": "absdiff", "customMarkingAlgorithm": "", "showPreview": true, "variableReplacementStrategy": "originalfirst", "answer": "{A1}", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": "0.5", "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "scripts": {}}, {"valuegenerators": [], "checkingAccuracy": 0.001, "vsetRangePoints": 5, "variableReplacements": [], "useCustomName": false, "unitTests": [], "type": "jme", "customName": "", "failureRate": 1, "vsetRange": [0, 1], "checkingType": "absdiff", "customMarkingAlgorithm": "", "showPreview": true, "variableReplacementStrategy": "originalfirst", "answer": "{A2}", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": "0.5", "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "scripts": {}}, {"valuegenerators": [], "checkingAccuracy": 0.001, "vsetRangePoints": 5, "variableReplacements": [], "useCustomName": false, "unitTests": [], "type": "jme", "customName": "", "failureRate": 1, "vsetRange": [0, 1], "checkingType": "absdiff", "customMarkingAlgorithm": "", "showPreview": true, "variableReplacementStrategy": "originalfirst", "answer": "{A3}", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": "0.5", "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "scripts": {}}, {"valuegenerators": [], "checkingAccuracy": 0.001, "vsetRangePoints": 5, "variableReplacements": [], "useCustomName": false, "unitTests": [], "type": "jme", "customName": "", "failureRate": 1, "vsetRange": [0, 1], "checkingType": "absdiff", "customMarkingAlgorithm": "", "showPreview": true, "variableReplacementStrategy": "originalfirst", "answer": "{A4}", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": "0.5", "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "scripts": {}}, {"valuegenerators": [], "checkingAccuracy": 0.001, "vsetRangePoints": 5, "variableReplacements": [], "useCustomName": false, "unitTests": [], "type": "jme", "customName": "", "failureRate": 1, "vsetRange": [0, 1], "checkingType": "absdiff", "customMarkingAlgorithm": "", "showPreview": true, "variableReplacementStrategy": "originalfirst", "answer": "{A5}", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": "0.5", "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "scripts": {}}, {"valuegenerators": [], "checkingAccuracy": 0.001, "vsetRangePoints": 5, "variableReplacements": [], "useCustomName": false, "unitTests": [], "type": "jme", "customName": "", "failureRate": 1, "vsetRange": [0, 1], "checkingType": "absdiff", "customMarkingAlgorithm": "", "showPreview": true, "variableReplacementStrategy": "originalfirst", "answer": "{total}", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": "0.5", "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "scripts": {}}], "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "sortAnswers": false, "marks": 0, "extendBaseMarkingAlgorithm": true, "scripts": {}}, {"stepsPenalty": 0, "variableReplacements": [], "failureRate": 1, "type": "jme", "valuegenerators": [], "customMarkingAlgorithm": "", "showPreview": true, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "vsetRangePoints": 5, "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "prompt": "

How many $\\var{w}$-letter words have at least one vowel?

", "useCustomName": false, "unitTests": [], "customName": "", "vsetRange": [0, 1], "checkingType": "absdiff", "answer": "{ans3}", "steps": [{"prompt": "

It may be simpler to take the total number of words, and subtract the number of words with no vowels.

", "variableReplacements": [], "useCustomName": false, "unitTests": [], "type": "information", "customName": "", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": 0, "extendBaseMarkingAlgorithm": true, "scripts": {}}], "marks": 1, "checkingAccuracy": 0.001, "scripts": {}}], "name": "Counting by cases", "advice": "

(a) The number of words is $(\\var{c} + \\var{v})^\\var{w} = \\var{c+v}^\\var{w}$.

\n

(b) The number of $\\var{w}$-letter words with exactly $n$ vowels is

\n

(number of ways of choosing positions of the vowels) $\\times$ (number of ways of choosing the vowels) $\\times$ (number of ways of choosing the consonants) = $\\begin{pmatrix} \\var{w} \\\\ n \\end{pmatrix} \\times \\var{v}^n \\times \\var{c}^{(\\var{w}-n)}$.

\n

The total is

\n

$\\displaystyle \\sum\\limits_{n=0}^\\var{w} \\left( \\begin{pmatrix} \\var{w} \\\\ n \\end{pmatrix} \\times \\var{v}^n \\times \\var{c}^{(\\var{w}-n)} \\right) = (\\var{v} + \\var{c})^\\var{w}$.

\n

(c) The number of words with at least one vowel is

\n

number of words with exactly one vowel + number of words with exactly two vowels + number of words with exactly three vowels + number of words with exactly four vowels + number of words with exactly five vowels = $\\var{answers[1]} + \\var{answers[2]} +\\var{answers[3]} +\\var{answers[4]} +\\var{answers[5]} = \\var{ans3}$.

\n

Alternatively, it is all the words except those with no vowels

\n

number of words $-$ number of words with exactly zero vowels = $(\\var{v} + \\var{c})^\\var{w} - \\var{c}^\\var{w} = \\var{(v+c)^w - answers[0]}$.

", "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}]}], "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}