// Numbas version: exam_results_page_options {"name": "Calculate centred moving averages", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0", "description": "", "name": "tol"}, "tothere3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=3,random(\"Mesa Airways.\",\"KiwiJet.\",\"Frontier Airlines.\",\"EasyAir.\",\"RyanJet.\",\"HorizonAir.\",\"SunCity Airlines.\",\"Air Caribe.\"),\"\")", "description": "", "name": "tothere3"}, "tothere": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=1,random(\"Souter Lighthouse\", \"Washington Old Hall\",\"Gibside\",\"Cherryburn Cottage\",\"Lindisfarne Castle\",\"Oakhurst Cottage\",\"George Stephenson's Birthplace\",\"Holy Jesus Hospital\"),\"\")", "description": "", "name": "tothere"}, "nat": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=1, \" (a National Trust attraction).\", \"\")", "description": "", "name": "nat"}, "y8": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(ap8+2*(m8+j8+ja9)+ap9)/8", "description": "", "name": "y8"}, "tothere2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=2,random(\"small electrical store.\",\"local baker's.\",\"book shop.\",\"local farmer's produce store.\",\"local newsagent.\",\"small restaurant.\",\"local grocery store.\"),\"\")", "description": "", "name": "tothere2"}, "j8": {"templateType": "anything", "group": "Ungrouped variables", "definition": "j7+random(20..60#10)", "description": "", "name": "j8"}, "ja9": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ja8+random(50..100#10)", "description": "", "name": "ja9"}, "tol1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "1", "description": "", "name": "tol1"}, "ap9": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ap8+random(20..50#10)", "description": "", "name": "ap9"}, "this": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=1,\"the number of visitors to \",if(ch=2,\"sales (in hundreds of pounds) at a \",if(ch=3,\"passenger numbers (in hundreds) for \",\"the number of orders taken at a \")))", "description": "", "name": "this"}, "y10": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(j8+2*(ja9+ap9+m9)+j9)/8", "description": "", "name": "y10"}, "ja7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(250..400#10)", "description": "", "name": "ja7"}, "y5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(m7+2*(j7+ja8+ap8)+m8)/8", "description": "", "name": "y5"}, "m9": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m8+random(10..50#10)", "description": "", "name": "m9"}, "ja8": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ja7+random(50..150#10)", "description": "", "name": "ja8"}, "y9": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(m8+2*(j8+ja9+ap9)+m9)/8", "description": "", "name": "y9"}, "y6": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(j7+2*(ja8+ap8+m8)+j8)/8", "description": "", "name": "y6"}, "ch": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "ch"}, "ap7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ja7+random(400..600#10)", "description": "", "name": "ap7"}, "rows": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[[\"2007\",ja7,ap7,m7,j7],[\"2008\",ja8,ap8,m8,j8],[\"2009\",ja9,ap9,m9,j9]]", "description": "", "name": "rows"}, "ap8": {"templateType": "anything", "group": "Ungrouped variables", "definition": "ap7+random(30..70#10)", "description": "", "name": "ap8"}, "y3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(ja7+2*(ap7+m7+j7)+ja8)/8", "description": "", "name": "y3"}, "tothere4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(ch=4,random(\"satellite TV store.\",\"take-away restaurant.\",\"TV shopping channel.\"),\"\")", "description": "", "name": "tothere4"}, "m7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2500..3500#100)", "description": "", "name": "m7"}, "j9": {"templateType": "anything", "group": "Ungrouped variables", "definition": "j8+random(20..60#10)", "description": "", "name": "j9"}, "y7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(ja8+2*(ap8+m8+j8)+ja9)/8", "description": "", "name": "y7"}, "j7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(750..1050#50)", "description": "", "name": "j7"}, "m8": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m7+random(20..70#10)", "description": "", "name": "m8"}, "y4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(ap7+2*(m7+j7+ja8)+ap8)/8", "description": "", "name": "y4"}}, "ungrouped_variables": ["ch", "j8", "j9", "tothere3", "j7", "tothere4", "y9", "y8", "ap9", "y3", "y5", "y4", "y7", "y6", "rows", "m7", "tol", "m9", "m8", "ap8", "tothere2", "nat", "ap7", "ja8", "ja9", "this", "ja7", "tol1", "tothere", "y10"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Calculate centred moving averages", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y3+tol", "minValue": "y3-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y4+tol", "minValue": "y4-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y5+tol", "minValue": "y5-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y6+tol", "minValue": "y6-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y7+tol", "minValue": "y7-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y8+tol", "minValue": "y8-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y9+tol", "minValue": "y9-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "y10+tol", "minValue": "y10-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Find the series of (centred) moving averages for these data and complete the table below:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Jan-MarApril-JuneJuly-SepOct-Dec
2007**[[0]][[1]]
2008[[2]][[3]][[4]][[5]]
2009[[6]][[7]]**
", "showCorrectAnswer": true, "marks": 0}], "statement": "

The following tables shows by quarter over the three years 2007, 2008, 2009 {This} {tothere} {nat} {tothere2} {tothere3} {tothere4} 

\n

{table(rows,[\" \",\"Jan-Mar\",\"Apr-June\",\"July-Sep\",\"Oct-Dec\"])}

", "tags": ["ACE2013", "centred moving averages", "checked2015", "moving average", "statistics", "time series"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

22/03/2014:

\n


Created from ACE i-assess question.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Centred moving averages.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Jan-MarApril-JuneJuly-SepOct-Dec
2007**$\\var{y3}$$\\var{y4}$
2008$\\var{y5}$$\\var{y6}$$\\var{y7}$$\\var{y8}$
2009$\\var{y9}$$\\var{y10}$**
\n

Let $Y_t$ denote the data table values so $Y_1=\\var{ja7},\\;Y_2=\\var{ap7} ,\\ldots, Y_{12}=\\var{j9}$

\n

Using the centred moving average formula for quarters:

\n

\\[Y^*_t=\\frac{Y_{t-2}+2(Y_{t-1}+Y_t+Y_{t+1})+Y_{t+2}}{8}\\] we obtain the values in the table above.

\n

Thus the moving average for Oct-Dec 2007 is:

\n

\\[\\frac{Y_{2}+2(Y_{3}+Y_4+Y_{5})+Y_{6}}{8}=\\frac{\\var{ap7} + 2 (\\var{m7} + \\var{j7} + \\var{ja8}) + \\var{ap8}}{8} = \\var{y4}\\]

\n

", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}