// Numbas version: exam_results_page_options {"name": "Nimm Hundert f\u00fcr Hundert", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Nimm Hundert f\u00fcr Hundert", "tags": [], "metadata": {"description": "

Ein sehr bekanntes Problem.

", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "statement": "

Eine Abwandlung der \"100-Vögel\"-Aufgabe lautet:

\n

Für 100 Sapek sollen 100 {strings[dice[0]][0]} gekauft werden. {strings[dice[0]][1]} kosten {costs[dice[1]][0]} Sapek, {strings[dice[0]][2]} kosten {costs[dice[1]][1]} Sapek und für einen Sapek erhält man {costs[dice[1]][2]} {strings[dice[0]][3]}.

\n

\n

", "advice": "

\n

Es seien $x$ die Anzahl der {strings[dice[0]][1]}, $y$ die Anzahl der {strings[dice[0]][1]} und $z$ die  Anzahl der {strings[dice[0]][2]}.

\n

(1) Aus den Anzahlen ermitteln wir dann die Gleichung $x+y+z=100$

\n

(2) Aus den Kosten zudem die Gleichung $\\var{costs[dice[1]][0]}\\cdot x + \\var{costs[dice[1]][1]}\\cdot y+\\frac{1}{\\var{costs[dice[1]][2]}}\\cdot z=100$

\n

Durch Einsetzen von (1) in (2) erhalten wir die Gleichung $\\simplify{{costs[dice[1]][0]}*x+{costs[dice[1]][1]}*y+1/{costs[dice[1]][2]}*(100-y-x)=100}$

\n

Umformen ergibt: $\\simplify{{costs[dice[1]][0]-1/{costs[dice[1]][2]}}*x+{costs[dice[1]][1]-1/{costs[dice[1]][2]}}*y=({100-100/costs[dice[1]][2]})}$ bzw. $\\simplify{{costs[dice[1]][2]}*{costs[dice[1]][0]-1/{costs[dice[1]][2]}}*x+{costs[dice[1]][2]}*{costs[dice[1]][1]-1/{costs[dice[1]][2]}}*y=({costs[dice[1]][2]}*{100-100/costs[dice[1]][2]})}$.

\n

Man wählt nun $y$ so, dass sich für $x$ ein ganzzahliger Wert ergibt, der dann auch zu einem ganzzahligen Wert von $z$ führen muss, wobei man noch aufpassen muss, dass $z$ nicht negativ werden darf.

\n

Eine mögliche Lösung ist $x=\\var{solutions[dice[1]][0]}, y=\\var{solutions[dice[1]][1]}, z=x=\\var{solutions[dice[1]][2]}$.

\n

", "rulesets": {}, "extensions": [], "variables": {"n": {"name": "n", "group": "Aufgabenteil a)", "definition": "a*b", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Aufgabenteil a)", "definition": "random(3,7,11)^2*5", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "Aufgabenteil a)", "definition": "random(7,11,13)", "description": "", "templateType": "anything"}, "costs": {"name": "costs", "group": "Aufgabenteil a)", "definition": "[[5,3,3],[7,3,3],[6,3,3],[5,4,4],[4,3,3]]", "description": "", "templateType": "anything"}, "strings": {"name": "strings", "group": "Aufgabenteil a)", "definition": "[[\"Orangen\",\"Wenzhou-Orangen\", \"gr\u00fcne Orangen\", \"goldene Orangen\"],[\"St\u00fcck Gefl\u00fcgel\",\"H\u00e4hne\", \"Hennen\", \"K\u00fcken\"],[\"St\u00fcck Vieh\",\"Rinder\", \"Milchk\u00fche\", \"K\u00e4lber\"],[\"Schweine\",\"Eber\", \"Sauen\", \"Ferkel\"]]", "description": "", "templateType": "anything"}, "dice": {"name": "dice", "group": "Aufgabenteil a)", "definition": "[random(0,3),random(0,4)]", "description": "", "templateType": "anything"}, "solutions": {"name": "solutions", "group": "Aufgabenteil a)", "definition": "[[4,18,78],[6,6,84],[8,8,84],[15,1,84],[8,14,78]]", "description": "", "templateType": "anything"}, "": {"name": "", "group": "Aufgabenteil a)", "definition": "", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Aufgabenteil a)", "variables": ["n", "a", "b", "costs", "strings", "dice", "solutions", ""]}], "functions": {"euclid_gcd": {"parameters": [["a", "number"], ["b", "number"]], "type": "anything", "language": "javascript", "definition": " a = +a;\n b = +b;\n if (a !== a || b !== b) {\n return [NaN, NaN, NaN];\n }\n \n if (a === Infinity || a === -Infinity || b === Infinity || b === -Infinity) {\n return [Infinity, Infinity, Infinity];\n }\n // Checks if a or b are decimals\n if ((a % 1 !== 0) || (b % 1 !== 0)) {\n return false;\n }\n var signX = (a < 0) ? -1 : 1,\n signY = (b < 0) ? -1 : 1,\n x = 0,\n y = 1,\n u = 1,\n v = 0,\n q, r, m, n;\n a = Math.abs(a);\n b = Math.abs(b);\n\n while (a !== 0) {\n q = Math.floor(b / a);\n r = b % a;\n m = x - u * q;\n n = y - v * q;\n b = a;\n a = r;\n x = u;\n y = v;\n u = m;\n v = n;\n }\n return [b, signX * x, signY * y];"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "mark:\n assert(interpreted_answer[0] = floor(interpreted_answer[0]) and\n interpreted_answer[1] = floor(interpreted_answer[1]) and\n interpreted_answer[2] = floor(interpreted_answer[2]),\n fail(\"Bitte nur ganzzahlige L\u00f6sungen!\"));\n assert(interpreted_answer[0] > 0 and interpreted_answer[1] > 0 and interpreted_answer[2] > 0,\n fail(\"Keine negativen L\u00f6sungen erlaubt!\"));\n correctif(interpreted_answer[0] + interpreted_answer[1] + interpreted_answer[2] = 100 and\n costs[dice[1]][0]*interpreted_answer[0] + costs[dice[1]][1]*interpreted_answer[1] + interpreted_answer[2]/costs[dice[1]][2] = 100)", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [{"name": "n", "value": "3185"}, {"name": "a", "value": "245"}, {"name": "b", "value": "13"}, {"name": "costs", "value": "[ [ 5, 3, 3 ], [ 7, 3, 3 ] ]"}, {"name": "strings", "value": "[ [ \"Orangen\", \"Wenzhou-Orangen\", \"gr\u00fcne Orangen\", \"goldene Orangen\" ], [ \"St\u00fcck Gefl\u00fcgel\", \"H\u00e4hne\", \"Hennen\", \"K\u00fcken\" ] ]"}, {"name": "dice", "value": "[ 0, 1 ]"}, {"name": "solutions", "value": "[ [ 4, 18, 78 ], [ 6, 6, 84 ] ]"}], "answer": {"valid": true, "value": ["3", "4", "5"]}, "notes": [{"name": "mark", "expected": {"value": "", "messages": ["There was an error in this part's marking algorithm. Please report this. Error evaluating variable mark: No definition of 'and' of correct type found."], "warnings": ["There was an error in this part's marking algorithm. Please report this. Error evaluating variable mark: No definition of 'and' of correct type found."], "error": "Error evaluating variable mark: No definition of 'and' of correct type found.", "valid": false, "credit": 0}}]}], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Wie viele {strings[dice[0]][0]} von jeder Sorte soll man kaufen?

\n

Geben Sie bitte eine mögliche ganzzahlige Lösung an.

\n

{strings[dice[0]][1]}: [[0]]

\n

{strings[dice[0]][2]}: [[1]]

\n

{strings[dice[0]][3]}: [[2]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "a", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "solutions[dice[1]][0]", "maxValue": "solutions[dice[1]][0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain-eu"], "correctAnswerStyle": "plain-eu"}, {"type": "numberentry", "useCustomName": true, "customName": "b", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "solutions[dice[1]][1]", "maxValue": "solutions[dice[1]][1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain-eu"], "correctAnswerStyle": "plain-eu"}, {"type": "numberentry", "useCustomName": true, "customName": "c", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "solutions[dice[1]][2]", "maxValue": "solutions[dice[1]][2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain-eu"], "correctAnswerStyle": "plain-eu"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Andreas Vohns", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3622/"}]}]}], "contributors": [{"name": "Andreas Vohns", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3622/"}]}