// Numbas version: exam_results_page_options {"name": "Lois's copy of Conjugate of permutations", "extensions": ["permutations"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Lois's copy of Conjugate of permutations", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Note that in this question cycles are indicated with commas between each element. So (1, 2, 3) denotes the cycle (1 2 3) and no gaps are left between cycles. You should omit cycles of length 1 in your answers.

", "advice": "

These answers omit cycles of length 1.

\n

a)

\n

$\\var{conjugate1}$

\n

b)

\n

$\\var{conjugate2}$

\n

", "rulesets": {}, "extensions": ["permutations"], "variables": {"sigma2": {"name": "sigma2", "group": "Ungrouped variables", "definition": "perm(deal(random(5..11)))", "description": "", "templateType": "anything"}, "conjugate2": {"name": "conjugate2", "group": "Ungrouped variables", "definition": "tau2*sigma2*inverse(tau2)", "description": "", "templateType": "anything"}, "tau2": {"name": "tau2", "group": "Ungrouped variables", "definition": "perm(deal(random(5..11)))", "description": "", "templateType": "anything"}, "conjugate1": {"name": "conjugate1", "group": "Ungrouped variables", "definition": "tau1*sigma1*inverse(tau1)", "description": "", "templateType": "anything"}, "sigma1": {"name": "sigma1", "group": "Ungrouped variables", "definition": "perm(randomcycle(7))", "description": "", "templateType": "anything"}, "tau1": {"name": "tau1", "group": "Ungrouped variables", "definition": "perm(deal(random(5..11)))", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["sigma2", "conjugate2", "tau2", "conjugate1", "sigma1", "tau1"], "variable_groups": [], "functions": {"randomcycle": {"parameters": [["n", "number"]], "type": "list", "language": "javascript", "definition": "var off = Numbas.math.randomint(n);\nvar d = Numbas.math.deal(n);\nwhile(d[off]==off) {\n d = Numbas.math.deal(n);\n}\nvar out = [];\nfor(var i = 0;i0) {\n out += ' + ';\n }\n out += l[i]\n t += l[i];\n}\nout += ' = '+t;\nreturn out;"}, "orderpossible": {"parameters": [["n", "number"], ["s_n", "number"]], "type": "boolean", "language": "javascript", "definition": "var factors = Numbas.math.factorise(n);\nvar t = 0;\nfor(var i=0;i1) {\n out += ' and ';\n } else if(i>0) {\n out += ', ';\n }\n out += '$'+l[i]+'$';\n}\nreturn out;"}, "permfrompartition": {"parameters": [["cycle_sizes", "list"]], "type": "list", "language": "javascript", "definition": "var to = [];\nvar offset = 0;\nfor(var i=0; i0) {\n var cycle_length = Math.pow(Numbas.math.primes[i],factors[i]);\n for(var j=0;j=0;i--) {\n n = perms[i].map(n);\n out += ' \\\\to '+(n+1);\n}\nreturn out;"}, "randompartition": {"parameters": [["n", "number"]], "type": "list", "language": "javascript", "definition": "var l = [];\nwhile(n) {\n var t = Numbas.math.randomint(n)+1;\n l.push(t);\n n -= t;\n}\nreturn l;"}, "show_factorisation": {"parameters": [["n", "number"]], "type": "string", "language": "javascript", "definition": "var factors = Numbas.math.factorise(n);\nvar out = '';\nfor(var i=0;i1) {\n out += '^{'+factors[i]+'}';\n }\n }\n}\nreturn out;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

If $\\sigma = \\var{sigma1}$ and $\\tau = \\var{tau1}$, write down the permutation $\\tau \\circ \\sigma  \\circ \\tau^{-1}$.

\n

$\\tau  \\circ \\sigma \\circ \\tau^{-1}$ = [[0]]

", "gaps": [{"type": "patternmatch", "useCustomName": false, "customName": "", "marks": 1, "scripts": {"mark": {"script": "var Permutation = Numbas.extensions.permutations.Permutation;\ntry {\n var p = Permutation.fromString(this.studentAnswer);\n} catch(e) {\n this.setCredit(0,\"Invalid notation\");\n return;\n}\nif(!Permutation.is_disjoint(this.studentAnswer)) {\n this.setCredit(0,\"Your cycles are not disjoint\");\n return;\n}\nvar unwrapValue = Numbas.jme.unwrapValue;\nvar prod = unwrapValue(question.scope.variables.conjugate1);\nif(p.equal(prod)) {\n this.setCredit(1,\"Correct!\");\n} else {\n this.setCredit(0,\"Wrong\");\n}", "order": "instead"}, "validate": {"script": "var Permutation = Numbas.extensions.permutations.Permutation;\ntry{\n Permutation.parse(this.studentAnswer);\n} catch(e) {\n this.giveWarning(\"Invalid notation\");\n return false;\n}\nreturn true;", "order": "instead"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "", "displayAnswer": "{show(conjugate1)}", "matchMode": "regex"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

If  $\\sigma = \\var{sigma2}$ and $\\tau = \\var{tau2}$, write down the permutation $\\tau \\circ \\sigma \\circ \\tau^{-1}$.

\n

$\\tau \\circ \\sigma \\circ \\tau^{-1}$ = [[0]]

", "gaps": [{"type": "patternmatch", "useCustomName": false, "customName": "", "marks": 1, "scripts": {"mark": {"script": "var Permutation = Numbas.extensions.permutations.Permutation;\ntry {\n var p = Permutation.fromString(this.studentAnswer);\n} catch(e) {\n this.setCredit(0,\"Invalid notation\");\n return;\n}\nif(!Permutation.is_disjoint(this.studentAnswer)) {\n this.setCredit(0,\"Your cycles are not disjoint\");\n return;\n}\nvar unwrapValue = Numbas.jme.unwrapValue;\nvar prod = unwrapValue(question.scope.variables.conjugate2);\nif(p.equal(prod)) {\n this.setCredit(1,\"Correct!\");\n} else {\n this.setCredit(0,\"Wrong\");\n}", "order": "instead"}, "validate": {"script": "var Permutation = Numbas.extensions.permutations.Permutation;\ntry{\n Permutation.parse(this.studentAnswer);\n} catch(e) {\n this.giveWarning(\"Invalid notation\");\n return false;\n}\nreturn true;", "order": "instead"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "", "displayAnswer": "{show(conjugate2)}", "matchMode": "regex"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}]}]}], "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}]}