Upload tmpl_code/tc_tp1_1791579407_00000.jsonl with huggingface_hub
Browse files
tmpl_code/tc_tp1_1791579407_00000.jsonl
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"tid": "4cf601b48d", "cat": "wordproblem", "code": "def make(rng, original=False):\n if original:\n n1, l1, r1 = \"A\", 12, 4\n n2, l2, r2 = \"B\", 8, 5\n cost = 50\n question = (\n \"In a debate on rural infrastructure, a committee is calculating the cost to pave two rural roads \"\n \"inspired by the regions where Robert Burns served as a minister. Road A is 12 km long and requires \"\n \"4 m\u00b3 of asphalt per kilometer. Road B is 8 km long and requires 5 m\u00b3 of asphalt per kilometer. \"\n \"If asphalt costs $50 per cubic meter, what is the total cost to pave both roads?\"\n )\n v1 = l1 * r1\n v2 = l2 * r2\n total = v1 + v2\n ans = total * cost\n lines = [\n f\"Road {n1} asphalt: {l1} \u00d7 {r1} = {v1} m\u00b3\",\n f\"Road {n2} asphalt: {l2} \u00d7 {r2} = {v2} m\u00b3\",\n f\"Total asphalt: {v1} + {v2} = {total} m\u00b3\",\n f\"Total cost: {total} \u00d7 {cost} = {ans}\",\n ]\n return question, lines, f\"${ans}\"\n\n names = [\"A\", \"B\", \"C\", \"D\", \"North\", \"South\", \"East\", \"West\", \"Main\", \"Mill\", \"Oak\", \"Creek\"]\n for _ in range(100):\n n1, n2 = rng.sample(names, 2)\n l1 = rng.randint(3, 30)\n l2 = rng.randint(3, 30)\n r1 = rng.randint(2, 9)\n r2 = rng.randint(2, 9)\n cost = rng.randint(20, 120)\n v1 = l1 * r1\n v2 = l2 * r2\n total = v1 + v2\n ans = total * cost\n if l1 <= 0 or l2 <= 0 or r1 <= 0 or r2 <= 0 or cost <= 0:\n continue\n if l1 == l2 and r1 == r2:\n continue\n if ans < 1000:\n continue\n break\n else:\n return None\n\n intros = [\n \"A committee is calculating the cost to pave two rural roads.\",\n \"A county board is estimating the cost of paving two rural roads.\",\n \"A local council is budgeting for the paving of two rural roads.\",\n \"A planning group is computing the cost to pave two rural roads.\",\n ]\n endings = [\n \"what is the total cost to pave both roads?\",\n \"how much will it cost to pave both roads?\",\n ]\n question = (\n f\"{rng.choice(intros)} Road {n1} is {l1} km long and requires {r1} m\u00b3 of asphalt per kilometer. \"\n f\"Road {n2} is {l2} km long and requires {r2} m\u00b3 of asphalt per kilometer. \"\n f\"If asphalt costs ${cost} per cubic meter, {rng.choice(endings)}\"\n )\n lines = [\n f\"Road {n1} asphalt: {l1} \u00d7 {r1} = {v1} m\u00b3\",\n f\"Road {n2} asphalt: {l2} \u00d7 {r2} = {v2} m\u00b3\",\n f\"Total asphalt: {v1} + {v2} = {total} m\u00b3\",\n f\"Total cost: {total} \u00d7 {cost} = {ans}\",\n ]\n return question, lines, f\"${ans}\"\n"}
|
| 2 |
+
{"tid": "9ddbbd9ea8", "cat": "wordproblem", "code": "def make(rng, original=False):\n if original:\n question = (\"The runway illumination system uses 48 bulbs, each drawing 15 watts. \"\n \"If the power supply can deliver only 600 watts, can the system operate \"\n \"all bulbs simultaneously? Answer yes or no.\")\n n, w, cap = 48, 15, 600\n required = n * w\n lines = [\n f\"{n} \u00d7 {w} = {required} watts required\",\n f\"{required} > {cap}, exceeds capacity\" if required > cap else f\"{required} <= {cap}, within capacity\",\n ]\n answer = \"no\" if required > cap else \"yes\"\n return question, lines, answer\n\n systems = [\n \"runway illumination system\",\n \"stage lighting rig\",\n \"warehouse LED array\",\n \"airport taxiway light bank\",\n \"studio lighting panel\",\n ]\n devices = [\n \"bulbs\",\n \"lamps\",\n \"fixtures\",\n \"LED modules\",\n \"light units\",\n ]\n\n for _ in range(20):\n n = rng.randint(20, 120)\n w = rng.randint(5, 30)\n required = n * w\n margin = max(10, required // 10)\n offset = rng.randint(-margin, margin)\n if offset == 0:\n continue\n cap = required + offset\n if cap <= 0:\n continue\n break\n else:\n return None\n\n system = rng.choice(systems)\n device = rng.choice(devices)\n\n if rng.random() < 0.5:\n question = (\n f\"The {system} uses {n} {device}, each drawing {w} watts. \"\n f\"If the power supply can deliver only {cap} watts, can it operate \"\n f\"all {device} simultaneously? Answer yes or no.\"\n )\n else:\n question = (\n f\"A {system} contains {n} {device}, each rated at {w} watts. \"\n f\"The power source can provide at most {cap} watts. \"\n f\"Can all {device} be powered at the same time? Answer yes or no.\"\n )\n\n lines = [f\"{n} \u00d7 {w} = {required} watts required\"]\n if required > cap:\n lines.append(f\"{required} > {cap}, exceeds capacity\")\n answer = \"no\"\n else:\n lines.append(f\"{required} <= {cap}, within capacity\")\n answer = \"yes\"\n\n return question, lines, answer\n"}
|