Upload tmpl_code/tc_tp5_1791579750_00003.jsonl with huggingface_hub
Browse files
tmpl_code/tc_tp5_1791579750_00003.jsonl
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"tid": "ed1bb57393", "cat": "science_calc", "code": "def make(rng, original=False):\n if original:\n d = 2.7\n v = 500\n m = int(round(d * v))\n question = (\n \"The marble used in the memorial has a density of \"\n \"2.7 g/cm\u00b3. If a specific decorative block has a volume of \"\n \"500 cm\u00b3, what is its mass in grams?\"\n )\n lines = [\n \"mass = density \u00d7 volume\",\n f\"mass = {d:.1f} g/cm\u00b3 \u00d7 {v} cm\u00b3\",\n f\"mass = {m} g\",\n ]\n return question, lines, str(m)\n\n materials = [\n \"marble\", \"granite\", \"basalt\", \"limestone\",\n \"quartz\", \"alabaster\", \"obsidian\", \"soapstone\",\n ]\n contexts = [\n \"memorial\", \"garden\", \"museum\", \"display\",\n \"monument\", \"fountain\", \"archway\", \"plaza\",\n ]\n items = [\n \"decorative block\", \"stone block\", \"sculpture block\", \"tile\",\n \"cube\", \"prism\", \"panel\", \"sample\",\n ]\n templates = [\n \"A {material} {item} for the {context} has a density of {d} g/cm\u00b3. If its volume is {v} cm\u00b3, what is its mass in grams?\",\n \"The {material} {item} used in the {context} has a density of {d} g/cm\u00b3. If the {item} has a volume of {v} cm\u00b3, what is its mass in grams?\",\n \"A {item} made of {material} in the {context} has a density of {d} g/cm\u00b3. If its volume is {v} cm\u00b3, what is its mass in grams?\",\n ]\n\n a = rng.randint(15, 35)\n b = rng.randint(50, 200)\n if a == 27 and b == 50:\n return None\n\n d = a / 10\n v = 10 * b\n m = a * b\n\n material = rng.choice(materials)\n context = rng.choice(contexts)\n item = rng.choice(items)\n template = rng.choice(templates)\n\n question = template.format(\n material=material,\n context=context,\n item=item,\n d=f\"{d:.1f}\",\n v=v,\n )\n lines = [\n \"mass = density \u00d7 volume\",\n f\"mass = {d:.1f} g/cm\u00b3 \u00d7 {v} cm\u00b3\",\n f\"mass = {m} g\",\n ]\n return question, lines, str(m)\n"}
|
| 2 |
+
{"tid": "bd9c2aa592", "cat": "wordproblem", "code": "def make(rng, original=False):\n if original:\n question = (\n \"Argo Tea sells a special blend for $5 per cup. \"\n \"On Monday they sold 24 cups, and on Tuesday they sold 18% more cups than Monday. \"\n \"How many cups did they sell on Tuesday?\"\n )\n lines = [\n \"24 \u00d7 0.18 = 4.32\",\n \"24 + 4.32 = 28.32\",\n \"Round to nearest whole cup \u2192 28\",\n ]\n return question, lines, \"28\"\n\n def fmt(cents):\n dollars, cents = divmod(cents, 100)\n return str(dollars) if cents == 0 else f\"{dollars}.{cents:02d}\"\n\n combos = [\n (\"Cedar Coffee\", \"house coffee\", \"cups\", \"cup\"),\n (\"Maple Bakehouse\", \"glazed donuts\", \"donuts\", \"donut\"),\n (\"Willow Bakery\", \"chocolate scones\", \"scones\", \"scone\"),\n (\"Harbor Coffee\", \"iced tea\", \"cups\", \"cup\"),\n (\"Juniper Cafe\", \"croissants\", \"croissants\", \"croissant\"),\n (\"Alpine Roasters\", \"espresso drinks\", \"cups\", \"cup\"),\n ]\n day_pairs = [\n (\"Monday\", \"Tuesday\"),\n (\"Tuesday\", \"Wednesday\"),\n (\"Thursday\", \"Friday\"),\n (\"Friday\", \"Saturday\"),\n ]\n prices = [3, 4, 5, 6, 7, 8]\n\n for _ in range(200):\n name, product, unit_pl, unit_sg = rng.choice(combos)\n price = rng.choice(prices)\n day1, day2 = rng.choice(day_pairs)\n base = rng.randint(12, 80)\n percent = rng.randint(5, 45)\n\n inc_cents = base * percent\n total_cents = base * 100 + inc_cents\n\n if total_cents % 100 == 0 or total_cents % 100 == 50:\n continue\n\n answer = (total_cents + 50) // 100\n if answer == base:\n continue\n\n inc_str = fmt(inc_cents)\n total_str = fmt(total_cents)\n pct_str = f\"{percent // 100}.{percent % 100:02d}\"\n\n line1 = f\"{base} \u00d7 {pct_str} = {inc_str}\"\n line2 = f\"{base} + {inc_str} = {total_str}\"\n line3 = f\"Round to nearest whole {unit_sg} \u2192 {answer}\"\n\n style = rng.randrange(3)\n if style == 0:\n question = (\n f\"{name} sells {product} for ${price} per {unit_sg}. \"\n f\"On {day1} they sold {base} {unit_pl}, and on {day2} \"\n f\"they sold {percent}% more {unit_pl} than {day1}. \"\n f\"How many {unit_pl} did they sell on {day2}?\"\n )\n elif style == 1:\n question = (\n f\"{name} sells {product} at ${price} per {unit_sg}. \"\n f\"{day1}, they sold {base} {unit_pl}. On {day2}, \"\n f\"they sold {percent}% more {unit_pl} than {day1}. \"\n f\"How many {unit_pl} did they sell on {day2}?\"\n )\n else:\n question = (\n f\"At {name}, {product} costs ${price} per {unit_sg}. \"\n f\"They sold {base} {unit_pl} on {day1}. On {day2}, \"\n f\"they sold {percent}% more {unit_pl} than on {day1}. \"\n f\"How many {unit_pl} did they sell on {day2}?\"\n )\n\n return question, [line1, line2, line3], str(answer)\n\n return None\n"}
|
| 3 |
+
{"tid": "274c55fe72", "cat": "wordproblem", "code": "def make(rng, original=False):\n if original:\n n, t, m = 4, 3, 2\n question = (\n \"A global project assigns 4 cultural ambassadors, one per continent. \"\n \"Each ambassador must mentor 3 teams, and each team must contain exactly 2 members from different continents. \"\n \"How many total team members are involved?\"\n )\n lines = [\n f\"Ambassadors = {n}\",\n f\"Teams per ambassador = {t} \u2192 total teams = {n}\u00d7{t} = {n * t}\",\n f\"Members per team = {m} \u2192 total members = {n * t}\u00d7{m} = {n * t * m}\",\n ]\n return question, lines, str(n * t * m)\n\n roles = [\n (\"ambassador\", \"ambassadors\"),\n (\"coordinator\", \"coordinators\"),\n (\"delegate\", \"delegates\"),\n (\"representative\", \"representatives\"),\n (\"liaison\", \"liaisons\"),\n ]\n units = [\n (\"region\", \"regions\"),\n (\"district\", \"districts\"),\n (\"province\", \"provinces\"),\n (\"campus\", \"campuses\"),\n (\"division\", \"divisions\"),\n ]\n teams = [\n (\"team\", \"teams\"),\n (\"committee\", \"committees\"),\n (\"squad\", \"squads\"),\n (\"panel\", \"panels\"),\n (\"group\", \"groups\"),\n ]\n scopes = [\n (\"a\", \"global\"),\n (\"a\", \"regional\"),\n (\"an\", \"international\"),\n (\"a\", \"community\"),\n (\"a\", \"university\"),\n (\"a\", \"corporate\"),\n ]\n nouns = [\"project\", \"program\"]\n\n for _ in range(200):\n n = rng.randint(2, 6)\n t = rng.randint(2, 5)\n m = rng.randint(2, 4)\n if (n, t, m) == (4, 3, 2):\n continue\n\n role = rng.choice(roles)\n unit = rng.choice(units)\n team = rng.choice(teams)\n article, scope = rng.choice(scopes)\n noun = rng.choice(nouns)\n\n clues = [\n f\"{article} {scope} {noun} has {n} {role[1]}, one per {unit[0]}.\",\n f\"Each {role[0]} must lead {t} {team[1]}.\",\n f\"Each {team[0]} must contain exactly {m} members from different {unit[1]}.\",\n ]\n order = rng.sample(range(3), 3)\n question = \" \".join(clues[i] for i in order) + f\" How many total {team[0]} members are involved?\"\n\n total = n * t * m\n lines = [\n f\"{role[1].capitalize()} = {n}\",\n f\"{team[1].capitalize()} per {role[0]} = {t} \u2192 total {team[1]} = {n}\u00d7{t} = {n * t}\",\n f\"Members per {team[0]} = {m} \u2192 total members = {n * t}\u00d7{m} = {total}\",\n ]\n return question, lines, str(total)\n\n return None\n"}
|
| 4 |
+
{"tid": "d1238d7f6e", "cat": "science_calc", "code": "import math\n\ndef make(rng, original=False):\n def sig3(x):\n if x == 0:\n return \"0.00\"\n d = 3 - int(math.floor(math.log10(abs(x)))) - 1\n if d < 0:\n return f\"{round(x, 0):.0f}\"\n return f\"{round(x, d):.{d}f}\"\n\n if original:\n t = 4.0\n unit = \"min\u207b\u00b9\"\n k = math.log(2) / t\n ans = sig3(k) + \" \" + unit\n question = (\n \"Consider a reaction involving the hydrolysis of a peptide bond, \"\n \"which can be approximated by a first-order kinetics model. \"\n \"If the half-life of the peptide bond cleavage under specific \"\n \"enzymatic conditions is $4.0 \\\\text{ minutes}$, calculate the \"\n \"rate constant $k$ in $\\\\text{min}^{-1}$ to three significant figures.\"\n )\n lines = [\n \"For a first-order reaction, the half-life is t1/2 = ln 2 / k\",\n \"Solving for k gives k = ln 2 / t1/2\",\n f\"Substitute t1/2 = {t:.1f} min\",\n f\"k = ln 2 / {t:.1f} min\",\n f\"ln 2 = {math.log(2):.6f}\",\n f\"k = {math.log(2):.6f} / {t:.1f} min\",\n f\"k = {k:.6f} min^-1\",\n \"Round to three significant figures\",\n f\"k = {sig3(k)} {unit}\",\n ]\n return question, lines, ans\n\n objects = [\n (\"hydrolysis of an ester bond\", \"ester bond cleavage\"),\n (\"cleavage of a glycosidic bond\", \"glycosidic bond cleavage\"),\n (\"reduction of a disulfide bond\", \"disulfide bond reduction\"),\n (\"hydrolysis of an amide bond\", \"amide bond hydrolysis\"),\n (\"cleavage of a phosphoester bond\", \"phosphoester bond cleavage\"),\n ]\n conditions = [\n \"specific enzymatic conditions\",\n \"mild catalytic conditions\",\n \"constant temperature and pH\",\n \"standard enzymatic conditions\",\n ]\n ts = [0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 5.0, 6.0, 7.5, 8.0, 10.0, 12.5, 15.0, 20.0]\n\n for _ in range(10):\n obj, proc = rng.choice(objects)\n cond = rng.choice(conditions)\n t = rng.choice(ts)\n if t == 4.0:\n continue\n k = math.log(2) / t\n ans_num = sig3(k)\n if \"e\" in ans_num or \"E\" in ans_num or ans_num in (\"0.00\", \"0\"):\n continue\n break\n else:\n return None\n\n unit = \"min\u207b\u00b9\"\n ans = ans_num + \" \" + unit\n templates = [\n f\"Consider a reaction involving {obj}, which can be approximated by a first-order kinetics model. If the half-life of the {proc} under {cond} is {t:.1f} minutes, calculate the rate constant k in {unit} to three significant figures.\",\n f\"A first-order model is used for {obj}. Under {cond}, the half-life of the {proc} is {t:.1f} minutes. What is the rate constant k in {unit} to three significant figures?\",\n f\"The {proc} follows first-order kinetics. If the half-life under {cond} is {t:.1f} minutes, calculate the rate constant k in {unit} to three significant figures.\",\n ]\n question = rng.choice(templates)\n\n ln2 = math.log(2)\n lines = [\n \"For a first-order reaction, the half-life is t1/2 = ln 2 / k\",\n \"Solving for k gives k = ln 2 / t1/2\",\n f\"Substitute t1/2 = {t:.1f} min\",\n f\"k = ln 2 / {t:.1f} min\",\n f\"ln 2 = {ln2:.6f}\",\n f\"k = {ln2:.6f} / {t:.1f} min\",\n f\"k = {k:.6f} min^-1\",\n \"Round to three significant figures\",\n f\"k = {ans_num} {unit}\",\n ]\n return question, lines, ans\n"}
|