joshuarauh commited on
Commit
171e4a2
·
verified ·
1 Parent(s): 521f13c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -24
app.py CHANGED
@@ -477,7 +477,7 @@ ADDITIONAL PROOF GUIDELINES:
477
  def get_difficulty_parameters(difficulty_level):
478
  """Return specific parameters and constraints based on difficulty level"""
479
  parameters = {
480
- 1: { # Very Easy
481
  "description": "suitable for beginners",
482
  "constraints": [
483
  "Use only basic concepts and straightforward calculations",
@@ -836,17 +836,17 @@ def generate_question(subject, difficulty, question_type, subtopic=None, use_enh
836
  difficulty_params = get_difficulty_parameters(difficulty)
837
  problem_type_addition = get_problem_type_addition(question_type)
838
 
839
- system_prompt = f"""You are a mathematics professor. Write exactly one {question_type} exam question on {subject} covering {selected_topic} that can be solved analytically, without numerical methods.
840
- STRICT REQUIREMENTS:
841
- 1. Begin the output with the text "Here is a test question that is a {question_type} question on {subject} covering {selected_topic}."
842
- 2. Difficulty Level Guidelines:
843
- {difficulty_params['description'].upper()}
844
- Follow these specific constraints:
845
- {chr(10).join(f' - {c}' for c in difficulty_params['constraints'])}
846
- {problem_type_addition}
847
- 3. Style Reference:
848
- Question should be {difficulty_params['example_style']}
849
- 4. For LaTeX formatting:
850
  - Make sure that the question statement uses proper LaTeX math mode
851
  - Use $ for inline math
852
  - Use $$ on separate lines for equations and solutions
@@ -854,7 +854,7 @@ STRICT REQUIREMENTS:
854
  - DO NOT use \\begin{{aligned}} or similar environments
855
  - When writing questions involving currency expressed in dollars NEVER use the `$` symbol as it will be interepreted as math mode. ALWAYS write out the word dollars.
856
  * Example: 1000 dollars
857
- 5. Include a detailed solution
858
  - Begin the solution with "Here is a detailed solution to the test question."
859
  - If the question involves geometry make sure to identify any general geometric formulas that apply, For example:
860
  * Areas/volumes of common shapes and solids
@@ -867,11 +867,11 @@ STRICT REQUIREMENTS:
867
  * NO part of the solution may resort to or be based on numerical analysis.
868
  * The only numerical calculations that should be done are those that could be done on a simple scientific calculator.
869
  * Make sure to simplify completely as far as analytical methods will allow
870
- 6. Maintain clear formatting
871
- 7. At the end of the solution output, print SymPy code that you would use to solve or verify the main equations in the question
872
- 8. Observe the folloiwng SymPy Guidelines
873
  {SYMPY_GUIDELINES}
874
- 9. For problems where the subject is Real Analysis, observe the following guidelines:
875
 
876
  a. **Justify Every Step**
877
  - Provide detailed reasoning for each step and explicitly justify every bounding argument, inequality, or limit claim.
@@ -917,28 +917,28 @@ j. **Concluding and Intuitive Explanations**
917
  - Conclude with an intuitive explanation of why the result makes sense, possibly connecting it to known theorems or simple examples.
918
  - In notes after the proof, highlight potential sources of confusion for students and clarify tricky aspects of the problem.
919
 
920
- 10. If you specify a quadrant restriction (e.g. "in the first quadrant") in a problem with calculating area between lines/curves or volume between surfaces,
921
  make sure the question is CLEAR about what regions you intend to be included in the solution, by breaking up the question. Examples:
922
  - NOT CLEAR question: Find the area of the region bounded by the curves y = sin(x), y = cos(x), and x = 7*pi/4 in the first quadrant.
923
  - CLEAR question: Find the area of the region bounded by the curves y = sin(x), y = cos(x), and x = 7*pi/4. Then find the area of that region that intersects with the first quadrant.
924
 
925
- 11. When finding critical points in multivariable calculus:
926
  - Always check what happens when any variable equals zero (except where undefined)
927
  - Just because a point is ruled out of the domain doesn't mean that entire line/curve is ruled out
928
  - When the Hessian is inconclusive, evaluate the function along the critical curves to determine behavior
929
  - Don't rely solely on the Hessian - consider direct function evaluation and nearby points
930
 
931
- 12. When using symmetry arguments:
932
  - Explicitly state what is symmetric
933
  - Identify the axis/plane of symmetry
934
 
935
- 13. In calculus do not forget opportunities to apply power-reduction formulas for trig functions
936
  - e.g.: Integral from 0 to pi of [cos(theta)]^(2n) d(theta) = (pi / 2^(2n)) * (2n choose n), where choose is the combinatorial choose function
937
 
938
- 14. In expanding or factoring polynomial expressions, be careful not to make errors
939
  - (1+u^2)^2 is equal to (1+2u^2+u^4), NOT equal to (1+3u^2+u^4)
940
 
941
- 15. When finding points where dy/dx = 0 in parametric equations:
942
  - (a) First find the ratio dy/dx = (dy/dt)/(dx/dt)
943
  - (b) Find t-values where this ratio equals 0
944
  - (c) CRITICAL: For any t-values where both dy/dt = 0 AND dx/dt = 0:
@@ -953,7 +953,7 @@ make sure the question is CLEAR about what regions you intend to be included in
953
  - Verify the point lies on the curve
954
  - State whether it's a regular point or special point (cusp, corner, etc.)
955
 
956
- 16. Be careful with trigonometric expressions involving powers
957
  - Example: solving sin^2(x)=cos(x) can be solved as 1-cos^2(x)=cos(x)
958
 
959
  """
 
477
  def get_difficulty_parameters(difficulty_level):
478
  """Return specific parameters and constraints based on difficulty level"""
479
  parameters = {
480
+ 1: { Very Easy
481
  "description": "suitable for beginners",
482
  "constraints": [
483
  "Use only basic concepts and straightforward calculations",
 
836
  difficulty_params = get_difficulty_parameters(difficulty)
837
  problem_type_addition = get_problem_type_addition(question_type)
838
 
839
+ system_prompt = f"""You are a mathematics professor.
840
+
841
+ Part I. Write 10 {question_type} exam questions that can be solved analytically, without numerical methods,
842
+ in increasing order of difficulty from easiest to hardest that would test a student's ability on the topic {selected_topic} in {subject}.
843
+ The easiest question should be the most basic problem on {selected_topic}. The hardest two questions would be very tricky even for an undergraduate
844
+ mathematics major at a top university.
845
+
846
+ Part II. Now select the problem that is number {difficulty} on your exam, state the question again and provide a solution.
847
+
848
+ 1. Begin the output for Part II with the text "Here is a test question that is a {question_type} question on {subject} covering {selected_topic} of difficulty level {difficulty} out of 10."
849
+ 2. Important LaTeX formatting for both Part I and Part II
850
  - Make sure that the question statement uses proper LaTeX math mode
851
  - Use $ for inline math
852
  - Use $$ on separate lines for equations and solutions
 
854
  - DO NOT use \\begin{{aligned}} or similar environments
855
  - When writing questions involving currency expressed in dollars NEVER use the `$` symbol as it will be interepreted as math mode. ALWAYS write out the word dollars.
856
  * Example: 1000 dollars
857
+ 3. For the detailed soltuion
858
  - Begin the solution with "Here is a detailed solution to the test question."
859
  - If the question involves geometry make sure to identify any general geometric formulas that apply, For example:
860
  * Areas/volumes of common shapes and solids
 
867
  * NO part of the solution may resort to or be based on numerical analysis.
868
  * The only numerical calculations that should be done are those that could be done on a simple scientific calculator.
869
  * Make sure to simplify completely as far as analytical methods will allow
870
+ 4. Maintain clear formatting
871
+ 5. At the end of the solution output, print SymPy code that you would use to solve or verify the main equations in the question
872
+ 6. Observe the folloiwng SymPy Guidelines
873
  {SYMPY_GUIDELINES}
874
+ 7. For problems where the subject is Real Analysis, observe the following guidelines:
875
 
876
  a. **Justify Every Step**
877
  - Provide detailed reasoning for each step and explicitly justify every bounding argument, inequality, or limit claim.
 
917
  - Conclude with an intuitive explanation of why the result makes sense, possibly connecting it to known theorems or simple examples.
918
  - In notes after the proof, highlight potential sources of confusion for students and clarify tricky aspects of the problem.
919
 
920
+ 8. If you specify a quadrant restriction (e.g. "in the first quadrant") in a problem with calculating area between lines/curves or volume between surfaces,
921
  make sure the question is CLEAR about what regions you intend to be included in the solution, by breaking up the question. Examples:
922
  - NOT CLEAR question: Find the area of the region bounded by the curves y = sin(x), y = cos(x), and x = 7*pi/4 in the first quadrant.
923
  - CLEAR question: Find the area of the region bounded by the curves y = sin(x), y = cos(x), and x = 7*pi/4. Then find the area of that region that intersects with the first quadrant.
924
 
925
+ 9. When finding critical points in multivariable calculus:
926
  - Always check what happens when any variable equals zero (except where undefined)
927
  - Just because a point is ruled out of the domain doesn't mean that entire line/curve is ruled out
928
  - When the Hessian is inconclusive, evaluate the function along the critical curves to determine behavior
929
  - Don't rely solely on the Hessian - consider direct function evaluation and nearby points
930
 
931
+ 10. When using symmetry arguments:
932
  - Explicitly state what is symmetric
933
  - Identify the axis/plane of symmetry
934
 
935
+ 11. In calculus do not forget opportunities to apply power-reduction formulas for trig functions
936
  - e.g.: Integral from 0 to pi of [cos(theta)]^(2n) d(theta) = (pi / 2^(2n)) * (2n choose n), where choose is the combinatorial choose function
937
 
938
+ 12. In expanding or factoring polynomial expressions, be careful not to make errors
939
  - (1+u^2)^2 is equal to (1+2u^2+u^4), NOT equal to (1+3u^2+u^4)
940
 
941
+ 13. When finding points where dy/dx = 0 in parametric equations:
942
  - (a) First find the ratio dy/dx = (dy/dt)/(dx/dt)
943
  - (b) Find t-values where this ratio equals 0
944
  - (c) CRITICAL: For any t-values where both dy/dt = 0 AND dx/dt = 0:
 
953
  - Verify the point lies on the curve
954
  - State whether it's a regular point or special point (cusp, corner, etc.)
955
 
956
+ 14. Be careful with trigonometric expressions involving powers
957
  - Example: solving sin^2(x)=cos(x) can be solved as 1-cos^2(x)=cos(x)
958
 
959
  """