Upload tmpl_code/tc_tp4_1791579464_00002.jsonl with huggingface_hub
Browse files
tmpl_code/tc_tp4_1791579464_00002.jsonl
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"tid": "8c0b911601", "cat": "wordproblem", "code": "def make(rng, original=False):\n if original:\n correct = 18\n points = 5\n incorrect = 7\n penalty = 2\n earned = correct * points\n lost = incorrect * penalty\n total = earned - lost\n question = (\n f\"In a quiz, Izzy answers {correct} questions correctly. \"\n f\"She gets {points} points for each correct answer and loses \"\n f\"{penalty} points for each of the {incorrect} questions \"\n f\"she answered incorrectly. What is her total score?\"\n )\n lines = [\n f\"Points from correct = {correct} \u00d7 {points} = {earned}\",\n f\"Points lost = {incorrect} \u00d7 {penalty} = {lost}\",\n f\"Total = {earned} \u2212 {lost} = {total}\",\n ]\n return question, lines, str(total)\n\n names = [\"Mia\", \"Leo\", \"Ava\", \"Sam\", \"Nora\", \"Kai\", \"Zoe\", \"Remy\"]\n contexts = [\"contest\", \"game\", \"challenge\", \"competition\"]\n templates = [\n \"In a {context}, {name} answers {correct} questions correctly. \"\n \"{name} gets {points} points for each correct answer and loses \"\n \"{penalty} points for each of the {incorrect} questions \"\n \"{name} answered incorrectly. What is {name}'s total score?\",\n \"In a {context}, {name} answers {incorrect} questions incorrectly \"\n \"and {correct} questions correctly. {name} loses {penalty} points \"\n \"for each incorrect answer and gets {points} points for each \"\n \"correct answer. What is {name}'s total score?\",\n \"{name} gets {points} points for each correct answer and loses \"\n \"{penalty} points for each incorrect answer in a {context}. \"\n \"{name} answers {correct} questions correctly and {incorrect} \"\n \"questions incorrectly. What is {name}'s total score?\",\n ]\n\n for _ in range(30):\n name = rng.choice(names)\n context = rng.choice(contexts)\n correct = rng.randint(3, 20)\n incorrect = rng.randint(2, 12)\n points = rng.randint(2, 10)\n penalty = rng.randint(2, 5)\n\n if (correct, points, incorrect, penalty) == (18, 5, 7, 2):\n continue\n\n earned = correct * points\n lost = incorrect * penalty\n total = earned - lost\n\n if total < 10:\n continue\n\n question = rng.choice(templates).format(\n name=name,\n context=context,\n correct=correct,\n incorrect=incorrect,\n points=points,\n penalty=penalty,\n )\n lines = [\n f\"Points from correct = {correct} \u00d7 {points} = {earned}\",\n f\"Points lost = {incorrect} \u00d7 {penalty} = {lost}\",\n f\"Total = {earned} \u2212 {lost} = {total}\",\n ]\n return question, lines, str(total)\n\n return None\n"}
|
| 2 |
+
{"tid": "0b218d7eca", "cat": "wordproblem", "code": "def make(rng, original=False):\n if original:\n question = (\n \"The Tulliallan Shopping Plaza has 5 stores on the ground floor. \"\n \"Each store sells a souvenir mug for $7 and a T\u2011shirt for $15. \"\n \"If a visitor buys one mug and one T\u2011shirt from each store, \"\n \"how much will they spend in total?\"\n )\n lines = [\n \"Cost per store = $7 + $15 = $22\",\n \"Total cost = 5 \u00d7 $22 = $110\",\n ]\n return question, lines, \"110\"\n\n plaza_names = [\n \"Maplewood\", \"Cedar Point\", \"Riverbend\", \"Sunrise\",\n \"Hilltop\", \"Lakeside\", \"Pinegrove\", \"Old Town\",\n ]\n item_names = [\n \"keychain\", \"postcard\", \"cap\", \"sticker\", \"bookmark\",\n \"tote bag\", \"pen\", \"coaster\", \"pin\", \"scarf\",\n ]\n\n while True:\n stores = rng.randint(3, 8)\n price1, price2 = rng.sample(range(4, 31), 2)\n if (stores, price1, price2) != (5, 7, 15):\n break\n\n item1, item2 = rng.sample(item_names, 2)\n plaza = rng.choice(plaza_names)\n per_store = price1 + price2\n total = stores * per_store\n\n templates = [\n (\n \"The {plaza} Shopping Plaza has {stores} stores on the ground floor. \"\n \"Each store sells a {item1} for ${p1} and a {item2} for ${p2}. \"\n \"If a visitor buys one {item1} and one {item2} from each store, \"\n \"how much will they spend in total?\"\n ),\n (\n \"The {plaza} Shopping Plaza has {stores} stores on the ground floor. \"\n \"Every store sells a {item1} for ${p1} and a {item2} for ${p2}. \"\n \"If a customer buys one {item1} and one {item2} from every store, \"\n \"what is the total cost?\"\n ),\n ]\n\n question = rng.choice(templates).format(\n plaza=plaza,\n stores=stores,\n item1=item1,\n item2=item2,\n p1=price1,\n p2=price2,\n )\n\n lines = [\n f\"Cost per store = ${price1} + ${price2} = ${per_store}\",\n f\"Total cost = {stores} \u00d7 ${per_store} = ${total}\",\n ]\n\n return question, lines, str(total)\n"}
|
| 3 |
+
{"tid": "03b1888cdc", "cat": "science_calc", "code": "def make(rng, original=False):\n if original:\n r_um = 5.0\n gamma = 0.025\n dp = 2 * gamma / (r_um * 1e-6)\n question = r\"A spherical vesicle with a radius of $5.0 \\, \\mu\\text{m}$ is observed to have a membrane surface tension of $0.025 \\, \\text{N/m}$. Assuming the Laplace pressure difference $\\Delta P = \\frac{2\\gamma}{r}$ applies strictly to this biological structure, calculate the pressure difference (in Pa) between the inside and outside of the vesicle.\"\n lines = [\n f\"r = {r_um:.1f} \u03bcm = {r_um:.1f} \u00d7 10\u207b\u2076 m\",\n \"\u0394P = 2\u03b3 / r\",\n f\"\u0394P = 2({gamma:.3f} N/m) / ({r_um:.1f} \u00d7 10\u207b\u2076 m)\",\n f\"\u0394P = {2 * gamma:.3f} N/m / ({r_um:.1f} \u00d7 10\u207b\u2076 m)\",\n f\"\u0394P = {dp:.0f} Pa\",\n ]\n answer = f\"{dp:.0f} Pa\"\n return question, lines, answer\n\n r10_choices = [5, 10, 20, 25, 40, 50, 80, 100]\n objects = [\"spherical droplet\", \"spherical microcapsule\", \"spherical cell\", \"spherical microdroplet\"]\n templates = [\n \"A {obj} with a radius of {r:.1f} \u03bcm has a surface tension of {g:.3f} N/m. If the Laplace pressure difference \u0394P = 2\u03b3/r applies strictly, calculate the pressure difference in Pa between the inside and outside.\",\n \"For a {obj} of radius {r:.1f} \u03bcm and surface tension {g:.3f} N/m, use \u0394P = 2\u03b3/r to find the inside-outside pressure difference in Pa.\",\n \"A {obj} has radius {r:.1f} \u03bcm and surface tension {g:.3f} N/m. Assuming \u0394P = 2\u03b3/r holds exactly, what is the pressure difference in Pa across the surface?\",\n \"A {obj} has a surface tension of {g:.3f} N/m and a radius of {r:.1f} \u03bcm. If \u0394P = 2\u03b3/r applies strictly, calculate the pressure difference in Pa between the inside and outside.\",\n ]\n\n for _ in range(25):\n r10 = rng.choice(r10_choices)\n k = rng.randint(1, 20)\n if r10 == 50 and k == 5:\n continue\n numerator = 100000 * k\n if numerator % r10 != 0:\n continue\n dp = numerator // r10\n if dp == 10000:\n continue\n r_um = r10 / 10\n gamma = k * 0.005\n question = rng.choice(templates).format(obj=rng.choice(objects), r=r_um, g=gamma)\n lines = [\n f\"r = {r_um:.1f} \u03bcm = {r_um:.1f} \u00d7 10\u207b\u2076 m\",\n \"\u0394P = 2\u03b3 / r\",\n f\"\u0394P = 2({gamma:.3f} N/m) / ({r_um:.1f} \u00d7 10\u207b\u2076 m)\",\n f\"\u0394P = {2 * gamma:.3f} N/m / ({r_um:.1f} \u00d7 10\u207b\u2076 m)\",\n f\"\u0394P = {dp} Pa\",\n ]\n answer = f\"{dp} Pa\"\n return question, lines, answer\n return None\n"}
|
| 4 |
+
{"tid": "c00759a0e6", "cat": "probability", "code": "def make(rng, original=False):\n if original:\n question = (\n \"A password system requires a sequence of 4 characters, where each character is chosen \"\n \"independently from a set of 26 lowercase letters. What is the probability that the first \"\n \"character is 'b' and the last character is 'r'?\"\n )\n base = 26\n denom = base * base\n lines = [\n f\"The probability that the first character is 'b' is 1/{base}.\",\n f\"The probability that the last character is 'r' is 1/{base}.\",\n \"Since the characters are chosen independently, the joint probability is the product of the individual probabilities.\",\n f\"(1/{base}) * (1/{base}) = 1/{denom}.\",\n ]\n return question, lines, f\"1/{denom}\"\n\n letters = \"abcdefghijklmnopqrstuvwxyz\"\n pos_words = [\"first\", \"second\", \"third\", \"fourth\", \"fifth\", \"sixth\"]\n templates = [\n \"A password system requires a sequence of {L} characters, where each character is chosen independently from the first {N} lowercase letters. What is the probability that the {p1} character is '{c1}' and the {p2} character is '{c2}'?\",\n \"A code uses a string of {L} characters drawn independently from the first {N} lowercase letters. Find the probability that the {p1} character is '{c1}' and the {p2} character is '{c2}'.\",\n \"A lock uses a {L}-character code, each character selected independently from the first {N} lowercase letters. What is the probability that the {p1} character is '{c1}' and the {p2} character is '{c2}'?\",\n ]\n\n for _ in range(25):\n length = rng.randint(3, 6)\n alphabet_size = rng.randint(10, 26)\n positions = rng.sample(range(1, length + 1), 2)\n if rng.random() < 0.5:\n p1, p2 = positions\n else:\n p1, p2 = sorted(positions)\n\n c1 = rng.choice(letters[:alphabet_size])\n c2 = rng.choice(letters[:alphabet_size])\n\n if length == 4 and alphabet_size == 26 and p1 == 1 and p2 == 4 and c1 == \"b\" and c2 == \"r\":\n continue\n\n w1 = pos_words[p1 - 1]\n w2 = pos_words[p2 - 1]\n question = rng.choice(templates).format(\n L=length,\n N=alphabet_size,\n p1=w1,\n p2=w2,\n c1=c1,\n c2=c2,\n )\n\n denom = alphabet_size * alphabet_size\n lines = [\n f\"The probability that the {w1} character is '{c1}' is 1/{alphabet_size}.\",\n f\"The probability that the {w2} character is '{c2}' is 1/{alphabet_size}.\",\n \"Since the characters are chosen independently, the joint probability is the product of the individual probabilities.\",\n f\"(1/{alphabet_size}) * (1/{alphabet_size}) = 1/{denom}.\",\n ]\n return question, lines, f\"1/{denom}\"\n\n return None\n"}
|