// Numbas version: exam_results_page_options {"name": "Converting units: baby weight", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [{"variables": ["oz_to_kg", "weight_kg", "weight_lb", "weight_oz", "weight_oz_rem"], "name": "hospital baby"}, {"variables": ["news_reports", "news", "newskg"], "name": "News baby"}], "preamble": {"css": "", "js": ""}, "type": "question", "name": "Converting units: baby weight", "parts": [{"variableReplacementStrategy": "originalfirst", "type": "gapfill", "showCorrectAnswer": true, "gaps": [{"correctAnswerFraction": false, "mustBeReduced": false, "type": "numberentry", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "scripts": {}, "minValue": "weight_lb", "maxValue": "weight_lb", "marks": 1, "variableReplacements": []}, {"correctAnswerFraction": false, "mustBeReduced": false, "type": "numberentry", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "scripts": {}, "minValue": "weight_oz_rem", "maxValue": "weight_oz_rem", "marks": 1, "variableReplacements": []}], "marks": 0, "variableReplacements": [], "prompt": "

A hospital measures the weight of a baby to be $\\var{weight_kg}$kg, but they are asked for the weight in pounds and ounces by the baby's parents, who would like to make an announcement to their friends and family in the traditional way.

\n

Using the conversion table above, what is the weight in pounds (lb) and ounces (oz)?

\n

[[0]]lb and [[1]]oz        Round your answer to the nearest ounce.

", "steps": [{"correctAnswerFraction": false, "precisionType": "dp", "showCorrectAnswer": true, "precisionPartialCredit": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "showPrecisionHint": true, "minValue": "weight_oz", "maxValue": "weight_oz", "variableReplacements": [], "prompt": "

Using the conversion rate for kg to oz, what is the weight of the baby in ounces?

\n

", "precisionMessage": "You have not given your answer to the correct precision.", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "scripts": {}, "strictPrecision": false, "precision": 0, "marks": "0.5", "mustBeReduced": false}, {"correctAnswerFraction": false, "mustBeReduced": false, "type": "numberentry", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "scripts": {}, "minValue": "weight_lb", "maxValue": "weight_lb", "marks": "0.5", "variableReplacements": [], "prompt": "

Now use the conversion rate for lb to oz. Rounding down, how many whole pounds does the baby weigh? 

"}, {"correctAnswerFraction": false, "mustBeReduced": false, "type": "numberentry", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "scripts": {}, "minValue": "weight_lb*16", "maxValue": "weight_lb*16", "marks": "0.5", "variableReplacements": [], "prompt": "

What is the above weight in ounces?

"}, {"correctAnswerFraction": false, "mustBeReduced": false, "type": "numberentry", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "scripts": {}, "minValue": "weight_oz_rem", "maxValue": "weight_oz_rem", "marks": "0.5", "variableReplacements": [], "prompt": "

Subtract the above weight from the baby's weight in ounces found in the first step. What is the remainder in ounces? 

"}], "showFeedbackIcon": true, "scripts": {}, "stepsPenalty": 0}, {"variableReplacementStrategy": "originalfirst", "type": "gapfill", "showCorrectAnswer": true, "gaps": [{"correctAnswerFraction": false, "precisionType": "dp", "type": "numberentry", "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "mustBeReducedPC": 0, "precisionPartialCredit": 0, "showFeedbackIcon": true, "allowFractions": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "correctAnswerStyle": "plain", "minValue": "newskg", "maxValue": "newskg", "precision": "1", "marks": 1, "variableReplacements": [], "strictPrecision": false, "scripts": {}, "precisionMessage": "You have not given your answer to the correct precision."}], "marks": 0, "variableReplacements": [], "prompt": "

In {news['year']}, newspapers reported the birth of {news['text']} with a weight over $1$ stone. The baby was recorded at $1$ stone, $\\var{news['lb']}$ pounds and $\\var{news['oz']}$ ounces.

\n

What was the weight in kg?

\n

[[0]] kg      round your answer to 1 decimal place.

", "scripts": {}, "showFeedbackIcon": true}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Convert weights of babies between kg and lb and oz.

"}, "tags": ["taxonomy"], "variables": {"weight_oz_rem": {"templateType": "anything", "definition": "mod(weight_oz,16)", "description": "

The remainder in ounces

", "name": "weight_oz_rem", "group": "hospital baby"}, "weight_lb": {"templateType": "anything", "definition": "floor(weight_oz/16)", "description": "

Weight of the baby in lb

", "name": "weight_lb", "group": "hospital baby"}, "news_reports": {"templateType": "json", "definition": "json_decode(safe(\"[\\n {\\n \\\"year\\\": 2016,\\n \\\"text\\\": \\\"only the second baby to be born in the UK\\\",\\n \\\"lb\\\": 1,\\n \\\"oz\\\": 8\\n },\\n {\\n \\\"year\\\": 2014,\\n \\\"text\\\": \\\"a boy in California\\\",\\n \\\"lb\\\": 2,\\n \\\"oz\\\": 2\\n },\\n {\\n \\\"year\\\": 2014,\\n \\\"text\\\": \\\"a boy in Florida, the heaviest ever recorded in the state,\\\",\\n \\\"lb\\\": 0,\\n \\\"oz\\\": 2\\n }, \\n {\\n \\\"year\\\": 2012,\\n \\\"text\\\": \\\"a record-breaking baby in China,\\\",\\n \\\"lb\\\": 1,\\n \\\"oz\\\": 5\\n } \\n]\"))", "description": "

A list of news reports

", "name": "news_reports", "group": "News baby"}, "newskg": {"templateType": "anything", "definition": "((16*(14+news['lb']))+news['oz'])/oz_to_kg", "description": "

Weight in kg of the baby in the news

", "name": "newskg", "group": "News baby"}, "news": {"templateType": "anything", "definition": "random(news_reports)", "description": "

The news report we're using

", "name": "news", "group": "News baby"}, "oz_to_kg": {"templateType": "anything", "definition": "35.3", "description": "

conversion rate, ounces in a kg

", "name": "oz_to_kg", "group": "hospital baby"}, "weight_kg": {"templateType": "anything", "definition": "precround(\n min(max(normalsample(3.5,1/1.96),2.5),5)\n,1)", "description": "

Weight of the baby in kg, given to the student in the question.

\n

Wikipedia says that the average baby of European heritage weighs 3.5kg, with 90% between 2.5 and 5.

\n

The min and max are to avoid really odd-looking weights.

", "name": "weight_kg", "group": "hospital baby"}, "weight_oz": {"templateType": "anything", "definition": "precround(weight_kg*oz_to_kg,0)", "description": "

weight of the baby in oz, rounded to the nearest integer

", "name": "weight_oz", "group": "hospital baby"}}, "rulesets": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "functions": {}, "ungrouped_variables": [], "statement": "

In many countries, it is still traditional to announce the weight of a baby in imperial units (pounds and ounces), rather than metric (grams or kilograms).

\n

A conversion table is as follows:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$1$ pound (lb)$16$ ounces (oz)
$1$ stone (st)$14$ pounds (lb)
$1$ kg$\\var{oz_to_kg}$ ounces (oz)
", "advice": "

a)

\n

We are told that the baby's weight is $\\var{weight_kg}$kg and we would like to convert this to pounds and ounces.

\n

To do this, we first obtain the weight in ounces using the conversion given:

\n

\\begin{align}
\\var{weight_kg} \\text{ kg}  &= \\var{weight_kg} \\times \\var{oz_to_kg} \\text{ oz} \\\\
&= \\var{weight_oz}\\text{ oz.}
\\end{align}

\n

We can now divide by $16$ to find out how many whole pounds we have:

\n

\\[ \\var{weight_oz}\\text{ oz} \\div 16 =  \\var{dpformat(weight_oz/16,1)}\\text{ lb.} \\]

\n

There are $\\var{weight_lb}$ whole pounds, which leaves a remainder

\n

\\[ \\var{weight_oz} - (16 \\times \\var{weight_lb}) =  \\var{weight_oz_rem} \\text{ oz.} \\]

\n

The baby weighs $\\var{weight_lb}$ pounds and $\\var{weight_oz_rem}$ ounces.

\n

b)

\n

We are given the weight of the baby in stones, pounds and ounces. To convert to kg we first convert the baby's weight to ounces.

\n

$1$ stone is $14$ pounds, so the baby weighs $\\var{news['lb']+14}$ pounds and $\\var{news['oz']}$ ounces, or

\n

\\[  (\\var{news['lb']+14} \\times 16) + \\var{news['oz']} = \\var{(news['lb']+14)*16+news['oz']} \\text{ oz.}\\]

\n

We can now convert to kg:

\n

\\begin{align}
\\var{(news['lb']+14)*16+news['oz']} \\text{ oz} &= \\var{(news['lb']+14)*16+news['oz']} \\div \\var{oz_to_kg}  \\\\
&= \\var{dpformat(newskg,1)}\\text{ kg.}
\\end{align}

\n

", "extensions": ["stats"], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}]}