Skip to content

Commit 9d27886

Browse files
committed
Improved question evaluatoin
1 parent 7d6fb76 commit 9d27886

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

conversion2025/mathpix_to_llm_with_lines_to_api.ipynb

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -613,14 +613,16 @@
613613
" {parser.get_format_instructions()}\n",
614614
"\n",
615615
" Earlier, an llm was used to separate a markdown file into questions and its relavant solution by returning the lines where the question and solution start and end.\n",
616-
" This is to ensure that the math delimiters and laTeX formatting is preserved.\n",
617-
" However, as with any LLM, it may not have been perfect.\n",
618-
" Evaluate the this particular question that was separated by the LLM.\n",
616+
" This is to ensure that the math delimiters and laTeX formatting is preserved, since the original markdown has perfect formatting and structure.\n",
617+
" However, as with any LLM, it may not have returned the best lines for this particular question.\n",
618+
" Evaluate this one singular full question, which has been procedurally extracted from the markdown file using the lines given by the llm.\n",
619619
" Using the full markdown, check if the question was extracted correctly (note that the question and its solution may not be in the same area), in particular, check that:\n",
620620
" - There is only 1 full question per `question_content`.\n",
621-
" - The full question content from the markdown is included, which may contain its sub-questions and parts.\n",
622-
" - The full solution content from the markdown is included, which should include the solution for the question and its parts.\n",
621+
" - The full question content from the markdown is included, which may contain its sub-questions and parts, which is fine as it will be separated later.\n",
622+
" - The full solution content from the markdown is included, which should include the full solution for the question and its parts.\n",
623+
" - The question and solution Text should have its math delimiters($, $$) and LaTeX formatting preserved and well closed.\n",
623624
" - Ignore all typos and grammar mistakes, since they are not relevant to the question separation.\n",
625+
" - only comment on things that can be improved.\n",
624626
" Be Very precise with what you believe is wrong, if any.\n",
625627
" If you believe the question was separated fairly well, set `well_separated` to true and leave `improvements` empty.\n",
626628
" If you believe the question was not separated correctly, set `well_separated` to false and provide a list of precise, improvements to be made.\n",
@@ -652,6 +654,20 @@
652654
" ]\n",
653655
" }}\n",
654656
"\n",
657+
" example input #3 invalid questions:\n",
658+
" {{\n",
659+
" \"question_content\": \"Q1: solve for x: 2x + 3 = 7\",\n",
660+
" \"solution_content\": \"\\\\begin{{aligned}} 2x + 3 &= 7 \\\\\\\\ 2x &= 4 \\\\\\\\ x &= 2 \\end{{aligned}}\",\n",
661+
" \"images\": []\n",
662+
" }} \n",
663+
" example output #3 not well separated response:\n",
664+
" {{\n",
665+
" \"well_separated\": False,\n",
666+
" \"improvements\": [\n",
667+
" \"Missing opening and closing math delimiters around the LaTeX solution display math.\",\n",
668+
" ]\n",
669+
" }}\n",
670+
"\n",
655671
" full markdown:\n",
656672
" {markdown}\n",
657673
"\n",

conversion2025/testing.json

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
11
{
2-
"name": "ME1 Stress Analysis Tutorial Sheet 1. Moments",
3-
"year": "2023-24",
2+
"name": "Mathematical Analysis (1st Year) - Problem Sheet 3",
3+
"year": "0",
44
"questions": [
55
{
6-
"question_content": "## Problem 1.1\n\nA 20 N force is applied to the end of a 0.4 m lever.\n![pictureTag](0_2025_07_29_62fff12b7847de9f2d97g-2.jpg)\n\nCalculate the magnitude of the moment that this force produces about the point O , and state the direction of the rotational effect.",
7-
"solution_content": "[6.9 Nm, clockwise]",
6+
"question_content": "1. This question concerns the definition of the least upper bound and greatest lower bound for sets of numbers and the difference between this notion and that of largest or smallest element of the set. To remind yourself of the difference between least upper bound and largest element, consider the set of real numbers $x$ such that $x<6$. This set has no largest element, but its least upper bound is 6 (which does not live in the set). If instead of $x<6$ we had $x \\leq 6$, then the set does have a largest element, namely 6 , which is again the least upper bound (but now does live in the set).\n\nFor each of the sets described below, write down the largest element of the set, the smallest element of the set, the least upper bound and the greatest lower bound (if they exist - they don't always).\n(i) The set of all even positive integers.\n(ii) The set of all rational numbers $r$ satisfying $0 \\leq r<1$.\n(iii) The set of all values of $x$ for which $x=\\sin t$ for some real $t$.\n(iv) The set of all numbers of the form $3^{-m}+5^{-n}$ for any positive integers $m, n$.\n(v) The set of all real numbers satisfying $-1 \\leq \\tan x \\leq 1$.\n(vi) The set of numbers of the form $1+1 / n$, where $n$ is any positive integer.\n(vii) The set of positive integers $n$ satisfying $n^{2} \\leq 10$.\n(viii) The set of real numbers $y$ of the form\n\n$$\ny=\\frac{(2 x+5)}{(x+1)}\n$$\n\nwhere $x>0$.",
7+
"solution_content": "1.(i) $\\quad S=\\{2,4,6,8, \\ldots\\}$\nmin $=2$, no max, glb. $=2$, to lub.\n(ii) $S=\\{r \\mid r \\in \\mathbb{Q}, 0 \\leqslant r<1\\}$ mur $=0, g l b=0$, no max, l.u.b. $=1$\n(iii) $S=\\{x \\mid x=\\sin t, t \\in \\mathbb{R}\\}$\n$\\min =g l \\cdot b=-1, \\quad \\max =l \\cdot u \\cdot b=+1$\n(iv) $\\quad S=\\left\\{\\left.\\frac{1}{3^{m}}+\\frac{1}{5^{n}} \\right\\rvert\\, m, n \\in \\mathbb{N}\\right\\}$\nno min, but $g \\cdot l \\cdot b=0$ since $\\frac{1}{3^{m}}+\\frac{1}{5} n>0$\n\n$$\n\\max =\\frac{1}{3}+\\frac{1}{5}=l \\cdot u \\cdot b\n$$\n\n(v) $\\quad S=\\{x \\mid x \\in \\mathbb{R},-1 \\leqslant \\tan x \\leqslant 1\\}$\nno min, no max, no g.l.b., no l.u.b\n(vi) $S=\\left\\{\\left.1+\\frac{1}{n} \\right\\rvert\\, n \\in \\mathbb{N}\\right\\}$\nno $\\min , g \\cdot l \\cdot b \\cdot=1, \\max =l \\cdot u \\cdot b .=2$\n(ii) $S=\\left\\{n \\mid n^{2} \\leqslant 10, n \\in \\mathbb{N}\\right\\}$\nmin $=g \\cdot l \\cdot b=1, \\max =l \\cdot u \\cdot b .=3$.\n(vii) $S=\\left\\{y \\left\\lvert\\, y=\\frac{(2 x+5)}{(x+1)}\\right., x \\in \\mathbb{R}, x>0\\right\\}$\n![pictureTag](0_2025_08_04_5ea1367dbcee79ac4f33g-4.jpg)\n$l \\cdot u \\cdot b=5, \\quad g \\cdot l \\cdot b=2$, no min since $x<\\infty$ and no max since $x>0 \\quad(y=5$ achemil at $x=0$ ).",
88
"images": [
9-
"0_2025_07_29_62fff12b7847de9f2d97g-2.jpg"
9+
"0_2025_08_04_5ea1367dbcee79ac4f33g-4.jpg"
1010
]
1111
},
1212
{
13-
"question_content": "## Problem 1.2\n\nA mechanic must tighten a bolt to 45 N cm .\n(a) If the mechanic's wrench is 15 cm long, what force must be applied by the mechanic perpendicular to the end of the wrench?\n(b) The maximum force that a mechanic can exert with one arm is 500 N . If the mechanic must close a valve that requires a torque of 150 N m , how long must the moment arm be?\n[3 N; 0.3 m ].",
14-
"solution_content": "",
13+
"question_content": "2. Let $A_{n}=\\left\\{a_{1}, a_{2}, \\cdots a_{n}\\right\\}$ be a finite set with $\\left|A_{n}\\right|=n$. Write down the complete list of subsets of $A_{n}$ for the cases $n=1,2,3$. Use induction to show that the total number of possible subsets of $A_{n}$ is $2^{n}$. [Hint: Write a set of $n$ elements as the union of a set containing\njust one of its elements together with a set of $n-1$ elements. Also note that any set has both itself and the empty set as subsets.]",
14+
"solution_content": "2. $n=1 \\quad A=\\{a\\}$\n\n2 subsets, $A$ and $\\phi$.\n\n$$\nn=2 \\quad A=\\left\\{a_{1}, a_{2}\\right\\}\n$$\n\n4 subsets: $A, \\phi,\\left\\{a_{1}\\right\\},\\left\\{a_{2}\\right\\}$\n\n$$\nn=3 \\quad A=\\left\\{a_{1}, a_{2}, a_{3}\\right\\}\n$$\n\n8 subsets: $A, \\Phi,\\left\\{a_{1}\\right\\},\\left\\{a_{2}\\right\\},\\left\\{a_{3}\\right\\},\\left\\{a_{11}, a_{2}\\right\\},\\left\\{a_{1}, a_{3}\\right\\},\\left\\{a_{2}, a_{3}\\right\\}$.\n\nGeneral $n$\n\n$$\n\\begin{aligned}\nA_{n} & =\\left\\{a_{1}, a_{2}, \\ldots a_{n}\\right\\} \\\\\n& =\\left\\{a_{1}, a_{2}, \\ldots a_{n-1}\\right\\} \\cup\\left\\{a_{n}\\right\\} \\\\\n& =A_{n-1} \\cup\\left\\{a_{n}\\right\\}\n\\end{aligned}\n$$\n\nThe subsets of $A_{n}$ all have its form $B_{n-1} \\cup \\phi(=B)$ or $B_{n-1} \\cup\\left\\{a_{n}\\right\\}$\nwhere $B_{n-1}$ ranges aver all the $2^{n-1}$ subsets of $A_{n-1} \\ldots A_{n}$ therefore hav\n\n$$\n2^{n-1}+2^{n-1}=2^{n} \\text { subsets. }\n$$\n\nI.e adoling one mare alement to the ret multiples the number of subsets by $Z$.",
1515
"images": []
1616
},
1717
{
18-
"question_content": "A 25 N planter is hung from a bracket. Calculate the moments applied by the 25 N about the mounting points A and B .\n![pictureTag](1_2025_07_29_62fff12b7847de9f2d97g-2.jpg)\n[ $\\mathrm{M}_{\\mathrm{A}}=\\mathrm{M}_{\\mathrm{B}}=70.71 \\mathrm{~N} \\mathrm{~m}$, clockwise.]\n\n## Problem 1.4\n",
19-
"solution_content": "A child attempts to drive a toy car and applies a force at three separate instants as shown below.",
20-
"images": [
21-
"1_2025_07_29_62fff12b7847de9f2d97g-2.jpg"
22-
]
18+
"question_content": "3. Show that the function\n\n$$\nf(n, m)=(2 n-1) \\times 2^{m-1}\n$$\n\ndefines a bijection from $\\mathbf{N} \\times \\mathbf{N}$ to $\\mathbf{N}$ (where $\\mathbf{N}$ denotes the set of natural numbers). Hence show that the rationals are countable.",
19+
"solution_content": "3.\n\n$$\n\\begin{aligned}\nf(n, m) & =(2 n-1) \\times 2^{m-1} \\text { defines a map } \\\\\nf: \\mathbb{N} \\times \\mathbb{N} & \\longrightarrow \\mathbb{N} \\\\\n& (n, m) \\longrightarrow(2 n-1) \\times 2^{m-1} \\quad n, m=1,2,3, \\ldots\n\\end{aligned}\n$$\n\nThe map is surjecture becaure every point in may be exprened in the form $(2 n-1) \\times 2^{m-1}$ To 2ee this note first that $m=1$ gries $(2 n-1)$, all the odd numbers. Second, every even number may be unitten as $(2 n-1) \\times 2^{n-1}$ for rame $m, n$.\n\nNow cheel for injective.\nSuppose $\\left(2 n^{\\prime}-1\\right) \\times 2^{m \\prime-1}=(2 n-1) \\times 2^{m-1}$\nIf $m>m^{\\prime}, \\quad \\underbrace{\\left(2 n^{\\prime}-1\\right)}_{\\text {odd }}=\\underbrace{(2 n-1) \\times 2^{m-m^{\\prime}}}_{\\text {odd }}$\nThis is inconsistent unters $m=m$ !\n( Samilarly for $m<m^{\\prime}$ ).\n\n$$\n\\Rightarrow 2 n^{\\prime}-1=2 n-1 \\Rightarrow n^{\\prime}=n .\n$$\n\nSo $\\left(2 n^{\\prime}-1\\right) \\times 2^{m^{\\prime}-1}=(2 n-1) \\times 2^{m-1} \\Rightarrow n=n^{\\prime}, m=m^{\\prime}$.\nThis means may is also injective.\nSurjecture + injecture = bijective -\n\nSince the rationals $n / m$ comesponel to $N \\times N$ if follows that they are courtable.",
20+
"images": []
2321
},
2422
{
25-
"question_content": "![pictureTag](3_2025_07_29_62fff12b7847de9f2d97g-3.jpg)\n(b)\n![pictureTag](4_2025_07_29_62fff12b7847de9f2d97g-3.jpg)\n(c)\n\nIf the magnitude of the force exerted by the child in all cases is 5 N and the radius of the steering wheel is 10 cm , calculate the moment applied to the steering wheel.\n[0.5 N m anti-clockwise; 0.5 N m clockwise; zero].\n\n## Problem 1.5\n\nA 4000 N force $F=4000 \\mathrm{~N}$ is applied at the trailer hitch shown below.",
26-
"solution_content": "![pictureTag](5_2025_07_29_62fff12b7847de9f2d97g-3.jpg)",
27-
"images": [
28-
"4_2025_07_29_62fff12b7847de9f2d97g-3.jpg",
29-
"5_2025_07_29_62fff12b7847de9f2d97g-3.jpg",
30-
"3_2025_07_29_62fff12b7847de9f2d97g-3.jpg"
31-
]
23+
"question_content": "4. Consider the function defined by\n\n$$\n\\begin{gathered}\ny=3 x \\quad \\text { for } \\quad x \\leq \\frac{1}{2} \\\\\ny=3(1-x) \\quad \\text { for } \\quad x \\geq \\frac{1}{2}\n\\end{gathered}\n$$\n\nShow that this function maps the Cantor set into itself. [Hint: Use the ternary representation and see what happens under the above maps].",
24+
"solution_content": "$-4$.\n\n$$\ny= \\begin{cases}3 x & x \\leqslant 1 / 2 \\\\ 3(1-x) & x \\geqslant 1 / 2\\end{cases}\n$$\n\nRecall etat elements $x \\in \\subset$ (cantrset) have ter temay verrenentation\n\n$$\nx=0 \\cdot a_{1} a_{2} a_{3} \\ldots \\quad a_{i}=0 \\text { or } 2\n$$\n\nFor $x \\leqslant 1 / 2$, elements of $C$ lie in $[0,1 / 3]$ and are of ete form\n\n$$\nx=0.0 a_{2} a_{3} a_{4} \\ldots . .\n$$\n\nso $3 x=0 . a_{2} a_{3} a_{4} \\ldots$ clearly in $C$.\nFor $x \\geqslant 1 / 2$, elements of $C$ lie $i$, $[2 / 3, F 1]$ and are of the form\n\n$$\n\\begin{aligned}\nx= & 0.2 a_{2} a_{3} a_{4} \\ldots . \\quad a_{i}=0 \\text { or } 2 \\\\\n(1-x)= & 0.22222 \\ldots \\\\\n& -0.2 a_{2} a_{3} a_{4} \\ldots \\\\\n= & 0.0(\\underbrace{\\left(2-a_{2}\\right)\\left(2-a_{3}\\right)\\left(2-a_{4}\\right)}_{a_{l} a b_{y}=0 \\text { or } 2 \\text { y } a_{i}=2 \\text { or } 0} \\ldots . \\\\\n3(1-x)= & 0 .\\left(2-a_{2}\\right)\\left(2-a_{3}\\right) \\ldots .\n\\end{aligned}\n$$\n",
25+
"images": []
3226
},
3327
{
34-
"question_content": "$\\left[\\mathrm{M}_{\\mathrm{A}}=600 \\mathrm{~N} \\mathrm{~m}\\right.$ anti-clockwise, $\\mathrm{M}_{\\mathrm{B}}=600 \\mathrm{~N} \\mathrm{~m}$ clockwise; $\\mathrm{M}_{\\mathrm{A}}=1039 \\mathrm{~N} \\mathrm{~m}$ anti- clockwise, $\\mathrm{M}_{\\mathrm{B}}$ $=0 \\mathrm{l}$.\n",
35-
"solution_content": "",
28+
"question_content": "5. Let $A_{i}$ be an infinite but countable set, for $i=1,2,3 \\cdots$. Show that the infinite union\n\n$$\nA=\\bigcup_{i=1}^{\\infty} A_{i}=A_{1} \\cup A_{2} \\cup A_{3} \\cdots\n$$\n\nis countable. [Hint: write out the first few sets using the notation $A_{1 j}, A_{2 j} \\cdots$ where $j$ denotes the elements of each set, and use what you already know about types of set which are countable].\n6. Consider maps $f$ from $\\mathbb{N}$ to $T$ with $|T|=2$. Prove that the set of all possible maps from $\\mathbb{N} \\rightarrow T$ is uncountable. (Hint: Find a way to use the binary representation to label all the possible choices of $f$ ).",
29+
"solution_content": "5. \n\n$A_{1 i}=\\left\\{A_{11}, A_{12}, A_{13}, \\ldots\\right\\}$\n$A_{2 i}=\\left\\{A_{21}, A_{22}, A_{23}, \\ldots\\right\\}$\n$A_{3 i}=\\left\\{A_{31}, A_{32}, A_{33} \\ldots\\right\\}$\nHeme elements of $A=\\bigcup_{i=1} A_{i}$\ncansit of element $A_{i j}$ where $i, j \\in \\mathbb{N}$, ie $A_{i j} \\in \\mathbb{N} \\times \\mathbb{N}$ which is countable.\n\n6. \n\nThis is the answer for question 6",
3630
"images": []
3731
}
3832
]

0 commit comments

Comments
 (0)